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

More descriptive and easier abstraction for recursive proofs generation #2838

Closed
Tracked by #2711
signorecello opened this issue Sep 26, 2023 · 0 comments · Fixed by #2845
Closed
Tracked by #2711

More descriptive and easier abstraction for recursive proofs generation #2838

signorecello opened this issue Sep 26, 2023 · 0 comments · Fixed by #2845
Assignees

Comments

@signorecello
Copy link
Contributor

signorecello commented Sep 26, 2023

Part of the first noir_js devex review.

To prove, we call prover.generateOuterProof which was a temporary name @kevaundray came up with for “generate a proof for some circuit not meant to be verified in another circuit”.

Problem is, it's not so descriptive and we could try to abstract that away or at least make it easier to understand.

Some suggestions:

Flag on the constructor

Noir.js could get the "type of proof" from the constructor, and expose just one function prover.generateProof, example:

const noir = new Noir(circuit, { recursive: true })
const proof = noir.generateProof() // noir.js already knows if it's dealing with a recursive circuit

Define new API

We could define a new API just for recursive proofs, possibly inheriting some base class:

import { Noir, NoirRecursive } from "@noir-lang/noir_js";

const noir = new Noir() // non-recursive instance of Noir
const recursive = new NoirRecursive() // recursive instance of Noir

Rename methods

This is probably the easiest: just renaming the methods. @Savio-Sou came up with some cool alternative names to generateOuterProof:

const noir = new Noir();
const proof = noir.generateIntermediateProof() // only people who care about recursive proofs know what does this mean
const proof = noir.generateFinalProof() // descriptive enough for those who have intermediate proofs, but doesn't prompt any confusion to the common app developer
@github-project-automation github-project-automation bot moved this to 📋 Backlog in Noir Sep 26, 2023
@signorecello signorecello changed the title Rename methods, or define new API for recursive proofs generation More descriptive and easier abstraction for recursive proofs generation Sep 26, 2023
@github-project-automation github-project-automation bot moved this from 📋 Backlog to ✅ Done in Noir Sep 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

4 participants