-
Notifications
You must be signed in to change notification settings - Fork 132
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
Implement API for sending MINA tokens via Party transactions #281
Comments
RFCWe wish to expose an intuitive and easy-to-use API for supporting sending MINA in party transfers. Adding transactions for MINA payments was discussed in #233 but was cut out of scope and should be implemented in another PR. Here, we propose an API that zkApp developers can use to support transactions with default MINA that is separate from the custom tokens API. Sending inside a zkApp methodAn easy-to-use API should be exposed on the zkApp instance inside a method's execution. For example, a method name such as @method sendMINATokens(receiverAddress: PublicKey) {
this.send({
to: receiverAddress,
amount: 10e9
})
} When the Sending using a constructed PartyIn addition to exposing a way to send MINA tokens on a zkApp method execution, we would also like to support generating the parties structure by the zkApp developer outside of a zkApp. This can be done by adding a let party = Party.createSigned(privateKey); // create party from a private key
let party2 = Party.createUnsigned(publicKey); // Can also create a party from a public key but require authorization later before txn is submitted
party.send({ to: someAddress, amount: 10e9 }); // send MINA from the party's account This way to construct a signed party and specify a send operation can be done inside a transaction block. This means that sending MINA in SnarkyJS isn't dependent on interacting with a zkApp and can be done anywhere a zkApp uses it. The combination of these two approaches (inside a zkApp and with a signed party) should cover the primary use cases that a zkApp developer needs to send MINA in an easy-to-use way. TestingA suite of unit tests should verify that these methods behave correctly. The following test cases should cover these behaviors: |
clean and easy to use :) |
this looks great to me! something I think we still have to improve is the naming of |
This is a very intuitive API. Nice work Martin! |
Description
During an internal discussion of the Tokens RFC, the product team decided to not include an API for transfers of MINA for zkApps. We instead decided to punt on this for a later PR as we wanted more time to decide on an easy to use API.
Once we have a good design in place for tokens, this should be implemented as part of this issue.
The text was updated successfully, but these errors were encountered: