/
💸
Fee Tokens & Transfers
Search
Try Notion
💸💸
Fee Tokens & Transfers
KIRA allows any token and NOT not only KEX to be used for the purpose of transaction fee payments. This feature enables easy onboarding of new users directly from foreign networks, without forcing them to utilize centralized exchanges to acquire KEX or otherwise deanonymize themselve to use KIRA. To make transaction fees in any token possible governance curates exchange rates registry which defines value of foreign tokens in therm of a native to KIRA KEX token as well as whether or not a specific token is a fee token. Token rates registry is not intended to precisely track market price of assets in regards to KEX but rather provides an easy conversion method that serves as transaction spam protection mechanism.
When token rates are set in the fee rates registry, the rateis expressed in terms of how many (amount) ukex is a single unit of a foreign token worth. For example if rate of token lol is 2 it means that 2 ukex == 1 lol so if minimum fee payment as defined by MinTxFee network property is 100 ukex, then to make a transfer a transaction fee should be set to minimum 50 lol tokens. Rates can be also expressed as decimals, meaning that rate set as 0.1 would imply 0.1 ukex == 1 lol and minimum transaction fee payment in our example is 1000 lol tokens.
It is intended and expected that paying transaction fees in tokens other then KEX will be more expensive as KIRA must ensure security of the chain (prevent transaction spam) regardless of the market price of other tokens in any given point of time. Governance is responsible for the exchange rates adjustments in a manner to account for possible black swan events. KIRA does NOT and will NOT utilize any form of third party oracles and fully depend on the capabilities of its own governance system, this is done to mitigate any possible risks involved with oracles and third parties.
Token Transfers
All KIRA accounts only exist on-chain and can be queried from the blockchain state if any amount of funds was ever deposited to them.
Token transfers pose a risk to the network if tokens that are fake, stolen or originating from compromised network are deposited to KIRA, especially if said tokens are used in the economy of the network (including fee payments). For that reason governance of KIRA possesses ability to enable blacklist and whitelist of foreign token transfers. Enabling/disabling whitelists and blacklists is controlled through EnableTokenWhitelist and EnableTokenBlacklist network properties, while their content is curated by the governance via dedicated proposals. Under critical circumstances where foreign network is compromised and its tokens deposited to KIRA this mechanism can be used to recover funds through a planned hard-fork. This mechanism is no different than funds recovery in case of other PoS & PoW chains, however offers a fair on-chain signaling of the network governance intents.
NOTE: Proposals can be raised using via CLI sekaid tx tokenscommand. The --help flag can be used to discover further options. To raise a certain proposal a dedicated permission is required. For example to submit UpsertTokenRates message a PermCreateUpsertTokenRateProposal (18) permission must be assigned to the account creating said proposal. For example to vote on the UpsertTokenRatesa PermVoteUpsertTokenRateProposal (19) is needed. To find available proposal types and corresponding to them permissions required to submit or vote see Proposals documentation.
Commands Examples
Updating Token Rates
# Updating Token Rates via Proposal # CLI sekaid tx tokens proposal-upsert-rate --denom="$DENOM" --rate="$RATE" --fee_payments="$IS_FEE_PAYMENT" \ --title="Set exchange rate of '$DENOM'" --description="Fee payments will be set at the rate of $RATE $DENOM == 1 KEX. Set '$FEE_PAYMENT' to indicate if $DENOM is a payment method." \ --from "$ACCOUNT" --chain-id=$NETWORK_NAME --keyring-backend=test --fees=100ukex --yes --log_format=json --broadcast-mode=async --output=json # KM # e.g.: setTokenRate <account> <denom> <rate> <is-fee-token> setTokenRate validator lol 2 true setTokenRate validator samolean 0.1 true
Bash
Transfering Tokens
# CLI sekaid tx bank send $ACCOUNT $DESTINATION "${AMOUNT}${DENOM}" --keyring-backend=test --home=$SEKAID_HOME --chain-id=$NETWORK_NAME --fees "${FEE_AMOUNT}${FEE_DENOM}" --output=json --yes # KM # e.g: sendTokens <source-account> <destination-account/address> <amount> <denom> <fee-amount> <fee-denom> sendTokens validator test 1 ukex sendTokens validator "kiraXXX...XXX" 1 ukex sendTokens validator test 1 ukex 50 lol
Bash
Whitelisting/Blacklisting Token Transfers
# Updating Token Black/White-list via Proposal # CLI sekaid tx tokens proposal-update-tokens-blackwhite --is_add="$IS_ADD" --is_blacklist="$IS_BLACKLIST" --tokens="$TOKENS" \ --title="Update Tokens Black/White-list" --description="Is Blacklist: '$IS_BLACKLIST', Is Add: $IS_ADD, Tokens: '$TOKENS'" \ --from "$ACCOUNT" --chain-id=$NETWORK_NAME --keyring-backend=test --fees=100ukex --yes --log_format=json --broadcast-mode=async --output=json # KM # Add Tokens To Transfers Whitelist # e.g: transfersWhitelistAddTokens <address> <tokens> transfersWhitelistAddTokens validator "test,samolean,lol" # Remove Tokens From Transfers Whitelist # e.g: transfersWhitelistRemoveTokens <address> <tokens> transfersWhitelistRemoveTokens validator "test,samolean,lol" # Add Tokens To Transfers Balcklist # e.g: transfersBalcklistAddTokens <address> <tokens> transfersBalcklistAddTokens validator "test,samolean,lol" # Remove Tokens From Transfers Balcklist # e.g: transfersBalcklistRemoveTokens <address> <tokens> transfersBalcklistRemoveTokens validator "test,samolean,lol"
Bash
Query Token Rates
# CLI sekaid query tokens all-rates --output=json --home=$SEKAID_HOME | jq # KM showTokenRates
Bash
Query Token Balances
# CLI sekaid query bank balances "$ADDR" --output=json --home=$SEKAID_HOME | jq # KM # e.g: showBalance <account/address> showBalance validator showBalance "kiraXXX...XXX"
Bash
Query Transactions
# CLI sekaid query tx "$TX_HASH" --output=json --home=$SEKAID_HOME | jq # KM # e.g: txQuery <hash> txQuery "YYY...YYY"
Bash
Query Token Transfers Blacklist/Whitelist
# CLI sekaid query tokens token-black-whites --output=json --home=$SEKAID_HOME | jq # KM showTokenTransferBlackWhiteList
Bash