The development of Web3 has led to the influx of hundreds of new chains, each promising to be better than the last - more scalable, safer, more decentralized (or just faster - in 90% of cases). Initially, there was nothing wrong with this, as it drove adoption and innovation. Each chain, after all, offered something new, creating a multi-chain environment. Then a problem emerged. "I'm on Ethereum, but there's a cool token listing on BNB Chain; I need to be there." The need for interchain operations grew with the emergence of new chains, leading to the creation of interchain bridges (which some view negatively, likening them to a cancer or a backstab to the crypto space). About 50% of all exploits in DeFi are bridge exploits, amounting to roughly 2.5 billion dollars. The second issue was liquidity fragmentation. We need liquid assets that can be exchanged without slippage. We need this liquidity on every chain, but it's fragmented since it cannot be combined. There was a need for some sort of infrastructure/standard that would be safe and easy to implement - this is when LayerZero appeared. Significant progress has been made since. LayerZero has been deployed on over 30 networks. The industry abhors a vacuum, so new solutions emerge, like CCIP from Chainlink. CCIP is a new product, officially launched on the mainnet on July 17, 2023, and is currently in its early access phase, being tested by protocols like Synthetix and AAVE. However, it's essential to understand what it is and initially compare the two technologies. Since LayerZero has been in the market longer and more people are familiar with this infrastructure, we will start by discussing CCIP.

The Cross-Chain Interoperability Protocol, abbreviated as CCIP, is described by Chainlink's CPO, Kemal El Moujahid, as the "safest, most reliable, and easiest-to-use interoperability protocol for creating cross-chain applications and services" (creators will always claim their product is the best – I will address its verification later). We can think of CCIP as an infrastructure that a protocol can easily implement to transfer tokens. It's like installing an add-on in GTA V that teleports your character from one city to another using a vehicle.
Arbitrary Messaging: This is a way to send any data to a receiving smart contract on another blockchain. A developer can encode any data they want to send to trigger specific actions on the receiving smart contract. Developers can encode multiple instructions in a single message to organize complex, multi-step, and cross-chain tasks.
Token Transfer: Tokens can be sent to a smart contract or directly to an EOA (Externally Owned Account) on another blockchain.
Programmable Token Transfer: This is a way to send tokens and instructions for their use in one transaction. For instance, a user might send tokens to a lending protocol with instructions to use those tokens as collateral for a loan, borrowing another asset that will be sent back to the user.
Transferring tokens between chains using a proprietary interface without the need to build a bridging solution.
The ability to deposit collateral on chain A (e.g. Optimism) and borrow an asset on chain B (e.g. Avalanche).
The opportunity to mint an NFT on chain A (e.g. Optimism) and receive it on chain B (e.g. Avalanche).
Creating smart wallets (Abstraction Account) with CCIP features. Example: A user authorizing transactions on any chain using a single wallet.
Developing Web3 games that allow users to play on a faster and cheaper chain (e.g. Avalanche) and store high-value items on safer chains (e.g. Ethereum).
Storing data on a more secure chain A (e.g. Ethereum) and performing computations on a faster and cheaper chain B (e.g. Polygon).
Synthetix is working on Synthetix v3, and its flagship product will be the Synth Teleporter. It utilizes Chainlink's CCIP to transfer sUSD between chains. The transfer is based on a "burn-and-mint" model – meaning sUSD (the settlement token in Synthetix) is burnt on the source chain and then minted on the target chain. There's no need to exchange token A for token B. This is crucial as it maintains a constant supply and token value, regardless of the chain it's used on. In short, there's no need for a liquidity pool for our sUSD to move from one chain to another.
Since the initial deployment of Aave v2 on a non-Ethereum network (Polygon), an interchain management system for Aave was introduced. AAVE utilized bridges so users could vote on different networks. However, there were certain limitations, such as high voting costs and maintaining the architecture. The AAVE community voted in favor of integrating CCIP into AAVE Governance v3. As mentioned earlier, CCIP enables "Storing data on a more secure chain A (e.g., Ethereum) and performing computations on a faster and cheaper chain B (e.g., Polygon)". Implementing Chainlink's infrastructure will save on voting costs and maintenance of the bridge architecture (developer's time to handle).
To put it simply, LayerZero is an easy-to-implement infrastructure that allows for the transmission of messages between chains. LayerZero conveys transactional messages via a "Relayer" and secures them using an "Oracle", which is responsible for confirming the authenticity of the transactional message. Sending and receiving messages are managed by "Endpoints" located on both sides of the networks, which are simply smart contracts. However, before it reaches from chain A to chain B, it must stop at two independent off-chain entities: the Oracle and the Relayer.
We also need to understand what UA and ULN are:
UA – "A User Application (UA) is any contract that uses LayerZero to send & receive messages between blockchains. We define UA as a tuple (chainId, contractAddress)."
ULN - ULN is a messaging protocol that allows lightweight cross-chain messaging with configurable trustlessness based on the specification of Oracle and Relayer, the two roles that relay block information and transaction proof across chains.
The simplest explanation of the process I found on the main LayerZero page:
"When a UA application sends a message from chain A to chain B, the message is routed through an endpoint in chain A. The endpoint then notifies the Oracle company specified by the UA and the relay module about the message and its target chain. The Oracle forwards the block header to the endpoint in chain B, and the relay module then sends the transaction proof. The proof is checked in the target chain, and the message is delivered to the destination address."

What distinguishes LayerZero from other interoperability protocols is its modularity. LayerZero provides infrastructure for sending messages between chains, but it allows dApps to choose both their own relay and oracle. This has its pros and cons. Some developers will prefer the infrastructure they implement with standardized and proven security and will not want to expend energy selecting appropriate providers and spending their developers' time on architectural management. On the other hand, others will appreciate the ability to design the security of their dApp from the beginning. LayerZero certainly provides the right education and content on the best practices to choose for your configuration.
I will use the example of a protocol I love, and they have wholeheartedly embraced the building block capabilities that LayerZero offers. This is what the LayerZero configuration will look like for TapiocaDAO:

As we mentioned, protocols using the LayerZero infrastructure can choose their own "Relayer". LayerZero is also flexible in that it allows deciding on the rules and consensus required to approve cross-chain transactions, giving full control over the security profile and level of decentralization. In this way, Tapioca designed their relay called Pearlayer:
"Pearlayer will be used instead of the default LayerZero Relayer + Oracle configuration to leverage the highly configurable nature of LayerZero and for the Tapioca protocol to maximize decentralization and minimize trust."
Pearlayer will enable the placement of the Tapioca $TAP token in a DPoS (Delegated Proof-of-Stake) system, allowing token holders to delegate tasks to validators. Their job is to secure the system Tapioca uses to send messages between chains. If a validator attempts any malicious behavior, there will be slashing.
The problem that arises is the choice of Oracle. How many trusted oracles do you know besides Chainlink? Me too, not many. Although Chainlink has proven its worth multiple times – let's recall the potential liquidation of CRV Curve, which, however, did not occur. But it's good to diversify one's price channels. That's what Tapioca did:
"Tapioca utilizes a combination of Chainlink oracles and Uniswap V3 TWAP (Time-Weighted Average Price) with a 10-minute window. Whenever there's a need for an Oracle value, the protocol chooses between Uniswap V3 TWAP output and Chainlink Price Feed, whichever is most beneficial for the protocol. For assets that do not have a Uniswap V3 TWAP Oracle or Chainlink source, such as GMX GLP or Curve TriCrypto, an available price channel will be used."
Such a combination is crucial for money markets. It aims to prevent deviations from spot prices or price manipulations. It also increases the decentralization of the protocol itself. Having a choice is always good. The most important thing is for the relayer and oracle to be independent of each other. Besides, Tapioca applies many other technologies and safeguards, but now is not the time to delve into them. My goal was to demonstrate how LayerZero allows you to design your cross-chain transaction security. This is reserved for teams that genuinely want to take responsibility for their project.
My initial aim was to select a champion - a structure that would indisputably dominate the market, with the other fading away. This, however, turned out to be a misconception. I believe they can coexist harmoniously, each fulfilling its role in the cross-chain realm. Now that the verdict is known, we can juxtapose these technologies to discern their strengths and weaknesses.

LayerZero and CCIP can be likened to Linux and Microsoft. Linux offers more configurable solutions, while, similar to CCIP, Microsoft is straightforward in usage and implementation. In situations where developers wish to focus on protocol building and product enhancement, sidestepping the behind-the-scenes intricacies of the omnichain space, they'll opt for the monolithic structure of CCIP. I also believe that for projects which weren't built from scratch and have already been operational in the market for some time, choosing CCIP seems more advantageous. On the other hand, LayerZero will appeal to developers aiming to construct their protocol from the ground up, tailor it as per their preferences, and attend to the nitty-gritty aspects of omnichain security. The bitter truth, however, is that when it comes to selecting an oracle, 99% will likely choose Chainlink, inadvertently centralizing their infrastructure.

Both CCIP and LayerZero utilize intermediary software for transmission and verification (CCIP: DON approval, DON execution; LayerZero: Relayer approval, Oracle execution). However, there are certain distinctions. Namely, CCIP boasts an independent RMN security network. On the other hand, LayerZero ensures the independence of relayers and Oracles to enhance security, making a bridge breach exceptionally challenging unless the actors collude.
When considering transaction finality, LayerZero surpasses CCIP. LayerZero has already demonstrated rapid finality with Stargate. On the other hand, CCIP transaction speed depends on the source chain - in the case of Ethereum, finalizing a transaction will take >10 minutes versus LayerZero's 1-5 minutes. dApps handling hundreds or thousands of transactions daily will undoubtedly choose LayerZero. Currently, Stargate alone accounts for 1/3 of bridge volume (Source: DefiLlama).
Regarding LayerZero, the use of the default Industry TSS Oracle configuration (Polygon, Sequoia) raised some eyebrows. However, for dApps built on LayerZero, this is inconsequential due to LayerZero's highly configurable nature. CCIP also doesn't have a single entity responsible for approving and executing DONs and requires a quorum of confirming votes on a DON before a transfer can be executed. Such a structure makes CCIP more decentralized than existing bridge solutions.
That's all for today. I'm aware that the topic hasn't been exhausted. It's certainly worth mentioning aspects such as the existing $LINK token and its utility in CCIP, speculations on how LayerZero will utilize the potential of the $ZRO token in the future, or the global partnerships of Chainlink. Writing this article has been a lot of fun. By gathering all this information, I know that both of these excellent infrastructures will contribute another brick to the development of DeFi and ensure our funds travel safely across blockchains. It's also worth noting that L2s like Optimism or zkSync are building Superchain or Hyperchain solutions, which will accommodate dozens or even hundreds of new L2s - How will they communicate? There are many exciting solutions on the horizon.
signed: Pawel_DeFi
For the Curious
In the interest of transparency, fairness, and respect for hard work, I am providing all the sources I've used and recommend familiarizing yourself with:
1.https://mirror.xyz/tapiocada0.eth/c3lWaifaPJJpKLK8jCWRff0bkLZSbG5Y_CTLhBn0Flk
2.https://blog.chain.link/ccip-mainnet-early-access/
3.https://xangle.io/en/research/detail/1483
4.https://messyproblems.substack.com/p/the-three-debates-of-the-layer-zero
5.https://medium.com/layerzero-official/layerzero-an-omnichain-interoperability-protocol-b43d2ae975b6
6.https://medium.com/stargate-official/the-bridging-trilemma-d80788cce4ef
7.https://docs.chain.link/ccip
8.https://mirror.xyz/filarm.eth/vJG_FMayXVQeEkT6RGqhxk0ALGlSb3SGU9j7Y5pnZPo
9.https://docs.tapioca.xyz/tapioca/core-technologies/pearlayer-and-oracles
10.https://layerzero.network/pdf/LayerZero_Whitepaper_Release.pdf

