-
Notifications
You must be signed in to change notification settings - Fork 45
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
Add Third Party Feepayer #424
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Co-authored-by: ymekuria <[email protected]>
shimkiv
approved these changes
Jun 19, 2023
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.
Looks good now! Thank you.
I've added couple more minor notes though.
This was referenced Jun 20, 2023
Closed
Merged
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
closes #129 #435 #429
Background
Currently, the zkApp cli creates a keypair for the zkApp account after running the
zk config
command. The cli assumes that this zkApp account has funds to pay fees, and uses it as fee payer.There are two reasons why the flow above is insufficient:
Incompatible with permissions
send: proof
permissions by default which means you need to provide a proof (of running a smart contract method) as authorization to send MINA away from the zkApp account.interact.ts
script in the template project.Unnecessary work to fund zkApp
Approach
After entering
zk config
, new steps are added to create or select a fee payer account.The first time a user enters
zk config
, they will be shown two option prompts.After selecting one of these options, there is an additional step to add an alias for this fee payer account.
? Create an alias for this account :
This base58 private key can be exported from a wallet or from any other existing account.
Every other time a use runs
zk config
, an option will be shown to use a stored account as a fee payer and an option to use a different account.If a user selects to use a different account they will see the previous options to recover a fee payor account or create a new one.
If a user has more than one fee payor account stored on their machine, an additional option is shown to choose another saved fee payer
The fee payer alias and corresponding keypair is stored globally on a users machine in the form of
<os specific cache directory>/zkapp-cli/keys/<fee payor alias>.json
. These fee payer accounts can be used across multiple projects.The
feepayerKeyPath
andfeepayerAliasName
are also added to theconfig.json
.The
interact.ts
script in the project template was also updated to work with the third party fee payer.See the discussion for more details.