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

Write main return value in prover.toml and verifier.toml #355

Closed
guipublic opened this issue Sep 29, 2022 · 1 comment
Closed

Write main return value in prover.toml and verifier.toml #355

guipublic opened this issue Sep 29, 2022 · 1 comment
Labels
enhancement New feature or request

Comments

@guipublic
Copy link
Contributor

The main return value is usually used for two reasons:

  1. to prove that a statement is true, in which case the return value should be true
  2. to prove that the result was properly computed, in which case you do not know the result in advance.

However;

  • to properly generate the proof, the return value must be put inside the prover.toml, which means the prover has to compute its value, which can be annoying and error prone.
  • to properly verify the proof the return value must be put inside the verifier.toml, which the verifier cannot always do

To support the first case, the user must be able to set its own return value, for instance to ensure that the value must be true
To support the second case, we want to benefit from the fact that noir is computing the return value by using it in the prover.toml and verifier.toml

As result, when generating a proof;

  • if the return value IS defined in the prover.toml/verifier.toml, we should use this one.
  • if the return value is NOT defined in the prover.toml, we should write the value in prover.toml
  • if the return value is NOT defined in the verifier.toml, we should write the value in verifier.toml

In order to avoid user errors, the handling of the return value in .toml files should be explicit:

  • the return value should always be present, if not it would be an error (of course unless the noir program does not return a value)
  • the return value can then be either defined with a value,
  • or explicitly stated as undefined
@guipublic guipublic added the enhancement New feature or request label Sep 29, 2022
@guipublic guipublic mentioned this issue Oct 5, 2022
@jfecher
Copy link
Contributor

jfecher commented Oct 18, 2022

Implemented in #360

@jfecher jfecher closed this as completed Oct 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants