Composability in the multi-chain era

Multi-chain Talk Editor
Multi-chain Talk
Published in
6 min readNov 1, 2022

--

Exploring the past, present, and future of composability

TL; DR

  • The lack of permissionless composability in Web2 has led to acute data monopolization.
  • A cross-chain composable and open-source Web3 has the potential to replace the privatized Web2.
  • There are several cross-chain messaging designs, each with certain strengths and inevitable trade-offs.

Recall the early days of the internet/Web2. Web developers have been building applications with reusable components and uniform standards since the 90s. COM, a Microsoft-developed domain name is the most used standard for structuring web applications. A common standard made it easy for developers to build applications and enabled them to reuse and combine components from existing applications to give them new functionality (for instance, combining one’s geographical data with shopping history for personalized ads).

As the internet went mainstream, IT companies realized they were better off not making their application components readily available, giving rise to the “walled gardens” of the internet. Today, data is a business, and giants like FAANG are at the top of the data chain.

Web3 is following the footsteps of its predecessor…so far

Let us draw some interesting parallels from this history. Ethereum kickstarted the Web3 revolution with an open-source, decentralized, and virtual state machine that offered a set of standards for building applications. Applications built on Ethereum are modular, various components from different applications can be composed to offer new functionality (like DEXs and liquidity farming).

Walled gardens of Web3

Web2 was private and standardized, Web3 instead is open source but disparate

Permissionless blockchains are incapable of off-chain communication out of the box, which creates the walled gardens inside Web3, and there are several such gardens (virtual machine blockchains), each offering unique application prospects, security, and throughput guarantees.

For Web3 to not follow its predecessor’s footsteps, it needs either standardization or composability. We all know that the former is not feasible, we need multiple chains with unique characteristics. Therefore, composability (cross-chain composability) is paramount for the future of Defi and Web3.

The Oracle problem

The oracle problem is a famous term coined by Chainlink, it states — A trustless blockchain is an isolated network that cannot verify the authenticity of messages generated outside its mainnet. This is because verification requires transaction signatures and account balance information and the signature from external keys is unverifiable for the node network. This is where cross-chain composability protocols come in.

Cross-chain composability — A subset of the Oracle problem

Smart contracts within their native network are made composable by effortlessly creating a fork of the original code(Sushiswap was a fork of Uniswap on Ethereum). Cross-chain composability is instead achieved by borrowing the smart contract logic by sharing execution instructions to the source blockchain where the contract resides.

To circumvent the oracle problem, cross-chain composability protocols have to make trade-offs between the following –

  1. Compatibility with heterogeneous blockchains
  2. Cost of cross-chain interaction
  3. Trustless nature is economically guaranteed

Common cross-chain composability designs

Today, there are several cross-chain messaging protocols that work around the oracle problem with novel designs. Let’s attempt classifying these protocols by their preferences and trade-off choices –

Protocols that favor compatibility with heterogeneous blockchains

Compatibility with several heterogeneous blockchains is achieved by establishing a middle layer between blockchains. Then, a node network within such a middle layer would deploy a consensus protocol to securely sign cross-chain messages from its source to the destination chain.

The middle layer node network would have to run a light client of the connected chains to detect cross-chain requests, which would be sent to specialized gateway contracts. Several messaging protocols implement a variation of this model in Web3, some of which are –

  • Multichain — Cross-chain requests on Multichain are secured on an open MPC network that runs a Threshold Signature Scheme (TSS) to sign cross-chain messages.
  • Axelar — A PoS blockchain built on Cosmos SDK acts as a middle layer to secure cross-chain messages. The messages are further secured with TSS on top of the PoS consensus.
  • Harmony — Multiple nodes sign a multi-signature contract to deliver the cross-chain communication request to the destination chain.

There are some notable downsides to this design. External verification demands additional trust in actors outside the validator group of the connected chains. Furthermore, the security of the entire ecosystem is concentrated on a small group of nodes running the middle layer which if compromised exposes every connected blockchain system.

The economic incentive for the middle layer validator’s honest conduct is also something to consider. In Axelar for instance, the integrity of its PoS middle layer is at risk if the value of resources staked by each individual falls below the assets secured by the network. At last, there also lies a risk of undetected bugs and inadequate audit of the protocol code which could be exploited to harm the network.

Protocols that favor the cost of cross-chain interaction

Instead of attempting to secure every cross-chain message with a dedicated round of consensus, there are optimistic cross-chain messaging protocols that assume the message to be honestly written and provide an infrastructure to challenge a message that may deem untrue. Nomad is a widely known messaging protocol that derives its cross-chain messaging model from optimistic rollups. Each cross-chain message on Nomad enters a time-bound challenge period during which off-chain watchers can challenge its authenticity by submitting fraud proofs.

As for trade-offs, optimistic protocols are inherently slow as each message must wait out the challenge period before finalization. Also, the incentive of the watchers may not always align with the protocol. Watchers, being outsourced entities may be subject to bribery and dishonest conduct if there is a greater incentive to produce invalid proofs to approve fraudulent messages.

Protocols that favor trustless nature

There are messaging protocols that prioritize the security of cross-chain messages above all else. High-security standards for cross-chain messages can be achieved when on-chain proofs are used for verification, and when the cost of compromising the system is higher than the potential gains.

Messaging protocols that are optimized for safety use light clients to process cross-chain messages and relayers to transport the messages to designated light clients on the destination chain. Each blockchain runs a light client of every network it connects to, a relayer transports a light client proof that the cross-chain message was honestly signed on the source chain.

The trade-offs made here are the overheads of maintaining such a design. The light clients must maintain a ledger of block headers from the source chain, which consumes considerable block space. The high-security standards are paid for with high transaction costs and low throughput of messages.

Deploying oracles for cross-chain messaging

LayerZero, a cross-chain messaging protocol deserves a notable mention. LayerZero leverages an off-chain oracle network to deliver cross-chain messages and their on-chain proofs. A set of oracles and relayers independently deliver the block header and the validity proof of the cross-chain message to a LayerZero client on the target chain. The message is then verified and processed by the client (called the LayerZero endpoint).

The model is an interesting innovation, it offers a modular design, which gives the connected applications the liberty to deploy third-party oracles and relayers. While LayerZero does recommend using their relayers and Chainlink as the oracle provider, protocols that do otherwise may be subject to collusion and dishonest behavior. Therefore, there is an ununiform trust assumption lying here.

In a nutshell…

We have explored several cross-chain messaging protocol designs. Together, these protocols help make smart contracts from various ecosystems composable with one another. By breaking the walled gardens sprouted by heterogeneous ecosystems, cross-chain composability protocols are leading towards a future where Web3 and the ‘internet’ will be used synonymously. The diverse design strengths ensure that the cross-chain message delivery under different technical requirements is resource efficient.

--

--