A Deep Dive into Application-Specific Sequencing
A Deep Dive into Application-Specific Sequencing
A Deep Dive into Application-Specific Sequencing
A Deep Dive into Application-Specific Sequencing
A Deep Dive into Application-Specific Sequencing
Special thank you to @ThogardPvP & @jacobeth4 from @0xFastLane, @ballsyalchemist from @sorella_labs, and @DariusTabai from @vertex_protocol for reading early versions of this article and providing feedback.
Introduction
As blockchain technology matures, decentralized applications (dApps) face increasing challenges in managing transaction sequencing to optimize user experience, value retention, and security. Traditional blockchain architectures often leave dApps at the mercy of external actors—such as miners, validators, searcher-builders —who control transaction ordering and inclusion. This lack of control can lead to value leakage, unfair user outcomes, including vulnerabilities to malicious behaviors like front-running or sandwich attacks.
Application-Specific Sequencing (ASS) emerges as a pivotal innovation, granting dApps greater control over the inclusion and ordering of transactions affecting their state, without the overhead and loss of asset composability of having to build and maintain their own appchains. By customizing sequencing mechanisms to their specific needs, dApps can mitigate negative externalities, internalize value, and enhance overall system efficiency. However, implementing ASS does come with complex trade-offs, particularly between composability and value capture, and raises critical questions about infrastructure design and incentive structures.
This article explores the nuances of ASS, synthesizing insights from current projects, and examines the inherent trade-offs in this design space. Our goal is to provide a comprehensive view for researchers and developers to further investigate and optimize ASS mechanisms.
Background: The Sequencing Spectrum
Importance of Transaction Sequencing
Sequencing of transactions directly impacts value flows, user experience, and security.
- Value ownership and flow: The sequencer (generic) plays an important role in how assets are transferred and who gains control over them.
- User experience: Affects transaction confirmation times, fees, and predictability.
- Transaction integrity and fairness: Influences vulnerability to MEV extraction and manipulative practices.
The Role of MEV in Transaction Sequencing
MEV refers to the profit miners or validators or other extractors can make via reordering, including, or excluding transactions within the blocks they produce. MEV extraction often comes at the expense of users and liquidity providers (LPs), leading to value leakage from the dApp ecosystem and undermining user trust. Common forms of MEV include arbitrage, liquidations, sandwich attacks, and time-bandit attacks.
Sequencing Mechanisms Today
Transaction sequencing decides the order in which blockchain transactions are processed. Different methods aim to improve performance, fairness, and security. The main mechanisms used today are:
- Proposer-Builder Separation (PBS) with Relays
- What it is: PBS separates the roles of block proposers (validators) and block builders. Builders create blocks that maximize profit via harvesting MEV, while relays securely pass these blocks to proposers.
- How it works: Proposers auction off the block proposing rights through relays. Builders assemble blocks, relays deliver them securely, and proposers choose the most valuable block to add to the blockchain.
- Pros: Optimized block construction, higher validator revenue.
- Cons: Risk of builder/relay centralization and trust in relays, added complexity.
- Sequencers with Priority Fees or First-Come-First-Served (FCFS)
- What it is: In Layer 2s and appchains, sequencers order transactions by priority fee or arrival time (FCFS).
- How it works: Sequencers collect transactions; high-fee transactions are processed first or in the order in which they arrive to the sequencer
- Pros: Better performance, simpler design, FCFS changes MEV to latency games
- Cons: Centralized sequencers can manipulate transaction ordering, leading to MEV exploitation.
- Application-Specific Sequencing (ASS)
- What it is: dApps control how their own transactions are ordered to reduce MEV risks and improve user experience.
- How it works: dApps set rules for transaction order, preventing manipulative tactics like front-running.
- Pros: Better security, user experience, control over MEV, and retains composability as compared to being on your own app chain.
- Cons: Less interoperability, added complexity, possible centralization.
Incentives and Challenges for dApps
dApps desire control over their own fee markets to prevent congestion spillover and maintain predictable costs. They also aim to capture MEV generated by their platforms. Shared sequencing complicates these goals due to merged fee markets and difficulties in fee redistribution.
Application-Specific Sequencing as an Alternative
For dApps that do not wish to use off-chain execution methods (like offloading to Layer 2 or Layer 3 networks), ASS provides a valuable alternative. ASS enables these dApps to enjoy the significant benefits of self-sequencing—including mitigating MEV risks, optimizing user experience, aligning incentives, and shielding from external congestion and spam—while keeping their application execution logic on their chosen execution layer.
Let's dive further into the new category of emergent sequencing designs.
Application-Specific Sequencing Frameworks
FastLane's ASS Framework
FastLane’s ASS Spectrum framework illustrates the balance between composability and value capture, showing how different sequencing approaches impact an application's ability to interact with others and internalize value.
- High Composability vs. Value Capture: dApps that prioritize seamless interactions with other applications (high composability) may sacrifice some control over transaction sequencing, making them more susceptible to MEV attacks and less able to capture value internally.
- Low Composability vs. Value Capture: dApps that limit interactions with others gain more control over transaction ordering, allowing them to better protect against MEV exploitation and capture more value. However, this can reduce interoperability and potentially affect user experience.
- This tradeoff exists because the transaction ordering is determined within a separate mempool. The ASS orderer and bundler do not have knowledge of other transactions nor their state and therefore cannot provide atomic composability guarantees.
- Finding the Right Balance: Each dApp must consider its priorities and choose a sequencing approach that balances the need for composability with the desire to internalize value and protect users. This involves strategic decisions about how much to interact with other applications and how to structure transaction processing to optimize security and functionality.
Examples
- Highly Composable dApp: A lending platform that integrates with multiple other dApps to offer a wide range of services, accepting that it cannot fully control transaction sequencing but provides a rich user experience.
- Low Composability dApp: A decentralized exchange that focuses on securing transactions within its own platform, preventing MEV attacks by controlling transaction ordering, but offering limited interoperability with other applications.
Use Cases
Backrun Arbitrage and OEV
- Oracle Extractable Value (OEV) refers to the value that dApps can capture by controlling the sequencing of transactions that rely on external data from oracles. By managing the order in which these transactions are processed, dApps like API3 or Warlock can optimize the use of oracle-provided information, preventing external actors from manipulating transaction outcomes to extract value.
- The value captured through OEV is redistributed to various stakeholders within the ecosystem, including: dApp, users, and LPs.
Rollup-Based Solutions
- Leveraging layer 2 solutions or app-specific chains optimizes performance and reduces costs. DApps gain extensive control over sequencing and execution parameters but may face challenges with isolation, security considerations, and bootstrapping liquidity, middleware integrations.
Anti-LVR Auctions
- Implementing mechanisms to mitigate Loss Versus Rebalancing (LVR) refunds LPs from value lost to arbitrageurs. By adjusting transaction ordering, dApps internalize a portion of LVR value which they can then redirect to passive LPs and enhance.
Strategic Considerations for Developers
When positioning applications on the ASS spectrum, developers must consider:
- Application goals: Balancing user experience, revenue objectives, and security priorities.
- Technical constraints: Infrastructure availability and development resources.
- Ecosystem dynamics: Market expectations and competitive landscape.
- Regulatory factors: Transparency requirements and risk management.
Application-Specific Sequencing: Current Landscape
FastLane’s Atlas Protocol
FastLane’s Atlas Protocol simplifies the deployment of custom Order Flow Auctions (OFAs), enabling developers to implement application-specific sequencing with ease.
Motivation Behind Atlas
Existing OFAs, such as solver dominance and opaque MEV supply chains, present centralization risks. Atlas aims to provide default MEV protection without requiring users to change their RPC settings, targeting unsophisticated users who need protection the most.
How and Why Existing OFAs face centralization risks
Existing OFAs face centralization risks mainly because of:
- Solver dominance
- How: A few solvers handle most transactions (e.g., in UniswapX, top 3 solvers manage 80-90% of volume).
- Why it’s risky: This leads to less competition, higher fees, and limits innovation, much like rent-seeking behavior in traditional finance.
- Opaque MEV supply chains
- How: Centralized solvers control how much MEV is captured and can manipulate transaction ordering.
- Why it’s risky: Lack of transparency makes it hard to know if the system is fair, allowing censorship and manipulation.
- How Atlas Fixes This
- Through permissionless access, gas escrow requirements for solvers, randomized sequencer selection, open protocol specifications, and decentralized order relays, Atlas fosters a competitive and fair ecosystem.
- These measures not only reduce the dominance of a few solvers but also ensure that the MEV extraction process is transparent and equitable.
- Additionally, aligned economic incentives and robust governance frameworks further safeguard the network against manipulation and censorship, promoting a sustainable and innovative DeFi environment.
- Increases transparency: Makes the MEV process more transparent, ensuring fair distribution and reducing the risks of manipulation through open auction mechanisms, decentralized solver participation, clear distribution policies, monitoring and auditing tools, and community governance.
Atlas also protects users without requiring complex setup changes, especially benefiting those who aren’t aware of MEV risks.
Atlas Protocol not only decentralizes solver participation and increases transparency but also incorporates advanced mechanisms like multiple bundle submissions and programmatic selection by the EntryPoint smart contract. These features collectively ensure that users are protected from MEV risks and transaction manipulation without the need for complex configurations. By automating fair and secure bundle selection, Atlas provides a robust and user-friendly environment that upholds the principles of DeFi.
Atlas Architecture
Atlas includes:
- EntryPoint Contract: This smart contract orchestrates the entire transaction flow. It manages user and solver operations and ensures that the correct bundle bid is selected and executed, guaranteeing the proper sequence of actions.
- SDK: Simplifies integration with the protocol.
- Key Roles:
- Originator - Initiates the Atlas process by generating a UserOperation, a smart contract call or EIP-712 signed message representing the user's intent.
- Auctioneer- Aggregates UserOperations with SolverOperations, sorts them using a bid valuation function defined in the DAppControl module, and ensures the correct execution order.
- Operations Relay - Facilitates communication between originators, auctioneers, and solvers. This can be a traditional relay, an L3, or even a smart contract on the same network as the application.
- Bundler - Packages the full Atlas transaction and submits it to the network for inclusion in a block.
- Solver - Competes to provide the best execution for a given UserOperation, potentially capturing MEV for the benefit of users or applications.
- Execution Environment: Secure operation execution using delegateCall and Permit69.
- atlETH: Wrapped ETH for value transfer and gas management.
- DAppControl Contracts: Define application-specific logic and parameters.
In FastLane’s Atlas protocol, the Bundler can be run by:
- Anyone (Permissionless): Any entity can act as a bundler, allowing for a decentralized system.
- Designated Entities: A smart contract (such as a batch aggregator), a trusted entity, or a group chosen by the application can bundle transactions.
- Self-Bundling: The originator (user) or solver can bundle and submit their own transactions.
- Secure Solutions: Advanced setups using secure environments (like TEEs) ensure bundlers can’t tamper with transactions.
The CallChainHash guarantees that bundlers can’t change the order of operations, keeping the process secure.
Technical Mechanisms
- CallChainHash: A cryptographic hash that secures the transaction order, ensuring that operations can’t be altered by intermediaries once they are signed.
- Permit69: A security feature that verifies the origins of token transfers within the Execution Environment, preventing unauthorized transfers.
- Native Bundling: Multiple operations are aggregated into a single transaction for atomic execution, helping to prevent MEV manipulation and ensuring that all steps occur as intended.
Handling MEV and Backrun Auctions
- Intent-Centric auctions: Users submit intents, and solvers compete to fulfill them efficiently, capturing MEV for the benefit of users or applications.
- Backrun auctions: Solvers attach backruns to extract MEV or OEV, with value shared according to application policies.
- Batching auctions: Solvers compete to sequence a batch of UserOperations in the most measurably efficient manner, as defined by the DAppControl’s bid valuation function.
- “Top of Block” auctions: For DApps willing to reduce composability to internalize exogenous MEV (such as LVR), Solvers compete to be the first to interact with the application each block.
Handling Flashloans in Atlas Protocol
Atlas Protocol features an integrated, Atlas-native cross-operation flashloan system designed to enhance the flexibility and efficiency of decentralized financial operations. Within Atlas, smart contract hooks can initiate flashloans by invoking the borrow() function before the solver phase of the transaction lifecycle. This seamless integration allows originators to access liquidity without needing to hold gas tokens, facilitating transactions that interact with smart contracts dependent on the msg.value parameter.
Additionally, these flashloans serve as collateral to support and manage multi-stage settlements during the atomic creation and sale of structured products or derivatives between originators and solvers.
By embedding flashloan capabilities directly into the Atlas framework, the protocol enables complex financial strategies while ensuring secure and efficient transaction sequencing. This design not only streamlines capital utilization for users but also maintains the integrity and robustness of the DeFi ecosystem by preventing common flashloan exploits and ensuring fair value distribution among all stakeholders.
Security and Trust Minimization
- Immutable Sequencing: Atlas uses CallChainHash, a cryptographic hash, to ensure transaction orders remain unaltered, preventing intermediaries from tampering with the sequence.
- Secure Execution Environment: The EntryPoint Contract manages operations securely using delegateCall and Permit69, which verifies token transfers and blocks unauthorized access, safeguarding user assets.
- Solver accountability: Solvers must escrow funds in atlETH to cover gas fees, promoting honest behavior and discouraging spam or malicious actions since they bear the cost of failed transactions.
- Decentralized solver competition: A market of solvers competes to execute user operations, reducing reliance on any single entity and minimizing trust assumptions.
- MEV mitigation: By controlling transaction sequencing at the application layer, Atlas mitigates MEV risks like front-running and sandwich attacks, protecting users from value extraction by external actors.
- Atomic Execution: Atlas enables atomic execution of operations, ensuring that either all operations succeed or none do, maintaining consistency and security.
- Transparency: Open-source code allows community auditing and verification, enhancing transparency and reducing the need for users to trust the system blindly.
- Customizable Security: Developers can define custom execution logic and security settings through DAppControl modules, tailoring security features to their application’s specific needs.
Integration Steps
- Embed the Atlas SDK: Developers incorporate the SDK into their application to interact with the protocol.
- Create and Publish a DAppControl Module: Define the custom logic, permissions, sequencing rules, and parameters for transaction processing.
- Initialize the DAppControl Contract: Link the application’s DAppControl module to the Atlas EntryPoint contract and configure the necessary settings.
Sorella Labs' Angstrom
Sorella Labs introduces Angstrom, a fully permissionless hook that implements application-specific sequencing. Currently on Uniswap V4, they are integrated with decentralized ASS.
The LP Dilemma
LPs provide liquidity to DEXs, enabling users to trade assets. However, they often face:
- Adverse selection: LPs are unaware of real-time CEX prices and provide quotes that may be stale, making them vulnerable to arbitrage.
- LVR losses: LPs incur losses when arbitrageurs exploit price discrepancies between the DEX and CEX.
The Attribution Problem in MEV
The attribution problem refers to the difficulty in identifying the specific parties affected by MEV extraction and ensuring they are appropriately compensated. Current blockchain architectures lack the granularity to:
- Trace MEV sources: Pinpoint which users or LPs are adversely affected.
- Redistribute value fairly: Allocate MEV profits back to those who incurred losses.
Addressing MEV Problems
Angstrom uses competitive the top of bundle and LVR auctions, batch auction mechanisms, and integrates searchers to create a market for LVR. This allows LPs to recover losses from adverse selection, swappers to receive optimal execution, and searchers to access arbitrage opportunities.
How Angstrom Works
- Stakeholders:
- Liquidity Providers (LPs): Provide liquidity and are compensated for LVR losses.
- Swappers: Execute trades with guaranteed execution and MEV protection.
- Searchers: Arbitrageurs who bid in LVR auctions, contributing to LP compensation.
- Angstrom nodes: Construct optimal bundles and earn protocol fees.
- LVR auction mechanism: Ensures competitive bidding and directs value back to LPs.
- Settlement timeline: From order submission to trade settlement, ensuring deterministic and fair execution.
- Bundle exclusivity: Atomic bundles executed in a specific order, preventing value leakage and reducing censorship incentives.
Technical Details
- Ensuring arbitrage opportunities: Angstrom's construction ensures arbitrage exists whenever there's a price delta between the DEX and CEX.
- Limit orders and uniform clearing price: Transient limit orders are executed at a single clearing price, minimizing slippage and preventing market order attacks.
- Angstrom Network Architecture:
- Nodes: Gossip, cache, verify orders, and construct optimal bundles.
- Bundle Lifecycle: Includes gossip, pre-proposal, and submit phases.
- Incentives: Competition among searchers drives value to LPs; nodes earn rewards and can be slashed for dishonest actions.
Benefits and Impact
- Democratizing arbitrage: Reduces the influence of high-frequency traders and promotes a competitive landscape.
- Neutralizing proposer timing games: Eliminates timing advantages and simplifies consensus.
- Stakeholder Benefits:
- LPs: Recover losses and are incentivized to provide liquidity.
- Swappers: Receive fair prices with MEV protection.
- Searchers: Access profit opportunities without excessive bribes.
- Nodes: Earn rewards and contribute to decentralization.
Security and Trust Minimization
Sorella’s Angstrom enhances security and minimizes trust requirements through application-specific sequencing, directly addressing vulnerabilities associated with MEV.
- Eliminating MEV exploitation: Batch auctions with uniform clearing prices prevent front-running and sandwich attacks by settling trades at a single price. Transient one-block limit orders further reduce MEV extraction by minimizing exploitation windows.
- Trust minimization through decentralization: Permissionless participation allows anyone to run a node or act as a searcher, enhancing decentralization and reducing reliance on central authorities. Node operators re-staked and staked native tokens, aligning their incentives with network security; dishonest behavior results in slashed stakes, discouraging malicious actions.
- Censorship resistance: Atomic bundle execution reduces incentives for miners or validators to censor transactions by executing them in a predetermined order. Decentralized order relay eliminates centralized intermediaries, reducing the risk of censorship or manipulation. The decentralized order relay is achieved through a network of node operators who participate in peer-to-peer broadcasting of orders, collective verification, and consensus on transaction inclusion. By requiring over ⅔ of the network’s signatures and preventing any single node from controlling the order flow, Angstrom enhances censorship resistance and reduces the risk of manipulation.
- Protection against market manipulation: Limit orders and uniform clearing prices prevent attackers from manipulating prices through large orders, ensuring fair execution for all participants. Arbitrage profits from searchers are redirected to compensate liquidity providers for adverse selection losses.
- Secure and transparent auctions: Competitive, permissionless auctions promote fair market dynamics and reduce collusion risks. MEV is accurately attributed and redistributed to affected parties, enhancing fairness and trust.
- Economic incentives aligned with security: Rewards for node operators incentivize honest participation and contribute to network security. Searchers profit without excessive bribes, encouraging compliance with protocol rules. Users and liquidity providers receive fair compensation and MEV protection, fostering trust and engagement.
- Resilience against attacks: Staking requirements deter Sybil attacks by increasing the cost of creating multiple identities. Fault tolerance ensures network functionality even if some nodes fail or act maliciously. Efficient order handling mitigates denial-of-service attacks by reducing the effectiveness of attempts to overwhelm the network.
- Minimizing trust assumptions: Transparency through open-source protocols and auditable processes allows participants to verify security properties independently, reducing reliance on trust. Internalizing MEV opportunities reduces dependence on external systems, minimizing potential vulnerabilities.
Vertex Protocol
Vertex is a perp and spot DEX. It employs application-specific sequencing through an off-chain sequencer to optimize performance and minimize MEV risks.
Key Features
- Hybrid liquidity model: Combines a central limit order book (CLOB) with an integrated AMM, enhancing liquidity utilization.
- Application-Specific Sequencing: Off-chain sequencer achieves order-matching latency comparable to top-tier centralized exchanges.
- Universal cross-margining: Allows users to manage multiple positions from a single account, enhancing capital efficiency.
- Vertex Edge: Extends liquidity across multiple chains, addressing liquidity fragmentation.
Addressing Challenges
Vertex addresses DeFi challenges by:
- High performance: Off-chain sequencer enables real-time trading experiences essential for high-frequency traders and better price discovery
- MEV mitigation: Minimizes exposure to front-running and sandwich attacks by handling operations off-chain.
- Capital efficiency: Cross-margining reduces collateral requirements and supports complex trading strategies.
- Liquidity aggregation: Vertex Edge unifies liquidity pools across chains, reducing slippage and market impact.
Capturing Value for Users
Users benefit from:
- Performance improvements: Reduced slippage and improved execution quality.
- Cost savings: Lower gas fees and minimized MEV exposure enhance net LP returns.
- Access to liquidity: Aggregated liquidity provides deeper markets.
- Flexibility: Integrated services streamline the user experience.
Security and Trust Minimization
- Mitigating MEV exploitation: By processing orders off-chain with an off-chain sequencer, Vertex reduces exposure to MEV attacks like front-running and sandwich attacks, since transactions aren’t publicly broadcast before execution. Low-latency execution (5–15 milliseconds) further minimizes the window for potential attackers to exploit transaction information.
- Trust minimization: The sequencer regularly commits batches of transactions to the blockchain, ensuring transparency and allowing users to verify that off-chain operations align with on-chain records. Through a non-custodial design, users retain control of their assets, eliminating the need to trust centralized intermediaries.
- Protection against manipulation: Transparent order books provide users with real-time market data, reducing the potential for price manipulation. Secure state synchronization ensures the sequencer maintains accurate alignment with the on-chain state, preventing inconsistencies that could be exploited.
- Economic incentives aligned with security: Incentive structures align participants’ interests toward maintaining a secure and fair trading environment. Risk management protocols—including real-time monitoring and automatic margin checks—protect the system from excessive risk and potential defaults.
- Resilience against attacks: Sharded state management enhances scalability and reduces the attack surface in cross-chain operations. Advanced synchronization techniques such as off-chain parallel processing of orders, atomic cross-chain transactions, efficient cross-chain communication protocols and more frequent state consistency checks may mitigate latency and prevent timing-based attacks during cross-chain transactions.
- Minimizing trust assumptions: Open-source code allows users to audit and verify the protocol’s security, reducing the need for blind trust.
Security Considerations
While Vertex Protocol offers impressive performance and innovative features, its reliance on an off-chain sequencer introduces certain security concerns:
- Sequencer misbehavior: The off-chain sequencer handles order matching, which could potentially allow it to engage in unfair practices like front-running or trading against users. This is akin to MEV exploits, where privileged entities profit at the expense of regular users.
- Censorship risks: Since the sequencer controls which transactions are processed, there’s a possibility it could censor specific users or transactions, undermining the platform’s neutrality and censorship resistance.
- Fairness in order matching: Without full transparency into the sequencer’s operations, users may question whether orders are matched fairly and in the correct sequence. Ensuring that the matching process is transparent and verifiable is essential for maintaining trust.
Alignment with Base Layers
Vertex aligns incentives with underlying networks by settling trades on users' origin chains, increasing network activity and benefiting validators. Vertex Edge fosters collaborative growth among connected networks.
Semantic Layer
Semantic Layer enables dApps to implement Verifiable Sequencing Rules (VSR) and Verifiable Aggregation Rules (VAR), giving them control over transaction sequencing and execution. This allows dApps to:
- Observe Transactions: View user transactions before execution.
- Enforce Execution Policies: Implement custom rules and real-time circuit breakers.
- Autonomously Execute Functions: Reduce reliance on external triggers.
By empowering dApps with sequencing sovereignty, Semantic Layer mitigates MEV leakage and opens possibilities for innovative designs, such as AI-powered applications and execution layer independence.
Conclusion
Application-Specific Sequencing represents a significant advancement, allowing dApps to balance composability and value capture according to their needs. By granting control over transaction sequencing and execution, ASS enables dApps to mitigate MEV risks, optimize operations, and innovate.
Projects like FastLane's Atlas Protocol, Sorella Labs' Angstrom, Vertex Protocol, and Semantic Layer showcase diverse approaches to implementing ASS. Each addresses unique challenges and offers solutions tailored to their objectives, contributing to a richer and more resilient decentralized ecosystem.
Application-Specific Sequencing will play a crucial role in empowering dApps to achieve greater sovereignty, efficiency, and fairness, driving broader adoption and innovation in decentralized applications.
Our goal at Eclipse is to become the best platform for dApps, treating them as first-class citizens. We’re committed to supporting any infrastructure that helps dApps accrue value and offers customization. By building robust tools around Application-Specific Sequencing (ASS) and MEV redistribution, we aim to make it easier for developers to create, deploy, and sustain ASS-based dApps.