A Quick Overview of the Principles, Current Status, and Future of the Sequencer
Author: Jian Shu
Currently, the main source of income for Layer2 is the Gas fees paid by users when they transact on the Rollup. After deducting the Gas fees paid by Layer2 to submit data to Layer1, the remainder is almost pure profit. As shown in the figure below, the profit for OP Mainnet in August this year was approximately $850,000, Arbitrum's profit was about $1,000,000, and zkSync Era achieved around $3,800,000 in profit.
What is the secret behind such huge profits? It is largely related to the unique Sequencer that they operate.
So, what is a Sequencer, and how does it work in Layer2? What problems do centralized Sequencers face? How will Sequencers develop in the future? This article will delve into these questions.
The Principle of Sequencers
Sequencer, translated into Chinese as 排序器 or 定序器, is a very critical role in Layer2. Its main function is to receive transactions from Layer2 users, execute them, and finally submit the batch formed by sorting and compressing the transactions to Layer1.
This may still sound abstract, so let me illustrate with a concrete example. In the past, when users transacted on Ethereum, we can imagine it as driving to the city (Ethereum) to do business. When peak transaction times arrive, traffic jams naturally occur. At this point, users can only wait or pay a little extra to get help (referring to validators) to pick them up; otherwise, there is no other way.
There are many solutions to solve traffic jams in reality, such as developing public transport, widening lanes, building more roads, and staggering travel times. Layer2 is essentially Ethereum's public transport solution, and the Sequencer is like the bus driver. The bus driver tells everyone that they don't need to drive into the city themselves; just pay me a service fee (lower than the cost of driving yourself), and I will ensure you reach your destination, saving both money and effort. Additionally, to maximize the use of the bus's space, the bus driver usually tries to fill the bus as much as possible before departing and will direct and rearrange passengers, for example, placing a thin person between two fat ones to make the passengers fit "perfectly."
After understanding this process, let's address some questions that everyone is concerned about.
Who can run a Sequencer?
There are several common solutions:
- Centralized Sequencer
This solution involves the Layer2 team personally or designating a specific organization to run the Sequencer exclusively. This method is highly efficient and low-cost, making it the favorite option for Layer2 teams.
Of course, there are other solutions to determine who can run the Sequencer, which I will detail in the "Decentralized Sequencer" section.
- Completely Permissionless Sequencer
This means anyone can sort transactions and submit them to Layer1. However, while this solution seems simple and fair, it has obvious drawbacks. After all, a Sequencer is not equivalent to Layer1 miners or validators; they do not enhance the final security but merely submit batches to the main chain. Even if multiple participants submit batches simultaneously, only one will ultimately be included, leading to a significant waste of resources and Gas for other Sequencers.
What criteria does the Sequencer use to sort?
Generally, there are two sorting methods: one is first-come, first-served, similar to how the first person to board a bus gets a seat; the transactions that are sent first will be sorted first. The second method is sorting by Gas fees; if a user is in a hurry, they can pay the Sequencer a bit more, and the Sequencer will prioritize packaging their transaction regardless of the order of arrival.
Mainstream Layer2s mostly adopt the first method, but whether it is the first or second method, it essentially just conforms to common sense. There are no strict regulations on how to sort in Layer2. The Sequencer can even sort at will, just like a bus driver can refuse someone from boarding or reserve seats for friends and relatives, even if it is not reasonable.
Can the Sequencer act maliciously? How can we prevent this?
In theory, a Sequencer can act maliciously.
The power of the Sequencer is quite significant; they can deliberately cancel someone's transaction and falsely report that it was successful, or they can mix a malicious transaction (for example, transferring a user's assets on Layer2 to their own address) among many transactions to profit themselves.
However, to prevent potential malicious behavior from Sequencers, different Layer2s have different constraints. Optimistic Rollup adopts a fraud-proof approach, initially assuming that the Sequencer is honest. If no validator proves that the data submitted by the Sequencer to Layer1 is incorrect during the dispute period (usually one week), then the submitted data cannot be changed forever. ZK Rollup, on the other hand, uses validity proofs, meaning that every batch published by the Sequencer is verified immediately, and once verified, the transaction receives final confirmation on Layer1, with no dispute period.
Starknet Sequencer Operation Diagram
Current Situation: Problems Caused by Centralized Sequencers
Currently, mainstream Layer2s such as OP Mainnet, Arbitrum One, Starknet, and zkSync Era all adopt a centralized Sequencer model, operated by official or affiliated organizations. For instance, the Optimism Foundation operates the Sequencer for OP Mainnet, and Offchain Labs operates the Sequencer for Arbitrum One.
Centralized Sequencers offer many benefits for Layer2 projects, such as ease of management, increased efficiency, and the ability to earn some revenue. Although they almost all promise to protect user interests and not act maliciously (strictly following the first-come, first-served sorting standard at this stage), centralized Sequencers still raise many concerns among users.
Weak Censorship Resistance
A Sequencer is run by a single centralized entity, so its censorship resistance cannot be compared to the thousands of validators or miners in Layer1. The team may exclude certain transactions due to regulatory requirements or blacklist some transactions for various reasons. Although most Layer2s currently have mechanisms designed to allow users to bypass the Sequencer and submit transactions directly to Layer1, users still incur additional costs.
User-initiated transaction submission scheme (Source: L2BEAT)
Weak Liveness
Weak liveness can also be understood as a single point of failure. Compared to thousands of transaction requests per second, a centralized Sequencer may not be able to handle so many requests simultaneously due to hardware limitations. When a Sequencer is overloaded and there are no backup Sequencers, it can lead to system downtime, as occurred during Arbitrum's airdrop distribution.
Improper Acquisition of MEV Profits
MEV, or Maximal Extractable Value, refers to the additional profits that miners/validators can obtain by manipulating transactions (adding, deleting, reordering transactions). Although they usually sort transactions from high to low Gas fees to determine the order in which transactions are included in blocks, once they detect significant profits, miners can add transactions to the block, delete transactions, or change the order of transactions to gain profits beyond block rewards. In simple terms, they are "both players and referees."
In Layer2, Sequencers also have the power to manipulate transaction order, similar to Layer1 miners/validators. Although Sequencers are operated by Layer2 teams, we still cannot fully trust them, especially since OP Mainnet still uses a private mempool (a place for users to temporarily store transactions while waiting for the Sequencer to process them), which is akin to a black box operation. Even though they claim this is to prevent others from monitoring transactions and obtaining improper MEV profits.
Future
Mainstream Layer2s (OP Mainnet, Arbitrum One, Starknet, zkSync Era) are also aware of the issues caused by centralized Sequencers. Therefore, they have proposed their own decentralized Sequencer solutions.
However, these are currently only reflected in official documents or white papers. It seems that, compared to distributing their power and profits, they are currently more focused on building their core competitiveness (network performance, ecosystem development).
Decentralized Sequencers
Below, I will briefly introduce several decentralized Sequencer solutions:
- Geographical Decentralization
This is a straightforward approach, deploying several Sequencers in different geographical locations around the world, operated by reputable and interested companies/organizations. They can rotate to decide who will sort transactions for a period. Although it still has issues, this solution offers better censorship resistance and liveness compared to a single centralized Sequencer.
- Sequencer Auction
Rollups can directly conduct Sequencer auctions through smart contracts. Anyone can bid for the right to operate the Sequencer. Such auctions can be conducted for each block or for a specific time period. Of course, the winning party must still stake a certain amount of collateral to be penalized if they act maliciously. Additionally, the funds raised from the auction can be effectively distributed by the Rollup.
- Leader Election
In this scheme, anyone can stake tokens (ETH or Layer2 native tokens) in Layer2's smart contract, and each Sequencer submitting a batch is randomly selected from these stakers (the probability of being selected can also be proportional to the staked amount).
- Based Rollup
This is a recent proposal emerging in the Ethereum community, where Ethereum validators directly lead the sorting of Layer2 transactions, completely replacing Layer2's own Sequencer. Of course, this solution is more complex than the previous ones and still has many technical issues to resolve.
Shared Sequencers
The decentralized Sequencer solutions essentially discuss how to distribute the power to operate Sequencers in Layer2, where the Layer2 team remains the dominant force. In contrast, shared Sequencers refer to the elimination of a single Layer2-exclusive Sequencer, with multiple Layer2s sharing a third-party Sequencer network.
This approach has many benefits, such as atomic composability between Layer2s (different Layer2 transactions in the same mempool) and preventing MEV extraction. Currently, many projects are working to establish a shared Sequencer network, such as Astria, Radius, and Espresso.
Conclusion and Reflection
Eliminating single points of failure and mitigating systemic risks is one of the spirits of cryptocurrency. The idea of decentralizing Sequencers is, to some extent, an extension of this spirit. However, if we consider it from a practical perspective, can decentralized Sequencers or shared Sequencers perfectly mitigate the issues caused by centralized Sequencers? In my view, not necessarily.
From the perspective of MEV, taking Ethereum as an example, according to data from Flashbots, since Ethereum's The Merge, the block proposers they tracked have extracted 288,829 ETH in REV. (Note: REV refers to MEV that has already been extracted.)
This is just incomplete data from Flashbots, highlighting how enormous the MEV market is in permissionless Ethereum.
Beneficial and appropriate arbitrage operations that generate MEV contribute to market stability, but malicious operations (such as sandwich attacks) driven by the temptation of huge MEV profits can adversely affect the entire network. Even if miners themselves do not act maliciously, it can foster an off-chain collusion and bribery market. This clearly contradicts the original intention of Ethereum's philosophy and can severely harm the interests of ordinary users. Although Ethereum is currently seeking solutions (such as separating Sequencers from proposers), such situations will still exist in the short term.
The current MEV landscape in Ethereum is a market that has formed spontaneously. When the sorting of Rollup's Sequencers is also opened up and decentralized, will a similar market structure emerge over time? Compared to the potential single point of failure caused by trusting Rollup teams, the chaos and another form of centralization resulting from market disorderly competition is equally concerning.
At the same time, while shared Sequencers can provide interoperability at the Sequencer level among different Rollups, if more and more such third-party shared Sequencers are used in the future, they will essentially become a network controlling multiple Rollups, and their power will grow. Will this lead to similar centralization issues? Do we need some solution to decentralize shared Sequencers? These questions require further reflection.
The development of blockchain and decentralization is a long and challenging process. The reason Sequencers attract attention is that they play an extremely important role in the entire Rollup. I believe that through continuous exploration and effort, the issues we face today will be appropriately resolved in the future.