semaphore-merkle-tree
This package offers a Merkle tree implementation which is meant to work with the Semaphore zero-knowledge signalling system.
Installation
npm i semaphore-merkle-tree
Usage
;;;
Functions
tree.update(index, value)
Adds value
to the leaf at index
tree.path(index)
Returns the Merkle path to the leaf at the specified index
tree.rollback(updates)
Rolls back the tree by the specified number of updates
Building
git clone https://github.com/weijiekoh/semaphore-merkle-tree.git && \cd semaphore-merkle-tree && \npm i && \npm run build
Testing
npm run test