Expand description
Two-level Merkle tree for reward account balances.
Uses an outer tree (4 bits, 16 partitions) of inner trees (156 bits each) for efficient storage and retrieval across a 160-bit address space.
§Storage Implementations
storage::CachedInMemoryStorage- In-memory with cache (default)
§Example
ⓘ
let mut tree = RewardMerkleTreeV2::new(REWARD_MERKLE_TREE_V2_HEIGHT);
tree.update(&account, &amount)?;
let result = tree.lookup(&account);Modules§
- storage
- Storage abstraction for inner Merkle tree roots.
Structs§
- Outer
Keccak256 Hasher - Keccak256 hasher for outer tree nodes.
- Storage
Backed Reward Merkle Tree V2 - Two-level reward Merkle tree with pluggable storage backend.
Constants§
- REWARD_
MERKLE_ TREE_ V2_ ARITY - Arity of the Merkle tree (binary tree)
- REWARD_
MERKLE_ TREE_ V2_ HEIGHT - Total height of the reward Merkle tree (160 bits = Ethereum address space)
- REWARD_
MERKLE_ 🔒TREE_ V2_ INNER_ HEIGHT - Height of each inner tree (156 bits)
- REWARD_
MERKLE_ 🔒TREE_ V2_ OUTER_ HEIGHT - Height of outer tree (4 bits = 16 partitions)
Type Aliases§
- Expected
Reward Merkle Tree V2 - Expected type alias for single-level reward Merkle tree.
- InMemory
Reward Merkle Tree V2 - Two-level reward Merkle tree with in-memory storage (default).
- Inner
Reward 🔒Merkle Tree V2 - Inner tree type: 156-bit universal Merkle tree for account balances.
- Outer
Reward 🔒Merkle Proof - Membership proof for an inner tree root in the outer tree.
- Outer
Reward 🔒Merkle Tree V2 - Outer tree type: 4-bit universal Merkle tree storing inner tree roots.
- Reward
Merkle Commitment V2 - Merkle tree commitment (root hash).
- Reward
Merkle 🔒Node - Merkle node containing a reward amount leaf.
- Reward
Merkle Proof - Membership proof for an account’s balance in the tree.
- Reward
Merkle Tree V2 - Canonical reward Merkle tree type (single-level, 160-bit).
- Reward
NonMembership Proof - Non-membership proof for an account not in the tree.
- Verification
Result - Verification result for merkle proofs.