Skip to content
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

Add skeleton for porting Nova verification #4

Merged
merged 9 commits into from
May 25, 2023
Merged

Add skeleton for porting Nova verification #4

merged 9 commits into from
May 25, 2023

Conversation

storojs72
Copy link
Collaborator

This solid PR contains a bunch of contracts that allow starting the porting process of Nova's CompressedSnark verification from Rust to Solidity.

The list of contribution is following:

  • Poseidon contracts (for both Pallas and Vesta curves) which produce compatible hashes with Neptune. Contracts implement Poseidon using parameters (constants, modes, state size) similar to Nova;
  • SAFE API contracts, also compatible to Neptune (it is important to have them, since verifier uses Poseidon via this API);
  • Step 1 of CompressedSnark verification - which is essentially a bunch of trivial checks of input data lengths;
  • Step 2 of CompressedSnark verification - this is a part of verification where Poseidon is used (checking if the output primary hash in R1CS instances point to the right running instance);
  • Python utility scripts that allows generating contracts-helpers for loading relevant information (CompressedSnark and VerifierKey hardcoded instances) into EVM memory - necessary for debugging.

Currently (for simplicity) we fix actual proof and key for its successful verification (we use this example from Nova) in order to have some stable data source. That is why appropriate JSONs are also committed.

Copy link
Contributor

@mpenciak mpenciak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this looks good, it has a few TODOs that may be worth tackling before merging though?

@@ -0,0 +1,2945 @@
pragma solidity ^0.8.0;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It may be worth adding a comment on these generated .sol files pointing to the python script that generates them.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It makes sense

@@ -0,0 +1,2945 @@
pragma solidity ^0.8.0;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here

@storojs72 storojs72 requested a review from mpenciak May 24, 2023 12:38
@storojs72
Copy link
Collaborator Author

it has a few TODOs that may be worth tackling before merging though

Do you have something in particular? I added #5 and #6 issues which seems to be a good tasks for newcomers, rest TODOs - comments in code - seem to me an important things but do not worth the time at the moment

@storojs72 storojs72 merged commit 5cd8886 into main May 25, 2023
@storojs72 storojs72 deleted the develop branch June 22, 2023 14:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants