-
Notifications
You must be signed in to change notification settings - Fork 79
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
smartcontract, examples: add API for Groth16 Verifier contract building and examples #3043
Conversation
Codecov Report
@@ Coverage Diff @@
## master #3043 +/- ##
==========================================
+ Coverage 84.89% 84.92% +0.02%
==========================================
Files 330 330
Lines 44332 44332
==========================================
+ Hits 37637 37649 +12
+ Misses 5180 5168 -12
Partials 1515 1515
... and 3 files with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
3e18752
to
5a19f81
Compare
We have to think about moving Verifier contract auto-generation to a separate package so that contract devs are able to use it from the outside to generate their own verification contracts without massive copy-pasting. @roman-khimov, what do you think? And with Consensys/gnark#799, the generator-related code will be much simplier. |
5a19f81
to
c267b36
Compare
d4e63bd
to
a247fc9
Compare
4e540e5
to
00d278e
Compare
00d278e
to
a808c11
Compare
@roman-khimov, could you, please, review the PR? We need to finalize the external smartcontract's generator API, let's fix the issues if there are any. |
fec8386
to
48010df
Compare
Not ready for review yet, will test against the C# node and update. |
I've tested it on testnet (carefully with preliminary test
Here's the contract: https://dora.coz.io/contract/neo3/testnet/c110099c025aadf10b5f4d6af32c65efd5268135 So the |
48010df
to
5260f64
Compare
…t multiplier Field element multiplier must be provided in the LE form, confirmed by cross-node invocation: #3043 (comment). Signed-off-by: Anna Shaleva <[email protected]>
5260f64
to
1e33c3a
Compare
…t multiplier Field element multiplier must be provided in the LE form, confirmed by cross-node invocation: #3043 (comment). Signed-off-by: Anna Shaleva <[email protected]>
1e33c3a
to
8849ccd
Compare
…t multiplier Field element multiplier must be provided in the LE form, confirmed by cross-node invocation: #3043 (comment). Signed-off-by: Anna Shaleva <[email protected]>
Port the C# contract provided in the neo-project/neo#2647 (comment) and add an integration test for it. Part of the #3002. Signed-off-by: Anna Shaleva <[email protected]>
…t multiplier Field element multiplier must be provided in the LE form, confirmed by cross-node invocation: #3043 (comment). Signed-off-by: Anna Shaleva <[email protected]>
eddbc94
to
03a22a2
Compare
The example shows that the proover knows the solution of the cubic equation: y = x^3 + x + 5. The example is constructed for BLS12-381 curve points using Groth-16 prooving algorithm. The example includes everything that developer needs to start using ZKP on the NEO platform with Go SDK: 1. The described cubic circuit implementation. 2. The off-chain proof generation with the help of gnark-crypto library. 3. Go verification contract generation and deployment with the help of NeoGo libraries. 4. The on-chain proof verification for various sets of input data. Signed-off-by: Anna Shaleva <[email protected]>
…t multiplier Field element multiplier must be provided in the LE form, confirmed by cross-node invocation: #3043 (comment). Signed-off-by: Anna Shaleva <[email protected]>
8ace218
to
a964b21
Compare
Linter is also fixed, the issue was caused by an update to gnark v0.9.0 in the core library. v0.9.0 requires go 1.19, and we still support go 1.18. Thus, #3079 is left unclosed until we'll bump minimum required go version for neo-go. |
Add an example and instructions for production CRS generation to ZKP examples with gnark >= v0.9.0. Signed-off-by: Anna Shaleva <[email protected]>
An upgrade from gnark v0.8.X to v0.9.0 changes serialization format of verifying/proving keys and proofs. In neo-go zkpbinding package we have to support both at least for now, because [email protected] requires minimum go 1.19. Signed-off-by: Anna Shaleva <[email protected]>
It's not differ from BN254, but we'd better use the proper package. Signed-off-by: Anna Shaleva <[email protected]>
…t multiplier Field element multiplier must be provided in the LE form, confirmed by cross-node invocation: #3043 (comment). Signed-off-by: Anna Shaleva <[email protected]>
Signed-off-by: Anna Shaleva <[email protected]>
Signed-off-by: Anna Shaleva <[email protected]>
Signed-off-by: Anna Shaleva <[email protected]>
And ignore on dependency checks, we update all the examples at once anyway, so may safely skip the check for zkp folder. Signed-off-by: Anna Shaleva <[email protected]>
Signed-off-by: Anna Shaleva <[email protected]>
a964b21
to
810f5bf
Compare
Signed-off-by: Anna Shaleva <[email protected]>
810f5bf
to
fc6e87a
Compare
Dependencies are updated as far. |
Should be a part of #3043. Signed-off-by: Anna Shaleva <[email protected]>
Three major improvements are included into this PR:
zkpbinding
package that exports API to generate and interact with circuit-cpecific (and Groth-16 parameters-specific) Verifier Go smart contract. This API is assumed to be used by smart contract developers who wants to verify some ZK proofs on Neo.zkpbinding
package andneotest
.Close #3002.
TODO: