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

feat: Recursive verification #1379

Closed
wants to merge 16 commits into from
Closed

feat: Recursive verification #1379

wants to merge 16 commits into from

Conversation

vezenovm
Copy link
Contributor

Related issue(s)

Resolves #1154

Description

This adds a foreign function to enable recursive verification of proofs.

Summary of changes

A new std lib method was added:

#[foreign(verify_proof)]
fn verify_proof(_verification_key : [Field], _proof : [Field], _public_input : Field, _key_hash : Field, _input_aggregation_object : [Field]) -> [Field] {}

Although this function signature is not final as I would like to remove the key hash field and have it be handled by the compiler. The key hash will have to be specific to a backend and we cannot rely on the compiler to generate the key hash without backend interop.

Include a way to generate inner recursive proofs with nargo. The barretenberg backend requries a different hash type for recursive proofs (it using pedersen-blake3 for efficiency), however, the Noir requries a keccak based prover in order to be compatible with the Solidity verifier. This is why a new RecursiveProver type was added to the DSL package.

Dependency additions / changes

ACVM: noir-lang/acvm#291
acvm-backend-barretenberg: noir-lang/acvm-backend-barretenberg#146

Test additions / changes

There is a new recursion test that calls the new verify_proof foreign function. The recursive data comes from the xor test.

Checklist

  • I have tested the changes locally.
  • I have formatted the changes with Prettier and/or cargo fmt with default settings.
  • I have linked this PR to the issue(s) that it resolves.
  • I have reviewed the changes on GitHub, line by line.
  • I have ensured all changes are covered in the description.

Documentation needs

  • This PR requires documentation updates when merged.

Additional context

@vezenovm vezenovm changed the title Mv/verify proof 2 feat: Recursive verification May 19, 2023
@vezenovm vezenovm mentioned this pull request May 19, 2023
6 tasks
@vezenovm vezenovm changed the base branch from master to phated/ref-string May 19, 2023 17:59
Base automatically changed from phated/ref-string to phated/acvm-0.12.0 May 22, 2023 15:08
Base automatically changed from phated/acvm-0.12.0 to master May 24, 2023 12:10
@vezenovm
Copy link
Contributor Author

vezenovm commented Jun 7, 2023

Closed due to move to bb.js

@vezenovm vezenovm closed this Jun 7, 2023
@Savio-Sou
Copy link
Collaborator

Superseded by #1594.

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.

Add foreign function for recursion
4 participants