Token is a digital asset on the blockchain. A token can be used:
A token can represent a physical or an intangible object. The words “token” and “asset” are used interchangeably in the DecentralChain ecosystem. DecentralCoin is the native token on the DecentralChain blockchain. More about DecentralCoin.
All other tokens are custom tokens issued on behalf of some account. Any account that has enough DecentralCoins to pay the fee can issue its own token. The new token is immediately available:
You can use Decentral.Exchange online to create an asset.
The transaction fee is 1 DecentralCoin for a regular token or 0.001 DecentralCoins for a non-fungible token (NFT). Moreover, the token can be issued by the dApp script as a result of the invoke script transaction when the callable function result contains the Issue action. The minimum fee for invoke script transaction is increased by 1 DecentralCoin for each non-NFT token issued.
Token ID is a byte array calculated as follows:
In the Node REST API, the token identifier is encoded in base58. For example:
"assetId": "8LQW8f7P5d5PZM7GtZEBgaqRPGSzS3DfPuiXrURJ4AJS"
The DecentralCoin token has no identifier. The Node REST API uses null for DecentralCoin.
Can be done via a transfer transaction or a mass transfer transaction. A dApp script can transfer the token via a ScriptTransfer script action as a result of an invoke script transaction.
Three accounts can participate in the exchange: one user creates an order to buy a token, the other creates an order to sell a token. The matcher combines buy and sell orders with suitable parameters and creates an exchange transaction.
Decreases the amount of token on the account and thereby the total amount of the token on the blockchain. Any token owner can burn it, not only the issuer. It is impossible to burn DecentralCoin. Can be done via a burn transaction. A dApp script can burn the token via a Burn script action as a result of the Invoke script transaction.
An invoke script transaction can contain up to two payments to the dApp. Payment amount and token are available to the callable function.
The following token operations can only be performed by the account that issued the token:
The token issuer can enable sponsorship which allows all users to pay fees in this token (instead of DecentralCoins) for invoke script transactions and transfer transactions. More about sponsorship. Enabling or disabling sponsorship can be done via a sponsor fee transaction. A dApp script can set up sponsorship using a SponsorFee as a result of the invoke script transaction.
Increases the amount of token on the blockchain. The reissuable field of token determines whether the token can be reissued. Can be done via a reissue transaction. A dApp script can reissue the token via a Reissue script action as a result of the invoke script transaction.
Can be done via a set asset script transaction. If the token is not a smart asset, that is, the script was not attached when the token was issued, then it is impossible to attach the script later.
Can be done via an update asset info transaction.
Non-fungible token or NFT is a special type of a token that is issued with the following parameters:
NFT is a singular entity that has a unique ID. This contrasts with a regular token, two coins of which (for example, two WBTC) cannot be distinguished from each other. NFTs can be used as in-game items, collectibles, certificates, or unique coupons.
NFT can be issued in the same ways as a regular token, see token issue. The minimum fee for an NFT issue is 0.001 DecentralCoins, 1000 times less than for a regular token.
Smart asset is a token that has an asset script assigned to it. By default, tokens on the DecentralChain blockchain are not smart contracts, and any transactions with them are allowed. The script endows a token with functionality that sets the rules for its circulation. Each transaction involving a smart asset is automatically checked against the conditions specified in the script. If the asset's script allows the transaction, it will be executed; if the script denies the transaction, it is either not put onto the blockchain at all or saved as failed (for details, see the transaction validation article).
Using smart assets, you can implement various financial instruments on the blockchain (options, interval trading, taxation), game mechanics (allowing transactions only between characters with certain properties). Please note:
A token issued on another blockchain cannot be used directly on the DecentralChain blockchain. A new token representing the original one can be issued on the DecentralChain blockchain, and a gateway that pegs the two tokens 1:1 can be deployed.
DecentralCoin is the native token of the DecentralChain blockchain. Block generators receive transaction fees and block rewards in DecentralCoins, which encourages generators to maintain and develop the blockchain network infrastructure. The more DecentralCoins the generator holds (by ownership or lease), the greater its chance to add the next block is.
DecentralCoins are present on the blockchain since inception, there is no issue transaction for it, therefore the DecentralCoin token does not have an ID. The REST API uses null for DecentralCoins. The number of decimal places (decimals) for DecentralCoins is 8. The atomic unit called Decentralite is frac{1}{100,000,000} DecentralCoins.
The owner of DecentralCoins can lease them via a lease transaction. DecentralCoins received on lease are included in the generating balance. Block generators send back different percentages as rewards to lessors. A lessor can cancel the lease at any time via a lease cancel transaction. More about leasing.
You can buy DecentralCoins tokens at Decentral.Exchange, or at one of the centralized exchanges. In addition, cryptocurrency gateways can be used to transfer external cryptocurrencies such as Bitcoin, Ethereum etc. from the external blockchain to the DecentralChain blockchain and vice versa. The gateway provides the user with the address on the external blockchain. After receiving a confirmation of transfer to this external address, the gateway transfers the corresponding asset (minus the fee) to the user's DecentralChain address.
Below is an example of JSON representation returned by the GET /assets/details/{assetId} method of Node REST API:
{
"assetId": "DG2xFkPdDwKUoBkzGAhQtLpSGzfXLiCYPEzeKH2Ad24p",
"issueHeight": 1806810,
"issueTimestamp": 1574429393962,
"issuer": "3PC9BfRwJWWiw9AREE2B3eWzCks3CYtg4yo",
"issuerPublicKey": "BRnVwSVctnV8pge5vRpsJdWnkjWEJspFb6QvrmZvu3Ht",
"name": "USD-N",
"description": "Neutrino USD",
"decimals": 6,
"reissuable": false,
"quantity": 999999999471258900,
"scripted": false,
"minSponsoredAssetFee": 7420,
"originTransactionId": "DG2xFkPdDwKUoBkzGAhQtLpSGzfXLiCYPEzeKH2Ad24p"
}| Field | Description |
|---|---|
| assetId | Token ID: base58 encoded byte array. The token ID is calculated as a hash of the token parameters upon issue. See also the token ID article. |
| issueHeight | Blockchain height (the sequence number of the block) at which the token is issued. |
| issueTimestamp | Token issue timestamp: Unix time in milliseconds. |
| issuer | address of issuer account: base58 encoded byte array. |
| issuerPublicKey | Public key of issuer account: base58 encoded byte array. |
| name | Token name. From 4 to 16 bytes (1 character can take up to 4 bytes). |
| description | Token description. From 0 to 1000 bytes. |
| decimals | Number of decimal places, from 0 to 8. |
| reissuable | Reissue availability flag. |
| quantity | Total supply of token on the blockchain specified in atomic units. From 1 to 9,223,372,036,854,775,807. Total supply can change as a result of reissue or burning, see token operations below. |
| scripted | There being a script: true for smart asset, false for regular token. More about smart assets. |
| minSponsoredAssetFee | For sponsored asset only: an amount of asset that is equivalent to 0.001 DecentralCoins. More about sponsorship. |
| originTransactionId | ID of the transaction that issued the token: base58 encoded byte array. |
| scriptDetails | For smart asset only: asset script and its attributes. |
The amount of token is displayed differently in UIs and in the JSON representation used by the Node REST API. In API requests and responses, amount values are integers indicated in atomic units to avoid precision issues in floating-point calculations. An atomic unit is the minimum fraction (“cent”) of a token, it is equal to 10^{-decimals}. The amount of token in JSON is the real quantity multiplied by 10^{decimals}.
For USD-N in the example above:
Elsewhere on this site