-
Notifications
You must be signed in to change notification settings - Fork 391
fix: circom public inputs commitment #2077
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
Conversation
MauroToscano
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Panics seems a bit strange, are we sure the user cannot send something with an invalid size and panic the code ?
You are right, I missed that, solved in 6067e86. |
MauroToscano
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing case of no public inputs
Added them in be11294. |
Description
Changes how public inputs are passed to Circom.
Previously, public inputs were provided as the UTF-8 bytes of the input.json file generated during proof creation. This approach made proofs unusable for on-chain verification, since the verification data would be committing to raw JSON bytes. Computing the same commitment in Solidity to verify the public inputs would be either impossible or prohibitively expensive, as it would require parsing JSON on-chain.
Now, public inputs are passed as big ints modulo 2^254, to make sure they stay within the prover field. This matches the actual data type used internally by the verifier. However, Circom’s Go verifier did not originally expose the necessary function to supply raw inputs, so we maintain a fork of the circom-go-verifier repository where these functions are made public. See: https://github.com/yetanotherco/go-rapidsnark
How to test
Note: You need to rebuild ffis
Type of change
Checklist
testnet, everything else tostaging