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

Discussion: Transfer operation vs Credit / Debit operations #3

Open
syuan100 opened this issue Jun 1, 2021 · 0 comments
Open

Discussion: Transfer operation vs Credit / Debit operations #3

syuan100 opened this issue Jun 1, 2021 · 0 comments
Labels
discussion Discussion topics

Comments

@syuan100
Copy link
Collaborator

syuan100 commented Jun 1, 2021

Primers:

Currently, token transfers are specified using two operations in this order:

  • A debit operation (- amount, account A)
  • A credit operation (+ amount, account B)

I decided to do this as a form of strongly "typing" the operations so that I can ensure a Debit occurs before a Credit, which also makes parsing Construction requests a little easier. However this forces the user to adhere to a stricter standard than other implementations.

Some implementations have a simple "transfer" operation, where the only difference is the signed "amount" for the operation. So for a token transfer, you would have two transfer operations like so:

  • A transfer operation (- amount, account A)
  • A transfer operation (+ amoun, account B)

This allows the end user to be more flexible when defining a token transfer, but error checking becomes a bit more tedious than having explicit debit and credit operations.

Would be happy to hear thoughts on what people think would be the best path forward.

@syuan100 syuan100 added the discussion Discussion topics label Jun 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discussion Discussion topics
Projects
None yet
Development

No branches or pull requests

1 participant