Introducing ibc-go v7.1.0

IBC Protocol
The Interchain Foundation
4 min readJun 9, 2023

--

Today we’re excited to announce the release of ibc-go v7.1.0, the first minor release in the v7 line. v7.1.0 adds support for localhost client and ICS-20 state entry for total escrowed amounts. This builds upon the client refactor that was included in v7.0.1.

This blog post aims to provide an overview of the new features introduced in this release and the exciting use cases they unlock.

Localhost client

The localhost client is designed to allow different applications on a chain to communicate with each other using the IBC interface. When packets are sent to a localhost client, they are routed internally to applications within that chain, instead of sending to a counterparty chain. This is akin to the loopback address 127.0.0.1 for IPv4 or ::1 for IPv6.

Localhost client is a powerful UX improvement, allowing users to interact with multiple smart contracts/modules on the same chain using a single interface.

This feature enables use cases such as:

  • By using the localhost client to interact with the x/stake module, Agoric plans on using this feature for automatic stake distribution within a chain to achieve validator decentralization.
  • On Osmosis, a planned use case is to simplify cross-chain swap contracts. Currently, separate handling is required for different chains, such as utilizing IBC transfer when the receiver is an external chain, and bank sends for Osmosis. However, with the localhost client, all chains can be treated equally, enabling local transfers with consistent guarantees.
  • Interchain Accounts facilitate cross-chain account management but not intra-chain. Using the localhost client, contracts on the same chain can manage funds between each other.

Apart from the use cases mentioned above, several other projects such as Stride, Timewave, and Andromeda have expressed interest in using the localhost client.

Relayer support for the localhost client will be provided by the go relayer in its next release.

ICS-20 state entry for total escrowed amount

ICS-20 fungible token transfer uses a lock-and-mint mechanism. When tokens are sent from chain A to chain B, they are first locked/escrowed on chain A, and then an equivalent amount of token vouchers are minted on chain B. The tokens locked on chain A are sent to an escrow bank account, and every ICS-20 channel has its own escrow bank account.

By querying an escrow account, it is possible to know the amount of tokens sent out from a particular IBC channel. But for certain use cases, it is necessary to query the total amount of tokens that reside outside of a chain, and not just based on individual channels.

To this end, a new IBC state entry totalEscrowForDenom/{denom}has been added. This allows for querying the total amount of tokens in escrow based on a particular denomination. For example, if there are 3 channels between Osmosis and Juno:

  • channel 1: sent 10 OSMO from Osmosis -> Juno
  • channel 2: sent 20 OSMO from Osmosis -> Juno
  • channel 3: sent 30 OSMO from Osmosis -> Juno

totalEscrowForDenom/OSMOcan be used to find out that 60 OSMO in total was sent out from Osmosis, without having to iterate over every single channel between Osmosis and Juno.

The main use case for this feature is for rate limiting. ibc-rate-limit is a safety control middleware developed by Osmosis that places a limit on the inflow/outflow of assets within a certain time interval. For the purposes of ibc-rate-limit, the totalEscrowForDenom state entry was added to make it efficient to query the total amount of assets flowing out of Osmosis per denomination.

To query the total escrowed amounts, you can find the gRPC endpoint and the CLI here in our docs. Please refer to ADR-011 to dive deeper into the technical details of the ICS-20 state entry for total escrowed amounts.

Conclusion

The ibc-go v7 line introduces exciting new features that enhance the Interchain. Notably, v7.0.1 incorporated the client refactor, streamlining the development of light clients. In v7.1.0, the localhost client simplifies development and testing by enabling applications on the same chain to communicate seamlessly using the IBC interface. Moreover, the introduction of the ICS-20 state entry for the total escrowed amount makes it particularly useful for rate limiting and asset control mechanisms.

Finally, we extend our sincere appreciation to the Strangelove, Polymer Labs, and Osmosis teams for their significant contributions to the development of these features. Their expertise and collaboration have been instrumental in making ibc-go v7.1.0 a reality!

About the Author:

Adi Ravi Raj works at Interchain GmbH and is the Protocol Analyst for the IBC team.

Thank you to Carlos Rodriguez, and Susannah Evans for the feedback and review.

--

--

IBC Protocol
The Interchain Foundation

IBC is a blockchain interoperability protocol used by 100+ chains. It enables secure, permissionless, feature-rich cross-chain interactions.