-
Write circom circuit
-
Compile the circuit:
circom circuit.circom --r1cs --wasm --sym
-
Download a powers of tau trusted setup file
-
Run Plonk setup to get the proving key:
snarkjs plonk setup circuit.r1cs ptau_file.ptau proving_key.zkey
- Export verifier smart contract
snarkjs zkey export solidityverifier proving_key.zkey verifier.sol
- Integrate verifier into your Solidity project
-
Take user inputs
-
Calculate witness & generate proof in one step
await snarkjs.plonk.fullProve({ inputs }, wasmPath, provingKeyPath);
- Submit transaction with proof to Verifier contract