This project demonstrates a simple zero knowledge proof using the circom compiler and snarkjs library.
- Install nodejs and npm
- Install circom to compile the circom code to a circuit
- Install snarkjs to generate the proving and verifying keys, and to generate and verify proofs.
- Compile the circuit using circom
circom circuit/age_ab18.circom --r1cs --wasm --sym -o build/
- Generate the proving and verifying keys using snarkjs
snarkjs setup --protocol groth
- Generate the proof using snarkjs
snarkjs groth16 prove circuit/age_ab18.r1cs build/age_ab18.wasm build/age_ab18.sym circuit/age_ab18_input.json proof.json
- Verify the proof using snarkjs
snarkjs groth16 verify verification_key.json proof.json