MCPcopy Index your code
hub / github.com/Sovereign-Labs/nmt-rs

github.com/Sovereign-Labs/nmt-rs @v0.2.3

Chat with this repo
repository ↗ · DeepWiki ↗ · release v0.2.3 ↗ · + Follow
151 symbols 454 edges 10 files 83 documented · 55% updated 13mo ago★ 332 open issues
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

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

  • [x] Compute merkle root

  • [x] Create index-based range proofs

  • [x] Verify index-based range proofs

  • [x] Create namespace range proofs

  • [x] Verify namespace range proofs

  • [x] Narrow namespace range proofs: supply part of the range to generate a proof for the remaining sub-range

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.

Extension points exported contracts — how you extend this code

MerkleHash (Interface)
A trait for hashing data into a merkle tree [2 implementers]
src/simple_merkle/tree.rs
NamespaceMerkleHasher (Interface)
An extension of [`MerkleHash`] indicating that the hasher is namespace aware. This allows for the creation of namespaced [1 …
src/namespaced_hash.rs
PreimageReader (Interface)
The reader trait for a data store that maps hashes to preimages [2 implementers]
src/simple_merkle/db.rs
PreimageWriter (Interface)
The writer trait for a data store that maps hashes to preimages [2 implementers]
src/simple_merkle/db.rs
PreimageDb (Interface)
A trait representing read and write access to data store that maps hashes to their preimages [2 implementers]
src/simple_merkle/db.rs
TakeLast (Interface)
Manually implement the method we need from #[feature(slice_take)] to allow building with stable; [1 implementers]
src/simple_merkle/tree.rs

Core symbols most depended-on inside this repo

iter
called by 21
src/namespaced_hash.rs
as_ref
called by 15
src/namespaced_hash.rs
root
called by 15
src/lib.rs
ns_id_from_u64
called by 13
src/lib.rs
leaves
called by 12
src/lib.rs
min_namespace
called by 11
src/namespaced_hash.rs
siblings
called by 10
src/nmt_proof.rs
max_namespace
called by 9
src/namespaced_hash.rs

Shape

Method 95
Function 29
Class 15
Interface 8
Enum 4

Languages

Rust100%

Modules by API surface

src/namespaced_hash.rs36 symbols
src/lib.rs35 symbols
src/simple_merkle/tree.rs28 symbols
src/simple_merkle/db.rs15 symbols
src/nmt_proof.rs15 symbols
src/simple_merkle/proof.rs11 symbols
src/tendermint_hash.rs8 symbols
src/simple_merkle/utils.rs2 symbols
src/simple_merkle/error.rs1 symbols

For agents

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

⬇ download graph artifact