-
Notifications
You must be signed in to change notification settings - Fork 369
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add PLONK in-circuit verifier #880
Conversation
📦 📦 📦 📦 📦 ❌ 📦 📦 📦 ❌ ❌ 📦 ❌ ❌ 📦 ❌ ❌ ❌ ❌ ❌ ❌ ❌ ❌ ❌ ❌ ❌ ❌ ❌ ❌ 🚧
📦 ❌ 📦 📦 📦 |
📦 📦 📦 📦 📦 ❌ 📦 📦 📦 ❌ ❌ 📦 ❌ ❌ 📦 ❌ ❌ ❌ ❌ ❌ ❌ ❌ ❌ ❌ ❌ ❌ ❌ ❌ ❌ ❌ ❌ ❌ ❌ ❌ ❌ ❌ ❌ ❌ ❌ ❌ ❌ ❌ ❌ ❌ ❌ 🚧
📦 ❌ 📦 📦 📦 |
6ecc547
to
42a4d5c
Compare
📦 📦 📦 📦 📦 ❌ 📦 ❌ 📦 📦 ❌ ❌ 📦 🚧
📦 ❌ 📦 📦 |
42a4d5c
to
54c2c35
Compare
📦
|
📦
📦
|
f58117b
to
7dba1bd
Compare
📦
|
📦
📦 ❌
❌
❌
❌
❌
❌
❌
📦 ❌
|
08e1a34
to
93ef51f
Compare
📦 ❌
|
📦 📦
|
1592414
to
1667207
Compare
📦 📦
|
1667207
to
0ac8f1c
Compare
📦 ❌ 📦 ❌ ❌ ❌ ❌ ❌ ❌ ❌ ❌ ❌ ❌ ❌ ❌ ❌ ❌ ❌ ❌ ❌ ❌ ❌ ❌ ❌ ❌ ❌ ❌ ❌ ❌ ❌ ❌ ❌ ❌ ❌ ❌ ❌ ❌ ❌ ❌ ❌ ❌ ❌ ❌ ❌ ❌ ❌ ❌ ❌ ❌ ❌ ❌ ❌ ❌ ❌ ❌ ❌ ❌ ❌ ❌ ❌ ❌ ❌ ❌ ❌ ❌ ❌ ❌ ❌ ❌ ❌ ❌ ❌ ❌ ❌ ❌ ❌ ❌ ❌ ❌ ❌ ❌ ❌ ❌ ❌ ❌ ❌ ❌ ❌ ❌ ❌ ❌ ❌ ❌ ❌ ❌ ❌ ❌ ❌ ❌ ❌ ❌ ❌ ❌ ❌ ❌ ❌ ❌ ❌ ❌ 📦 📦 |
0ac8f1c
to
4e6454d
Compare
📦 📦
|
📦
|
📦
|
📦
|
6bebdca
to
5f8a060
Compare
Ready from my side. @ThomasPiellard - if you can confirm that also good from your side then I think it is good for review. I assigned @yelhousni for review as we both have worked on it :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM but I need a second round of review
Added MSM tests for emulated and 2-chain curves. This revealed another bug :) I think the PR is done from my side. We could merge from my side after approving review. I think we can address additional optimisations in different PRs, to keep number of different open PRs small and avoid needing to rebase/merge. Some other discussed optimisations:
Ping @yelhousni for review. |
Alright on my end. Let's merge this and address optimizations in other PRs. I gave the Wesolowski VDF approach a try to compute efficiently
|
Thanks for the review and co-authoring the PR! I gathered the ideas for improvements in #935. |
commit 6c05ea4 Author: Ivo Kubjas <ivo.kubjas@consensys.net> Date: Tue Nov 28 16:24:47 2023 +0100 perf: use G2 precomputed lines for Miller loop (#930) * feat: add lazy line eval for Miller loop * chore: go mod * fix: DoublePairFixed order * refactor: remove fixed Q specialized methods * chore: serialize lines for KZG key * chore: go generate * docs: add init docs * feat: add fixed KZG verification key init * test: add constant and fixed VK test cases * test: use fixed init * feat: add fixed Groth16 verification * fix: unused import * refactor: merge last manual iteration commit a99d198 Author: Ivo Kubjas <ivo.kubjas@consensys.net> Date: Tue Nov 28 16:20:44 2023 +0100 feat: add PLONK in-circuit verifier (#880) * test: add recursion hash tests * fix: accumulate MSM result * refactor: take emulated element for additional data * fix: handled infinity point in native multi scalar exp * fix: use only nbBits when creating scalar * feat: add PLONK verifier * feat: PlaceholderVerifyingKey takes the vk as argument * feat: f -> scalarApi * feat: addition of computeIthLagrangeAtZeta * feat: bsb commitments are added to pi * refactor: PlaceholderProof takes the proof as argument * fix: compute ith lagrange ok, hashToField failing * fix: native short hash output size * feat: add bw6 * docs: add package documentation * refactor: describe error in panic * refactor: init curve and pairing implicitly * refactor: remove comments * docs: add package examples * feat: add all supported witness assignments * test: add MSM test * fix: remove todo panic * feat: add option shortcuts * fix: include hash to field in shortcut option * feat: use only CCS for placeholder proof and verifyingkey * chore: typos and cleanup * docs: add KZG package documentation --------- Co-authored-by: Thomas Piellard <thomas.piellard@consensys.net> commit 62b52ea Merge: ec07217 97156f3 Author: Youssef El Housni <youssef.elhousni@consensys.net> Date: Fri Nov 24 10:44:33 2023 -0500 Merge pull request #933 from Consensys/perf/karabina-cycloSq Perf: variant of the Karabina cyclotomic squaring commit 97156f3 Author: Youssef El Housni <youssef.housni21@gmail.com> Date: Fri Nov 24 10:27:00 2023 -0500 refactor: apply PR review suggestions commit f52c4cb Author: Youssef El Housni <youssef.housni21@gmail.com> Date: Thu Nov 23 01:50:41 2023 -0500 perf(bls12-377): implement a variant of Karabina cyclo square commit d7e8d78 Author: Youssef El Housni <youssef.housni21@gmail.com> Date: Wed Nov 22 23:28:26 2023 -0500 perf(bw6): implement a variant of Karabina cyclo square commit ec07217 Merge: 3aa2559 5479586 Author: Youssef El Housni <youssef.elhousni@consensys.net> Date: Wed Nov 22 18:16:46 2023 -0500 Merge pull request #931 from Consensys/perf/bw6-finalExp Perf: optimize addition chains in BW6-761 final exponentiation commit 5479586 Author: Youssef El Housni <youssef.housni21@gmail.com> Date: Wed Nov 22 13:07:50 2023 -0500 perf(bw6/finalExp): replace Add(x,x) by MulConst(x,2) commit 65cd6ee Author: Youssef El Housni <youssef.housni21@gmail.com> Date: Tue Nov 21 21:39:55 2023 -0500 fix(linter): ineffectual assignment commit d948c7c Author: Youssef El Housni <youssef.housni21@gmail.com> Date: Tue Nov 21 21:27:02 2023 -0500 perf(bw6/finalExp): optimize addition chains commit 3aa2559 Author: Gautam Botrel <gautam.botrel@gmail.com> Date: Mon Nov 20 14:03:52 2023 -0600 feat: if we don't compress we don't need the dict (#929)
Description
This PR adds in-circuit verifier supporting commitments for both 2-chain and emulated computations.
Fixes #847
Type of change
How has this been tested?
TestBLS12InBW6WoCommit
TestBW6InBN254WoCommit
TestBLS12InBW6Commit
TestBW6InBN254Commit
How has this been benchmarked?
Checklist:
golangci-lint
does not output errors locally