Just wanted to write up an idea that me and @Noam brainstormed. Not sure if it’s been thought of before.
TLDR: Use your staked ATOM on any Cosmos chain to pay for gas. No transferring tokens over IBC for gas either. Just do stuff on other chains, and then your gas fees are deducted from your staked ATOM balance on the Hub.
Even as an experienced Cosmos user, managing gas on a lot of different chains can be a headache. You’ve got to transfer it over, make sure its in the right token, and then you can sometimes run out and be stuck if, for example, you staked or locked all your tokens.
An oft-requested feature for the Cosmos would be for users to only have to worry about one gas token, no matter what chain they are on. This is the UX in monolithic ecosystems such as Ethereum and Solana, and it is what users mostly prefer. There have been initiatives to encourage chains to use ATOM as gas token before, based on talking to chain’s dev teams and convincing or inducing them to add ATOM as a gas token option by upgrading their chain’s code. These efforts never really made a big impact since it is a very slow process to do this outreach. Also, even if a chain supports ATOM as a gas fee, users still have to transfer it over before they can use it, adding UX overhead.
What would really accelerate the usage of ATOM is if it was possible to use ATOM as a gas token on any Cosmos chain, without any integration or buy-in needed from the chain’s team. What would be even better is if you could do this without having to actually transfer the ATOM over to the other chains. And it would be great if you could do all this without even unstaking your ATOM.
Fortunately all of these things are possible using a combination of two Cosmos technologies: FeeGrant and Interchain Accounts.
FeeGrant
FeeGrant allows one account on a Cosmos chain to give a gas allowance to another account. The account receiving the grant can make transactions, with gas paid for by the granting account.
Interchain Accounts
Interchain Accounts (or ICA) allows one chain to control an account on another chain. For example, ICA could allow the Cosmos Hub to have its own account on Kujira.
How it could work
A new module (or smart contract) on the Cosmos Hub would establish an ICA account on every Cosmos chain of note, and load these accounts up with each chain’s gas token.
When a user opted into the universal ATOM gas system, the ICA accounts on the chains would issue feegrant transactions to the user’s accounts on each of the other chains. The total amount of feegrants could not exceed a user’s staked ATOM balance on the Hub.
When the user goes on one of the other chains, they can instantly make transactions without worrying about fees, since the feegrant covers it.
Periodically, the Cosmos Hub would query the other chains to see how much of the feegrant each user had used. The equivalent amount of ATOM would be deducted from the user’s staked ATOM balance on the Hub. If the feegrant on any of the chains was getting low, it would be added to, possibly by removing feegrant on a chain that the user did not transact on.
Challenges
The hardest part about this is deciding how much of a feegrant to do to each user on each chain. A user cannot be given feegrants exceeding the amount of their staked ATOM, since this could lead to the Hub losing money. If a user had 10 ATOM staked, perhaps they could be given feegrants of the equivalent of 0.1ATOM on 100 top chains. The challenge here is that a big part of the UX benefit is for the user not to worry about whether or not a given chain is covered, so it’s best if the grant happens without them having to initiate it. Rebalancing will also be necessary. Even if a user starts out with an even distribution across many top chains, as they use any given chain more than the others, feegrants on the unused chains will need to be decreased so that the heavily used chain’s feegrant can be increased.
UX for what happens if a chain that a user wants to use does not have a feegrant for them also needs to be handled. Technically, this is not complex. The Hub’s logic just needs to know that a given user needs a feegrant increase on a given chain. What’s tricky is to figure out where to do this in the UX.
Perhaps the feegrant can be automatically increased attempted transaction with an out of gas error is observed, and the user can then try the transaction again.