The LeanIMT is an optimized binary version of the IMT into binary-focused model, eliminating the need for zero values and allowing dynamic depth adjustment. Unlike the IMT, which uses a zero hash for incomplete nodes, the LeanIMT directly adopts the left child's value when a node lacks a right counterpart. The tree's depth dynamically adjusts to the count of leaves, enhancing efficiency by reducing the number of required hash calculations. To understand more about the LeanIMT, take a look at this visual explanation. For detailed insights into the implementation specifics, please refer to the LeanIMT paper.
🛠Install
Add the zk-kit-lean-imt crate to your cargo.toml:
= { = "https://github.com/privacy-scaling-explorations/zk-kit.rust", = "zk-kit-lean-imt" }
📜 Usage
use DefaultHasher;
use ;
use ;
// Setup hasher
;