Merkle Verification
Status: Under Development
The contents of this page are currently under development and may be updated frequently without prior notice. It is not recommended to use the information on this page for production purposes.
mETH Protocol has partnered with Veda for Merkle verification and vault components. For more information, please visit: https://docs.veda.tech/.
Simplified Diagram
Key Points
Each permitted action of the Strategist is detailed within a Merkle Leaf 's structured data, and hashed into a MerkleLeafDigest or MerkleProof.
When a Strategist attempts to take a rebalancing action (e.g. transfer mETH from the BoringVault to PositionManager1), this call must be accompanied with the corresponding MerkleProof which is verified against the MerkleRoot.
The MerkleRoot is the cryptographic summary of all MerkleLeafs. Currently active Roots and Leafs can be found here: Merkle Roots
The BoringVault.Manager contract can contain multiple MerkleRoots and assigned Strategists. This allows for flexibility (for example we can have limited function and full function MerkleRoots) and redundancy (for example we can have multiple backup Strategist incase the primary Strategist is offline).
Component Details
MerkleLeafs
Key Points
A list of all active Leafs and Roots can be found here Merkle Roots.
[Placeholder for key points text]
Example Format
The code example below is for one Leaf associated with the rebalancing of mETH to the WithdrawerContract. This involves: interacting with the mETHToken
(targetAddress: 0xd5...ADfa); and Transfer
function (0xa9059bb); and with Destination Address
being the DelayWithdrawal contract (AddressArguement: 0x12....B113).
Descriptions
Item | Description |
---|---|
LeafDigest | This serves as a Leaf "Id". It is a "hash result of structured data in every leaf element, and merkle tree constructed with the range of leaf digests by a fixed sequence". For more details see: https://soliditydeveloper.com/merkle-tree |
TargetAddress | The smart contract address being interacted with. For example: for transfering mETH token it will be the mETH token address; for existing restaking positions it will be the restaking protocol smart contract address. |
FunctionSelector, FunctionSignature | The smart contract function being called. For example: transfer, deposit, withdraw, claim, delegate. |
AddressArguments | Contains the address arguments if required as part of the Function. For example: transfer destination addresses. |
DecoderAndSanitizer | DecodersAndSanitizers are required when integrating with a new external protocol. Their job is to decode input target data, extract a bytes value comprised of addresses found in the target data, and to sanitize other non address argument values. https://docs.veda.tech/architecture-overview/decoderandsanitizer |
MerkleRoots
Key Points
A list of all active Leafs and Roots can be found here Merkle Roots.
[Placeholder for key points text]
Example Format
Updating MerkleRoots
Key Points
Full name:
BoringVaultManager.setManageRoot()
This function is called when modifying constraints (MerkleRoots) or Strategists.
There can be multiple MerkleRoots and assigned Strategists.
Each Strategist can only be assigned one MerkleRoot.
Etherscan Interface
Rebalancing mETH
Key Points
This function is called by Strategists when rebalancing mETH (e.g., between the BoringVault and PositionManagers or DelayedWithdrawal contracts.
Etherscan Interface
Strategist Walkthrough
For manual rebalancing
Additional Resources
https://soliditydeveloper.com/merkle-tree
https://docs.veda.tech/architecture-overview/manager/managerwithmerkleverification
https://docs.alchemy.com/docs/merkle-trees-in-blockchains
https://ethereum.org/en/developers/docs/data-structures-and-encoding/patricia-merkle-trie/
Last updated