Skip to content

UseCases_tokens_Send tokens

BytzCK edited this page Nov 23, 2021 · 1 revision

Use Cases, Scenario’s, Walkthroughts - for tokens

Case "Send tokens"

Scenario: Perform basic operations with tokens

Feature: Sending tokens

Actor: Any user

Summary:

When sending tokens, a user needs to specify the tokengroup ID, the recipient BYTZ address and the amount of tokens to send. (At the moment, coin control isn't implemented.)

  • While the precision of regular BYTZ transactions is 8 decimals after the decimal separator (which is the same as with Bitcoin), a token creator can specify how many decimals after the decimal separator he wants for his token group. DarkMatter for example knows a 13 decimal precision after the decimal separator.
  • The tokengroup ID is a unique identifier that is linked to a token group. For more information on linking tokengroup ID's to token names and token tickers, see the case "View information related to a token group".

The command to use is: sendtoken [TOKENGROUPID] [BYTZADDRESS] [AMOUNT]

Preconditions:

  • The user must have tokens to send

Steps:

If you do not know the tokengroup ID of the token you want to send, one way to find the tokengroup ID:

$ tokeninfo ticker RTTOK
[
  {
    "groupID": "bytzreg1zd4077w2tk2ct4wqfd4er3esasgxmvkeehknwumrea4h0tx3nz7sqta2cgp",
    "specification": {
      "ticker": "RTTOK",
      "name": "RegtestToken",
      "metadata_url": "https://github.com/bytzcurrency/ATP-descriptions/blob/main/regtest/test_token_1.json",
      "metadata_hash": "bbcec1b365e12371997dd8ab0c968a7f571da96772da9ed481f65b08571ef250",
      "decimal_pos": 0
    }
  }
]


Additional options for finding groupid of tokens
$ gettokenbalance
$ tokeninfo all

Send the token:

# Send 123 RTTOK to address TmNTKUGQkxXgVMExrcMpAHZwEXXEVCMKoh
$ sendtoken bytzreg1zd4077w2tk2ct4wqfd4er3esasgxmvkeehknwumrea4h0tx3nz7sqta2cgp TmNTKUGQkxXgVMExrcMpAHZwEXXEVCMKoh 123
a31bfb18a180826a55ada789f705aaaa57ccc01770ec45175441bc0c89dbd553

Postconditions:

  • The tokens have been send to the recipient
  • When needed, fees are paid automatically

Related use cases:

Clone this wiki locally