Golang implementation of Sparse Merkle Tree that is optimized for managing an append-only tree, and is able to generate proofs to be used as private inputs to a circom-based proof generator. The project also includes an end-to-end integration test that demonstrates how to use the go-rapidsnark library to generate zkSNARK proofs with WASM based circuit runtimes.
$ make
The project does NOT contain some of the cryptographic materials to perform proof generations and verifications, such as the proving keys and the verification keys. You must run the build steps before you can run the tests.
You do NOT need to re-compile the circuits. Start with the step to Generate the proving key.
Once the proving keys and verification keys are generated, set the following environment variables
CIRCUITS_ROOT
: the folder that contains the WASM runtime for the circuits that are generated by the circom compiler. If you do not want to compile the circtuis yourself, a copy of them are included in thejs/lib
folderPROVING_KEYS_ROOT
: the folder that contains the proving keys and verification keys
Note: you need to be running a postgres database locally before running the tests, you can run it in Docker with:
docker run -d --name postgres -e POSTGRES_PASSWORD=my-secret -p 5432:5432 postgres
$ make e2e