mirror of
https://github.com/circify/circ.git
synced 2026-01-10 06:08:02 -05:00
1.2 KiB
1.2 KiB
Quickstart for ZKPs using the Z# front-end
- Configure CirC's example compiler:
./driver.py --features bellman r1cs poly zok
- turns on the bellman ZKP backend, the R1CS compiler extension needed to target it, support for finite field polynomials, and the Z# (an extended ZoKrates) frontend
- Build the CirC library and example compiler
./driver.py -b - Compile an example program to ZKPs and sample ZKP paramaters:
./target/release/examples/circ examples/ZoKrates/pf/maj.zok r1cs --action setup
- creates a proving key in file
./P - creates a verifying key in file
./V - The program does a bitwise majority of three 8-bit arguments; the inputs are secret, the output is public.
- Create a proof:
./target/release/examples/zk --inputs examples/ZoKrates/pf/maj.zok.pin --action prove
- creates a proof in file
./pi - the (secret) program inputs are in the input file
examples/ZoKrates/pf/maj.zok.pin
- Verify the proof against a claimed program output:
./target/release/examples/zk --inputs examples/ZoKrates/pf/maj.zok.vin --action verify
- the output is
returnin the input fileexamples/ZoKrates/pf/maj.zok.vin - if verification fails, the command will return an error