This is a basic circom project that was presented at the Aya Builder showcase in July 2024. It explains how to evaluate a polynomial:
evaluates to 24
at x=1
Open the repo and run:
npm install
node compile.js
This will compile the circuit and create the necessary packages for the build.
Next, run:
node setup_and_prove.js
This completes the powers of tau ceremony with stdin randomness and generates a proof for a certain input {x: 1}
.
Now, create the solidity verifier:
npx snarkjs zkey export solidityverifier polynomial_final.zkey verifier.sol
Move the verifier.sol
contract to the src
directory in ./deploy
.
Fill in the .env
section with your sepolia private key and RPC url.
Deploy the contract:
forge create --rpc-url $SEPOLIA_RPC_URL --private-key $PRIVATE_KEY src/verifier.sol:Groth16Verifier
verify it:
node verify_proof.js