Concept
The Token Rate Registrar in Kira Network allows governance to whitelist foreign tokens, set exchange rates, and define limits on staking rewards distribution in order to maintain the relevance and value of KEX. This enables users to pay execution fees with any whitelisted token, providing easy onboarding for new users directly from foreign networks without requiring them to use centralized exchanges to acquire KEX or deanonymize themselves. The Token Rate Registrar also allows governance to define the distribution of incentives to maintain the relevance and value of KEX, ensuring that the native token remains attractive and desirable for users and stakeholders to hold and use. By incentivizing participation and holding, the network is able to maintain a high level of security and value.
Governance
Parameters
For the native KEX token, only the stake_cap and stake_min parameters can be modified.
Staking capability
The stake_token property determines whether or not a specific token can be used as collateral by delegators on the KIRA Network. If the stake_token property for a token is set to true, then users will be able to stake that token and earn rewards. If it is set to false, then it will not be possible to stake the token and no rewards will be distributed.
The stake_token property of a specific token can only be set to true if the given token is present in the Token Aliases, which sets the decimals in the lowest denomination. Removal of a token from the token aliases registry will automatically disable it by setting stake_token and fee_token properties to false.
Fee payment capability
The fee_payment property determines if a given token can be used to pay transaction fees on the Kira Network, provided the enable_foreign_fee_payments network property is enabled. If the fee_payment property is set to true, then users will be able to use that token to pay transaction fees based on its fee_rate parameter, which sets the exchange rate for the token. By allowing users to pay transaction fees with a variety of different tokens, the network can be more accessible and user-friendly, providing an easy onboarding process for new users and allowing them to pay fees without having to acquire the native KEX token.
Fee exchange rate
fee_rate sets the exchange rates for whitelisted tokens in terms of KEX. The Token Rate Registrar is not meant to track the market price of assets accurately as this would be too much of an overhead, but rather provides an easy way to convert between tokens and KEX as a way to protect against transaction spam. For example, if the fee_rate for token u<denom> is 2, it means that 2 ukex is equal to 1 u<denom>. If the minimum fee payment, as defined by the min_tx_fee network property, is 100 ukex, then to make a transfer, the transaction fee should be set to at least 50 u<denom> tokens. Rates can also be expressed as decimals. For example, a rate of 0.1 would mean that 0.1 ukex is equal to 1 u<denom>. In this case, the minimum transaction fee payment in our example would be 1000 u<denom> tokens.
The fee_rate for transactions using tokens other than KEX is expected to be higher in order to ensure the security of the blockchain and prevent transaction spam. This is because KIRA must maintain the security of the chain regardless of the market price of other tokens at any given time. The governance system is responsible for adjusting the exchange rates to account for possible black swan events. KIRA does not and will not use any third-party oracles, and instead relies solely on the capabilities of its own governance system. This is to mitigate any potential risks associated with the use of oracles and third parties.
Staking reward cap
Any token eligible for staking has a corresponding stake_cap parameter which sets the maximum percentage of staking rewards that it is entitled to receive from a staking pool. For example, if the stake_cap for BTC is set to 0.1 (10%), then no matter how much BTC is staked in the pool, only 10% of incoming rewards will be allocated and shared among BTC delegators. This is to prevent a malicious user from diluting the pool with a large amount of a particular token in order to claim all the rewards for themselves. By setting specific shares for each token, the reward distribution process is made simpler and more efficient, as it eliminates the need to track the market value of the staking tokens in terms of a fiat currency such as USD or KEX.
The sum of all stake caps for tokens in the Token Rates Registrar must be equal to or less than 1.0 (100%) when adding, deleting, or updating a token's stake_cap. It should not be possible to set the stake_token property to true if the cumulative reward caps exceed 1.0. If the stake_token property for a specific token is set to false, then it is not be possible to stake that token (only unstaking is possible) and no rewards is distributed (equivalent to a fee_rate of 0).
KEX stake_cap cannot be set under 50%.
Spam prevention
The stake_min property sets the minimum amount of token a user can delegate or undelegate per transaction to prevent a dust spam attack where a malicious user would try to massively delay the block production by adding/withdrawing small amounts of staking tokens with many different accounts (c.f Fees and staking rewards distribution).
stake_min must be greater than 0
Example of Token Rate registry
JSON
Copy
[ {
"denom": "ukex", // token denom MUST be present in the Token Aliases Registrar [CAN NOT BE MODIFIED - FOR ukex ONLY]
"fee_rate": 1.0, // paying 1 ukex in fees is equivalent of paying 1 ukex [CAN NOT BE MODIFIED - FOR ukex ONLY]
"stake_cap": 0.50, // 50% of all block & fee rewards go to KEX delegators [CAN NOT BE LESS THEN 50% - FOR ukex ONLY]
"stake_min": 100, // can't stake less than 100 ukex [MUST BE GREATER THAN 0 - FOR ANY TOKEN]
"fee_payment": true, // can be used as fee token [CAN NOT BE MODIFIED - FOR ukex ONLY]
"stake_token": true // can be used as staking token [CAN NOT BE MODIFIED - FOR ukex ONLY]
} {
"denom": "xbtc",
"fee_rate": 175885.0, // paying 1 satoshi in fees is equivalent of paying 175'885 ukex for a fee transfer
"stake_cap": 0.251, // 25.1% of all rewards go to BTC delegators
"stake_min": 10000, // can't stake less than 10k sats
"fee_payment": true, // can be used as fee token
"stake_token": true // can be used as staking token
}, {
"denom": "xeth",
"fee_rate": 0.0000012, // paying 1 wei in fees is equivalent of paying 0.0000012 ukex
"stake_cap": 0.1, // 0% of all rewards go to ETH delegators, because stake_token is set to false
"stake_min": 8333333334, // can't stake less than 8'333'333'334 wei
"fee_payment": true, // can be used as fee token
"stake_token": false // can NOT be used as staking token
},{ ... }, ... ]
CLI functions description
tx/tokens
proposal-upsert-rate - Create a proposal to add a token rate
upsert-rate - Add a token rate with sudo permission
query/tokens
all-rates - Get all token rates
rate - Get a specific token rate by denom
rates-by-denom - Get token rates of multiple tokens by denom
Syntax & Examples
Each CLI command and proposal process in KIRA requires specific permissions. These permissions must be added to the account's whitelist or obtained as sudo permissions for direct changes. Refer to the Roles & Permissions documentation for more details. $SIGNER represents the transaction signer's account name or address. For instructions on setting common flags as environment variables, such as $FLAGS_TX and $FLAGS_QR, see the CLI flags configuration section
Adding/Updating a token rate registry
Bash
Copy
sekaid tx tokens proposal-upsert-rate \
--from=$SIGNER $FLAGS_TX \
--title=$TITLE --description=$DESCRIPTION \
--denom=$DENOM --rate=$RATE \
--fee_payments=$FEE_PAYMENT --stake_token=$STAKE_TOKEN \
--stake_cap=$STAKE_CAP --stake_min=$STAKE_MIN
Bash
Copy
# Example
sekaid tx tokens proposal-upsert-rate \
--from=$SIGNER $FLAGS_TX \
--title="upsert rate" --description="upsert rate description" \
--denom="mykex" --rate="1.5" --fee_payments=true
Accounts with sudo permission 8 can use the upsert-rate CLI to create or modify token rate without a proposal.
Bash
Copy
sekaid tx tokens upsert-rate \
--from=$SIGNER $FLAGS_TX \
--denom=$DENOM --rate=$RATE \
--fee_payments=$FEE_PAYMENT --stake_token=$STAKE_TOKEN \
--stake_cap=$STAKE_CAP --stake_min=$STAKE_MIN
Queries
List all existing token rates
Bash
Copy
sekaid query tokens all-rates $FLAGS_QR | jq
Query a specific token rate
Bash
Copy
sekaid query tokens rate $DENOM $FLAGS_QR | jq
Query multiple token rates
Bash
Copy
sekaid query tokens rates-by-denom $DENOM_LIST $FLAGS_QR | jq