For more information on the circuit generation, you can read more about it in my blog post I wrote.
If you use Visual Studio Code - Docker Container, you can just open this container inside VSCode and all the prerequisite will be installed for you. You can skip this step and go to the next section
- you should use v2.0.6 to ensure snarkjs compatibility at the time of writing
- i.e.
git checkout tags/v2.0.6 -b v2.0.6
-
Install snarkjs
-
Install all package dependencies
yarn
- Setup the contract deploy credentials.
Create /packages/contracts/.env
by using the example file /packages/contracts/.env.example
and fill in all the fields.
- Start a hardhat local node
yarn localnode
- In another terminal window, deploy to the local node
yarn deployLocalhost
- Start the react app
yarn react
You can deploy to rinkeby
by running:
yarn deployRinkeby
The circuit and related files are all stored in packages\circuits\CheckSecret
.
If you update CheckSecret.circom
and CheckSecret_input.json
, you can use the convenient script packages\circuits\gen.sh
to compile and generate all the necessary files.
# To use Plonk
./gen.sh CheckSecret plonk
# To use Groth16
./gen.sh CheckSecret groth16
- add nullifier
- add test cases
- allow string as passwords