-
Notifications
You must be signed in to change notification settings - Fork 195
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
Auto return #360
Auto return #360
Conversation
So when we have |
In all cases (i.e with a return="" , or with return="5", or with no return at all), it now generates the verifier.toml, and overwrites existing file.
|
Undefined arrays returned from main does not work, so I return an error in that case. |
With this PR, prover does not need to provide the main return value and can instead write in the prover.toml:
return = ""
Note that the return parameter must still be present in prover.toml, but we can give an empty value instead using an empty string.
Generating the proof will also create the verifier.toml (it overwrites if already existing) with the public inputs (including the return value if there is one) corresponding to the provided prover.toml.
Here is a bit of context:
The
main()
function of a noir program can return a public value, which is computed by this noir program.However, this public value is also a public input for the ZK proof so this requires the prover to compute by itself the value and put it in the provel.toml in order to generate the proof.
But the computation itself can be delicate if the noir program is doing a lof of (e.g. cryptographic) stuff. On the other hand, generating a proof of execution is also executing the program so noir should have already computed this value and it should not be necessary for the prover to provide the main return value.
This follows the concerns expressed in issue 355 [https://github.com//issues/355]