fil

Posted on Jul 20, 2023Read on Mirror.xyz

Cosmos IBC, LayerZero, and Chainlink CCIP. Comparing Cross-Chain Solutions

As the number of blockchains and applications grows, the siloed nature of these networks poses challenges for communication and collaboration. To address this issue, various protocols and architectures have been developed to facilitate inter-chain communication, enabling the transfer of assets, data, and messages between different blockchains. While bridges came up as the first pieces of cross-chain infrastructure, they revealed issues and limitations that led to massive hacks and funds losses.

This article delves into three prominent solutions at the forefront of the interoperability space: Cosmos IBC, LayerZero, and the recently-released Chainlink Cross-Chain Interoperability Protocol (CCIP). Each brings a unique approach, aiming to break down the barriers that hinder the fluid exchange of value and information across decentralized networks. Due to their novelty and similarities, more emphasis will be put on LayerZero and Chainlink CCIP.

A comparison of the three main solutions

Cosmos IBC

  • It’s a blockchain network architecture rather than a messaging protocol like LayerZero and CCIP.

  • It allows arbitrary messages to be sent among supported chains, which are the chains (called ‘zones’) built on Cosmos Hub.

  • By default, it only works with chains on Cosmos Hub because, due to the Cosmos consensus algorithm Tendermint, it only supports fast finality chains. Cosmos announced that in 2023 they will open up interoperability with other chains, starting with Ethereum.

  • Packets of information are communicated from one zone to another by posting Merkle proofs as evidence that the information was sent and received. This mechanism is called inter-blockchain communication, or IBC for short.

  • It uses an intermediate chain (Comos Hub) to facilitate consensus. Each zone is responsible for verifying and executing transactions in its zone, but inter-zone tokens or message transfers go through the Cosmos Hub, which relays messages and manages the zones. Zones post block commits to the Hub so that the Hub is up to date with all zones’ states.

  • Cosmos Hub ensures the packages posted in the source zone are valid.

LayerZero

  • The first trustless omnichain interoperability protocol.

  • It’s a low-level communication primitive/messaging protocol upon which dApps (such as cross-chain DEX or multi-chain yield aggregator) can build (thus becoming automatically cross-chain). LayerZero requires apps to build on its protocol, and it doesn’t simply connect existing apps on existing blockchains. However, interoperability is then ensured among all blockchains that have a LayerZero Endpoint.

  • LayerZero doesn’t rely on a trusted custodian or intermediate transactions and doesn’t need an intermediary chain or token. Technically, it’s said that it allows the transfer of tokens and messages without requiring cross-chain machine state replication.

  • Trustless valid delivery of arbitrary messages and data, not just tokens. Valid delivery = the message m is only delivered to the target chain/app if and only if the transaction t’s header and proof match (which can only happen if the transaction is valid, or if it’s not and Oracle and Relayer collude).

  • Two independent entities corroborate the validity of a cross-chain transaction: the Oracle provides the block header, and the Relayer the proof associated with the transaction. For Oracle, LayerZero has integrated Chainlink Decentralized Oracle Networks (DONs). The Relayer is an off-chain service currently provided by LayerZero (but the infrastructure allows for the usage of any arbitrary relayer, meaning that individual dApps are able to choose any chosen relayer, even set their own). There is no trust assumption. The only requirement is independence between these two entities.

  • On each supported blockchain, there is an onchain lightweight client (as lightweight as possible to reduce the costs of running smart contracts on L1 chains) as the interface to access the LayerZero messaging protocol (called LayerZero Endpoint). In short, these smart contracts allow users to interact with the protocol and send messages.

  • Unlike Cosmos or Polkadot, where communication needs to always go through the relayer chain, incurring extra costs, LayerZero enables the passage of messages without intermediate steps.

  • Basically, LayerZero delivers messages (m) and works as a guarantor that the request to get tokens on Chain B from a user on Chain A is valid because some tokens on Chain A have been locked (transaction t). Based on this third-party guarantee, Chain B puts the requested tokens at the disposal of the user. The exchange logic is managed entirely by smart contracts on both chains (source and destination).

LayerZero architecture

Chainlink CCIP

  • It’s an inter-chain communication protocol.

  • The architecture is similar to LayerZero: there are on-chain smart contracts on both sides of the two blockchains handling the exchange logic and off-chain nodes relaying the messages.

  • For oracles, CCIP leverages Chainlink’s extensive Decentralized Oracle Networks, or DONs, high-quality off-chain node operators with verifiable on-chain performance histories. Before CCIP, DONs’ job was to relay off-chain data to on-chain (the main purpose of oracles and Chainlink). Now, they also participate in relaying messages and value across chains. Specifically, DONs bundle transactions and create a Merkle root. This Merkle root is signed by a quorum of oracles nodes part of the Committing DON. The Merkle root is verified and approved by the Active Risk Management (ARM) network. DONs are separated into Committing DONs (provide Merkle root) and Executing DONs (provide transactions proof). Separating this gives the ARM time to monitor and intervene in case of malicious activity.

  • CCIP adds extra security with an Active Risk Management (ARM) network, a separate and independent set of off-chain nodes that monitor for malicious activity and that can automatically pause services and protect user funds in case of malicious activity. Specifically, they monitor the Merkle roots committed by the Committing DON (they can bless or curse them). There is also an ARM contract (on-chain) that maintains the list of ARM nodes’ addresses and enables ARM nodes to bless/curse the Merkle roots.

  • OnRamp and OffRamp are smart contracts on the source and destination chains. OnRamp basically manages the lock or burn part, while OffRamp ensures the message is authentic by verifying the proof provided by the Executing DON against a committed and blessed Merkle root, and if all is good, interact with the pool to unlock or mint tokens.

  • Each token has its own token pool, an abstraction layer over ERC-20 tokens that facilitates OnRamp and OffRamp token-related operations (and that can be set as lock or burn and unlock or mint).

  • Transfer arbitrary messages AND tokens. Users can use CCIP to:

    • Arbitrary Messaging: Call smart contract functions on a different blockchain. Multiple messages can be included in one transaction, allowing for multi-step, multi-chain tasks.

    • Transfer tokens to a smart contract or Externally Owned Account (EOA) on a different blockchain. Technically they are not ‘transferred’, but they are locked or burned on the source chain and then unlocked or minted on the destination chain.

    • Programmable Token Transfer: Send arbitrary messages and tokens within the same transaction. This functionality can be used to transfer tokens with instructions on what to do with those tokens to a smart contract on a different blockchain.

  • Off-chain reporting (OCR) protocol, which was already used by Chainlink oracle service to secure value on several mainnet blockchains.

Chainlink CCIP architecture

Major similarities and differences between LayerZero and Chainlink CCIP

Design

  • Both are low-level communication protocols that can be applied to existing blockchains. Chainlink also openly aims to involve traditional financial institutions and connect them with blockchains.

  • Both LayerZero and Chainlink CCIP have on-chain components (smart contracts on each side that manage the execution and exchange of tokens) and off-chain ones (networks of nodes that relay messages and provides proofs). LayerZero Endpoints cover the functions of Routers (interface and initiate messaging) and OnRamp/OffRamp (two smart contracts on each side that initiate and execute transactions) in Chainlink CCIP.

Functionalities

Chainlink CCIP seems to allow for more actions than LayerZero, especially with the Programmable Token Transfer.

Security

The separation between Oracle and Relayer in LayerZero resembles the separation between Committing DON and Executing DON in CCIP (one provides Merkle root, the other the transaction proof). However, DON belongs to the same network and thus would make the infrastructure less trustless. This is why, on top of the DON network, CCIP added an extra check with the ARMs, a separate and independent network that monitor DONs’ activity and can pause service and protect users’ funds. All in all, the level of trustlessness of Chainlink CCIP can be compared to the one of LayerZero (two independent networks). For both, the security depends on the separation and independence (aka, more likely that they won’t collude to steal users’ funds) between these two sets of nodes. It’s not clear how this separation can be ensured (individual dApps are unlikely to create their own Relayer, the same way they don’t have their independently-run oracles) or how we can be sure that, despite being separate and independent, they won’t collude anyway.

Conclusion

While still considered the gold standard of cross-chain communication, Cosmos IBC has been facing formidable challenges from LayerZero and Chainlink CCIP, which have introduced novel approaches and additional functionalities. One notable enhancement is their low-level nature and blockchain-agnostic design, which provide greater flexibility in connecting arbitrary blockchains. In response to this competitive pressure, Cosmos is expediting the development of its IBC-Solidity infrastructure, expected to release later this year, which will further intensify the race for cross-chain leadership.

CosmosChainlink