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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Properly constrain zkApp party #278

Merged
merged 3 commits into from
Jul 15, 2022
Merged

Properly constrain zkApp party #278

merged 3 commits into from
Jul 15, 2022

Conversation

mitschabaude
Copy link
Member

@mitschabaude mitschabaude commented Jul 14, 2022

  • Stacked on top of Sequencing events聽#274
  • Closes Ensure that the zk app circuits generated by @method have all the proper constraints needed聽#98 - zkApps are now properly constrained 馃帀
  • This means that zkApps take the party they produced, hash it and assert that it equals the public input. So the public input can't be anything else than the hash of the exact same party. Essentially, the party is the public input.
  • Without this assertion, a transaction containing an entirely different party, which might not comply with the smart contract logic at all, could also have had a valid proof!
  • This PR was easier than originally expected, thanks to the fact that the protocol definition of the zkApp public input changed, to a hash of the zkApp party we had already implemented. (It used to be something that didn't really make sense,)

function circuitValue<T>(typeObj: any): AsFieldElements<T> {
function circuitValue<T>(
typeObj: any,
advanced?: { customObjectKeys: string[] }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how about options? ? Same suggestion on the other PR too

Base automatically changed from feature/sequence-events to main July 15, 2022 06:57
@mitschabaude mitschabaude merged commit de013fd into main Jul 15, 2022
@mitschabaude mitschabaude deleted the feature/constrain-party branch July 15, 2022 07:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Ensure that the zk app circuits generated by @method have all the proper constraints needed
2 participants