Skip to content

maximopalopoli/Rusty-Merkle-Tree

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

56 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Rusty-Merkle-Tree

An implementation of Merkle Tree in Rust.

To run the program, use cargo run, and then use the commands below. Initially, the program will start with an empty tree, to which you can add elements.

Commands

build

To create a Merkle Tree from a set of hashes. Usage: build <hash-1> <hash-2> ... <hash-n> Example:

build ca978112ca1bbdcafac231b39a23dc4da786eff8147c4e72b9807785afee48bb 3e23e8160039594a33894f6564e1b1348bbd7a0088d42c4acb73eeaed59c009d

build-unhashed

To create a Merkle Tree from a set of unhashed texts. Usage: build-unhashed <unhashed-text-1> <unhashed-text-2> ... <unhashed-text-n> Example:

build-unhashed a b c d

add

To add to the current tree a hashed text Usage: add 32-bytes-hash Example:

add ca978112ca1bbdcafac231b39a23dc4da786eff8147c4e72b9807785afee48bb

add-unhashed

To add to the current tree a unhashed text Usage: add-unhashed unhashed-text Example:

add-unhashed This is a text!

verify

To verify with a proof if a leaf of an index is part of the tree Usage: verify proof1 proof2 ... proofN seed index Example:

build-unhashed a b c d
verify ca978112ca1bbdcafac231b39a23dc4da786eff8147c4e72b9807785afee48bb d3a0f1c792ccf7f1708d5422696263e35755a86917ea76ef9242bd4a8cf4891a 3e23e8160039594a33894f6564e1b1348bbd7a0088d42c4acb73eeaed59c009d 1

proof

To create a proof of a leaf at an index. Usage: proof index Example:

proof 1

print

To print the tree Usage: print

--help

To see the available commands. Usage: --help

About

An implementation in Rust of Merkle Tree

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages