From Modularity to Aggregation: Exploring the Core of Polygon 2.0’s Agglayer

YBB
YBB Capital
Published in
13 min readJun 28, 2024

Author: YBB Capital Researcher Zeke

TLDR

  • Agglayer is the core component of Polygon 2.0, designed to unify fragmented blockchains by aggregating and ensuring atomic cross-chain transactions. Its goal is to provide a seamless user experience equivalent to a single-chain level, addressing the issues of liquidity and state fragmentation in the current blockchain ecosystem.
  • Agglayer employs a new verification mechanism called pessimistic proof, which assumes that all connected chains are insecure, ultimately using zero-knowledge proofs to ensure the correctness of cross-chain operations.
  • Agglayer is more concise and efficient, aiming to achieve an ideal form of chain abstraction, aligning with the definition of the next generation of Web3.

1. Deriving from the Modular Era

1.1 Introduction to Agglayer

Agglayer is one of the core components of Polygon 2.0. The “Agg” in its name stands for aggregation, reflecting its role as an aggregation layer. Essentially, its function is similar to cross-chain interoperability protocols like Layerzero and Wormhole, aiming to connect the fragmented blockchain world. However, their construction methods differ. In simple terms, traditional cross-chain interoperability protocols are akin to construction companies building bridges everywhere, designing and constructing bridges to connect different chains or protocols (which can be challenging for heterogeneous chains). In contrast, Agglayer functions more like a “local area network” composed of exchange mechanisms, where connected chains can join the “LAN” by simply plugging in a “cable” (ZK proof) to exchange data. Compared to building bridges everywhere, it is faster, more user-friendly, and offers better interoperability.

1.2 Shared Validity Sequencing

The concept of Agglayer owes much to Umbra Research’s design of Shared Validity Sequencing, which aims to achieve atomic cross-chain interoperability among multiple Optimistic Rollups. By sharing a sequencer, the entire system can uniformly handle transaction sequencing and state root publishing across multiple Rollups, ensuring atomicity and conditional execution.

The specific implementation logic involves three components:

  • Shared Sequencer for Cross-Chain Operations: Receives and processes cross-chain transaction requests.
  • Block Construction Algorithm: The shared sequencer constructs blocks containing cross-chain operations, ensuring their atomicity.
  • Shared Fraud Proofs: Implements a shared fraud-proof mechanism among the involved Rollups to enforce cross-chain operations.
The diagram shows the working process of the MintBurnSystemContract when a single sequencer is shared.

Since current Rollups typically support bidirectional message passing between Layer 1 and Layer 2, along with other special pre-compiles, Umbra adds a simple cross-chain system comprising a MintBurnSystemContract (Burn and Mint) to complement the three components, as illustrated above.

Workflow

  1. Burn Operation on Chain A: Any contract or external account can invoke this operation. Upon success, it is recorded in the burnTree.
  2. Mint Operation on Chain B: The sequencer records this in the mintTree after successful execution.

Invariants and Consistency

Merkle Root Consistency: The Merkle roots of burnTree on Chain A and mintTree on Chain B must match, ensuring cross-chain operation consistency and atomicity.

In this design, Rollup A and B share a single sequencer. This shared sequencer is responsible for publishing the transaction batches and state roots of both Rollups to Ethereum. The shared sequencer can be either centralized, like most current Rollup sequencers, or decentralized, similar to Metis’s approach. The key point in the system is that the shared sequencer must publish the transaction batches and state roots of both Rollups to L1 in a single transaction.

The shared sequencer receives transactions and constructs blocks for A and B. For each transaction on A, the sequencer checks if it interacts with the MintBurnSystemContract. If the transaction successfully interacts with the burn function, the sequencer attempts to execute the corresponding mint transaction on B. If the mint transaction succeeds, the sequencer includes the burn transaction on A and the mint transaction on B; if the mint transaction fails, the sequencer excludes both transactions.

In simple terms, this system is a straightforward extension of the existing block construction algorithm. The sequencer executes transactions and conditionally inserts triggered transactions from one Rollup into another. During fraud proof verification on the main chain, it only needs to ensure the correctness of the burn on Chain A and the mint on Chain B (i.e., Merkle root consistency). In this scenario, multiple Rollups behave like a single chain. Compared to a monolithic Rollup, this design offers better sharding support, application sovereignty, and interoperability. However, the drawbacks include increased validation and sequencing burdens on nodes, and the likelihood of adoption is low due to considerations of profit distribution and Rollup autonomy.

1.3 Core Components of Agglayer

Agglayer integrates the aforementioned solutions while introducing more efficient improvements and two key components: the Unified Bridge and Pessimistic Proofs.

Unified Bridge: The Unified Bridge’s workflow involves collecting and aggregating the states of all connected chains into the aggregation layer, which then generates a unified proof to Ethereum. This process involves three stages of state: pre-confirmation (which allows faster interaction under temporary state assumptions), confirmation (which verifies the validity of the submitted proof), and finalization. Ultimately, this proof can validate the transaction validity of all connected chains.

Pessimistic Proofs: Connecting Rollups to a multi-chain environment introduces two main issues: 1. The introduction of different validators and consensus mechanisms complicates security; 2. Optimistic Rollup withdrawals require a 7-day period. To address these issues, Polygon introduces a novel zero-knowledge proof method known as Pessimistic Proofs.

The idea behind Pessimistic Proofs is to assume that all blockchains connected to AggLayer could potentially act maliciously and to make worst-case assumptions for all cross-chain operations. AggLayer then uses zero-knowledge proofs to verify the correctness of these operations, ensuring that even in the presence of malicious behavior, the integrity of cross-chain operations remains intact.

1.4 Features

Under this scheme, the following features can be achieved:

  • Native Tokens: By using the Unified Bridge, assets within the aggregation layer are all native assets. There are no wrapped tokens, and no third-party trust sources are needed for cross-chain transactions, making the process seamless.
  • Unified Liquidity: The TVL (Total Value Locked) of all connected chains is shared, which can be referred to as a shared liquidity pool.
  • Sovereignty: Compared to the Optimistic Rollup method described above, which achieves interoperability through a shared sequencer, Agglayer has better sovereignty. AggLayer is compatible with shared sequencers and third-party DA solutions. Connected chains can even use their native tokens as gas.
  • Faster: Unlike the Optimistic Rollup method mentioned above, Agglayer does not require a 7-day wait for cross-chain transactions.
  • Security: Pessimistic Proofs only accept correct behavior. Additionally, they ensure that no chain can withdraw more than the amount deposited, thereby securing the aggregation layer’s shared asset pool.
  • Low Cost: The more chains connected to the aggregation layer, the lower the proof fees paid to Ethereum, as these costs are shared. Agglayer does not charge additional protocol fees.

2. Cross-Chain Solutions

2.1 Why Is Cross-Chain So Difficult?

As mentioned earlier, the goal of Agglayer aligns with that of cross-chain protocols. But which one is superior? Before comparing, we need to understand two questions: 1. Why is cross-chain so difficult? 2. What are the common cross-chain solutions?

Like the famous blockchain trilemma, cross-chain protocols also face an interoperability trilemma. Due to the fundamental premise of decentralization, blockchains are essentially state machines that cannot receive external information. Although AMMs and oracles have filled some gaps in DeFi, cross-chain protocols face much more complex challenges. In some ways, we can never truly extract any real tokens from the original chain, leading to various wrapped tokens like xxBTC and xxETH. However, this approach is risky and centralized because real BTC and ETH must be locked in cross-chain bridge contracts on the original chain, while the entire cross-chain design might face issues such as asset disparity, protocol incompatibility due to different VMs, trust issues, double-spending problems, and latency issues. To be efficient and cost-effective, most cross-chain solutions still rely on multi-signature wallets. This is why we still frequently hear about cross-chain bridge failures today.

Now, let’s take a closer look at the issue from a lower level. According to Connext founder Arjun Bhuptani, cross-chain protocols can only optimize two out of the following three key attributes:

  • Trustlessness: No reliance on any centralized trust entities, providing the same level of security as the underlying blockchain. Users and participants do not need to trust any intermediaries or third parties to ensure the security and correct execution of transactions.
  • Extensibility: The protocol can easily be applied to any blockchain platform or network, without being limited by specific technical architectures or rules. This allows interoperability solutions to support a wide range of blockchain ecosystems, not just a few specific networks.
  • Generalizability: The protocol can handle any type of cross-domain data or asset transfer, not limited to specific transaction types or assets. This means different blockchains can exchange various types of information and value, including but not limited to cryptocurrencies, smart contract calls, and other arbitrary data through the bridge.

Early classifications of cross-chain bridges were often based on figures like Vitalik Buterin, who categorized cross-chain technologies into three types: hash time locks, witness validation, and relay validation (light client validation). Later, Arjun Bhuptani reclassified cross-chain solutions into native validation (trustlessness + extensibility), external validation (extensibility + generalizability), and native validation (trustlessness + generalizability). These validation methods are based on different trust models and technical implementations to meet various security and interoperability needs.

Natively Verified Bridges:

Natively verified bridges rely on the consensus mechanisms of the source and target chains themselves to directly validate the transaction’s validity. This method does not require additional validation layers or intermediaries. For example, some bridges may use smart contracts to create verification logic directly between two blockchains, allowing them to confirm transactions through their own consensus mechanisms. This approach enhances security as it directly relies on the inherent security mechanisms of the participating chains. However, it can be more technically complex to implement and not all blockchains support direct native verification.

Externally Verified Bridges:

Externally verified bridges use third-party validators or validator clusters to confirm the transaction’s validity. These validators may be independent nodes, consortium members, or other types of participants operating outside the source and target chains. This method typically involves cross-chain message passing and verification logic executed by external entities rather than directly handled by the participating blockchains. External validation allows broader interoperability and flexibility because it is not limited by specific chains but introduces an additional layer of trust and potential security risks. Despite its centralization risks, external validation is the most mainstream cross-chain method, as it is efficient, flexible, and cost-effective.

Locally Verified Bridges:

Locally verified bridges involve the target chain verifying the source chain’s state to confirm transactions and execute subsequent transactions locally. This usually involves running a light client of the target chain’s virtual machine on the source chain or in parallel. Local verification requires an honest minority or synchronous assumption, where at least one honest relayer exists in the committee (honest minority) or if the committee fails, users must transmit transactions themselves (synchronous assumption). Local verification is the most trust-minimized cross-chain communication method but is also costly, less flexible in development, and more suitable for blockchains with high state machine similarity, such as between Ethereum and L2 networks or blockchains developed based on the Cosmos SDK.

Current Cross-Chain Solutions [1]

The compromises made in different areas have led to various types of cross-chain solutions. Besides verification methods, current cross-chain solutions can be categorized in multiple ways, each adopting unique approaches to achieve asset exchange, transfer, and contract invocation.

· Token Swaps: This method allows users to trade a certain asset on one blockchain and receive an equivalent asset on another chain. By utilizing technologies such as atomic swaps and cross-chain automated market makers (AMMs), liquidity pools can be created across different chains to facilitate the exchange of different assets.

· Asset Bridges: This method involves locking or burning assets on the source chain through smart contracts and unlocking or minting new assets on the target chain through corresponding smart contracts. This technique can be further divided into three types based on how assets are handled:

  • Lock/Mint Model: In this model, assets on the source chain are locked, while equivalent “bridged assets” are minted on the target chain. In the reverse operation, the bridged assets on the target chain are burned to unlock the original assets on the source chain.
  • Burn/Mint Model: In this model, assets on the source chain are burned, and the same amount of equivalent assets are minted on the target chain.
  • Lock/Unlock Model: This method involves locking assets on the source chain and unlocking equivalent assets from a liquidity pool on the target chain. These asset bridges often attract liquidity by offering incentives such as revenue sharing.

· Native Payments: This method allows applications on the source chain to trigger payment operations using native assets on the target chain. It can also trigger cross-chain payments based on data from one chain on another chain. This method is primarily used for settlement and can be based on blockchain data or external events.

· Smart Contract Interoperability: This method allows smart contracts on the source chain to invoke functions of smart contracts on the target chain based on local data, enabling complex cross-chain applications, including asset swaps and bridging operations.

· Programmable Bridges: This is an advanced interoperability solution that combines asset bridging and message passing functions. When assets are transferred from the source chain to the target chain, contract calls on the target chain can be triggered immediately, enabling various cross-chain functionalities such as staking, asset swaps, or storing assets in smart contracts on the target chain.

2.2 The Future Advantages of Agglayer

Let’s compare Agglayer with the current cross-chain protocols, taking LayerZero, the most influential cross-chain protocol, as an example. LayerZero employs an improved version of external verification by converting the trust source for verification into two independent entities — an oracle and a relayer. This minimalist approach addresses the flaws of external verification, making it a programmable bridge solution that can perform various operations. Logically, it seems to have elegantly resolved the so-called trilemma. From a grand narrative perspective, LayerZero has the potential to become the cross-chain hub of the entire Web3, addressing issues like fragmented user experience and broken liquidity caused by the chain explosion in the modular era. This is why leading VCs are heavily betting on such protocols.

However, what is the reality? Putting aside recent controversies regarding LayerZero’s airdrop operations, let’s consider its development challenges. Achieving the ideal state of connecting the entire Web3 is extremely difficult, and its decentralization is questionable. In its early V1 version, LayerZero’s oracle posed risks of being hacked and potentially malicious behavior (Wormhole, which employs industry institutions as guardian nodes, often faces similar criticisms). These concerns were only mitigated with the advent of the decentralized verification network (DVN) in V2, which required significant B-side resources.

Moreover, developing cross-chain protocols involves dealing with heterogeneous chain protocols, data formats, operational logic, and the invocation of different smart contracts. True interoperability in Web3 requires not just individual efforts but also the collaboration of various projects. Early users of LayerZero might recall that it primarily supported cross-chain interactions for EVM-based blockchains, with limited support for other ecosystems. This is also true for Agglayer, but Agglayer offers ultra-low latency and asynchronous interoperability, making it more akin to the internet we use daily.

Overall, Agglayer’s approach to aggregation for single-chain-like usage is simpler, more efficient, and aligns with the current modular trends. However, there is no absolute superiority between the two at present. Cross-chain protocols still hold the advantages of broader liquidity, a more mature ecosystem, and greater proactivity. Agglayer’s strength lies in its ability to genuinely aggregate rival Layer 1 and Layer 2 chains, breaking the zero-sum game of fragmented liquidity and users in the chain explosion era. It allows for low-latency multi-chain interactions, native chain abstraction, and shared liquidity pools without the need for wrapped tokens, presenting a significant opportunity for long-tail and application-specific chains.

In summary, Agglayer is currently the most promising cross-chain solution, with similar projects like Polkadot’s “Join-Accumulate Machine” also in development. The history of Web3 has transitioned from monolithic to modular, and the next step will be towards aggregation.

3. Ecosystem Connected by Agglayer

Although still in its early stages, Agglayer has integrated a few key projects. Here are three notable examples:

3.1 X Layer

X Layer is an Ethereum Layer 2 project built on Polygon CDK. It connects OKX and the Ethereum community, enabling anyone to participate in a truly global on-chain ecosystem. As the public chain of a leading exchange, integrating with Agglayer will bring extensive liquidity to the projects within the aggregation layer. Additionally, the OKX Web3 wallet, serving as an access layer for regular users, might also provide better support for Agglayer.

3.2 Union

Union is a zero-knowledge infrastructure layer built on Cosmos, used for general messaging, asset transfers, NFTs, and DeFi. It relies on consensus validation without depending on trusted third parties, oracles, multisignature, or MPC. As an integrated chain, Union enables deep connectivity between EVM and Cosmos ecosystems within the aggregation layer. By using Union as an IBC gateway, it allows connecting to Union and then to IBC, thereby recombining two otherwise fragmented modular ecosystems.

3.3 Astar

Astar Network is a network for enterprises, entertainment, and gaming projects in Japan and globally, dedicated to advancing “Web3.” It uses cross-virtual machine support from Polygon and Polkadot to provide customizable blockchain solutions. As the first fully integrated chain of Agglayer, Astar will directly access a multi-billion dollar shared liquidity pool and achieve real user growth.

About YBB

YBB is a web3 fund dedicating itself to identify Web3-defining projects with a vision to create a better online habitat for all internet residents. Founded by a group of blockchain believers who have been actively participated in this industry since 2013, YBB is always willing to help early-stage projects to evolve from 0 to 1.We value innovation, self-driven passion, and user-oriented products while recognizing the potential of cryptos and blockchain applications.

Website | Twi: @YBBCapital

References

1.Understanding Blockchain Interoperability in One Article:https://blog.chain.link/blockchain-interoperability-zh/

2.AggLayer: Why Polygon’s Scalability Solution is a Game Changer in 2024 & Beyond?:

https://www.antiersolutions.com/agglayer-why-polygons-scalability-solution-is-a-game-changer-in-2024-beyond/

3.The Aggregation Age is Coming:https://polygon.technology/agglayer

4.Shared Validity Sequencing:https://www.umbraresearch.xyz/writings/shared-validity-sequencing

5.Union:https://www.rootdata.com/zh/Projects/detail/Union?k=MTAxMjY%3D

--

--

YBB
YBB Capital

A leading Web3 fund driving the future through innovative investments.