The principle, current situation and future of Sequencer

avatar
鉴叔
6 months ago
This article is approximately 2328 words,and reading the entire article takes about 3 minutes
So what is a Sequencer and how does it work in Layer2? What are the problems faced by centralized sorters? How will concurrent sorters develop in the future? This article explores these issues in depth.

At present, the main source of income for Layer 2 is the gas fee paid by users when conducting transactions on Rollup. As long as the gas fee paid by Layer 2 when submitting data to Layer 1 is subtracted, the rest is almost pure profit. As shown in the figure below, rough statistics show that OP Mainnets profit from June to December 2023 is approximately US$5.23 million, Arbitrums profit for the whole year is US$16.5 million, and zkSync Eras profit from March to December 2023 is US$22.24 million.

The principle, current situation and future of Sequencer

Whats the secret behind achieving such huge profits? In fact, this has a lot to do with the only sorter they are running.

So, what is a sequencer and how does it work in Layer 2? What are the problems faced by centralized sorters? How will concurrent sorters develop in the future? This article explores these issues in depth.

Principle of Sequencer

Sequnencer, translated as sequencer or sequencer in Chinese, is a very critical role in Layer 2. Its main function is to receive transactions from Layer 2 users and execute them, and finally submit the batch (Batch) formed after sorting and compressing the transactions to Layer 1.

The principle, current situation and future of Sequencer

Perhaps this is still relatively abstract. Next, the author will use specific examples to make analogies. In the past, when users transacted on Ethereum, we can visualize it as driving to the city (Ethereum) to do things. When the peak trading period comes, traffic jams will naturally occur. At this time, users can do nothing but wait. , you can only pay more money to let foreign aid (referring to the verifier) ​​pick you up, otherwise there is no way.

There are many solutions to the traffic jam problem in reality, such as developing public transportation, widening lanes, building more roads, staggering peak hours and limiting travel numbers, etc. Layer 2 is Ethereum’s public transportation solution, and the Sequencer is Hes a bus driver. The bus master told everyone that you don’t have to drive into the city yourself. You only need to pay me some service fees (lower than the cost of driving yourself) to ensure that I deliver you to your destination. This saves money and effort. At the same time, in order to maximize the use of the space in the bus, the bus driver will usually fill the bus with as many people as possible before starting the bus. He will also direct and rearrange the passengers. For example, a thin person can be sandwiched between two fat people to make the bus more comfortable. Passengers are perfectly tuned.

After understanding this process, let’s answer some questions that everyone is concerned about.

Who can run the sequencer?

There are several common scenarios:

  • Centralized sorter

This solution is for the Layer 2 team to personally or designate an organization to only run the sequencer. Because this method is very efficient but low cost, it is the favorite solution for the Layer 2 team;

Of course, there are other solutions to decide who can run the sorter, which I will introduce in detail in the Decentralized Sorter section.

  • Completely permissionless sorter

Meaning anyone can sort and submit transactions to Layer 1. However, although this solution seems simple and fair, it also has obvious shortcomings. After all, the sequencer is not equal to the miners or verifiers of Layer 1. They do not improve the final security, but only submit batches to the main chain. Even if multiple participants submit batches at the same time, only one will be included in the end, which leads to a large waste of computing resources and gas of other sequencers;

By what criteria does the sorter sort?

Generally speaking, there are two sorting methods. One is first-come, first-served, which is similar to those who get on the bus first and can occupy seats first, and transactions sent first will be sorted first. The second method is to sort by gas fee. A user who is very urgent about his transaction can give the sorter more money, and then the sorter will prioritize packaging his transaction regardless of first come, first served.

Mainstream Layer 2 mostly uses the first method, but whether the first or the second method is essentially common sense, there is no hard and fast rule for Layer 2 on how to sort. The sorter can even sort things as you like, just like a bus driver can refuse someone to get on the bus or reserve a seat for his relatives and friends in advance, although it is not common sense.

Can sequencers do evil? How to prevent it?

Sorters can theoretically do evil.

The power of the sequencer is actually very great. He can deliberately revoke someones transaction and then lie that it has been successful, or he can mix a malicious transaction among many transactions (such as transferring the users Layer 2 assets to his own address). Make yourself a profit.

However, in order to prevent possible evil behaviors of the sorter, different Layer 2 also have different constraints. Optimistic Rollup adopts the method of fraud proof, that is, it is first optimistic that the sorter is honest. During the dispute period (usually one week), if no verifier proves that the data submitted by the sorter to Layer 1 is incorrect, then the data submitted by it will It can never be changed; ZK Rollup uses validity proof, that is, the batch issued by the sequencer will be verified immediately. After the verification is passed, the transaction will be finally confirmed in Layer 1 without a dispute period.

The principle, current situation and future of Sequencer

Starknet sequencer operation diagram

Current Situation: Problems Caused by Centralized Sorters

The current mainstream Layer 2 such as OP Mainnet, Arbitrum One, Starknet and zkSync Era all use a centralized sequencer solution, with official or affiliated organizations running sequencers. For example, the Optimism Foundation runs OP Mainnets sequencer and Offchain Labs Running Arbitrum Ones sequencer, etc.

A centralized sorter has many benefits for Layer 2 projects, such as ease of management, increased efficiency, and the ability to earn some revenue. Although almost all of them promise to safeguard the interests of users and not do evil (at this stage, they strictly follow the first-come, first-served sorting standard), centralized sorters still cause worries to many users.

Weak censorship resistance

A sequencer run by a single centralized entity is not as censorship resistant as Layer 1 with thousands of validators or miners. The team may exclude some transactions due to regulatory requirements, or blacklist some transactions for certain reasons. Although most Layer 2 systems currently have mechanisms designed to allow users to bypass the sequencer and submit transactions directly to Layer 1, users still need to pay additional costs.

The principle, current situation and future of Sequencer

Users submit their own transaction plans (Source: L 2B EAT)

weak activity

Weak activity can also be understood as a single point of failure. Compared with thousands of transaction requests per second, a centralized sorter cannot handle so many requests at the same time due to hardware and other reasons. When a sorter is overloaded and there are no other backup sorters, it will cause the entire system to shut down. , for example, Arbitrum experienced a period of downtime when issuing airdrops.

Obtaining Improper MEV Gains

MEV stands for Maximal Extractable Value, which refers to the additional income that miners/verifiers can obtain by manipulating transactions (adding, deleting, and rearranging transactions). Although they usually determine the order in which transactions are included in the block by sorting the gas fee from high to low, once they monitor the occurrence of significant profits, miners can add transactions to the block, delete transactions, or change the order of transactions. In order to obtain benefits other than block rewards, the popular understanding is to be both a player and a referee.

In Layer 2, the sequencer also has the power to manipulate the order of transactions similar to the miners/validators in Layer 1. Although the sorter is run by the Layer 2 team, essentially we still cannot fully trust them, especially since the OP Mainnet still uses a private memory pool (a place where transactions are temporarily stored for users, waiting for the sorter to process), which is equivalent to Conducting black box operations, despite its stated reason for doing so is to prevent others from monitoring transactions and obtaining improper MEV gains.

The future of Sequencers

Mainstream Layer 2 (OP Mainnet, Arbitrum One, Starknet, zkSync Era) are not unaware of the problems caused by centralized sequencers. So they all proposed their own decentralized sorter solutions.

However, it is currently only reflected in official documents or white papers. It seems that they are now more focused on building their core competitiveness (network performance, ecological construction) than dispersing their power and benefits.

Decentralized sorter

The following author will briefly introduce several decentralized sorter solutions:

  • Geographical decentralization

This is a simple and crude way of publishing several sequencers in different geographical locations around the world and run by reputable and interested companies/organizations. They can use a rotation to decide who will order trades over a period of time. Although there are still problems, this solution is still more censorship-resistant and lively than a single centralized sorter.

  • Sorter Auction

Rollup can conduct sequencer auctions directly through smart contracts. Anyone can bid for the right to run the sequencer. Such auctions are conducted for each block and can also be for a certain time period. Of course, the party that wins in the end still has to pledge a certain deposit so that they can be punished if they do evil. At the same time, the rollup of funds obtained from the auction can also be effectively distributed.

  • leader election

This solution allows anyone to stake tokens (ETH or Layer 2 native tokens) into Layer 2 smart contracts. Each orderer who submits a batch is randomly selected from these pledgers (the probability of winning is It can also be proportional to the pledge amount).

  • Based Rollup

This is a solution that has recently emerged in the Ethereum community, in which Ethereums validators directly lead the sorting of Layer 2 transactions, completely replacing Layer 2s own sorter. Of course, this solution is more difficult to operate than the previous ones, and there are still many technical problems to be solved.

Shared sorter

The decentralized sorter solution essentially explores how Layer 2 issues the operating power of the sorter. In this process, the Layer 2 team is still the leader. The shared sorter means that the exclusive sorter for a single Layer 2 is cancelled, and multiple Layer 2s share a third-party sorter network.

This has many benefits, such as atomic composability between Layer 2 (different Layer 2 transactions in the same memory pool), preventing MEV fetches, etc. There are many projects currently building a shared sequencer network, such as Astria, Radius, and Espresso, among others.

Summary and reflections

Eliminating single points of failure and mitigating systemic risks is one of the spirits of encryption, and the idea of ​​decentralizing the sequencer is also based on an extension of this spirit to some extent. But if we think about it from a practical perspective, is a decentralized sorter or a shared sorter now perfectly capable of mitigating the problems caused by a centralized sorter? The author doesnt think so.

From the perspective of MEV, take Ethereum as an example. According to data from Flashbots, since the Merge of Ethereum, its statistical block proposers (Proposers) have achieved REV extraction of 288,829 ETH. (Note: REV is the MEV that has been extracted)

This is only the incomplete data compiled by Flashbots, which shows how huge the MEV market is in permissionless Ethereum.

The principle, current situation and future of Sequencer

MEV generated by benign and appropriate arbitrage operations is conducive to market stability, but malicious operations (such as sandwich attacks) carried out under the temptation of huge MEV interests will have an adverse impact on the entire network. Even if the miners themselves do not do evil, it will create an off-chain market for collusion and bribery. This obviously goes against the original intention of the Ethereum concept and will also seriously harm the interests of ordinary users. Although Ethereum is currently looking for solutions (such as separating orderers from proposers), this situation will still exist in the short term.

The current MEV pattern of Ethereum is formed spontaneously by the market. So when Rollups sequencer is also liberalized and decentralized, will such a market pattern also form over time? Compared with the possible single point of failure caused by trusting the Rollup team, the chaos and another kind of centralization caused by disorderly competition in the market are also frightening.

At the same time, although shared sorters can make different Rollups interoperable at the sorter level, if more and more such third-party shared sorters are used in the future, they will essentially become a controller that controls multiple Rollups. The network will become more and more powerful. So, will the same centralization problem arise again? Do we need some solution to decentralize the shared sorter? These issues require further consideration.

The development and decentralization of blockchain is a long and difficult process. The reason why the sequencer attracts attention is because it plays an extremely important role in the entire Rollup. I believe that through continuous exploration and efforts in the future, the problems we face today will be appropriately solved.

References:

【 1 】You are not a real Rollup

【 2 】MEV: From zero-sum game to separation of powers

【 3 】Talk to AltLayer, Scroll, Starknet Team - Shared Orderer and L2 Consensus

【 4 】optimistic-rollups-vs-zk-rollups

Disclaimer: All contents on this website may involve project risk matters and are for science and reference purposes only and do not constitute any investment advice. Please treat it rationally, establish a correct investment philosophy, and increase your awareness of risk prevention. It is recommended to comprehensively consider various relevant factors, including but not limited to personal purchasing purpose and risk tolerance, before interacting and holding. Copyright notice: The copyright of the quoted information belongs to the original media and author. Without the consent of Jian Shu J Club, other media, websites or individuals are not allowed to reprint the articles on this site. Jian Shu J Club reserves the right to pursue legal liability for the above-mentioned acts.

Original article, author:鉴叔。Reprint/Content Collaboration/For Reporting, Please Contact report@odaily.email;Illegal reprinting must be punished by law.

ODAILY reminds readers to establish correct monetary and investment concepts, rationally view blockchain, and effectively improve risk awareness; We can actively report and report any illegal or criminal clues discovered to relevant departments.

Recommended Reading
Editor’s Picks