Signaling Proposal: Add the Fee Abstraction Module to the Cosmos Hub
This is a signaling proposal to add the Fee Abstraction Module to the Cosmos Hub. At a high level, the module will allow for transaction fees on the Cosmos Hub to be paid with any token by first swapping that token for ATOM on Osmosis. The function of the module will be outlined in more detail below.
The fee abstraction module was developed by the team at Notional, and funded by the Osmosis Grants Program, as a method of solving fee abstraction issues that currently plague the Cosmos Ecosystem and hinder adoption from external ecosystems. The module solves for this by allowing fees to be paid in any asset on chains that implement it without requiring that chain to change its accepted fee assets.
This proposal is merely a signaling proposal and will not result in any immediate changes to the Cosmos Hub if passed. The module will need to be added via a subsequent software upgrade requiring an independent vote. If this vote passes, the Notional team will assist the maintainers of the Cosmos Hub codebase with integration as needed and help solve any technical challenges that may be encountered in the process of adding the module.
The estimated on-chain date for this proposal, pending community discussion and amendments, is August 02, 2023
- July 22: Posted this proposal to the Cosmos Hub Forum
- July 31: Changed on-chain date to August 02
- Aug 01: Added a paragraph to “Impact and Benefits” detailing the benefit of this module to allow for onboarding of users to the Cosmos Hub from the upcoming Metamask integration.
Thanks to Replicated Security, the Cosmos Hub is undergoing a period of rapid expansion. The Hub recently onboarded Neutron as the first ever consumer of its security, with Stride expected to onboard in a matter of days, and Duality to follow soon thereafter.
As these integrations grow, so too will the diversity of assets received by ATOM stakers grow (Stride alone will reward ATOM stakers with 10 different assets as staking rewards). In the short term, many of these rewards will be small, and will not be worth the ATOM gas fees required to transfer them back to their native chains via IBC. This is especially true for smaller delegators.
Rather than letting these assets sit unused in their wallets, what if ATOM stakers could use these assets to pay for gas fees instead of their ATOM? Further, what if these gas fees could be used to create a consistent supply of steady buy pressure on the ATOM token? This is where the fee abstraction module comes in.
How the Fee Abstraction Module Works
The fee abstraction module leverages interchain queries, packet forwarding middleware, and ibc hooks to periodically swap collected transaction fees to a chain’s native token using Osmosis. The frequency at which fees are swapped is parameterized. Using this feature, the Cosmos Hub can have its transaction fees paid in any asset that has a liquidity pool on Osmosis, and the asset will be swapped to ATOM to be used as a transaction fee.
The module operates on the following module flow:
- Interchain Query to Osmosis to determine the exchange rate between the fee asset and ATOM
- Collect fee assets from executed transactions
- IBC transfer accrued fee assets to Osmosis
- [If needed] Unwind IBC path to preserve fungibility
- Swap to ATOM on Osmosis
- IBC transfer back to the Hub for distribution to ATOM validators and delegators
On a regular basis, the module queries Osmosis TWAP data over IBC to determine the rate of exchange between a given fee asset and the chain’s native token (in this case, ATOM). Osmosis returns an acknowledgement via IBC with the rate of exchange to the module, which is then used to set the rate at which fees are collected in other assets to be swapped.
The frequency at which the module sends an interchain query message to Osmosis is governed by the
update exchange rate period parameter. This parameter is governance mutable and by default is set to a frequency of 1 hour. This setting is recommended to limit the number of query messages being sent over IBC by the Hub as much as possible while still maintaining a high degree of reliability in the exchange rate.
Fee Collection, Transfer, Path Unwinding, and Swap
Transaction fees collected by the Hub in IBC assets are stored in the module at the time of collection, and are periodically sent to Osmosis over IBC. If the fee asset is native to the Osmosis chain (i.e., OSMO or ION), it will be swapped for ATOM immediately via Osmosis’s cross-chain swap contract and sent back to the Hub.
If the fee asset is an IBC denom that doesn’t have Osmosis as its origin chain, its IBC path will first be unwound to maintain fungibility with the corresponding IBC asset on Osmosis. For example, if a transaction on the Hub is paid in Stargaze’s native STARS token, the module would send the STARS token to Osmosis with instructions to unwind the tokens’ IBC path as follows:
- Send the STARS to the Cosmos Hub
- Send the STARS to Stargaze
- Send the STARS to Osmosis
From there, the STARS will be swapped to ATOM as normal and returned to the Hub, where they will be distributed to ATOM stakers.
Fees are transferred and swapped every hour before being distributed. This feature is a governance-controlled parameter that can be adjusted depending on how many external fee assets are used to pay for transaction fees on the Hub. The more non-ATOM fees that are paid, the more frequently the hub should want to make this transfer.
Impact and Benefits
The principal benefit of this module is that it will allow for an increase of ATOM’s status as a canonical source of onboarding liquidity to the Cosmos ecosystem. With the influx of new Cosmos users that will accompany the upcoming metamask integration, users coming to Cosmos holding ETH, USDC, USDT, wBTC, or other high-volume bridge onramp assets will be able to easily use these assets to pay for transaction fees on the Cosmos Hub before they are able to get ATOM tokens. Fiat onramps like Kado could also allow for onboarding of liquidity directly to the Cosmos Hub in non-ATOM assets like USDC or ETH. It is important to have such an onboarding mechanism in place before the metamask integration goes live in order to make the onboarding UX as simple as possible for non-cosmos users.
This module also allows transaction fees on the Cosmos Hub to be paid in assets received by ATOM stakers via Interchain Security while also placing a consistent source of buy pressure on the ATOM token.
For example, ATOM stakers can begin to pay for transaction fees on the Hub in assets like NTRN, STRD, or even stATOM which will be paid to them via Interchain Security. This will not only obviate the need for ATOM stakers to use ATOM for transaction fees, but it will also cause a continuous source of buy pressure for the ATOM token on the Osmosis DEX.
Fee Abstraction Module github repo: GitHub - osmosis-labs/fee-abstraction