11 releases (1 unstable)

new 28.1.0-non-semver-compat May 8, 2025
28.0.0-non-semver-compat May 5, 2025
27.5.2-non-semver-compat May 2, 2025
27.5.0-non-semver-compat Apr 30, 2025
0.1.0 Jul 12, 2024

#179 in Magic Beans

Download history 136/week @ 2025-01-16 269/week @ 2025-01-23 235/week @ 2025-01-30 239/week @ 2025-02-06 144/week @ 2025-02-13 30/week @ 2025-02-20 24/week @ 2025-02-27 237/week @ 2025-03-06 49/week @ 2025-03-13 196/week @ 2025-03-20 81/week @ 2025-03-27 58/week @ 2025-04-03 115/week @ 2025-04-10 159/week @ 2025-04-17 241/week @ 2025-04-24 673/week @ 2025-05-01

1,191 downloads per month
Used in 60 crates (2 directly)

MIT/Apache

220KB
5K SLoC

Crate allowing to calculate root hashes and Merkle proofs for small in-memory Merkle trees.


In-memory Merkle tree

Simple in-memory binary Merkle tree implementation. The tree is of bounded depth (up to 1,024 leaves) and uses the keccak-256 hash function.

Benchmarking

The tree implementation comes with a criterion benchmark that can be run with a command like this:

cargo bench -p zksync_mini_merkle_tree --bench tree

The order of timings should be 2M elements/s for all tree sizes (measured on MacBook Pro with 12-core Apple M2 Max CPU), both for calculating the root and the root + Merkle path. This translates to approximately 130µs for a tree with 512 leaves (the tree size used for L2ToL1Logs).

Dependencies

~13MB
~189K SLoC