This article wouldn’t be possible without the input of Josh Bowen from Astria, Gus Gutoski [verify the name] from Espresso, Anil Kumar from Rome protocol,
<aside> 💥 Today, we’re excited to announce that RockawayX invested in Astria alongside Placeholder and DBA. Astria is building the leading decentralized sequencer on top of Celestia while offering the best tooling to deploy rollups. Thanks to Astria, rollups can be deployed with just several clicks, be decentralized from day one, and stay interoperable with other rollups building on top of Astria. For this occasion, we’re publishing an article delving into the intricate world of sequencers.
</aside>
Imagine a bustling city with thousands of cars navigating through its streets every day. Now, think of the traffic lights and signs that govern the flow of these vehicles, ensuring they reach their destinations efficiently and safely. In the world of blockchain, especially in Layer 2 solutions (L2s), sequencers play a similar role to these traffic control systems.
Just as traffic lights control the order and timing of cars passing through an intersection, sequencers determine the order and timing of transactions within a blockchain network. They decide which transactions to process first, which to delay, and how to organize them to maintain a smooth and efficient flow within the blockchain 'city'. Without sequencers, the 'traffic' of transactions would descend into chaos, much like a city intersection without traffic lights - leading to delays, potential conflicts, and an overall inefficient system.
This article delves into the intricate world of sequencers in L2s, highlighting their fundamental importance and the emerging trend of decentralizing this critical function. Firstly, we dive into what sequencers are and how they fit in the transaction supply chain of a typical L2. Second, we look into the trend of decentralization of sequencers, examine the advantages and disadvantages of decentralized sequencers, and compare them with centralized ones. Third, we discuss the shared sequencer and its major beneficial feature, atomic composability, and finally, we explore the new emerging research around based sequencing. Now let's delve deeper into what a sequencer is and how it functions within the wider blockchain ecosystems.
At its core, a sequencer is a component responsible for determining the order of transactions. When a user initiates a transaction on Ethereum, it doesn’t immediately become part of the blockchain. Instead, it enters a pool of unconfirmed transactions a so-called mempool (1). From here, the sequencer selects transactions, arranges them in a specific order, and proposes a block (2). The block then gets broadcasted to the executor who then updates the state of the blockchain - attaches the proposed block to the blockchain (3). Now this diagram is highly simplified but it shows the key idea.
Consider a blockchain sequencer like a traffic light at an intersection, directing the flow of vehicles (transactions). It ensures each transaction proceeds at the right time, maintaining orderly and efficient network traffic.
Have you ever experienced a delay in your transaction on the Ethereum network? That's a sequencer at work trying to get rid of the congestion. The process of sequencing transactions involves more than just randomly picking and ordering transactions. Sequencers must consider various factors, such as transaction fees, and network rules. They prioritize transactions based on some pre-defined rules, such as gas fees paid or first-come-first-serve, among others. This ordering is crucial because it dictates the state of the network at any given moment. Without a sequencer, transactions would be processed in a chaotic, unpredictable manner, leading to issues like double spending, front running, or network congestion.
Sequencing upholds the integrity of the blockchain and fair sequencing can significantly impact the outcome of trades or contract executions. It can directly influence the financial outcomes for participants in the network. As the sequencer holds the power over the order of transactions it can reorder them according to the rules of the network to extract any potential value that stems from a particular ordering. This value is called MEV, maximum extractable value, and is one of the potential revenue sources for sequencers.
When the transaction data is finally ordered, it is published for everyone to see. On Ethereum the validators order the transactions and form a block. In the case of L2s, the sequencer is in charge to batch several of such transactions and publish the batch to the data availability layer, like Ethereum, EigenDA or Celestia. If the sequencer is in charge of execution it would now execute the transactions on L2s. However, most of the time it proposes the batch of ordered transactions back to the L2 for execution. Usually, the sequencer also sends a commitment that the batch was published on the DA layer to the smart contract governing the L2 rollup.
Having established how sequencers operate, it becomes crucial to explore their different forms, starting with the centralized model prevalent in today’s typical L2 platforms.
Centralized sequencers in a typical L2s provide fast pre-confirmation times.
As already mentioned, on Ethereum, validators assume the role of sequencers. In a typical L2 today in 2024, however, the role of a sequencer is assumed by the operator of the L2 like zkSync, or Arbitrum. The sequencing role is therefore centralized and under the control of those entities.
The current centralized design is highly efficient as it allows the rollup to provide the user with a fast form of finality (=soft finality), a highly valuable feature that significantly improves the UX of using Web3 products. Without a sequencer, the user would have to wait quite a significant amount of time for the transaction to settle (=hard finality). In the case of a ZK rollup, a user would need to wait for the ZK proof to settle on the L1, which would take at least 12 minutes on Ethereum, assuming ZK proof is generated for each batch of transactions. In the case of an optimistic rollup, a user would need to wait till the fraud-proof window elapses, which is approximately 7 days. A sequencer could never provide faster hard finality times than that of the DA layer where the data (and proofs) are published.