Page cover

🚦Preconf Sequencing Rules

As we will further decentralize the preconfer role, we need to enforce a MEV-resistant sequencing rule to prevent potentially malicious preconfers.

Our end game is to develop a concurrent proposer consensus for both L1 and L2 preconfirmations to maximize censorship resistance, MEV resistance, and liveness properties.

As the first step, however, we will introduce a verifiable sequencing mechanism that's much easier to implement.

Consider the scenario where a sequencer is responsible for ordering user transactions. To limit the sequencer's ability to extract MEV, we establish specific rules for the final order of transactions. Here we define a verifiable sequencing rule to be a sequencing rule that can be effectively determined within polynomial time.

Definitions

  • A sequencing rule is a function SS with two variables:

    • a sequence of transactions txs=<T1,T2,...,Tn>\text{txs}=<T_1,T_2,...,T_n> and

    • prior blockchain states XX. The output, S(txs,X)S(\text{txs}, X), is nonempty subset of all permutations of txs\text{txs}, representing allowed orderings of txs\text{txs}.

  • A sequencing rule SS is verifiable if and only if for any transaction sequence trs\text{trs} and any given prior states XX, it can be determined in polynomial time that is txs∈S(txs,X)\text{txs} \in S(\text{txs}, X) or txsβˆ‰S(txs,X)\text{txs} \notin S(\text{txs}, X).

Note:

  • We gave a slightly more general definition of sequencing rule SS above. In many other works, the first input of SS is set of transaction instead of a sequence of transaction. Our definition is more general in the sense that if we add the restriction S(txsβ€²,X)=S(txs,X)S(\text{txs}', X) = S(\text{txs}, X) for any permutation txsβ€²\text{txs}' of txs\text{txs}, then we obtain the definition of a sequencing rule found in other works.

  • A sequencing rule SS is verifiable here means SS can be verifiable effectively within polynomial times

A sequencing rule defines what kind of ordering is acceptable and add restrictions to sequencers ordering of transactions. A good sequencing rule should be designed to achieves designer goal. In the next section, we use an example work to illustrate the initial version of our verifiable sequencing mechanism.

Taiyi V0's sequencing rule will be based on the verifiable sequencing rule proposed by Credible Decentralized Exchange Design via Verifiable Sequencing Rules.

Here is the gist of the rule:

Usually, a sequencer can extract MEV from user’s currency exchange transaction TT on a convex AMM pool PP by inserting sequencer’s own currency exchange transactions before and after TT. This is particularly profitable when the sequencer can use users’ transactions to significantly shift PP’s position from its prior state. In this context, the position of a liquidity pool is represented by a pair (m,n)(m,n), indicating the amounts of each currency in the pool.

This suggests that it may be beneficial to restrict the sequencer’s ability to significantly shift a liquidity pool’s position. In particular, the paper points out following key dichotomy:

Consider a pool PP’s prior position is (m0,n0)(m_0,n_0), where m0m_0 and n0n_0 are amounts of currencies C0C_0 and C1C_1, respectively. A buy is a transaction that sell C0C_0 for C1C_1, and a sell is a transaction that sells C1C_1 for C0C_0. Then for any position (m,n)β‰ (m0,n0)(m,n) \neq (m_0,n_0), exactly one of following is true:

  1. A buy at position (m,n)(m,n) buys more than it does at position (m0,n0)(m_0,n_0) if m<m0m<m_0

  2. A sell at position (m,n)(m,n) sells more than it dose at position (m0,n0)(m_0,n_0) if m>m0m>m_0

Based on this dichotomy, the paper suggests a greedy sequencing rule: when m<m0m<m_0, the next transaction on PP must be a buy unless no remaining buy transactions are available for sequencing; when m>m0m>m_0, the next transaction on PP must be a sell unless no remaining sell transactions are available for sequencing. Thus, the greedy sequencing rule requires oscillation around the convex AMM pool’s prior positions for as long as possible. Clearly, this greedy sequencing rule can be verified with linear time complexity, making it verifiable.

As for implementation, we will leverage zk-coprocessor, Axiom to verify transaction sequence according to the rule.

Last updated