Kevin Jue a516925ad8
Poseidon BN128 (#20)
* initial commit of poseidon bn128

* got challenger working

* deserialize is working

* cleaned up deserialization function a bit

* fixed challenger

* add in the hack to the challenges

* fixed some bugs in poseidon_bn128

* fri verification is working

* some changes for benchmarking

* added decode_block plonky2 data

* initial commit for poseidon_mds_gate

* updated gate test cases

* working poseidon mds gate

* full verifier test case working
2023-06-06 17:36:51 -07:00
2023-05-25 07:39:06 -07:00
2023-06-06 17:36:51 -07:00
2023-05-25 07:39:06 -07:00
2023-06-06 17:36:51 -07:00
2022-10-03 19:17:42 +00:00
2023-05-25 07:39:06 -07:00
2023-05-25 07:39:06 -07:00
2023-05-25 07:39:06 -07:00
2023-03-28 11:12:07 -07:00
2023-03-28 13:07:39 -07:00

gnark-plonky2-verifier

This is an in-progress implementation of a Plonky2 verifier in Gnark (supports Groth16 and PLONK). 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.

Besides the verifier, there are some Gnark implementation of circuits in this repo that may be useful for other projects:

Requirements

Benchmark

To run the benchmark,

go run benchmark.go

Here are relevant numbers from a benchmark ran on an M1 Max with 10 CPU cores.

11:04:08 INF compiling circuit
11:04:08 INF parsed circuit inputs nbPublic=0 nbSecret=0
11:12:30 INF building constraint system nbConstraints=6740784
Generating witness 2023-03-28 11:12:42.702566 -0700 PDT m=+514.333410376
Running circuit setup 2023-03-28 11:12:42.702666 -0700 PDT m=+514.333509834
Creating proof 2023-03-28 11:18:58.881518 -0700 PDT m=+890.519971543
11:18:59 DBG constraint system solver done backend=groth16 nbConstraints=6740784 took=675.361625
11:19:10 DBG prover done backend=groth16 curve=bn254 nbConstraints=6740784 took=10512.664584
Verifying proof 2023-03-28 11:19:10.169636 -0700 PDT m=+901.808314709
11:19:10 DBG verifier done backend=groth16 curve=bn254 took=6.288792
bn254 2023-03-28 11:19:10.175992 -0700 PDT m=+901.814670834

The circuit can be significantly optimized by using more efficient arithmetic for Goldilocks, among other things.

Description
No description provided
Readme MIT
Languages
Go 100%