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

barretenberg API and bb.js should be modified to accept the proof separate the public inputs #1675

Open
kevaundray opened this issue Aug 20, 2023 · 0 comments
Labels
C-bb.js Component: bb.js - wrapping bberg in js C-bb-bin Component: Barretenberg executable binary

Comments

@kevaundray
Copy link
Contributor

Problem

There are inconsistencies in handling of public inputs in the proof. For most of the ACIR stack, the proof is separate to the proof. This decision was made because the public inputs may be derived by the verifier and so it is of no benefit for the prover to send them alongside the proof. Moreover, even in this model, the verifier would need to check correctness of the public inputs that came with the proof anyway.

Solution

We could fix this inconsistency in the internals of barretenberg, but this would require a conversation with more stakeholders. The most optimal solution right now is to make the barretenberg API accept the proof and public inputs, then internally it concatenates them together. Furthermore, when we return a proof, we chop off the public inputs from the proof.

Note: We could return the public inputs separately from the proof, since its reasonable to assume that the prover will always have them. I think we should not do this now though. The only benefit I can think of is when the public inputs are not in the initial set of witnesses, this however is a particularity of barretenberg circuits that we should not make leak through the interface. For more information, see set_public_input in barretenberg. I do not expect any gadget that is used via ACIR/Noir to ever need that function.

Notes

With the above, we will not need to make changes to the internals of barretenberg, so it should be a quick fix.

Won't put it as part of #1672 for two reasons:

  • We want to keep that PR lean
  • This breaks all of our test vectors because it would require the binaries to accept public inputs and currently the compiled ACIRs do not include them. We would need to add a public_inputs file for bb to read from.
@kevaundray kevaundray added the C-bb.js Component: bb.js - wrapping bberg in js label Aug 20, 2023
@github-project-automation github-project-automation bot moved this to Todo in A3 Aug 20, 2023
@kevaundray kevaundray changed the title barretenberg API and bb.js should be modified to accept the proof alongside the public inputs barretenberg API and bb.js should be modified to accept the proof separate the public inputs Aug 20, 2023
@TomAFrench TomAFrench added the C-bb-bin Component: Barretenberg executable binary label Sep 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bb.js Component: bb.js - wrapping bberg in js C-bb-bin Component: Barretenberg executable binary
Projects
Status: Todo
Development

No branches or pull requests

2 participants