Crates.io | shardtree |
lib.rs | shardtree |
version | 0.5.0 |
source | src |
created_at | 2022-12-15 02:51:15.369731 |
updated_at | 2024-10-04 14:32:44.257705 |
description | A space-efficient Merkle tree with witnessing of marked leaves, checkpointing & state restoration. |
homepage | https://github.com/zcash/incrementalmerkletree |
repository | https://github.com/zcash/incrementalmerkletree |
max_upload_size | |
id | 737580 |
size | 285,246 |
shardtree
This is a Rust crate that provides an implementation of a fixed-depth Merkle tree structure that is densely filled from the left. It supports:
The tree is represented as an ordered collection of fixed-depth subtrees, or "shards". The roots of the shards form the leaves in the "cap".
Level
3 root \
/ \ |
/ \ |
2 / \ } cap
/ \ / \ |
/ \ / \ |
1 A B C D / \
/ \ / \ / \ / \ } shards
0 /\ /\ /\ /\ /\ /\ /\ /\ /
This structure enables witnesses for marked leaves to be advanced up to recent checkpoints or the latest state of the tree, without having to insert each intermediate leaf individually. Instead, only the roots of all complete shards between the one containing the marked leaf and the tree frontier need to be inserted, along with the necessary nodes to build a path from the marked leaf to the root of the shard containing it.
Documentation
Licensed under either of
at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.