Crates.io | merkletree |
lib.rs | merkletree |
version | 0.23.0 |
source | src |
created_at | 2019-05-20 12:47:50.34813 |
updated_at | 2023-05-19 13:30:11.378621 |
description | Light merkle tree implementation with SPV support and dependency agnostic. |
homepage | https://github.com/filecoin-project/merkle_light |
repository | https://github.com/filecoin-project/merkle_light |
max_upload_size | |
id | 135592 |
size | 351,593 |
merkle is a lightweight Rust implementation of a Merkle tree.
external dependency agnostic
std::hash::Hasher
compatibility
standard types hasher implementations
#[derive(Hashable)]
support for simple struct
customizable merkle leaf/node hashing algorithm
support for custom hash types (e.g. [u8; 16], [u64; 4], [u128; 2], struct)
customizable hashing algorithm
linear memory layout, no nodes on heap
buildable from iterator, objects or hashes
certificate transparency style merkle hashing support
SPV support included (via proof type)
supports power of 2 arity merkletrees (only)
supports compound merkletrees (a tree of merkletrees)
supports compound-compound merkletrees (a tree of compound merkletrees)
Documentation is available.
The most relevant examples are located in the following files:
test_common.rs
: custom hash example xor128, misc shared utilstest_xor128.rs
: most comprehensive tests for library featuresproof.rs
: contains impl and tests for proofs across pow2 arity trees# Run tests in release mode
cargo test --release --all
# Run ignored tests in release mode
cargo test --release --all -- --ignored
Please report bugs either as pull requests or as issues in the issue tracker. merkle has a full disclosure vulnerability policy. Please do NOT attempt to report any security vulnerability in this code privately to anybody.
See LICENSE.