Commit e3ce784 1 parent 56c07d4 commit e3ce784 Copy full SHA for e3ce784
File tree 4 files changed +29
-1
lines changed
4 files changed +29
-1
lines changed Original file line number Diff line number Diff line change @@ -26,6 +26,10 @@ On Ubuntu `coinor-cbc` and `coinor-libcbc-dev`.
26
26
27
27
You'll also need a stable Rust compiler.
28
28
29
+ ## Quickstart
30
+
31
+ For an example of doing ZKP compilation, look [ here] ( ./doc/zkp.md ) .
32
+
29
33
## Architecture
30
34
31
35
* Components:
Original file line number Diff line number Diff line change
1
+ # Quickstart for ZKPs using the Z# front-end
2
+
3
+ 1 . Configure CirC's example compiler: ` ./driver.py --features bellman r1cs poly zok `
4
+ * turns on the [ bellman] ( https://github.com/zkcrypto/bellman/ ) ZKP backend,
5
+ the R1CS compiler extension needed to target it,
6
+ support for finite field polynomials,
7
+ and the Z# (an extended ZoKrates) frontend
8
+ 2 . Build the CirC library and example compiler ` ./driver.py -b `
9
+ 3 . Compile an example program to ZKPs and sample ZKP paramaters: ` ./target/release/examples/circ examples/ZoKrates/pf/maj.zok r1cs --action setup `
10
+ * creates a proving key in file ` ./P `
11
+ * creates a verifying key in file ` ./V `
12
+ * The program does a bitwise majority of three 8-bit arguments; the inputs are secret, the output is public.
13
+ 4 . Create a proof: ` ./target/release/examples/zk --inputs examples/ZoKrates/pf/maj.zok.pin --action prove `
14
+ * creates a proof in file ` ./pi `
15
+ * the (secret) program inputs are in the input file ` examples/ZoKrates/pf/maj.zok.pin `
16
+ 5 . Verify the proof against a claimed program output: ` ./target/release/examples/zk --inputs examples/ZoKrates/pf/maj.zok.vin --action verify `
17
+ * the output is ` return ` in the input file ` examples/ZoKrates/pf/maj.zok.vin `
18
+ * if verification fails, the command will return an error
Original file line number Diff line number Diff line change 1
- def main(u8 a, u8 b, u8 c) -> u8:
1
+ def main(private u8 a, private u8 b, private u8 c) -> u8:
2
2
return (a & b) ^ (a & c) ^ (b & c)
Original file line number Diff line number Diff line change
1
+ (let (
2
+ (return #xD9)
3
+ )
4
+ false
5
+ )
6
+
You can’t perform that action at this time.
0 commit comments