MCPcopy Index your code
hub / github.com/antouhou/rs-merkle

github.com/antouhou/rs-merkle @v1.5.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release v1.5.0 ↗ · + Follow
114 symbols 265 edges 21 files 49 documented · 43% updated 16mo agov1.5.0 · 2025-02-24★ 2357 open issues

Browse by type

Functions 97 Types & classes 17
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

rs-merkle

Rayon crate Rayon documentation Build and test

rs-merkle is the most advanced Merkle tree library for Rust. Basic features include building a Merkle tree, creation, and verification of Merkle proofs for single and several elements, i.e. multi-proofs. Advanced features include making transactional changes to the tree and rolling back to any previously committed tree state, similarly to Git.

The library is highly customizable. Hashing function and the way how the tree is built can be easily configured through a special trait.

rs-merkle is available on crates.io, and API Documentation is available on docs.rs.

About Merkle trees

Merkle trees, also known as hash trees, are used to verify that two or more parties have the same data without exchanging the entire data collection.

Merkle trees are used in Git, Mercurial, ZFS, IPFS, Bitcoin, Ethereum, Cassandra, and many more. In Git, for example, Merkle trees are used to find a delta between the local and remote repository states to transfer only the difference between them over the network. In Bitcoin, Merkle trees are used to verify that a transaction was included in the block without downloading the whole block contents. ZFS uses Merkle trees to quickly verify data integrity, offering protection from silent data corruption caused by phantom writes, bugs in disk firmware, power surges, and other causes.

Usage

Add the following to your Cargo.toml:

[dependencies]
rs_merkle = "1.4"

This crate also can be used on the no-std targets. To use as a dependency in a project that requires no-std, disable default features:

[dependencies]
rs_merkle = { version = "1.4", default-features = false }

Documentation

Documentation is available on docs.rs.

Contributing

Everyone is welcome to contribute in any way or form! For further details, please read CONTRIBUTING.md

Authors

Also, see the list of contributors who participated in this project.

License

This project is licensed under the MIT License - see the LICENSE.md file for details

Extension points exported contracts — how you extend this code

Core symbols most depended-on inside this repo

Shape

Method 65
Function 32
Class 14
Interface 2
Enum 1

Languages

Rust100%

Modules by API surface

src/merkle_tree.rs23 symbols
src/partial_tree.rs14 symbols
tests/common.rs12 symbols
src/merkle_proof.rs12 symbols
src/error.rs11 symbols
src/utils/indices.rs9 symbols
tests/merkle_tree_test.rs7 symbols
tests/merkle_proof_test.rs7 symbols
src/utils/collections.rs3 symbols
src/proof_serializers/reverse_hashes_order.rs3 symbols
src/proof_serializers/direct_hashes_order.rs3 symbols
src/hasher.rs3 symbols

For agents

$ claude mcp add rs-merkle \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page