Assets in the Polkadot network can be represented on several chains. They can take many forms, from a parachain's native token to on-chain representations of off-chain reserves. This page focuses on the latter, namely assets that would be issued by a creator (e.g. rights to audited, off-chain reserves held by the creator, or art issued as an NFT).
The Statemint parachain hosts data structures and logic that specialize in the creation, management, and use of assets in the Polkadot network. Although other parachains can host applications dealing with assets on Statemint, Statemint can be thought of as the "home base" of assets in the network.
Statemint uses DOT as its native token. The chain yields its governance to its parent Relay Chain, and has no inflation or era-based rewards for collators (although collators do receive a portion of transaction fees). As a system parachain, Statemint has a trusted relationship with the Relay Chain, and as such, can teleport DOT between itself and the Relay Chain. That is, DOT on Statemint is just as good as DOT on the Relay Chain.
Statemint does not support smart contracts. See the Advanced section at the bottom for discussion on using proxy and multisig accounts to replicate oft used contract logic.
Creation and Management
Anyone on the network can create assets on
Statemint, as long as they can reserve the
required deposit of
The network reserves the deposit on creation. The creator also must specify a unique
integer of type
u32, to identify the asset. The
AssetId should be the canonical identifier for
an asset, as the chain does not enforce the uniqueness of metadata like "name" and "symbol". The
creator must also specify a minimum balance, preventing accounts from having dust balances.
Asset classes and instances can have associated metadata. The metadata is an array of data that the class owner can add on-chain, for example, a link to an IPFS hash or other off-chain hosting service. The Uniques pallet also supports setting key/value pairs as attributes to a class or instance.
An asset class has several privileged roles. The creator of the asset automatically takes on all privileged roles, but can reassign them after creation. These roles are:
- The owner can set the accounts responsible for the other three roles and set asset metadata (e.g. name, symbol, decimals).
- The issuer can mint and burn tokens to/from their chosen addresses.
- The admin can make force transfers as well as unfreeze accounts of the asset class.
- The freezer can freeze assets on target addresses or the entire asset class.
Always refer to the reference documentation for certainty on privileged roles.
An asset's details contain one field not accessible to its owner or admin team, asset sufficiency. Only the network's governance mechanism can deem an asset as sufficient. A balance of a non-sufficient asset (the default) can only exist on already-existing accounts. That is, a user could not create a new account on-chain by transferring an insufficient asset to it; the account must already exist by having more than the existential deposit in DOT (or a sufficient asset). However, assets deemed sufficient can instantiate accounts and pay for transaction fees, such that users can transact on Statemint without the need for DOT.
Polkadot-JS UI doesn't support the functionality to pay with a sufficient asset yet. When using Polkadot-JS UI, transaction fee needs to be paid in DOT.
Fungible assets are those that are interchangeable, i.e. one unit is equivalent to any other unit to claim the underlying item. Statemint represents fungible assets in the Assets pallet. This pallet presents a similar interface for those familiar with the ERC20 standard. However, the logic is encoded directly in the chain's runtime. As such, operations are not gas-metered but benchmarked upon every release, leading to efficient execution and stable transaction fees.
Transferring Asset Balances
Users have a simple interface, namely the ability to transfer asset balances to other accounts on-chain. As mentioned before, if the asset is not sufficient, then the destination account must already exist for the transfer to succeed.
The chain also contains a
transfer_keep_alive function, similar to that of the Balances pallet,
that will fail if execution kills the sending account.
Statemint also sweeps dust balances into transfers. For example, if an asset has a minimum balance of 10 and an account has a balance of 25, then an attempt to transfer 20 units would transfer all 25.
Statemint provides an
cancel_approval interface. Application developers can use this interface
so that users can authorize the application to effectuate transfers up to a given amount on behalf
of an account.
Statemint uses a reserve-backed system to manage asset transfers to other parachains. It tracks how much of each asset has gone to each parachain and will not accept more from a particular parachain.
As a result of this, asset owners can use Statemint to track information like the total issuance of their asset in the entire network, as parachain balances would be included in the reserve-backed table. Likewise, for the minting and burning of tokens, an asset's team can perform all operations on Statemint and propagate any minted tokens to other parachains in the network.
Parachains that want to send assets to other parachains should do so via instructions to Statemint so that the reserve-backed table stays up to date. For more info, see the "Moving Assets between Chains in XCM" section of the article on the XCM format.
Unlike fungible assets, the particular instance of a non-fungible asset (NFT) has a separate meaning from another instance of the same class. Statemint represents NFTs in the Uniques and NFTs pallets.
Similar to the Assets pallet, this functionality is encoded into the chain. Operations are benchmarked before each release in lieu of any runtime metering, ensuring efficient execution and stable transaction fees.
Users can transfer their NFTs to other accounts. The chain also provides an
cancel_approval interfaces that application developers can use to allow
users to authorize an application to transfer an instance on their behalf.
Many asset creators on other networks use smart contracts to control privileged functions like minting and burning. Although Statemint does not have a smart contract interface, it contains the Multisig, Proxy, and Utility pallets, which will meet most account management needs.
For example, if a team wants sign-off from two groups to perform a privileged operation, it could create a 2-of-2 multisig from two pure proxies, and then set members from each group as proxies to those two accounts.