2 unstable releases

0.2.0 Apr 3, 2025
0.0.0 Mar 24, 2025

#469 in #substrate

Download history 74/week @ 2025-03-19 27/week @ 2025-03-26 167/week @ 2025-04-02 19/week @ 2025-04-09 10/week @ 2025-04-16 6/week @ 2025-04-23

206 downloads per month
Used in 7 crates (6 directly)

Apache-2.0

1MB
14K SLoC

Merkle-Tree Primitives

Contains the custom merkle tree implementation optimized for Ethereum.


lib.rs:

This crate implements a simple binary Merkle Tree utilities required for inter-op with Ethereum bridge & Solidity contract.

The implementation is optimised for usage within Substrate Runtime and supports no-std compilation targets.

Merkle Tree is constructed from arbitrary-length leaves, that are initially hashed using the same \[Hasher\] as the inner nodes. Inner nodes are created by concatenating child hashes and hashing again. The implementation does not perform any sorting of the input data (leaves) nor when inner nodes are created.

If the number of leaves is not even, last leaf (hash of) is promoted to the upper layer.

Dependencies

~18–31MB
~507K SLoC