Module sparse

Source
Expand description

Sparse Merkle Tree and related data structures.

Sparse Merkle Tree is essentially a huge Balanced Merkle Tree, where most of the leaves are empty. By “empty” here we mean [0u8; 32]. To optimize proofs and their verification, the hashing function is customized and returns [0u8; 32] when both left and right branch are [0u8; 32], otherwise BLAKE3 hash is used like in a Balanced Merkle Tree.

Structs§

SparseMerkleTree
Sparse Merkle Tree variant that has hash-sized leaves, with most leaves being empty (have value [0u8; 32]).

Enums§

Leaf
Sparse Merkle Tree Leaf

Functions§

ensure_supported_bits
Ensuring only supported NUM_BITS can be specified for SparseMerkleTree.