top of page
Search

Layer Cake


“Rollups are primed to be Ethereum’s major scalability solution for the foreseeable future.”

Vitalik Buterin

The time has come.

TLDR

  • Rollups are the next generation of Layer 2 technology that will scale Ethereum to its full potential.

  • Transactions that are sent to the Ethereum network are executed off-chain by rollups and sent back to Ethereum allowing for greater scalability (increased throughput & cheaper gas fees).

  • Two types of rollups: Optimistic and ZK rollups.

  • Optimistic and ZK rollups are different and will work in parallel with Ethereum but one will always seem to outshine the other.

  • Total value locked in rollups smart contracts $6.34 billion.

Many layer 2 protocols are competing for the throne-read below for our top picks.


Disclaimer: Not financial nor investment advice. Any capital-related decisions you make is your full responsibility and only you are accountable for the results.

“You’re born, you take shit. You get out in the world, you take more shit. You climb a little higher, you take less shit. Till one day you’re up in the rarefied atmosphere and you’ve forgotten what shit even looks like. Welcome to the layer cake son.”

Villians Wiki who plays the role of “Eddie Temple” in the film “Layer Cake”.

The link between the above quote and the article is that “in crypto, those who want to go higher up must increase their cognizance about this market, how it works and how to take advantage of the opportunities. In this case, understanding the models of the different types of L2s and where they are in their development. This puts you ahead of most people because you’d already know who’s winning over the short term and who’s winning over the long term.

Hello PoF, glad you have made it to the second part of our “L2 thesis”; so sit back, relax and enjoy the ride!

This Research Report is longer and slightly more complex than others as we go all of the details relating to Layer-2s for a full explanation. We explore the different types, pros and cons, their mechanisms and on that basis we conclude which are likely to dominate.


What are Rollups?

Rollups execute transactions outside of the main Ethereum network and send the final data back to Ethereum once done for it to be entered into the immutable ledger. Rollups are secured by native Ethereum security because transaction data is included in layer 1 blocks. When it comes to scaling Ethereum through rollups; majority of the data is executed off-chain in a “layer 2 protocol” while preserving some data on-chain for verification. Rollups deploy smart contracts on-chain that are responsible for deposits, withdrawals and for verifying proofs. By executing transactions off-chain, less gas is consumed, resulting in lower gas fees and higher throughput (i.e. better scalability).


Rollups Mechanics

There is a smart contract on-chain which maintains the state of each rollup (meaning, the account balances, contract code, etc, that are “inside” the rollup).

  1. Transactions are executed off-chain; data is taken from the main chain, compressed and rolled up to the main chain, hence the name rollups.

  2. Any verifier can publish a batch on-chain, which is a collection of transactions in a highly compressed form together with the previous state and the new state of the on-chain smart contract.

  3. Finally, the on-chain smart contract checks that the previous state in the batch matches its current state; if it does, the batch is stored on-chain, updating the state of the smart contract.

These compression tricks are critical to rollup scalability; without them, rollups wouldn’t be an improvement over the main chain’s scalability. Each batch can contain up to 62,500 transactions, so each rollup would be able to scale 1000-4000 TPS compared to Ethereum 15 TPS on a good day. Another thing that rollups do is that they try to replace as much data as they can with computation. Moreover, rollups are completely general-purpose, meaning that anyone can submit a batch on-chain and you can even run an EVM inside a rollup, allowing existing Ethereum dApps to transition to rollups with little to no recoding. An Ethereum base layer ERC-20 token transfer costs around 45,000 Gwei (gas) which is the equivalent of $0.12. On the other hand, an ERC-20 token transfer in a rollup costs under 300 Gwei which is the equivalent of $0.0008.


That’s all there is to it! except for one crucial detail: how do you know if the batch stored has the correct information (post-state)? This question is crucial since there are two distinct answers to the problem, which results in two distinct rollup flavors!


Optimistic Rollups

Optimistic rollups assume that all transactions are valid and submit batches without performing any computation whatsoever, hence the name optimistic which can lead to significant improvements in scalability. However, they include a challenge period during which anyone can dispute the legitimacy of the data contained in a batch.

If a fraudulent transaction is detected, the rollup executes a so called fraud proof and runs the correct transaction computation using the data available on Layer 1, this process requires gas. To ensure that validators are incentivized to process only legitimate transaction data, validators are required to stake ETH. If they perform their duties diligently they receive staking rewards, but if a validator submits a fraudulent transaction to the main Ethereum chain, their stake is burned.

Therefore withdrawals through optimistic rollups from L2 to L1 would take up to 1 week because of the time it takes to generate a fraud proof.


ZK Rollups

ZK rollups aim to ensure that everyone behaves in good faith, whereas optimistic rollups presume that everyone acts in good faith. Zk rollups bundle hundreds of transactions into a single batch, a cryptographic proof know as ZK-SNARK is generated for each batch. The SNARK proof or the validity proof is then stored on-chain. This strategy reduces the size of the data in each block because you are replacing data with proofs (much much smaller) and as a result, reducing time and gas cost. The SNARK proof can be quickly verified on-chain, regardless of how large the computation is.

In contrast to optimistic rollups, ZK rollups do not require a challenge period because the validity proof has already validated the integrity of transaction data. As a result, this type allows for very quick withdrawals. Therefore, ZK rollups are ideal for exchanges and other dApps that require simple transactions.

The tweet is simply explaining the difference between the 2 mechanisms of rollups; a zk rollup would proof that a batch has the correct post-state while an optimistic rollup would assume that a batch has the correct post-state. The barman is the layer 1, Ethereum.


Side note

  • EVM-compatible: Ethereum smart contracts can be deployed on the compatible chain.

  • EVM-equivalence: complete alignment with the Ethereum virtual machine (EVM).

EVM compatibility is not the same as EVM equivalence. Settling for mere compatibility means that you are forced to modify, or even completely reimplement, lower-level code that Ethereum’s supporting infrastructure also relies on.

Optimistic vs ZK


Privacy

Another aspect we’d like to mention is how each rollup handles privacy. The technical difference ; zk rollups, as the name implies, use zero knowledge proofs. Which is a type of cryptography that allows the proof of data without revealing the data itself. ZK-SNARKS stand for “Zero-Knowledge Succinct Non-Interactive Argument of Knowledge”. “Recursive proofs” refers to the act of verifying a proof inside another proof, verifying a SNARK inside of another SNARK. This is a handy compression technique that allows for greater efficiency and reduced privacy costs. Optimistic rollups are incapable of this innovation.

SNARK proof verified inside another SNARK proof – just like Mina Protocol.


Security: Major Factor for Adoption

Security is the one of the key aspects in the success of every blockchain. Many L2 solutions have attempted to scale Ethereum; they function, to be sure, but security was still jeopardized because these solutions relied on their own consensus rather than Ethereum’s. Security is not at risk with rollups. Let us explain why:

  • Rollups store batches on-chain, this allows rollups to inherit the full security of Ethereum.

  • If you ever had funds on Solana or Polygon and the network was down for an unusually long period of time then your funds would be stuck and there’s nothing you can do about it. Mainnet rollup smart contracts contain “escape mechanisms” that allow users to exit rollups with their funds back to mainnet even if the rollup network is offline.

  • When using a rollup with a centralized validator you are compromising on trust and censorship-resistance, but not security. Centralized validators cannot steal your funds and you can always withdraw back to mainnet Ethereum.

Ethereum is there for trust and resolution; any issues that the rollup chain encounters will always be resolved by Ethereum.


Ethereum Sharding Upgrade

Sharding refers to splitting the entire Ethereum network into multiple chains called “shards”, which will reduce network congestion and increase transaction throughput. Each shard would have its own state, which would include a distinct set of account balances and smart contracts.


Initially, there will be 64 “shard chains.” Eventually, there will be 1,024 “shard chains”. Shard chains provide extra, cheaper, storage layers for rollups to store data. Rollups that use sharded data can process up to 100k TPS, and possibly even more in the future. So it’s rollups on top of sharding that will be the king of scaling, of course this is such a long term process and is still in development.

The Rollup King

The transition to rollups is still at an extremely early stage, with the most activity still seen on Ethereum mainnet and a handful of alternative layer 1s.


Optimistic and zk rollups will be able to run at the same time and can interact with the Ethereum blockchain, one will be more favorable than the other in certain dApps. They are versatile and can easily be upgraded or changed without affecting the fundamentals of the underlying blockchain they were built to interact with, rollups also enable redeployment of all the existing Ethereum smart contracts to a rollup with little or no change.


In the short term, as of today protocols seem to favor optimistic rollups simply because they are fully EVM compatible unlike zk which are still in development to be fully verified on EVM , some users have already migrated to optimistic rollups, which have a TVL of $4.96 billion compared to $1.38 billion for zk rollups.

However, if we were to pick one for the medium-to-long term, it would undoubtedly be ZK ROLLUPS!. Simply said, zk is more scalable, secure, and cheap; they provide immediate on-chain verification and instant withdrawals, which are critical for bridges. ZK-SNARKs tech is also a huge deal, and one that will very probably be incorporated in crypto in the long run due to its privacy and scalability characteristics, as certain protocols have already begun to do so.


Top Contenders

To be clear, I selected these chains based on their core qualities. These picks aren’t meant to be considered as investment advice, other investment aspects like tokenomics, value accrual, team and developers, funding and so on were left out.


Arbitrium

With $2.1 billion in TVL, it is now the most used L2 protocol. Arbitrium is an optimistic rollup that acts as a bridge for the Ethereum ecosystem where users can deposit and withdraw ETH to enjoy a wonderful experience of fast transactions and cheap gas fees. It comes with its own Arbitrium virtual machine (AVM) where dApps from Ethereum such as uniswap can migrate to Arbitrium. When withdrawing your funds it can take up to 1-2 weeks because nodes need to check for fraudulent transactions and provide a fraud proof, but it appears that users are still enjoying it since TVL is steadily increasing. Arbitrium does not have a token yet.


Optimism

Optimism is an optimistic rollup that is set to be the main challenger for Arbitrium. After a delay in it’s launch; Arbitrium used the opportunity and launched before , attracting more capital. With $333.21 million in TVL offering fast transactions and cheap gas fees. Optimism is EVM-equivalent and even has it’s own virtual machine-OVM (optimistic virtual machine). Unlike Arbitrium, which executes certain parts of l2 transactions in multiple rounds, Optimism executes the whole l2 transaction in one round. The withdrawal period can still take up to one week, however it is shorter than Arbitrium. Optimism does not have a token yet.


Metis (METIS)

An optimistic rollup originally forked from Optimism, and a new contender to the L2 solutions. the withdrawal time from Layer 2 back to Ethereum is 7 days (similar to other optimistic rollups). Once the Metis network is fully deployed, withdrawal times will be cut down to just a few hours and eventually minutes, through a network of Rangers who validate the transactions. An EVM-equivalent chain with $241.81 million in TVL and has a new ecosystem on it’s own.


ZkSync

EVM-compatible L2 scaling solution that leverages zk rollups and supports ETH and ERC-20 tokens. ZkSync is still relatively new and has $90.4 million in TVL. ZkSync is very popular even though it does not have a token yet. Offering fast transactions and cheap gas fees with instant withdrawals, ZkSync is still under testnet.


StarkWare Ecosystem

The StarkWare ecosystem consists of two scaling solutions that rely on zk rollups for scalability. Instead of a SNARK, the validity proof generated is known as a STARK (another type of zero knowledge technology). STARKS differ from SNARKS in that they do not require a trusted setup, but their proofs are larger than SNARKS

  • StarkEx: ZK rollup layer 2 scaling engine, that allows a specific range of dApps (NFTs and decentralized exchanges) to be built on the StarkEx system that is live on the Ethereum mainnet (secured by Ethereum). The TVL across StarkEx dApps (DeversiFi, dYdX, Immutable X and Sorare) is $1.14 billion.

  • StarkNet: General-purpose zk rollup that operates as an L2 over the Ethereum network. StarkNet is not application specific unlike StarkEx therefore anyone can deploy a wide range of dApps on StarkNet and still be fully secured by the Ethereum consensus. As of recently, it is now EVM-compatible. It has no TVL at the minute because dApps are soon to be deployed on StarkNet (no bridges with other chains at the moment).


15 views0 comments

留言


bottom of page