LazyTower implementation in TypeScript.
This library has not been audited.
Install the @zk-kit/lazytower
package with npm:
npm i @zk-kit/lazytower --save
or yarn:
yarn add @zk-kit/lazytower
You can also load it using a script
tag using unpkg:
<script src="https://unpkg.com/@zk-kit/lazytower/"></script>
or JSDelivr:
<script src="https://cdn.jsdelivr.net/npm/@zk-kit/lazytower/"></script>
import { LazyTowerHashChainProofBuilder } from "@zk-kit/lazytower"
import { poseidon } from "circomlibjs" // v0.0.8
const H = 10
const W = 4
const pb = LazyTowerHashChainProofBuilder(H, W, poseidon)
for (let i = BigInt(0); i < 150; i += BigInt(1)) {
pb.add(i)
}
const index = pb.indexOf(BigInt(42))
const proof = pb.build(index)
console.log(proof)