Optimistic Rollups & EIP-4844: The catalyst for the Layer-1 Exodus
A Brief History of Scalability and Layer-2’s
Ethereum is a global Turing-complete state machine that is maintained by a network of consensus participants who are actors that validate the entire history of the chain and execute state transitions to update the ledgers state. Before the inception of layer-2’s such as Optimistic rollups and the zkEVM, the age old problem of the scalability trilemma resulted in the throughput of the underlying layer-1 to be severely limited providing incredible friction to mass adoption. The competition for blockspace only grew with adoption resulting in increasingly costly transactions that priced out the majority of network users. In order to understand the History of layer-2’s one must first understand the scalability trilemma to which the motivation for Layer-2 architectures becomes immediately apparent.
The Scalability Trilemma
The inherent scalability limitation of blockchains come from the fact that each node in the network is required to store and validate every network transaction. Hence why blockchains are the slowest database on the planet. Blockchains use peer-to-peer networking allowing participants to come and go as they please whilst being able to verify state updates since leaving the network, as decentralization was always apart of the core ethos. However, if a network wanted to increase the throughput, it would result in faster state growth. Each node would have increasingly high computational requirements to store the chain’s history and maintain its current state. As the computational hardware requirement increases, the number of consensus participants in the network that have the resources to participate decreases which is why decentralisation and scalability are inherently linked. One cannot simply increase throughput without sacrificing the decentralisation of the network.
The Layer-2 approach to the Scalability Trilemma
Given the underlying limitation on throughput as outlined in the scalability trilemma, what are the best way to tackle scalability? 1) Partition the layer-1’s state into shards that reduces the amount of computational resource for entire chain validation commonly known as sharding. 2) The layer-2 approach in which transactions are executed on an external computational layer that have the same security guarantees as being executed on the underlying layer-1 itself. It’s best to think of layer-2’s as an Information compression approach to scalability. Recognizing that not all transactions need to be published on the underlying layer-1, but instead we can submit cryptographic proofs of the state transitions that occurred on the external computational layer. The latter approach to scalability has been the primary focus for Ethereum scalability as outlined in the rollup-centric roadmap.
Optimistic, Zero-Knowledge rollups and the zkEVM
The term rollup is donated to the process of batching transactions together and providing a proof of the state transition that has occurred for those set of transactions. Instead of validating each transaction individually, we roll them up into a single verifiable proof. This is where the Information compression comes from as we significantly reduce the amount of bytes needed for transaction validation on Ethereum’s layer-1. Typically a transaction consists of 156 bytes with the digital signature being the most informationally dense part of the transaction. Layer-2’s remove the need to individually verify each transaction and instead using cryptographic proofs allow the verification for batches of transactions. There are two different forms of layer-2 architectures which we will outline below.
Optimistic Rollups
The term Optimistic rollup derives from the underlying economic game that is constructed for achieving transaction finality. To expand on this, every transaction in an Optimistic rollup isn’t immediately guaranteed its validity, it’s assumed ‘optimistically’ to be valid. Instead of providing a proof for each state change that occurs with every proposed block and their set of transactions, the state transition is assumed to be correct. There is a 7-day contestion period in which actors can contest a state update using fault proofs which are cryptographic proofs show the state transition was correct or incorrect. If a state transition is not contested within the 7 day limit, the state update is finalised into the optimistic rollups state history and is considered immutable.
Block production in Optimistic rollups is managed by the sequencer which constructs the layer-2 blocks (transaction ordering) and executes the state transition for the set of transactions within the block and finally submits the relevant data to Ethereums layer-1 so that data is available to reconstruct state for the fraud proving system. In their present form, Optimistic rollups have a single entity running the sequencer being the parent company developing the network as in Offchain Labs for Arbitrum and Optimism PBC for Optimism. This makes current Optimistic rollups incredibly centralised, trusting the block production to a single entity, but this was necessary in their guarded launch phase. As we exit the guarded launch phase the sequencer role will become decentralised allowing anyone to participate in layer-2 block production which also sets the foundation for layer-2 tokeneconomic models.
Zero-Knowledge Rollups
The key distinction between optimistic and zero-knowledge rollups is that zero-knowledge rollups provide a verifiable proof of the state transition where as optimistic rollups assume the state transition to be valid unless proven to be incorrect via fraud proof resolution. This is where the difference in finality periods comes from as zero-knowledge rollups just need to have the zero-knowledge proof verified on the layer-1 which takes around 45 minutes were as optimistic rollups need to undergo the 7-day contention period in order for a transaction to achieve finality.
The primary problem facing zero-knowledge rollups in their current form is firstly EVM equivalence and secondly proof times/costs. The first problems essentially means layer-2’s such as Starkware are not EVM compatible. This means that native Solidity code that represents EVM opcodes cannot be seamlessly ported to Starkware, but must instead undergo a rewriting of the codebase into their Cairo programming language. This poses significant developer overhead for protocols wanting to leverage the superior scalability offered by SNARKS/STARKS. The ultimate realized vision of zero-knowledge rollups is to achieve EVM equivalence. Secondly, the time and cost to produce validity proofs for state transitions is not fully optimized, but new zero-knowledge setups and zero-knowledge proof optimized hardware are working diligently to address this problem.
The zkEVM
The zkEVM is the holy grail of scalability solutions and also one of the single hardest engineering problems in the cryptocurrency space to date. The zkEVM is the goal of making the Ethereum Virtual Machine (EVM) fully integrate into an arithmetic circuit that is used to compute zero-knowledge proofs. Traditionally in zero-knowledge rollups, an custom arithmetic circuit is constructed for a programme whereby a zero-knowledge proof can be generated to show proof the computation was executed correctly. Instead of writing an arithmetic for every single programme which causes significant developer overhead, the zkEVM aims to fully implement every single opcode within the EVM so that any smart contract that operates inside the Ethereum virtual machine can have a proof-of-computation without having to write a custom arithmetic circuit.
The zkEVM requires many novel cryptographic techniques such as the zero-knowledge optimised cryptographic hash function called the Poseidon hash function, polynomial commitments, lookup tables, recursive zero-knowledge proofs and zero-knowledge optimised hardware to decrease proof times. There are several teams working on this such as Scroll, zkSync and Polygon all trying to create a EVM equivalent arithmetic circuit. The codebase for this scalability solution in its current state is extremely large and thus has a large attack surface. Hence, the zkEVM will have a long guarded launch phase to battle test the solution. Therefore, we expect in the immediate term optimistic rollups such as Arbitrum and Optimism to outperform the likes of Scroll and zkSync.
Modularity in Layer-2 Architecture
The Monolithic and Modular architecture debate has become prominent in the space since engineers realized that blockchains are composed of several interlinked systems each of which has its own purpose in the lifecycle of state updates to the ledger. Modular components adhere to the UNIX philosophy of software development in which software in batched into single purpose modules that do one function and do it well. These modules can be imported and reused by engineers which abstracts alot of the work load associated with programming and avoids repeating operations that have already been defined and tested. The same principle can be applied to blockchains and the best way to illustrate this is with the in-development Optimism Bedrock Architecture.
Optimism Bedrock
Optimism recently introduced their new Bedrock architecture which put forward the idea that layer-2 rollups can be thought of as a modular stack. Modularity offers numerous benefits in system design and future iterations which we will discuss below. But first what are the layers that contribute to the modular Bedrock architecture:
Consensus Layer
The consensus layer acts as the data availability layer which directs the current state and payloads to the execution layer. Data availability is paramount to the settlement layer as we will discuss below, but in summary in order for the fault proving system to work to attest state transitions, the attesters must be able to reconstruct the state transition with the historical state and payload. Without data availability you would not have the ability to attest potentially fraudulent state transitions compromising the security of the system.
Optimism Bedrock uses traditional Ethereum clients such as Geth and Prysm instead of the Optimistic Virtual Machine (OVM) which was previously used in their monolithic layer-2 architecture. Separating the consensus layer from the execution layer sets the groundwork for seamlessly integrating EIP-4844 which heavily relies on the consensus layer clients as we will discuss below.
Execution Layer
The execution layer is the virtual environment where smart contracts are executed and in the case of Optimism, the execution environment is the Ethereum Virtual Machine. This allow smart contracts already deployed on layer-1 to seamlessly deploy to Optimism without any modifications to the codebase. Allowing developers to leverage scalability without the prospect of developer overhead. The execution layer in summary is responsible for executing the state transitions which can be represented by the following:
STF(prev_state, payload) ⇒ next_state
When prev_state is the current state of the layer-2 and payload being the set of transactions included in the current block to produce post_state which is representative of the state after the payload has been executed inside the EVM.
Now that the execution layer is modular it means we can make changes to the execution environment without changes to the consensus or settlement layer. To illustrate why the above is so powerful, it means that we can create an optimistic rollup that does not operate on the EVM but can operate on a execution model such as Bitcoin’s UTXO. Essentially this means that Bitcoin can become a optimistic rollup on Ethereum.
Settlement Layer
The settlement layer is the layer in which transaction finality is achieved. In the case of Optimistic rollups, this is the fault proving system that is used to attest fraudulent state updates. The Bedrock architecture introduces a new fault proving system known as Cannon fault proving system. However, when you make the settlement layer modular it means the system used to achieve finality can be seamlessly changed. The Bedrock architecture actually sets the stage for Optimistic rollups to transition into zero-knowledge rollups by replacing the fault proving system with validity proofs.
EIP-4844
As outlined above Ethereum is pursuing a rollup-centric roadmap in the pursuit of scalability without sacrificing decentralization in the process. Optimistic rollups are the most production ready scalability solutions that have been operating on mainnet since December 2021. Zero-Knowledge rollups or more broadly the zkEVM suffer from non-EVM equivalence or only just now being deployed to mainnet and will go through the same guarded launch period with limited throughput as Optimistic rollups went through previously. Therefore, it is paramount in the Intermediate term that Optimistic rollups reduce the gas cost associated with posting data to layer-1 in order to increase throughput and lower gas costs for users.
In their current state, Optimistic rollups have cheap costs for layer-2 execution and storage but in order to comply with data availability,. the posting of data to layer-1 still remains costly for users. Data is published to Ethereums layer-1 using the calldata opcode, therefore both Arbitrum and Optimism have been implementing calldata compression algorithms such as Zlib and the brotli compression algorithm. In Optimisms Bedrock architecture the calldata compression actually approaches its theoretical limit meaning the L1 transaction costs have approached their absolute minimum before the implementation of EIP-4844.
EIP-4844 is an Ethereum Improvement Proposal that aims to change the way data is posted to Ethereums layer-1 via a new transaction type which is estimated to reduce layer-2 transaction gas fees by a minimum of 20x. The new transaction type is known as a ‘blob-carrying transaction’. Instead of posting data to the Ethereum layer-1 using calldata, the blob transaction is actually stored in the Beacon chain nodes consensus layer and persisted for around 14–30 days. In the case of Optimistic rollups, the data needs to be available for 7 days for the contestation period but once the transactions are finalised the blob data being used for data availability does not need to be persisted it can be wiped from the consensus node.
The original approach to EIP-4844 was to reduce the gas cost of the calldata opcode by 10x to making posting data to Ethereum’s layer-1 much cheaper. However, this would increase the average blocksize, increasing node hardware requirements and since the data is stored in the execution layer there is no form of pruning requiring nodes to store this data forever. Proto-danksharding instead stores the blob data in the consensus layer on the Beacon chain which is required to be downloaded by the consensus clients. This is commonly donated as ‘blob space’. Blob space is subject to data pruning after the time period for blob data storage has experienced for layer-2 data availability. This is much more maintainable for consensus clients that storing the data in the execution layer forever.
In summary, EIP-4844 is expected to be included in the Shanghai hardfork the very first hardfork post the Ethereum merge which will also enable the withdrawal of staked ETH on the Beacon chain and is expected to substancially reduce the cost of layer-2 transactions by a minimum of 20x. We expect EIP-4844 to be the true catalyst for the realisation and subsequent mass adoption of the Ethereum rollup-centric roadmap. EIP-4844 is the merge trade for Optimistic rollups. To flesh out why we think this we will outline our overall layer-2 thesis below.
The Layer-2 Thesis
After outlining the history of layer-2’s, different approaches in architectures and the upcoming EIP-4844 catalyst what can we derive from all of the above to form a succinct thesis to operate on:
Applying first principles analysis, users seek low transaction fees given the layer-1 rotation trade that occurred in the previous cycle which was driven by Ethereums core scalability limitation and its refusal to sacrifice the decentralisation of the network. We believe that the underlying layer-1 of Ethereum is destined to become the data availability for layer-2’s in which dispute resolutions for optimistic rollups occur and the submission of zero-knowledge proofs for zkRollups. Therefore, we can derive since users seek low transactions fees and the layer-1 will become a data availability/proof layer the amount of actual on-chain activity on the layer-1 is expected to decrease over time and trend towards 0.
At this present moment in time Ethereums TVL is at $23.95B whilst Optimism and Arbitrums TVL is sitting at $535.7m and $926.6m respectively. Since users seek low transactions fees and liquidity seeks users we can predict that over time capital will migrate from Ethereum layer-1 to some layer-2 network. EIP-4844 is a central catalyst to the layer-2 thesis that is predicted to reduce transactions fees on Optimistic rollups be a minimum of 20x. Post EIP-4844 we expect an acceleration in the exodus of capital to Optimistic rollups. Over a longer timeframe we are predicting that 70% of Ethereums layer-1 TVL will migrate to a layer-2 within the next 5 years. Additionally, we are expecting that layer-2s become the standard network to onboard new users and that new users will rarely interact with Ethereum layer-1 as the onboarding process matures from CEXs or third-parties.
A question central to portfolio construction post-merge is what assets outperform Ethereum? This is actually a difficult question to answer given the ~90% ETH issuance reduction and that periods of high network demand result in ETH becoming deflationary with the burning of the base fee in EIP-1559. In regards to other layer-1s, we currently view their tokenomics as being inferior with larger issuance for validators meaning more supply to hit the market annually. We feel that attention is now reverting back to Ethereum post the layer-1 rotation space and ultimately to its rollup-centric roadmap which is in the process of being fully realised and ready for the next phase of mass adoption. We feel that layer-2s will act to be strong beta on ETH and have the best probability outperforming ETH on an annual basis as outlined in the above first principles thinking.
The Future of Layer-2’s
Decentralising the Sequencer
At this present moment in time, layer-2 sequencers are centralised into the parties that have developed the network. The entities being Offchain labs for Arbitrum and Optimism PBC for Optimism. They are the sole operators of the sequencers making layer-2’s in their present form highly centralised. However, progressive decentralisation is very much advocated for these new computational layers with large attack surfaces in their initial guarded launch phase.
Decentralising the sequencer would most likely come through a proof-of-stake mechanism is which users would be able to stake the native L2 token with imposes slashing conditions for malicious behaviour in order to disincentivise the posting of incorrect state transitions which can always be attested and proved incorrect using the Cannon fault proving system. From here we can speculate on possible layer-2 tokenomics from decentralising the sequencer:
Transactions Fees: A portion of the transaction fees on the layer-2 can be directed to those who stake and participate in the sequencer which is a direct incentive to further decentralise the sequencer role.
MEV: Transactions can be reordered in layer-2 block construction to provide MEV services which a portion of the revenue can be distributed to the block producer.
Staking Rewards: Those that participate in the sequencer role will receive the L2 native token as a reward for honest behaviour. A portion of token inflation would be given to those who stake and participate in block production.
MEV Protection
There has been talks of eliminating bad forms of MEV such as front-running and sandwich attacks by implementing a timelock encrypted transaction mechanism that would shield transactions until they were validated and added into the proposed layer-2 block. The timelock encryption scheme works as follows:
1 — User encrypts transaction and generated a key w/ a time-lock puzzle.
2 — The tx + time-lock puzzle + validity proof are sent to the sequencer
3 — Sequencer verifies validity proof and includes encrypted tx first come first served basis.
4 — Sequencer solves timelock puzzle with key and decrypts the transaction
Explained simply the sequencer cannot see the content of the transaction hence cannot reorder transactions in a block to execute MEV to extract value from network users. This does increase the latency of confirmation times but eliminated bad MEV such as frontrunning and sandwich attacks in their entirety. zkSync has already expressed interest in this MEV prevention approach.
Layer-3 Appchains
Layer-2 modularity opens up the possibility of appchains. Projects now have the ability to deploy their own ‘opchain’ which inherits the sequencer of the original Optimism layer-2. Many different projects can create their own opchain resulting in a network of interconnected opchains known as the ‘superchain’. Since they will use the original layer-2 sequencer the opchains will be able to have completely cross-chain atomic transactions which is vital for opchain interoperability. The thesis for this type of architecture is that opchains or appchains in general do not want their performance effected by other DApps which happens frequently on Ethereum’s monolithic layer-1. Hence, these application specific rollups or sovereign chains as proposed by Cosmos actually has a place in the future.
Additionally, zkSync is developing ‘HyperChains’ that are customizable and trustlessly linked blockchains powered by zkSyncs layer-2 zkEVM scalability solution. Developers can customise their chain whilst inheriting from the security of Ethereum itself. Customisation can occur in the data availability solutions that power the HyperChain aswell as options such as on-chain privacy and aligning tokenomic designs with the chain itself. These layer-3 appchains are interconnected by ‘HyperBridges’. As we can see beyond the Cosmos ecosystem that aims to enable a whole ecosystem of interconnected sovereign chains, the Ethereum layer-2 scalability solutions are also heading in the same direction.
Summary
Layer-2’s are central to the scaling roadmap of Ethereum. The layer-1 rotation trade was a result of Ethereum’s inability to scale in time to accommodate for mass adoption. Optimistic rollups have now exited their guarded launch phase and continue to reduce transaction fees with calldata compression algorithms. EIP-4844 is the ultimate catalyst that will realise the immediate scalability of Optimistic rollups. Given the significant estimated reduction in layer-2 transaction fees we can expect a flight of users and liquidity to both Optimism and Arbitrum.
Ethereum is the undisputed largest smart contract blockchain with the largest developer community and the best developer tooling. We can expect these developers to port their existing DApps or newly developed DApps to an Optimistic rollup to reduce gas costs for their users. We expect over the next 3 years that the majority of on-chain activity will occur on Optimistic rollups and hence are well positioned for immense value capture as liquidity and on-chain activity leaves the underlying layer-1 in pursuit of a cheaper transaction environment.