How to Interact with System Token

This tutorial covers the process of registering and using system tokens in InfraBlockchain.

InfraBlockchain provides a differentiated blockchain system that uses system tokens as gas fees. The following content is organized to help developers easily understand and develop the process of registering, using, and disposing of system tokens. You can practice this content in how-to-pay-transaction-fee.

Bootstrap Stage

Infra Blockchain Runtime has two runtime states. When the network is first started, it is in the Bootstrap stage, where the system token is not yet registered. There are limitations on the transactions that can be performed in the bootstrap stage.

List of transactions that can be performed:

  • Assets::create: Transaction to create a token

  • Assets::set_metadata: Transaction to set metadata for the created token

  • Assets::mint: Transaction to issue a token (at least one token that can be transacted must exist for registration)

  • InfraParaCore::request_register_system_token: Transaction to request registration of the system token

Notation _::_: The part before :: is the palette name, and the part after is the transaction name within the palette.

Registering System Tokens

Registration Request Process

  • Token Creation

  • Metadata Setting

  • Token Issuance

  • System Token Registration Request

    This transaction can be called by an approved account of the relay chain or the governance of the parachain itself.

    Event

    exp represents the expiration time for the registration request.

Once this event is confirmed, the information for the registration request is reflected in the relay chain, and the approval status is determined by the governance of the relay chain validators.

Relay Chain Governance Process

Get Exchange Rate Information

All system tokens are based on fiat currency, and exchange rate information must be reflected for registration to proceed. First, a data request is sent from the relay chain to the oracle node side through the requestExchangeRate transaction. This transaction is carried out through governance.

This transaction is a request for exchange rate data for the system token being used as a reference against the current system token that has been registered or the system token for which registration is requested. When the transaction is executed successfully, the relay chain requests data from the oracle node, and the following event occurs on the oracle node.

When exchange rate data is obtained from an external source, the following event occurs after the relay chain submits the data.

When the relay chain receives the data, it updates the exchange rate data for each fiat currency, and the following event occurs.

Register System Token

Governance Submission: The owner of the token submits relay chain governance to register the token as a system token.

Currency Type is an option when registering a relay chain token as a system token.

Extended Metadata is an option when additional metadata for the system token is desired.

Governance Vote: Relay chain validators participate in governance, and if more than 2/3 agree, the system token is registered.

When approved and registered as a system token, the following event occurs on the chain that issued the token, and the registration as a system token is completed.

End Bootstrap

Once the system token registration is completed, the bootstrap stage is completed, and it is possible to pay transaction fees with the system token. The relay chain performs a transaction to end the bootstrap stage for the chain.

dest represents the chain to end the bootstrap.

When the transaction is executed successfully, the following event occurs on the dest chain:

Using Wrapped System Tokens

Approval to Use Wrapped System Tokens: When you want to use system tokens as gas fees on another chain, you need to submit a governance proposal for using wrapped system tokens.

The para_id option below represents the chain id to use the wrapped system token.

Once approved, you can confirm that the wrapped system token is successfully registered in the ForeignAssets of the chain where you want to use it.

Even after registration is complete, the token can be used as a transaction fee by receiving it through XCM from the chain that issued the token.

Stopping System Token Usage

  • Action in Case of Problems: If there is a problem with the parachain or the system token, you can temporarily suspend or permanently delete the system token or the wrapped system token to prevent harm to the ecosystem.

    The suspension of the system token requires approval from governance, and once approved, the system token and the wrapped system token cannot be used as gas fees.

Last updated