Introduction
Ethereum scaling is one of, if not the most, discussed topics in the ETH ecosystem. We experience scalability issues when there is a high influx of activity in the network, resulting in high gas prices and slow transactions.
To tackle these issues Finding scalable solutions has been the top priority for the multiple teams in the ETH ecosystem.
There are three ways to scale Ethereum: Layer 1 scaling (ETH 2.0), on top of Layer 1 (Layer 2 scaling-State channels, Plasma, and Rollup), and on the side of the chain (side chain).
ETH 2.0
Concerns about scalability have resulted in the development of an upgrade to Ethereum on multiple levels. This enhancement is known as Eth2.0 or serenity. Eth2.0 seeks to make Ethereum more scalable, secure, and long-lasting.
Click here for everything you need to know about ETH2.0
Side chains
A side chain is a separate blockchain that is linked and connected to the main chain (ETH L1) by a two-way bridge. Side chains have a different consensus mechanism from the main chain and don’t rely on the security of ETH L1, making them less secure than L2s.
A popular misconception is that Polygon is a side chain, which is false. Polygon is a commit chain; a commit chain is a non-custodial side chain that relies on the parent blockchain (ETH L1) for its consensus.
Layer 2 (L2)
Layer 2 refers to any system built on top of Ethereum that inherits the security of ETH L1. This includes Plasma, Rollups, and state channels.
It’s important to note that L2s won’t be built by the Ethereum Foundation and there’s no official roadmap for L2s. However, rollups are part of the ETH2.0 roadmap where they’ll function effectively with Sharding, making it the most anticipated scaling solution.
Rollups
Rollups achieve the best of sidechain and other L2s (Plasma and state channels). Rollups offer similar capabilities as Plasma but solve Data Availability issues. Rollups allow for the deployment of smart contracts on ETH to a rollup without sacrificing ETH’s security.
Please, what exactly is a rollup?
A rollup is a type of scaling solution that works by processing and executing transactions outside the L1 but post the transactions back to the L1. This makes it possible for rollups to both scale and derive security from the L1.
How is this done?
Transactions are executed off-chain, which allows for the processing of more transactions in total. For this to be achieved, rollup transactions are executed on a separate chain that can run a rollup-specific version of an EVM.
In the next step, transactions are batched and posted on the ETH L1 by a sequencer.
The whole process above involves executing transactions, taking data, compressing it, and ‘rolling-up’ the transactions to the main chain in a single batch.
In detail, a batch of transactions in a rollup are ‘rolled-up’ to a state root (a single small value that serves as a witness). This contains enough information to validate every transaction that occurred on an L2.
Rollups update ETH L1 on events of the sidechain by regularly posting transactions of the sidechain. This extends ETh consensus to L2 rollups.
However, how does ETH know that the posted data is valid and wasn’t submitted by a malicious actor? Rollups deploy a set of smart contracts on L1 that’s responsible for processing deposits and withdrawing them and verifying proofs.
Proofs are the main distinction between rollups, which are characterized as Optimistic, and ZK rollups.
Optimistic rollups use fraud proofs while ZK rollups use validity proofs.
Let’s look into the two types of rollups:
Optimistic Rollup
From its name, “Optimistic,” it posts a transaction to the ETH L1 and assumes it’s correct. In cases of invalid transactions by fraudulent users, the network has to identify them, recover the correct transaction, and penalize the fraudulent user.
For this to be implemented, Optimistic Rollups have dispute resolution systems that can identify invalid transactions and bad actors and disincentivize them from involving themselves in further fraudulent acts in the system.
In most Optimistic Rollups, the user responsible for sending batches of transactions to the ETH main chain has to provide a stake, which can be slashed if any fraudulent transaction is identified by a user who submits a fraud-proof.
When batches of transactions are sent to ETH, there’s a second user who submits a fraud-proof if a malicious transaction is noticed. The system enters dispute resolution mode and the suspected transaction is executed again on the ETH main chain.
If found guilty, the user who submitted the batches of transactions will be slashed, and vice versa for users who submit fraud proofs as a way to stop the spamming of fraud proofs.
For transactions to be executed on L1, a “manager contract” is created so optimistic rollups can be able to replay a transaction with the exact state that was present when the transaction was executed on the rollup.
Note, this system works and detects fraud even if there’s one honest user who monitors and submits fraud proofs in the rollup.
Entering the dispute resolution process is something that happens only during exceptional periods and not regularly due to the rollup’s incentive.
Examples of Optimistic Rollups are Optimism, Arbitrum, Cartesi.
A rollup with no dispute resolution does exist — ZK Rollups.
Zk Rollups
Thanks to Zero-Knowledge Proofs, dispute resolution doesn’t exist in ZK rollups.
Zk rollups use validity proofs (zksnark , ZKstark) to check transactions and know their legitimacy before sending them to the ETH chain.
Instead of a dispute system, ETH Zk rollups use complex mathematical computations and cryptography to ensure that transactions are “settled” on the ETH main chain.
In detail, for a new transaction batch to be submitted and accepted, this process must be followed: The transaction batches are posted on L1, which includes a cryptographic proof called zksnarks. The proof can be verified by the L1 contract when a transaction batch is submitted and invalid batches will be rejected.
At first, ZK technology was thought impossible to ship to blockchains, but teams have spent years trying to refine complex transactions into simpler transactions into proofs (using ZKP tech) that are easy to verify. This year alone, 3 zkevms have reached the testnet stage with some already heading to mainnet, this includes Scroll, Polygon Hermez, and ZKsync2.0 (Matter Labs). That’s some substantial progress.
Examples of ZK Rollups
A Zero-Knowledge Proof is a validity method by which one party (prover) can prove to another party (verifier) that a particular statement/data/transaction is true without revealing the details of the data apart from the fact that it’s true.
Differences between Optimistic and ZK rollups
Optimistic Rollups
Slow Withdrawal
Due to the dispute resolution process, the network gives time to network users to submit their fraud proofs before transactions are finalized. In most cases, this period is quite long; long enough to ensure transactions submitted aren’t fraudulent. Withdrawal can be slow and most of the time, users have to wait 7 days to get back their funds to L1.
However, projects are now offering fast liquidity exits to salvage the situation. These projects offer a fast withdrawal to L1, side chains, or other L2s. This is done for a small fee.
2. EVM compatibility
Optimistic rollups still need to write their own versions of EVM. Most of the time, contracts can be shipped from L1 to optimistic rollups without making changes. Hence, EVM compatible.
Zk Rollup
Fast withdrawals
Thanks to the absence of a dispute resolution process, withdrawals in ZK rollups are fast, together with a validity proof as transactions are hatched to the L1.
2. EVM compatibility
Due to the complexity and cryptography involved in ZK technology, most ZK rollups aren’t EVM compatible, for example, Starkware.
The term given to EVM-compatible Rollups is zkEVM. zkEVM allows developers to port solidity contracts from the ETH main chain to a rollup without needing to change the underlying code.
Teams building this include Scroll, Polygon, and Matter labs (Zksync2.0).
Thanks to ZK tech complexity, Optimistic rollups are easier to implement than ZK rollups. This was why Optimistic rollups were the first to go live (Arbitrum and Optimism launched in 2021).
ZK rollups, the winner?
ZK rollups have the advantage over Optimistic rollups. Would you rather trust someone to prove that transactions are correct (dispute system) or a computational cryptographic technology to prove that transactions are correct?
Buterin said on Primer YouTube, “In general, my personal view is that in the short term, the Optimistic rollups are most likely to win out for general EVM calculation, and ZK rollups are more likely to be used for payments, transactions, and other application-specific use cases. But in the medium and long term, as ZK-SNARK technology matures, ZK rollups will win in all use cases.”
I guess ‘the medium and long term’ is very soon thanks to zkEVM, as Polygon Hermez and other rollups are set to launch. Polygon Hermez uses ZK-SNARK.
Optimistic Rollups: Now the Underdog
The Optimistic Rollups (Arbitrum and Optimism) launched with a happy response from the ETH community as fees are cheap on their protocols. However, they haven’t lived up to expectations in terms of adoption when compared to ETH.
TVL indicates the total value of projects committed to a chain. According to Defi Llama, Optimism and Arbitrum have a TVL (Total Value Locked) of $920.15 million and $1.11 billion, respectively, which seems good, but when compared to ETH, the term “adoption” seems undermined. ETH has a TVL of $31.13 billion.
According to y2charts, Ethereum has a daily transaction of 1.07M. That seems large, yh? However, when compared to Optimism and Arbitrum, the word “adaption” loses value once more. Arbitrum daily transactions peaked on June 27, 2022, at 287,019 transactions, while Optimism peaked at 487,814 on June 1, 2022.
What’s next for Optimistic Rollups?
Is it over?
Can we get real adoption with zkEVMs?
Will zkEVMs overshadow Optimistic Rollups?
What’s next for Optimistic Rollups?
From the write-up above, we can see that zkEVMs are likely to spare-head adoption.
Optimistic Rollups have to adopt ZK technology and build with it.
Vitalik Buterin has this to say on the topic on Primer YouTube, “I personally would trust $10 million of my money to an EVM Optimistic Rollup rather than a zkEVM rollup for at least the next couple of years. But, in the long term, ZK Rollups will be everything. So, my advice to Arbitrum and Optimism is to start ZK-ifying themselves fairly soon.”
Conclusion
Whether ZK or Optimistic or sidechain, it's a healthy debate aimed at doing better to improve ETH scalability and improve the ultra-sound blockchain.
If you enjoyed this write-up and would like to reach out to me. This is my twitter handle — twitter.com/0xSalazar
Please remember to do your research. None of this is financial advice.