Crate jf_merkle_tree

Source
Expand description

Merkle Tree traits and implementations

Re-exports§

pub use crate::errors::MerkleTreeError;

Modules§

append_only
Implementation of a typical append only merkle tree
errors
Error types
examples
Provides sample instantiations of merkle tree. E.g. Sparse merkle tree with BigUInt index.
hasher
A convenience wrapper HasherMerkleTree to instantiate MerkleTree for any RustCrypto-compatible hash function.
light_weight
A light weight merkle tree is an append only merkle tree who only keeps its frontier – the right-most path.
macros
Useful macros
prelude
Prelude. Also provides sample instantiations of merkle trees.
universal_merkle_tree
Implementation of a typical Sparse Merkle Tree.

Macros§

impl_forgetable_merkle_tree_scheme
Macro for generating a forgetable merkle tree implementation
impl_merkle_tree_scheme
Macro for generating a standard merkle tree implementation
impl_to_traversal_path_biguint
Macros for implementing ToTreversalPath for BigUint types
impl_to_traversal_path_primitives
Macros for implementing ToTreversalPath for primitive types

Enums§

LookupResult
The result of querying at an index in the tree Typically, F for element type, P for membership proof type and N for non-membership proof type

Constants§

FAIL
Glorified false
SUCCESS
Glorified true

Traits§

AppendableMerkleTreeScheme
Merkle tree that allows insertion at back. Abstracted as a commitment for append-only vector.
DigestAlgorithm
Merkle tree hash function WARN: it’s important to domain separate the two digest functions. Otherwise, you may suffer from the length extension attack.
Element
An element of a Merkle tree.
ForgetableMerkleTreeScheme
Merkle tree that allows forget/remember elements from the memory
ForgetableUniversalMerkleTreeScheme
Universal Merkle tree that allows forget/remember elements from the memory
Index
An index type of a leaf in a Merkle tree.
MerkleProof
Trait for a Merkle proof
MerkleTreeScheme
Basic functionalities for a merkle tree implementation. Abstracted as an accumulator for fixed-length array. Supports generating membership proof at a given position and verify a membership proof.
NodeValue
An internal node value type in a Merkle tree.
PersistentUniversalMerkleTreeScheme
A universal merkle tree that allows non destructive updates. A non destructive update doesn’t directly modify the existing content, it creates a new copy about the update so that people could access both the old version and the new.
ToTraversalPath
A trait for Merkle tree index type.
UniversalMerkleTreeScheme
A universal merkle tree is abstracted as a random-access array or a key-value map. It allows manipulation at any given position, and has ability to generate/verify a non-membership proof.