@zk-kit/lean-imt.sol

2.0.0 • Public • Published

Lean Incremental Merkle Tree (Solidity)

Lean Incremental Merkle tree implementation in Solidity.

NPM license NPM version Downloads Code style prettier

[!NOTE]
This library has been audited as part of the Semaphore V4 PSE audit: https://semaphore.pse.dev/Semaphore_4.0.0_Audit.pdf.

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.


🛠 Install

npm or yarn

Install the @zk-kit/lean-imt.sol package with npm:

npm i @zk-kit/lean-imt.sol --save

or yarn:

yarn add @zk-kit/lean-imt.sol

📜 Usage

Please, see the test contracts for guidance on utilizing the libraries.

Package Sidebar

Install

npm i @zk-kit/lean-imt.sol

Weekly Downloads

45

Version

2.0.0

License

MIT

Unpacked Size

19.4 kB

Total Files

6

Last publish

Collaborators

  • sripwoud
  • njofce
  • akinovak
  • cedoor