github cosmos/ibc-go modules/light-clients/08-wasm/v0.1.0+ibc-go-v8.0-wasmvm-v1.5

latest releases: v8.5.1, v6.2.3, ibc-eureka-alpha.0...
9 months ago

This is the first release (compatible with ibc-go v8.0) of the anticipated 🥁🎺 08-wasm light client proxy module 🌈🤩
Read the blog post by @adiraviraj announcing the release, for more information.

What is the 08-wasm module?

The 08-wasm client module comprises a Wasm VM capable of hosting light client bytecode, offering the flexibility to write new light clients in any language that compiles to Wasm (Rust, C/C++, JS, Go, etc.). With a consistent interface aligned with ICS 02, this module serves as a proxy light client, facilitating interaction with the actual light client contracts deployed as Wasm bytecode. To learn more about what it means to be a proxu light client, please read this section of the documentation.

Why do we need it?

The expansion of IBC into new blockchain ecosystems necessitates adding support for new light clients. Light clients for non-Cosmos ecosystem chains are, in many cases, implemented in Rust, and thus there are probably libraries used in their light client implementations for which there is no equivalent in Go. This makes the development of a light client in Go very difficult, but relatively simple to do it in Rust. Therefore, writing a CosmWasm smart contract in Rust that implements the light client algorithm becomes a lower effort. However, The light client can actually be implemented in any language that compiles to Wasm and implements the interfaces of a CosmWasm contract. Even though in theory other languages could be used, in practice (at least for the time being) the most suitable language to use would be Rust, since there is already good support for it for developing CosmWasm smart contracts.

At the moment of this release there are two contracts available: one for Tendermint and one GRANDPA (which is being used in production in Composable Finance's Centauri bridge). And there are others in development (e.g. for Near).

How can I use it?

First the 08-wasm module needs to be integrated in the chain. For more details about how to integrate the module in your own chain, please read this section of the documentation. Then, adding a new light client to a chain is just as simple as submitting a governance proposal with the message that stores the byte code of the light client contract. No coordinated upgrade is needed. When the governance proposal passes and the message is executed, the contract is ready to be instantiated upon receiving a relayer-submitted MsgCreateClient. The process of creating a Wasm light client is the same as with a regular light client implemented in Go. Please read this section of the documentation, for more information.

Our e2e tests used the GRANDPA contract at this hash of Composable Finance's composable-ibc repository. To build the bytecode for the contract we have followed these steps:

# set up environment
rustup toolchain install nightly
rustup target add wasm32-unknown-unknown
rustup +nightly target add wasm32-unknown-unknown
cargo install wasm-opt --locked

# build and optimise contract
cd light-clients/ics10-grandpa-cw
RUSTFLAGS='-C link-arg=-s' cargo build -p ics10-grandpa-cw --target=wasm32-unknown-unknown --release --lib
wasm-opt -Os ../../target/wasm32-unknown-unknown/release/ics10_grandpa_cw.wasm -o ics10_grandpa_cw.wasm

# gzip
gzip ics10_grandpa_cw.wasm

Who developed this breakthrough innovation?

Lets go down the memory lane and talk about the history of this module... In 2021 the Chorus One team submitted the ICS 08 spec with a design that was implemented also by them, but never got merged in ibc-go. Then at the end of 2022 Composable Finance took over the initial ICS 08 spec written by Chorus One and updated it with a new design. Composable Finance teamed up with Strangelove, who re-booted the implementation based on the new design. Then in July 2023, Strangelove opened the PR to upstream the module to ibc-go. Strangelove and the IBC team at Interchain GmbH had already started collaborating on the upstreaming process at the beginning of 2023, and after the PR was merged the IBC team continued improving the module based on their own feedback and an audit by Ethan Frey and Confio GmbH. And that's how we got here!

Shout-outs are passionately given to:

  • From Composable: @blasrodri and @vmarkushin, for coming up with the new design and writing the GRANDPA contract that enables direct connection to the Polkadot ecosystem.
  • From Strangelove: @jackzampolin (for taking up the challenge of re-booting the implementation of the module) and @misko9 (for implementing the module, for his support along the upstreaming process and for always being there to help us and answer our questions).
  • @ethanfrey, for auditing the implementation and providing increadibly useful feedback.
  • From Confio: @webmaster128 (for taking to the finish line the audit started by Ethan Frey) and @alpe (for answering many Wasm-related questions we had in this journey).

And last, but not least, to each and everyone in the IBC team at Interchain GmbH: @adiraviraj @AdityaSripal @colin-axner @charleenfei @chatton @damiannolan @DimitrisJim @sangier @srdtrk @womensrights @zadkiel88. Everyone moved mountains and poured blood, sweat and tears to elevate this module to the team's high quality standards of product, engineering and marketing.

Contributors ❤️

Special thanks to all other external contributors that pushed code for this release:

Don't miss a new ibc-go release

NewReleases is sending notifications on new releases.