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

Make address a variable #406

Merged
merged 12 commits into from
Sep 14, 2022
Merged

Make address a variable #406

merged 12 commits into from
Sep 14, 2022

Conversation

mitschabaude
Copy link
Member

@mitschabaude mitschabaude commented Sep 9, 2022

  • closes Make address a variable in zkapp circuits #136
  • the publicKey (address) and tokenId of a SmartContract, which used to be baked into the circuit as constants, are variables now
    • they were part of the public input anyway, so them also being constants wasn't adding security or anything. you still can't make a proof that uses publicKey1 but succeeds in authorizing an update to an account with publicKey2, if publicKey1 !== publicKey2
  • removes the required arguments for SmartContract.compile(), anaylyzeMethods() and digest(). that also means a smart contract can now be compiled once and used for different accounts
  • unrelated: add detailed error message for the common Invalid_fee_excess error

@mitschabaude mitschabaude marked this pull request as ready for review September 13, 2022 11:39
Copy link
Contributor

@MartinMinkov MartinMinkov left a comment

Choose a reason for hiding this comment

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

Awesome changes! 🥇

@@ -23,7 +23,7 @@ await isReady;
let address = PrivateKey.random().toPublicKey();

console.log('compile...');
await MyContract.compile(address);
Copy link
Contributor

Choose a reason for hiding this comment

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

Great change :D

src/lib/errors.ts Outdated Show resolved Hide resolved
src/lib/zkapp.ts Outdated Show resolved Hide resolved
src/lib/zkapp.ts Show resolved Hide resolved
@mitschabaude mitschabaude merged commit b24540a into main Sep 14, 2022
@mitschabaude mitschabaude deleted the feature/address-variable branch September 14, 2022 12:34
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.

Make address a variable in zkapp circuits
2 participants