Creating a Highly Scalable and MEV-Resistant DeFi Ecosystem Using Arbitrum and Fair Sequencing Services
The smart contract economy has created a large ecosystem of decentralized applications in only a few years time, supporting unique markets like decentralized finance (DeFi), Non-Fungible Tokens (NFTs), play-to-earn gaming, and many more. However, if the smart contract economy is to onboard the next billion users and become the dominant system of contractual agreements, it will need to both scale its transaction processing capabilities and maintain high levels of trust by minimizing the harmful effects of Miner-Extractable Value (MEV). In this post, we will explore Chainlink’s recommended solution for scaling smart contracts on Ethereum, Arbitrum, and how Arbitrum and Chainlink are together exploring solutions to create fairer smart contracts by eliminating MEV on Arbitrum.
There are many different approaches to scalability, with layer-2 solutions using a technology known as “rollups” emerging as a leading way to scale existing ecosystems like Ethereum. This is largely due to a rollups’ ability to achieve scalable transaction processing for existing smart contract code, while retaining composability with other dApps also written in languages like Solidity and providing the underlying security guarantees of the layer-1 Ethereum network.
Unfortunately, rollups are still subject to some forms of MEV that afflict layer-1 blockchains, equally limiting their trustworthiness. MEV is a byproduct of miners/sequencers being able to choose the order of transactions within blocks they produce, enabling them to manipulate transaction ordering to benefit themselves at the expense of others through techniques like frontrunning and sandwiching. MEV makes any time-order based process corruptible, greatly limiting a smart contract’s trustworthiness and limiting our industry from wider adoption.
In order to solve the problem of MEV to the maximum degree possible, the Chainlink team has been developing a solution: Fair Sequencing Services (FSS)—a decentralized transaction ordering service that makes the time-ordering of transactions fair and predictable for all users. By using FSS as a method for ordering transactions, the smart contract economy can simultaneously achieve scalability through the use of leading layer-2 rollups such as Arbitrum, and mitigate the trust eroding effects of MEV, if FSS is applied to that same Layer 2.
In the following blog post, we briefly describe rollup technology and its core advantages, explore the most widely used optimistic rollup as well as Chainlink’s recommended solution for fairly scaling your smart contracts on Ethereum, Arbitrum, and discuss how Arbitrum is exploring the integration of FSS to minimize MEV, restoring transaction order fairness.
What Are Rollups and Their Core Benefits?
Generally speaking, rollups move the computation required to execute user transactions from the layer-1 blockchain to an off-chain layer-2 network that performs it at a lower cost. Rollups then retain the security of the layer-1 blockchain they support by posting the transaction data and a condensed proof of its off-chain computation on the layer-1 blockchain where it can be disputed/invalidated.
In a slightly more technical sense, user transaction data involving potentially hundreds of independent transactions is bundled into a single rollup transaction that’s posted on the layer-1 blockchain. The nodes operating the rollup then generate a new state root—a cryptographic hash of the current state of the network—which is also posted onto the layer-1 blockchain as a claim backing their work. The claim is then verified to be legitimate either through a validity proof (generate a zero-knowledge proof) or fraud proof (retroactively prove a state root is incorrect). Validity proofs are associated with zkRollups whereas fraud proofs are associated with Optimistic Rollups.
In the case of Optimistic Rollups, after a claim is made, there is a dispute period (commonly one week) when anyone can post a fraud proof if they believe a state root is incorrect. If there is no fraud proof posted during this period, then the transaction is accepted as valid, hence the term “optimistic.” However, if a fraud-proof is created, then the transaction in question is either fully or partially executed on the layer-1 network to see if the result conflicts with the claim. If the results of the on-chain execution do not match the claim, that claim (state root) and any subsequent claims are reverted and the stake of the entity who made the claim is slashed. If the original claim is proven to be true, then the entity that raised a false alert is slashed.
Because all of the transaction data of an Optimistic Rollup is stored directly on the layer-1 network, anyone running a rollup node can generate the latest state of the rollup chain and post a fraud proof as needed. Through this design, there only needs to be one honest entity checking the state of an optimistic rollup network for user funds to be secured. If a user chooses to perform this work themself, they don’t need to trust any external entity for the safety of their funds. Additionally, this design allows users to force a withdrawal to the layer-1 blockchain at any time, meaning user funds can never get stuck on the layer-2 network.
The act of moving the bulk of the execution work off-chain and only storing a small amount of data on the layer-1 blockchain means layer-2 rollups provide a similar level of security for only a fraction of the costs. It is because of these advantages that rollups have become the scalability choice of blockchains such as Ethereum, ultimately enabling wider adoption as more users can afford to interact with applications and applications can run at near real-time speeds to cater to fast-moving markets.
Arbitrum’s Optimistic Rollup Protocol
The leading Layer-2 Rollup by operational track record, community size, and value secured is Arbitrum. Arbitrum has garnered significant interest from the wider cryptocurrency community because it has been one of the pioneers of rollup technology and is backed by a team of industry leaders. The Offchain Labs team, the development firm behind Arbitrum, consists of leading computer scientists in cryptography and blockchain technology, including former White House Chief Technology Officer Ed Felten and Princeton PhDs Steven Goldfeder and Harry Kalodner.
Some of the benefits for development teams deploying on Arbitrum include full EVM compatibility, meaning Arbitrum can run unmodified Solidity smart contracts and execute Ethereum-style transactions using existing tooling and infrastructure. Arbitrum is also highly scalable with minimal transaction cost because it uses the Optimistic Rollup model of moving contract computation and state storage off-chain.
Arbitrum rollups use an innovative interactive fraud proof mechanism as a highly efficient and low-cost way to prove fraud on the layer-1 blockchain. Arbitrum’s interactive fraud proof design involves a back-and-forth protocol refereed by a layer-1 contract, which dissects the dispute into a one-step computation that is executed on the Ethereum network as opposed to higher-cost alternatives like re-executing the entire transaction in question. Arbitrum’s approach leads to some powerful properties such as allowing for a much higher per-transaction gas limit compared to Ethereum, as well as removing limits on the size of a smart contract on Arbitrum.
Importantly, these scalability features are achieved in a highly trust-minimized manner in regards to its relationship with Ethereum L1—this reason being that Arbitrum’s security is rooted in Ethereum, allowing any one party to ensure correct layer 2 results. By not compromising on security to achieve scale for Ethereum smart contracts, the smart contract ecosystem as a whole can scale with ease and support more advanced applications. You can learn more by reading the Arbitrum Protocol Deep Dive. In addition to integrating support for Chainlink Price Feeds, numerous leading DeFi projects have already launched on the Arbitrum One network. The growing ecosystem of dApps on Arbitrum One can be explored today using the Arbitrum Portal.
Reducing MEV With Fair Sequencing Services
As a continuation of the collaboration between Offchain Labs and Chainlink Labs, both teams are working on minimizing MEV by exploring the application of Fair Sequencing Services (FSS)—a decentralized transaction ordering solution to mitigate the detrimental effects of MEV. FSS uses decentralized oracle networks which include Chainlink nodes to collect user transactions off-chain, generate decentralized consensus for transaction ordering, and submit the ordered transactions using the Arbitrum protocol, in a decentralized way. We’re incredibly excited to be working with Offchain Labs on discovering how FSS helps decentralize the Arbitrum sequencer and brings MEV to a minimum.
As explored by Chainlink Labs Chief Scientist Ari Juels in his recent presentation at SmartCon 2021, FSS is planning deployment in two phases. The first phase involves secure causal ordering (atomic broadcast), where user transactions are first encrypted by users to hide transaction details, ordered by a decentralized oracle network, and then decrypted for execution by the Arbitrum protocol. Thus, the transaction payload will not be visible to nodes before the ordering process begins, removing the ability to front-run transactions based on early visibility.
In phase two, which is the focus of the Arbitrum collaboration, Aequitas ordering (consensus) protocols (co-authors include Chainlink Labs’ Ari Juels and Arbitrum’s Steven Goldfeder) will be implemented into FSS for transaction ordering based on supermajority receive time. This helps enforce a first-in, first-out (FIFO) ordering policy, and when combined with transaction encryption from phase one, provides a defense-in-depth solution for the fair ordering of user transactions. The technology making FSS possible is further explored in-depth within section 5 of the Chainlink 2.0 whitepaper.
Ultimately, the combination of FSS together with the Arbitrum protocol would help provide users a greater degree of assurance that the ordering of their transactions won’t be manipulated, such assurances become increasingly important as more dApps deploy on Arbitrum One and the network’s total value locked rises. Additionally, FSS would increase the reliability of the Arbitrum protocol by creating a decentralized sequencer, minimizing risk of downtime. This ideal combination of Arbitrum’s leading Layer-2 Rollup capabilities and the transaction fairness provided by FSS, makes Arbitrum Chainlink’s recommended solution for scaling Ethereum to billions of users worldwide, across all dApps.
“Decentralizing the sequencer of the Arbitrum protocol has been a long-term goal of ours to increase trust-minimization and provide users strong guarantees for minimizing MEV. We’re thrilled to explore implementing FSS into Arbitrum through a long-standing collaboration with Chainlink Labs, which has a very experienced team, academic-research focused approach, and proven success in bootstrapping secure and reliable oracle solutions for high-value smart contracts,” stated Steven Goldfeder, Co-founder of Offchain Labs.
“We’ve been impressed with the launch of Arbitrum One, which gives the existing Ethereum ecosystem a much-needed scaling solution that is easy to integrate while maintaining the security properties of Ethereum L1. Chainlink Labs has been engaged in a long-term collaboration with Offchain Labs around exploring the integration of FSS into Arbitrum because of the team’s technical expertise and academic research-based approach. We’re excited to set a new industry standard in fair and decentralized transaction ordering and empower developers to build highly scalable, MEV-resistant smart contract applications,” stated Sergey Nazarov, Co-founder of Chainlink.