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

End-to-end "pp-spartan" verification contract #25

Merged
merged 9 commits into from
Aug 23, 2023
Merged

Conversation

storojs72
Copy link
Collaborator

@storojs72 storojs72 commented Aug 8, 2023

This PR starts series of PRs aimed to move the pp-spartan branch to the main one. It contains some important changes in the overall repository organisation as well as grounding the possibility of overall verification logic testing with a help of Anvil node instead of isolated testing of partial verification with a help of data contracts which we used previously.

More specifically this PR:

  • introduces e2e verification contract skeleton with publicly exposed pushToProof, pushToVk and verify functions. First two ones are used for loading the proof and public parameters data correspondently, and last one is used for invoking the e2e verification logic;
  • adds JSONs (pp-compressed-snark.json and pp-verifier-key.json) generated by pasta-based test-ivc-nontrivial-with-compression test from pp-spartan;
  • introduces the so-called loader which is used for loading the pp-spartan JSONs into the node's storage by sending correspondent transactions;
  • adds two initial steps of e2e verification;
  • does some refactoring.

The parallel work on #22 is performing at the current moment. Once it is finished, the integration testing of e2e verification can be enforced by CI.

P.S.: while working on this PR, I had to include the pp-spartan JSONs into the codebase in addition to already existed (I suppose temporarily) ones for "regular" Spartan. In this regards, the idea of including the Rust binary that could generate us necessary JSONs comes to my mind: #24

Copy link
Contributor

@huitseeker huitseeker left a comment

Choose a reason for hiding this comment

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

In the interest of future switch to grumpkin, it may be useful to name things pp-compressed-pasta, or some variant of this naming scheme, just so there's not mistaking data generated for pasta for something else.
Otherwise, this looks great to me!

Congrats to you both (@storojs72 and @samuelburnham ) for making this happen!


- name: Check proof verification status
run: |
[[ $(cast call ${{steps.deployment.outputs.CONTRACT_ADDRESS}} "verify(uint32,uint256[],uint256[])(bool)" "3" "[1]" "[0]" --private-key $ANVIL_PRIVATE_KEY --rpc-url $ANVIL_URL) == true ]] && exit 0 || exit 1
Copy link
Contributor

Choose a reason for hiding this comment

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

Awesome!

@storojs72 storojs72 merged commit 9d0d641 into main Aug 23, 2023
@storojs72 storojs72 deleted the pp-spartan-merge branch August 23, 2023 07:31
storojs72 added a commit that referenced this pull request Oct 15, 2023
* End-to-end "pp-spartan" verification contract (#25)

* Add JSONs generated by pp-spartan

* Separate path (src/blocks/) for low-level crypto building blocks

* Add e2e verification contract skeleton

* Move FieldLib and PolyLib code to Utilities.sol file

* Step 1

* Step 2

* CI adjustments

* Update README

* Update integration testing infrastructure

* End-to-end "pp-spartan" verification contract (Step 3) (#27)

* Add PolyEvalInstance building block

* Refactor building blocks

* Add step 3 of verification to the e2e contract

* Remove data contracts for step 2 and step 3

* Adjust CI

* KeccakTranscript and Sumcheck blocks adjustments

* Requested changes

* Update Utilities.sol

---------

Co-authored-by: Artem Storozhuk <[email protected]>
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