gnark-plonky2-verifier/README.md
README.mdRaw
1# gnark-plonky2-verifier
2
3This is an in-progress implementation of a [Plonky2](https://github.com/mir-protocol/plonky2) verifier in Gnark. It currently is able to verify some dummy circuits, but not much more as many of the custom gates used in Plonky2 are currently not implemented.
4
5Besides the verifier, there are some Gnark implementation of circuits in this repo that may be useful for other projects:
6
7- [Goldilocks](https://github.com/succinctlabs/gnark-plonky2-verifier/blob/main/field/field.go)
8- [Poseidon](https://github.com/succinctlabs/gnark-plonky2-verifier/blob/main/poseidon/poseidon.go)
9- [FRI](https://github.com/succinctlabs/gnark-plonky2-verifier/blob/main/plonky2_verifier/fri.go)
10
11## Requirements
12
13- [Go (1.20.1+)](https://go.dev/doc/install)
14
15## Benchmark
16
17To run the benchmark,
18```
19go run benchmark.go
20```
21
22Here are relevant numbers from a benchmark ran on an M1 Max with 10 CPU cores.
23
24```
25# of constraints: 6740784
26circuit compilation time: 19 minutes, 33 sec.
27witness generation time: < 1 second
28groth16 setup: 8 minutes 23 seconds
29proof generation: 23 seconds
30proof verification: < 1 second
31```
32
33The circuit can be significantly optimized by using more efficient arithmetic for Goldilocks, among other things.