1 unstable release

0.1.0 Nov 14, 2023

#854 in Cryptography

Download history 437/week @ 2024-01-06 322/week @ 2024-01-13 471/week @ 2024-01-20 1118/week @ 2024-01-27 2785/week @ 2024-02-03 2568/week @ 2024-02-10 880/week @ 2024-02-17 715/week @ 2024-02-24 709/week @ 2024-03-02 744/week @ 2024-03-09 749/week @ 2024-03-16 1240/week @ 2024-03-23 1517/week @ 2024-03-30 1558/week @ 2024-04-06 1517/week @ 2024-04-13 1205/week @ 2024-04-20

5,973 downloads per month
Used in 5 crates (2 directly)

MIT/Apache

78KB
1.5K SLoC

codecov

NMT

An implementation of a namespaced merkle tree in Rust.

Warning

This code has not been audited, and may contain critical vulnerabilities. Do not attempt to use in production.

Functionality

  • Compute merkle root

  • Create index-based range proofs

  • Verify index-based range proofs

  • Create namespace range proofs

  • Verify namespace range proofs

License

Licensed under the Apache License, Version 2.0.

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this repository by you, as defined in the Apache-2.0 license, shall be licensed as above, without any additional terms or conditions.


lib.rs:

This crate implements a Namespaced Merkle Tree compatible with https://github.com/celestiaorg/nmt. To quote from their documentation:

A Namespaced Merkle Tree is an ordered Merkle tree that uses a modified hash function so that each node in the tree includes the range of namespaces of the messages in all of the descendants of each node. The leafs in the tree are ordered by the namespace identifiers of the messages. In a namespaced Merkle tree, each non-leaf node in the tree contains the lowest and highest namespace identifiers found in all the leaf nodes that are descendants of the non-leaf node, in addition to the hash of the concatenation of the children of the node. This enables Merkle inclusion proofs to be created that prove to a verifier that all the elements of the tree for a specific namespace have been included in a Merkle inclusion proof.

The concept was first introduced by @musalbas in the LazyLedger academic paper.

This implementation was developed independently by Sovereign Labs, and is not endorsed by the Celestia foundation.

Dependencies

~0.5–1MB
~21K SLoC