This is Cli tool for generation of aggregated proof for multiple inputs.
In this version, it supports circom circuit.
circom and snarkjs should be installed already.
You can check that by this command:
snarkjs --help
circom --help
cargo install --path ./rust
./rust
cd rust
./rust
and inputs in ./rust/example/
(/example
is not mandatory)You can give inputs by commands:
gkr-aggregator prove -c circuit.circom -i ./example/input1.json ./example/input2.json ./example/input3.json
You can get a message from cli:
Proving by groth16 can be done
You should prepare an appropriate ptau file.
snarkjs groth16 setup aggregated.r1cs pot.ptau c0.zkey
snarkjs zkey contribute c0.zkey c1.zkey --name=“mock” -v
Give random string for contribution, and then
snarkjs zkey beacon c1.zkey c.zkey 0102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f 10 -n="Final Beacon phase2"
gkr-aggregator mock-groth -z c.zkey
You can get proof.json
and public.json
.
Get input from input.json
, make d
in proof with it.
Parse r1cs file and convert it to GKRCircuit
. (Let's call this $C$)
Make proof $\pi_0$ from d
and GKRCircuit
.
There are two circuit $Ci$ and $C{v{i - 1}}$. $C{v{i - 1}}$ is circuit that can verify $C{i - 1}$.
$C_{v_i}$ can be different form for each circuit $C_i$.
To make aggregated proof for previous proof and current round's proof, we need
Make integrated circuit $C'_i$.
Use those inputs, make proof $\pii$. To be specific, input and proof $\pi{i - 1}$
Also there are two circuit $Cn$ and $C{v{n - 1}}$. To send aggregated proof to on-chain verifier, we can use groth16 prover in snarkjs
.
Integrated circuit $C'{n}$ can be proved with snarkjs
also.
So final proof $\pi_n$ is groth16 or plonk proof