DEV Community

Egold
Egold

Posted on

zk-verifier — on-chain zero-knowledge proof with Groth16, Circom & Ethereum

most developers know blockchain. few know what happens when you
combine it with zero-knowledge cryptography.

i built zk-verifier — a dapp that verifies a groth16 zk-snark
proof directly on ethereum sepolia, with zero trusted intermediaries.

what it proves

the circuit proves knowledge of two numbers a and b such that
a × b = c — without revealing a or b on-chain.

only the result c = 33 (3 × 11) is public. the factors stay private.

*## the stack
*

  • circom 2.0 — zk circuit definition
  • groth16 — proof system via snarkjs
  • solidity — on-chain verifier (bn128 pairing)
  • foundry — deployment to sepolia
  • react + ethers.js v6 — frontend dapp

***live on sepolia*

contract: 0x29DD4CC005bEa9969a3120fb930F2a59fAEDB15D

one click — proof verified on ethereum in seconds.

how the proof flows

circom circuit → r1cs constraints → groth16 trusted setup
→ witness generation → proof.json
→ solidity verifier → on-chain pairing check → true/false

the verifier circuit

pragma circom 2.0.0;

template Multiplier2() {
    signal input a;
    signal input b;
    signal output c;
    c <== a * b;
}

component main = Multiplier2();
Enter fullscreen mode Exit fullscreen mode

simple circuit. serious cryptography underneath.

try it yourself

👉 https://github.com/ar1as1/zk-verifier-egold

git clone https://github.com/ar1as1/zk-verifier-egold
cd zkphase2/zk-frontend
npm install && npm run dev
Enter fullscreen mode Exit fullscreen mode

built on blackarch linux. powered by bn128 elliptic curve cryptography.

Top comments (0)