The Future of Seamless Cross-Chain: A Detailed Explanation of LayerZero and Stargate

Chain Tea House
2022-04-01 23:38:21
Collection
Learn how Loopring achieves high throughput, low-cost, non-custodial decentralized trading and payments.

Author: echo_z, Chain Teahouse

The public offering was emptied by Alameda under SBF, backed by 0xMaki, and after its launch, the token price surged over 10 times, recently achieving a valuation of $135 million. LayerZero Labs is undoubtedly the hottest Web3 team recently. The same team has created a cross-chain underlying protocol and the first application built on it. On the day the underlying protocol LayerZero was announced, the accompanying application Stargate's public offering was also announced.

The enormous prospects of inter-chain communication combined with the already implemented cross-chain products make this project stand out.

Chain Teahouse has previously written about Stargate and has conducted more in-depth research on these two projects, attempting to analyze their core mechanisms, future prospects, operational capabilities, and project valuations, summarized as follows.

1: Product Mechanism

From the most macro perspective, LayerZero is a cross-chain infrastructure that achieves inter-chain communication through a set of smart contracts deployed on each chain; Stargate is a specific application built on it, functioning similarly to a DEX but focusing on cross-chain transfers of native assets.

With LayerZero's inter-chain communication capabilities, future projects built on it can achieve cross-chain lending, cross-chain staking, etc. All functions currently implemented on a single chain can be completed across chains. Stargate currently implements cross-chain transfers of stablecoins and the native token STG, representing the first step in showcasing LayerZero's capabilities.

The white papers of both projects were co-authored by the three co-founders of LayerZero Labs. Below, Chain Teahouse will briefly introduce the product mechanisms described in their white papers.

1.1 LayerZero

LayerZero is a "Trustless Omnichain Interoperability Protocol." Compared to existing cross-chain solutions, the prospects proposed by LayerZero are indeed very appealing.

Current mainstream cross-chain methods include: 1) Cross-chain protocols like THORChain/Anyswap that require intermediary tokens to complete, and 2) Cross-chain ecosystems like Polkadot/Cosmos that rely on a hub chain.

In the 1) scheme, the reliance on intermediary tokens brings additional operations, delays, and costs. In the 2) scheme, a hub chain is still needed as an intermediary to complete inter-chain communication within the ecosystem, and it is not directly open to chains outside the ecosystem.

Therefore, existing cross-chain solutions require some intermediary to complete the process, while LayerZero aims to eliminate intermediary tokens and chains to achieve direct communication between all chains.

This process is implemented by setting up two independent entities—Oracle and Relayer—to independently obtain certain information from a block and verify each other. The functions of these two entities are similar, but the information they obtain is different, effectively using two sources of information for verification.

The specific working steps of Oracle and Relayer are illustrated in the diagram below. The image is complex but can be simply understood as two stages: 1) Oracle and Relayer independently obtain certain information from Chain A; 2) Oracle and Relayer send the information they obtained to Chain B.

LayerZero deploys a terminal on each chain, composed of a series of smart contracts from LayerZero, which can be understood as a "communication point" on that chain. The purple parts in the diagram, namely Communicator/Validator/Network, are the core components of the LayerZero terminal, responsible for notifying Oracle and Relayer to obtain specific information and receiving messages from them.

image

Source: LayerZero White Paper

Each arrow and number in the diagram represents a step. Steps 1~5 represent the process when a transaction event occurs on Chain A, where the LayerZero terminal notifies Oracle and Relayer to obtain the corresponding information from Chain A. Step 1 shows all the content notified by the terminal, including the identifier t of a transaction event, the target chain dst to which it needs to be sent, any data payload that Chain A wants to transmit to Chain B, and the relayer parameters relayer_args needed by Chain A.

The terminal will send all content to the Relayer, but for the Oracle, it only sends the target chain dst and the block header of the transaction t, not the transaction event t.

In Step 6, the Oracle obtains the block header blk_hdr of the event from Chain A, and in Step 7, the Relayer obtains the transaction proof proof(t) of the event from Chain A. The difference in functionality between Oracle and Relayer is that one obtains the block header while the other obtains the transaction event proof.

In the subsequent steps 8~11, Oracle and Relayer will send the information they obtained to the LayerZero terminal on Chain B. However, since a block may contain multiple transaction events, the Relayer's information sending will take one extra step—after the terminal on Chain B receives the block header sent by the Oracle, it will send the block header hash to the Relayer.

Then, the Relayer will package and send all transaction event proofs corresponding to this block header to Chain B. Note that in Step 7, the Relayer obtains the transaction proof for a single event from Chain A, while in Step 11, the Relayer passes a list of proofs for multiple transaction events to the terminal on Chain B.

At this point, the block header from Chain A and all necessary transaction event proofs within that block have been collected by the terminal on Chain B. In Steps 12~13, the components within the terminal will complete the verification and send it to the smart contract on Chain B.

Since this process essentially relies on the two information sources, the matching of information on both sides completes the verification, thus ensuring that the necessary condition for secure communication is that Oracle and Relayer are independent entities that will not collude to cheat. Currently, LayerZero's default configuration uses Chainlink as the Oracle and LayerZero's own built Relayer, but developers can customize configurations in the future.

Among all existing cross-chain solutions, Cosmos is the closest to LayerZero. The team specifically clarifies the differences between LayerZero and Cosmos:

1) Cosmos's IBC requires running a full-chain light node to verify cross-chain information. In contrast, in LayerZero's process, information verification only requires obtaining specific transaction events and their corresponding block headers as needed, without needing to read all events on Chain A, thus the LayerZero terminal can achieve extreme lightweight.

2) IBC can only provide direct communication for chains that adopt fast-finality consensus (where all transactions are quickly packaged and cannot be reversed), while for chains like ETH/BTC that adopt probabilistic-finality consensus (where the probability of the block verification result being tampered with increases with the addition of blocks, and proof-of-work public chains fall into this category), an additional peg zone interface chain is required, making it more complex. In contrast, LayerZero can provide direct communication for all types of public chains.

The differences between LayerZero and Cosmos are also some of LayerZero's most important advantages: the protocol can achieve very lightweight operations to reduce cross-chain steps and fees; and it can provide direct communication for all types of public chains without relying on intermediary chains or assets.

1.2 Stargate

As the first Dapp developed based on LayerZero, Stargate's core lies in enhancing the utilization of funds through a "resource balancing algorithm," treating the liquidity of single-coin assets across chains as a complete liquidity pool to avoid depletion on any single chain.

As illustrated in the diagram below, suppose there is a total of $4 million in funds on the source chain, and there are 4 target chains. In a dispersed liquidity model, each target chain is allocated $1 million, with a single transfer limit of $1 million. In contrast, in a unified liquidity model, the funds are placed in the same pool, with a single transfer limit of $4 million, allowing for deeper transaction depth.

image

Source: "∆: Solving the Bridging Trilemma"

The benefits of a unified liquidity pool are obvious, as it can allocate funds where needed, providing high flexibility; the challenge lies in how to allocate funds on each channel as needed while ensuring that the liquidity of individual channels does not deplete.

The solution of the Stargate algorithm is to create an "initial accounting" for each target chain, which means pre-assuming the bandwidth on each channel, while allowing target chains to "borrow and repay" funds during actual transfers to achieve on-demand allocation of the unified liquidity pool.

Stargate refers to initial accounting as "soft partitioning." As shown in the diagram below, suppose there is $100 on source chain X, this money will be soft-partitioned into $50 on target chain Y and $50 on target chain Z. If during the actual transfer, chain Y needs to transfer $60, it will "borrow" $10 from the soft partition of chain Z. When new funds enter chain X, they will first fill the deficit on chain Y, and the remaining amount will be allocated to all soft partitions based on their proportions.

image

Source: "∆: Solving the Bridging Trilemma"

If a particular channel has exceptionally high demand, could it drain funds from other channels? This is indeed possible, which would affect transfer users on other chains. To balance the demand across channels, when a channel's balance is low, additional fees will be charged to transfer users to incentivize the balance of funds across channels.

Through LayerZero's cross-chain communication capabilities and the aforementioned algorithm, Stargate claims that its product solves the impossible triangle problem of cross-chain transfers, namely: instant guaranteed finality (where transactions on both the source and target chains can be confirmed simultaneously); unified liquidity; and native asset transactions across chains.

Moreover, because it achieves instant guaranteed finality and native asset transactions across chains, Stargate also possesses cross-chain composability: it can interact with smart contracts on both the source and target chains, unlike traditional bridge smart contracts that only interact with smart contracts on the source chain.

For example: a user can perform a Swap on the source chain, then transfer to the target chain, and continue to Swap on the target chain, with the entire process completed in a single transaction.

It is worth noting that recently, the Cobo security team released an analysis report indicating that a recent update submitted by Stargate fixed serious vulnerabilities present in previous versions. The original text mentioned: "Although the LayerZero project team has fixed the currently obvious vulnerabilities, the possibility of other exploitable vulnerabilities cannot be ruled out." The security risks associated with Stargate must be taken seriously.

2: Stargate Token Economics

The underlying LayerZero protocol has not yet released a token; this section analyzes the Stargate token economic model.

2.1 Token Function and Value Capture

The platform's native token is STG, and its function is similar to Curve. Users can lock up their tokens to obtain veSTG for voting, with the weight of veSTG allocated based on the locking time, although the staking function has not yet been launched.

The platform primarily profits by charging transfer fees. Each time a non-STG token transfer occurs, a platform fee of 0.06% is generated, of which 3/4 goes to incentivize LPs in the liquidity pool, and 1/4 goes to the treasury, which will be managed by veSTG holders in the future.

Additionally, as mentioned earlier, when there is high demand for channel transfers on a given day, the platform will charge extra fees to balance channel bandwidth.

STG cross-chain transfers do not incur platform fees; users only need to pay gas fees.

To promote the ecosystem, Stargate has also launched a whitelist program, where for products with high transaction volumes, 0.003% of each transaction will be distributed to that product, funded by the treasury.

2.2 Token Distribution

The token cap is 1 billion, and all tokens were generated during the genesis period.

The token distribution is shown in the diagram below, with 35% in the hands of investors and the team; ~35% for initial sale and early liquidity; and 30% allocated to the community.

In the initial sale and early liquidity portion: 10% is for the Launch Auction, which has a one-year lock-up period, and 5% is for early liquidity added to Curve. These two parts constitute the Protocol Launch shown in the diagram below; after the auction ends, 15.95% of STG will be sold in a Bonding Curve format, as shown in the Bonding Curve section of the diagram, with no lock-up period.

Additionally, 2.11% is allocated for early incentives, released over a total of 3 months; a cap of 1.55% is for DEX liquidity on 6 chains other than ETH.

However, since the 100 million STG publicly sold in the first round of the Protocol Launch was snatched up by two addresses from Alameda, the team has recently added a second round of community auctions, selling a total of 20 million STG, accounting for 2% of the total.

image

Source: Official docs "Tokenomics" section

The token release is illustrated in the diagram. Since the investors, team, and public offering portions have a one-year lock-up period, a large number of tokens will begin to be released linearly starting in March 2023.

image

Source: Official docs "Tokenomics" section

3: Stargate Operational Status

3.1 Product Ecosystem

Stargate currently supports the functionality of transferring assets with a 1:1 price correspondence across 7 chains, including mainstream stablecoin assets USDT/USDC/BUSD, as well as the platform's native token STG.

The 7 supported chains are: ETH/BSC/AVAX/Polygon/Arb/Opt/FTM. For example, users can transfer USDC on ETH to USDT on the BNB chain, or convert STG from Arbitrum to STG on Fantom.

The official Medium disclosed that in the next 6~8 weeks, they will consider integrating Solana/Terra/Cosmos Hub/Osmosis, and will deploy on various chains in the next 4~6 months.

Recently, 0xMaki proposed to integrate Stargate within the Sushiswap community to achieve a better transfer experience and expand Sushi LP traffic. If finalized, this will be a milestone in the construction of the Stargate ecosystem.

image

According to the current community vote, 95% support.

image

Source: https://forum.sushi.com/t/enter-the-stargate-omnichain-strategy/9741

3.2 Token Operations

Stargate has completed its public offering. The 100 million STG from the public auction was entirely snatched by two addresses from Alameda, prompting the team to initiate a second round of community auctions, selling an additional 20 million STG. As of the time of writing, the second round of auctions is still ongoing.

The CEO of Alameda acknowledged this on Twitter and promised to hold the tokens for 3 years, indirectly indicating SBF's supportive stance towards Stargate. SBF's endorsement undoubtedly serves as a strong boost for the token price.

image

In Stargate's token distribution, 2.11% of STG is allocated for early liquidity incentives, totaling 2,110 tokens. This incentive program lasts for ~3 months.

Currently, users staking stablecoins on Stargate can earn an APY ranging from 15% to 18%. For stablecoins, this is a very high APY, which explains why it has already attracted $3.7 billion in TVL.

Since most STG is locked or managed by the community, the actual circulating STG is not much, accounting for about 10% of the total, approximately 100 million, including: 5.58% sold in the Bonding Curve; 5% in Curve liquidity; and 2.11% early incentives to be fully distributed after 3 months. The current FDV is approximately $3.5 billion, with a circulating market cap of around $350 million.

image

Source: https://twitter.com/princebtc28/status/1506426976269180950

4: Team and Financing

The team consists of three co-founders: Bryan Pellegrino as CEO, Ryan Zarick as CTO, and Caleb Banister. All three graduated from the CS program at the University of New Hampshire and have had many professional intersections since graduation.

In 2010, the three co-founded a software development company called Coder Den. Ryan Zarick and Caleb Banister later co-founded 80Trill and Minimal AI; CEO Bryan Pellegrino founded OpenToken in 2017. Until 2021, the three reunited to co-found LayerZero Labs.

According to the CEO's tweet in March, LayerZero Labs has a total of 24 employees.

On March 15, the official Medium announced that 0xMaki has joined LayerZero full-time to handle business development.

In April 2021, they secured $2 million in seed funding. In September 2021, they raised $6.3 million in Series A funding, led by Binance Labs and Multicoin Capital, with other participants including Sino Global Capital, Defiance, Delphi Digital, Robot Ventures, Spartan, Hypersphere Ventures, Protocol Ventures, and Gen Block Capital.

On March 31 of this year (just yesterday), it was announced that LayerZero Labs secured $135 million in Series A+ funding at a valuation of $1.35 billion. This round was led by FTX Ventures, Sequoia Capital, and a16z, with participation from Coinbase Ventures, PayPal Ventures, Tiger Global, and Uniswap Labs.

5: Advantages and Risks

Chain Teahouse believes that LayerZero Labs' core advantages include:

1) High certainty and high ceiling in the track. The cross-chain transfer of native assets can break down public chain data silos, potentially forming a unified trading depth across all networks, bringing a new landscape to blockchain development.

2) The product is already live, with straightforward cross-chain transfer functionality, and the user experience indeed surpasses that of cross-chain bridges and networks like Cosmos/Polkadot that require additional wallet downloads.

3) Backed by significant capital, ensuring team resources.

The main risks lie in the high security vulnerabilities associated with cross-chain operations. Stargate has already experienced serious security vulnerabilities, and the possibility of other security flaws cannot be ruled out.

Stargate's valuation is already high, with a current TVL of $3.7 billion, corresponding to an FDV of $3.5 billion. Assuming a comparison with the leading DEX Curve, which has a TVL of approximately $20 billion and an FDV of around $8.7 billion, Stargate's valuation is indeed higher than that of Curve.

Stargate is, after all, just a Dapp built on LayerZero, while the LayerZero underlying protocol has greater imaginative potential. According to publicly available financing information, LayerZero Labs is valued at $1 billion, while similar cross-chain ecosystems like Cosmos have an FDV of approximately $8.3 billion and Polkadot an FDV of around $23 billion. It appears that LayerZero still has significant room for growth.

ChainCatcher reminds readers to view blockchain rationally, enhance risk awareness, and be cautious of various virtual token issuances and speculations. All content on this site is solely market information or related party opinions, and does not constitute any form of investment advice. If you find sensitive information in the content, please click "Report", and we will handle it promptly.
ChainCatcher Building the Web3 world with innovators