How Composable Finance Overcame Technical Barriers to Architect a Trust-Minimized CosmoDot Connection

By Medium July 26, 2023 In Blockchain, Cosmos, Cryptocurrencies, DeFi, Kusama, Osmosis, Polkadot

If architecting trustless connections between various blockchains was easy, then multi-chain, cross-chain interoperability would already be the industry norm. Unfortunately, the same thing that makes a multi-chain future so appealing is also what makes it so difficult to achieve: each major blockchain is unique, with its own benefits and opportunities. The downside here is that these different advantages and use cases of each chain are rooted in their very distinctive infrastructures, making secure and trustless communication between blockchains very difficult.

Composable Finance is incredibly pleased that we have been able to overcome these significant technical challenges in connecting two leading ecosystems, Cosmos and DotSama — widely expanding the interchain ecosystem. It is a task that we could not have accomplished alone; this monumental journey is fueled by synergy and collaboration. The connection between Cosmos SDK chains and DotSama parachains via Centauri was made possible by the invaluable contributions of NotionalDAO, Informal Systems, Strangelove, Interchain Foundation, over 100 validators, and many other industry and community members. The path forward is challenging, but it is clear we can accomplish an interoperable future by working together.

Cosmos SDK chains and DotSama (the broad term for the interwoven Polkadot and Kusama ecosystems) have a great deal in common not just in terms of their multi-chain architecture, but also in relation to their visions for interoperability and user-centricity. Yet, until just recently, these two networks remained largely cut off from one another. As a result, users were unable to smoothly transact between the interchain and DotSama to take advantage of opportunities in these spaces. Moreover, developers were unable to create protocols leveraging both of these powerful networks to capitalize upon cross-chain functionalities.

The divide between these two ecosystems has since been lifted; at the close of June 2023, our team, Composable Finance, launched Centauri, marking the first trust-minimized connection between Cosmos, Polkadot, and Kusama. As a result, all 46+ IBC-enabled Cosmos SDK chains can now interoperate with the ~80 DotSama parachains in a trust-minimized, non-custodial manner. Liquidity can subsequently flow between these two platforms, with interchain-native tokens like ATOM now available in DotSama via the Pablo DEX, and DotSama-native tokens like DOT and KSM becoming available to Cosmos SDK chains.

Advertisement

Innumerable new and improved cross-chain use cases result. One new use case has already been made available: cross-ecosystem DEX pairings with native tokens of both DotSama and Cosmos SDK chains on Osmosis, the largest decentralized exchange on the interchain.

Currently, several novel cross-ecosystem pools are live with many more to come👇

Live on Osmosis:

Live on Pablo DEX:

  • $ATOM / $DOT
  • $stATOM / $DOT
  • $STARS / $DOT
  • $KSM / $OSMO
  • $DOT / $OSMO

The opportunities to capitalize upon the newly unlocked CosmoDot space are truly endless and its incredibly exciting to see the introduction of Cosmos Hub, Osmosis, Stride, and Stargaze and their respective assets in the DotSama verse.

Perhaps even more important than the immediately available opportunities are the future ramifications of this connection; our team at Composable has now paved the way for IBC to continue to expand outside of the Cosmos, driving towards the vision of an entirely connected DeFi space, which will aid the industry in reaching mass adoption.

For a broad overview of Centauri’s DotSama connection, the new benefits and opportunities it brings about, and instructions on how to get started participating in this cross-chain space, please refer to this post.

Connecting Cosmos SDK chains and Polkadot parachains in a trust-minimized manner was an incredibly technically-intensive endeavor. Perhaps this is why such a project has never been created before. However, it was critical to us at Composable that we uphold trust-minimization in our connection, in order to augment security and to help avoid the many problems such as hacks and rug pulls that have impacted ‘trusted’ bridges.

Thus, at the crux of Centauri lies the Inter-Blockchain Communication (IBC) Protocol. The IBC and resultantly, Centauri, are trust-minimized due to the fact that (1) they are built upon light clients that communicate amongst each other to update states of counterparty chains, and (2) they are able to update chain states by sending finality proofs and other verifiable transaction and packet types.

The IBC protocol previously allowed for trust-minimized bridging, but was limited to connections between Cosmos SDK chains (and the Cosmos Hub). The IBC was designed specifically for these intra-chain connections, and therefore a significant amount of development was required to expand the IBC to Polkadot and Kusama. Composable was successfully able to accomplish this, making us the first organization to expand the IBC to non-Cosmos SDK chains.

Now, like any IBC connection between two chains, Centauri supports transfers of both non-fungible and fungible tokens, generic message passing, cross-chain contract calls, cross-chain fee payments, interchain collateralization, and other transactions, all in a trust-minimized manner.

Centauri was created as a trust-minimized connection between a number of blockchain ecosystems. Before it unlocked the connection between the interchain and DotSama, we first had to unlock the connection between Polkadot and Kusama at a higher level than previously available. This connection, like our Cosmos <> DotSama connection, is facilitated through our Kusama parachain, Picasso.

In the existing DotSama space, parachains connect to one another via the Cross-Consensus Messaging (XCM) Format. XCM messages can perform actions across different parachains such as transferring tokens and executing smart contracts. However, XCM did not enable a connection between Polkadot and Kusama’s relay chains; this is what our Polkadot <> Kusama connection within Centauri accomplishes, as depicted below.

In Centauri, IBC is used as a trust-minimized access point between Polkadot and Kusama.

IBC is the native communication protocol of the interchain ecosystem, allowing for trust-minimized communication to occur between any blockchains built using the Cosmos SDK which have the IBC module enabled. IBC is open-sourced, and anyone can add data and improvements to this protocol. Therefore, Composable has been able to make a number of adaptations to and expansions of IBC in order to allow it to suit the needs of Centauri and operate beyond the Cosmos SDK chains.

To implement IBC on non-Cosmos SDK chains, Composable leveraged our own Cosmos SDK chain, also called Centauri, in addition to three essential components, most of which required significant updates and construction. These components are Pallet IBC, light clients, and the Hyperspace relayer, all discussed in detail below.

The original plan for the Centauri bridge was to use Picasso as the base chain for connecting other bridges (to Cosmos, Ethereum, NEAR, etc.). However, it soon became apparent that building individual bridges for each Cosmos SDK chain would be incredibly time-inefficient, as this would require implementing Wasm and CosmWasm module for each chain, uploading CosmWasm contracts to understand DotSama finality and publish and read blocks. Creating our own Cosmos SDK chain, the Centauri chain, enables us to seamlessly connect across the interchain via the existing IBC infrastructure.

Of course, we still needed to connect the Centauri chain to DotSama in order to connect the broader Cosmos ecosystem with Polkadot and Kusama. We accomplished this by building one bridge from our Kusama parachain, Picasso, to our Centauri chain. With this connection successfully in place, DotSama and Cosmos SDK chains are securely and permissionlessly connected by passing through the Centauri and Picasso chains, spinning up relayers and opening channels.

For Picasso to connect with a Cosmos SDK chain like Centauri, it needed a module installed that required ibc-go v7. Therefore, it was essential to create our own, new chain that incorporated the necessary upgrades, which most existing Cosmos SDK chains lack. This made the compatibility of IBC and Substrate (the framework for building DotSama parachains) significantly easier to architect; our Centauri chain has the needed upgrades to connect directly with Substrate, allowing this chain to serve as a middleware “hop” network for Cosmos SDK chains.

We are incredibly thankful to Notional DAO for their innovative and expert work in helping us develop and deploy the Centauri chain that is so critical to this connection.

A light client, also referred to as a light node, functions similarly to a standard node in that they are able to verify the latest blockchain state. However, they do not need to execute and store the full block data and state. Instead, light clients track block headers and execute transactions to reach the latest state. Therefore, light clients reduce the computational and memory resources when compared to full nodes.

On the IBC, light client protocols enable bridging. The IBC uses light clients on connected chains to link these chains together. This enables the passage of IBC opaque packets of information containing transactions and associated data.

On Centauri, we similarly leverage light clients for bridging. These light clients contain headers and transactions of blocks:

On our Centauri chain, we implemented a Tendermint light client, and on Picasso, we implemented a GRANDPA (GHOST-based Recursive Ancestor Deriving Prefix Agreement) light client. GRANDPA is a protocol developed by Parity to verify finality proofs of parachain headers. The GRANDPA light client is based on the GRANDPA protocol and written in CosmWasm. The ICS-8 client enables light clients written in CosmWasm to run natively on Cosmos SDK chains built with the Cosmos SDK. Therefore, our GRANDPA light client can track the finality of DotSama parachains on Cosmos chains as a CosmWasm contract.

We, at Composable, needed to develop and implement both of these new light clients in order to allow the two ecosystems to communicate along the IBC. To connect the GRANDPA light client implementation to the IBC, we extended the IBC specification to include the 10-wasm-light-client module, which adapts CosmWasm light clients and the ibc-go stack to ease integration. As a result, light clients for non-Cosmos SDK chainscan be ported into the ecosystem more easily.

This module is included in the Cosmos SDK 0.47 and ibc-go v7 upgrades, although most Cosmos SDK chains have not yet undergone these upgrades. This would have made it difficult for these chains to support Centauri. However, we created a solution where packet forwarding can occur between Picasso and Cosmos SDK chains. Picasso can therefore communicate with Cosmos SDK chains in a manner similar to how they already communicate amongst themselves, without the need for these chains to undergo any technical changes.

We have plans to upgrade our GRANDPA light client, however Parity’s Bridge Efficiency Enabling Finality Yielder (BEEFY) has not yet been deployed on Kusama. Once it is, we will replace our GRANDPA light client implementations with 11-BEEFY IBC light clients, which we are developing for Cosmos-IBC. The advantage of this change would be that a single instance of this BEEFY light client on any Cosmos chain can provide finality for any Kusama parachain. Cosmos SDK chains could then verify IBC commitment packets, which are IBC consensus proofs. A single instance of this light client on any Cosmos SDK chain can prove finality for any Kusama parachain, allowing Cosmos SDK chains to verify IBC commitment packets (IBC consensus proofs).

More details about Centauri’s use of light clients are available here.

Pallet IBC is the IBC stack for non-Cosmos SDK (i.e. Substrate) chains. In DotSama, pallets are simply Substrate runtime modules, which allow applications to run in these ecosystems.

Another core component of Centauri is a pallet on Picasso, facilitating the creation of the IBC commitment packets discussed above. Pallet IBC is composed of both IBC-rs and a Tendermint light client (ics07), which were developed by Composable. IBC-rs is an implementation of IBC in Rust, which allows for IBC messages to be interpreted on Picasso (and other IBC-enabled chains). Together, these two components enable our parachains to process and interpret IBC packets.

Blockchain relayers serve the critical roles of submitting user transactions and relaying this information from one location to another. Most relayers operate solely across one chain, and thus were not suitable for our needs. To optimally serve the Centauri bridge, Composable constructed its own custom-build relayer implementation, Hyperspace. Hyperspace allows arbitrary packets of information to be relayed across the IBC between different chains that are connected via Centauri (currently including Polkadot, Kusama, and Cosmos).

This is the first relayer of its kind in the interchain ecosystem, as no relayers previously performed their designated purposes between Cosmos SDK chains and another ecosystem like Hyperspace does. In the future, other relayers may be created by other teams in order to support these cross-chain operations, given the many opportunities that will likely arise in CosmoDot. This represents another valuable opportunity in CosmoDot (e.g. the creation of relayers to serve this novel space).

A diagram of the high-level architecture in this implementation can be found below. In particular, it outlines how Centauri facilitates Cosmos SDK chains <> DotSama transfers over the IBC.

We are incredibly eager to see the novel opportunities and use cases constructed in the newly opened CosmoDot space. We believe that these two ecosystems are optimally positioned to synergize, and will both benefit from this connection.

Moreover, Centauri’s CosmoDot connection marks a huge step forward in a more connected DeFi space overall. Now that Composable has completed the architectural work to bring the IBC beyond Cosmos SDK chains, we have smoothed the path forwards for connecting additional chains to Centauri. Currently, we have plans for adding connections to NEAR and Ethereum, just to name a few additional networks we ultimately will incorporate into Centauri. The end goal is truly any money, anywhere: enabling the use of any token along any network, thus providing ample new opportunities and seamlessness to users and increasing mass appeal of crypto.

Composable Finance is dedicated to improving the accessibility, quality, transparency, efficiency, and security of decentralized finance. We accomplish this by pioneering innovative Web3 user experiences in a trustless, non-custodial, and decentralized manner. Composable’s technology stack enables and combines key services across different DeFi ecosystems and protocols. Our ultimate vision is to enable “any money, anywhere”: the use of any assets on any network. Composable aims to do this by expanding the reach of the IBC everywhere.

Picasso is Composable’s layer 1 blockchain acting as an infrastructure layer to pioneer interoperable DeFi solutions, with a native token $PICA available on the Pablo DEX. Picasso is equipped with a robust set of novel DeFi primitives that are built as modular pallets. These pallets are designed to attract liquidity from the broader DeFi landscape whilst promoting interoperability between various ecosystems.

Trustless.Zone is our extension of the IBC protocol that facilitates trust-minimized cross-ecosystem communication among various blockchains; it already connects Polkadot, Kusama, and Cosmos, with plans for expansion to Ethereum, NEAR, and other ecosystems. Centauri expands the existing IBC beyond Cosmos for the first time. Similar to any IBC connection between two chains, Centauri supports asset transfers (including fungible and non-fungible tokens), generic message passing, cross-chain contract calls, cross-chain fee payments, interchain collateralization, and more in a trust-minimized manner.

Picasso also provides an ideal building ground for developers. We offer:

💰 An ongoing grants program

🧰 Developer tooling

📚 Guides & documentation

For more information about Composable and how it is architecting the unified DeFi landscape of the future, refer to these useful links:

👋 Social Media 👋

🌐 Websites 🌐

💻 Apps 💻

📄 Documentation 📄

❓ User Guides ❓

Published on

Medium

View the full article

You may also like