How Stride Utilizes Interchain Accounts for Interchain Liquid Staking
Released more than two years ago, Interchain Accounts (ICA) is an IBC application that allows a controller chain to control accounts on a host chain. As the first user of ICA, Stride leverages this feature to offer liquid staking services across multiple blockchains, making it a critical component of their product offering.
In this blog we’ll explore how Stride built an interchain liquid staking protocol leveraging ICA for various cross-chain use cases.
How Stride works
Stride is a blockchain built using the Cosmos SDK for its state machine and CometBFT for consensus. Via their application, users can stake tokens such as ATOM, TIA, OSMO, etc., and receive a liquid staked version, such as stATOM, stTIA, stOSMO, etc.
On the backend, Stride stakes the user's tokens on the respective native chain by virtue of Interchain Accounts (ICA). Stride acts as the controller chain while other chains where Stride stakes tokens on the user's behalf act as host chains. When users wish to redeem their stake, Stride burns their liquid tokens and returns the native tokens after the unbonding period on the host chain.
From a user perspective, they visit the app, connect their wallet, click ‘liquid stake’, and immediately receive liquid tokens. But under the hood, there are multiple components at play.
Stride uses ICA to stake/unstake user tokens cross-chain
When Stride adds support for a new host chain, 4 new interchain accounts are created on that chain:
- Delegation ICA
- Withdrawal ICA
- Redemption ICA
- Fee ICA
Consider an example where a user wishes to liquid stake their ATOM. When the liquid stake request is made via the app, the ATOMs are first sent to Stride’s Deposit account, and a corresponding amount of stATOMs are minted and forwarded to the user. Under the hood, the ATOMs are transferred via IBC using an ICA SendTx message to the Delegation ICA account on the Cosmos Hub, aka the ‘host chain’.
Next, these tokens are delegated to the validator set of Cosmos Hub (according to a predetermined weight) using MsgDelegate packaged inside of an ICA ICA allows you to send a regular message (token transfer, stake/unstake, swap, etc.) inside of an ICA transaction[1].
Staking rewards accumulate in real time. When new tokens are forwarded from Stride to the Delegation ICA account on Cosmos Hub for staking, previously accumulated rewards are withdrawn and sent to the Withdrawal ICA account.
Stride uses Interchain Queries (ICQ) to query the total amount of tokens in Withdrawal ICA every 6 hours. The goal is to know how much rewards have accumulated and to reinvest that amount into staking. To do so, the ICA WithdrawalBalanceCallback triggers two ICA transactions to:
- Reinvest 90% of tokens on Withdrawal ICA by forwarding them to the Delegation ICA account for staking.
- Send 10% (the fee charged by Stride) to the ICA Fee account.
Conversely, when a user wishes to redeem their staked tokens, Stride sends a MsgUndelegate inside of an ICA SendTx which undelegates the user's funds. Once the unbonding period elapses, tokens are forwarded to the Redemption ICA. Users can claim their unbonded tokens via ClaimUndelegatedToken, triggering an ICA transaction that forwards the tokens from Redemption ICA to the user’s account on the host chain.
Summary of ICA functions
Stride leverages ICA to perform the following actions remotely:
- Stake and unstake user funds on a host chain
- Reinvest staking rewards
- Transfer funds to charge fees
- Move undelegated tokens from Stride’s account to the user
By using ICA for these use cases, Stride has built an interchain liquid staking protocol that has enabled $140 million worth of liquid staked value, with more than 116k users.
Get started with Interchain Accounts
The launch of Interchain Accounts has been crucial in enabling complex cross-chain workflows. Today, it’s used for various cross-chain applications such as liquid staking, portfolio management, and lending and borrowing.
1 ICA allows you to send a regular message (token transfer, stake/unstake, swap, etc.) inside of an ICA transaction.