Implementation of groth16.Not suitable for production use.
Ensure you have Rust and Cargo installed. To install the project, run:
git clone https://github.com/Saksham010/mini-groth16/
cd mini-groth16
Specify your constraint/circuit for computation in groth.circuit file in root folder. Use [val] for negative coeff,ie: -1 => [1] Eg:
Run trusted setup to generate proving and verification key. Doesn't support adding randomness:
cargo run --bin setup
Two binary files proving_key.bin and verification_key.bin will be generated in the root directory
Honest prover will provide valid constraint/circuit for computation in gorth.circuit file that matches to that of the agreed circuit during trusted setup. In src/prover/witness.json provide all the values for involved variable in the circuit and their computed values. Eg:
Public witness will contain public values:
Proof generated form the values that does not satisfy the constraint is rejected
Generate proof by running:
cargo run --bin prover
Copy the proof string.
Honest verifier will run the recieved proof with the verifier algorithm.
cargo run --bin verifier REPLACE_WITH_PROOF
The verification algorithm will output whether the proof is valid or not in the console.
- Contribute randomess in the setup ceremony
- Groth16 paper: https://eprint.iacr.org/2016/260.pdf
- Mathematical mechanics of groth16: https://kayleegeorge.github.io/math110_WIM.pdf
- Rareskills: https://www.rareskills.io/post/groth16