Skip to content

DarmaCash Omni Token

Darma edited this page Nov 20, 2020 · 1 revision

darmad

token_list command

View the information of all issued tokens, including Symbol, Name, Token Id, Total Supply, Spent DMCH etc.

darma-wallet-cli

issue_token command

Issue tokens: enter the name, total supply and symbol.

  • Token name,less than 32 characters.
  • Symbol is 2-5 uppercase English characters, excluding numbers and special characters; DM* is reserved by the system.
  • For ease of use, if the symbol you enter contains lowercase characters, the program will automatically convert them to uppercase.
  • The symbol is a global unique identifier.
  • Issuing a token will cost different amounts of DMCH according to the length of the symbol. The shorter the length, the more it will cost.
  • The program will hash the symbol to obtain the globally unique hash value as Token Id.
  • Symbol and Token Id are one-to-one correspondence, so they are equivalent.
  • The number of issued tokens must be an integer, that is, the minimum number is 1.

Eg. issue_token or issue_token

transfer_token command

Token transfer: symbol, receive address, amount.

The target token needs to be specified by symbol, and other parameters can be referred to the transfer command.

Eg. transfer_token or transfer_token

[ ]... [<payment_id>]

token_transfers command

All token transfer records.

Refer to the show_transfers command, symbol can be used to filter the output.

Eg. token_transfers or token_transfers [min height] [max height]

list_token command

A list of all tokens owned by the wallet and the latest height.

token_balance command

Check the token balance.

The target token needs to be specified by symbol.

Eg. token_balance OR token_balance

RPC

Full node

token_list interface

Example:

{  
	"jsonrpc":"2.0",  
	"method": "token_list",  
	"params": {	  
	}  
}  

check_tx_key interface

If it is a token transfer, the returned data will contain token_symbol and token_id information based on the original returned value

Wallet

issue_token interface

Example:

{
	"jsonrpc":"2.0",
	"method": "issue_token",
	"params": {
				"symbol": "CCXB",
        "name": "Conceal B",
        "amount": 100000000000000,
        "limit": 1,
        "limit_type": "min",
        "mixin": 6,
        "get_tx_key": true,
        "get_tx_hex": true,
        "address": "dST1KNnZhT8Fnr1sZr5eDy9jVERTLeFa2SLwdt3UCquUDH7QHGFWb141xP8FEEYszoZTDUR2BHYFjEhrPthSc4pU23Bn5dYZY9"
	}
}

In the rpc interface, amount is in 8-digit decimal form, 100000000000000 = 1,000,000.00000000 For the meaning of the parameters, please refer to the transfer interface.

transfer_token interface

Example:

{
	"jsonrpc":"2.0",
	"method": "transfer_token",
	"params": {
        "destinations": [{"address": "dTvPqmgvatbjNWEcbdtru84yS6JUCh2fF6RwXf7Pt6dFbxxJaaWLk2Ga51B3KCRnni3yNvykqiFTMTqKdGxuHg3m12s5WbxXt", "amount": 2200000000}, {"address": "dST19xiLGj9ZrTCo87feujEebn57wPxEAKPtSgms3zjc9DECWPUUAYNdFQV4hrydFXEjS2dG8BrveF2w18N8hUiJ83DCnak5oJ", "amount": 3300000000}],
        "mixin": 5,
				"symbol": "SINX",

        "limit": 2,
        "limit_type": "min",
        
        "get_tx_key": true,
        "get_tx_hex": true
	}
}

For the meaning of the parameters, please refer to the transfer interface.

list_token interface

Example:

{
	"jsonrpc":"2.0",
	"method": "list_token",
	"params": {
	}
}

token_balance interface

Example:

{
	"jsonrpc":"2.0",
	"method": "token_balance",
	"params": {
		"symbol": "CCXZ"
	}
}

For the meaning of the parameters, please refer to the getbalance interface.

get_token_transfers interface

Example:

{
	"jsonrpc":"2.0",
	"method": "get_token_transfers",
	"params": {
		"in": true,
		"out": true,
    "pool": true,
    "pending": true
	}
}

For the meaning of the parameters, please refer to the get_transfers interface.

Others

Token transaction, ordinary transaction

All transactions before the release of the anonymous token function are called ordinary transactions. The issuance of tokens and the transfer of tokens are called token transactions. We have expanded the Extra field of ordinary transactions. The new OMNI_TOKEN field is used to store token transaction related metadata, including Name, Symbol, Id, Amount, etc. The new TOKEN_TX field is used to store token transaction related data. Its data structure is exactly the same as that of ordinary transactions. Therefore, token transactions are the same as ordinary transactions, with complete anonymity and security.

Validation

To issue a token, in addition to the verification of ordinary transactions, the verification of token transactions is also required, including Name, Symbol, Id, Amount, etc.

Token transfer requires verification of token transactions in addition to verification of ordinary transactions, including Symbol, Id, Amount, KeyImage, RingMember, Rct, etc.

Except for the differences in the Extra field, token transactions and ordinary transactions are consistent in structure and usage algorithms.

Write UTXO

The issuance of tokens is similar to the coinbase mechanism, which is issued by the system to the issuer (corresponding to the miners in the coinbase), and the amount is public.

When a token is issued, DMCH is spent. The transaction has only the sender and no receiver, which is equivalent to the DMCH being destroyed and cannot be retrieved later.

Based on the technical requirements of the Monero (including Darma Cash), a Ring Member is required to transfer tokens. Therefore, when issuing tokens, the system will split the total supply into 7 (the maximum number of vouts allowed) vout . The split ratio is 8, 10, 12, 14, 16, 18, 22 and the total amount is still 100%

The transfer token amount allows 8 decimal places like DMCH, and the number of issued tokens must be an integer.

Transaction cost

Token transactions are attached to ordinary transactions. Token transactions themselves do not charge fees, but charge fees for ordinary transactions.

Transaction sender, receiver, transfer amount, change

When issuing a token, if you operate through the command line, the sender and change are the same address, and the receiver defaults to the operator himself. If the token is issued through the rpc interface, the sender and change are the same address, and the recipient of the token can be specified.

How to ensure privacy

  • Issuing anonymous tokens, the mechanism is similar to the coinbase issuance of mining transactions, the sender and receiver are anonymous, and the amount is publicly displayed.
  • Anonymous token transfer, the mechanism is exactly the same as ordinary transactions, and the anonymity of the transaction is guaranteed by ring signatures, one-time addresses, bulletproof and RingCT.