Skip to content

Basic implementation of a Merkle Tree in Rust

Notifications You must be signed in to change notification settings

romanroibu/merkle-tree-rs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Basic implementation of a Merkle Tree in Rust.

Example

let initial_leaf = hex!("0000000000000000000000000000000000000000000000000000000000000000");
let leaf_3 = hex!("3333333333333333333333333333333333333333333333333333333333333333");

let mut tree = MerkleTree::new(4, initial_leaf).unwrap();
tree.set(3, leaf_3.clone()).unwrap();

let proof = tree.proof(3).unwrap();
assert_eq!(&MerkleTree::verify(&proof, leaf_3), tree.root());

About

Basic implementation of a Merkle Tree in Rust

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages