Home Community Insights Ethereum EVMs; Optimistic v. Zero-Knowledge Rollups

Ethereum EVMs; Optimistic v. Zero-Knowledge Rollups

Ethereum EVMs; Optimistic v. Zero-Knowledge Rollups

Before getting into the distinction between optimistic and zero-knowledge rollups, a refresher on what a rollup actually does will be helpful.

What Is the Purpose of Rollups?

Rollups are considered off-chain (or Layer 2) scaling solutions because they execute transactions outside of the core Layer 1 blockchain on which they are built. If this sentence does not fully make sense, I recommend reading the beginning sections of my Previous publication on zkEVMs.

Tekedia Mini-MBA edition 14 (June 3 – Sept 2, 2024) begins registrations; get massive discounts with early registration here.

Tekedia AI in Business Masterclass opens registrations here.

Join Tekedia Capital Syndicate and invest in Africa’s finest startups here.

How does moving transactions off-chain increase scalability? Think of it like this?—?if every transaction on a blockchain network were executed and processed on the Layer 1, unless that network is capable of supporting high transaction speeds (i.e., the amount of time needed to fully confirm a transaction) and throughput (high transactions per second), bottlenecks will occur.

Rollups help by alleviating the processing burden of Layer 1s. Rollups process transactions “offline” from the main network, bundle (or “rollup”) these transactions into a single block, and then send that block back to the Layer 1 for final publishing. In effect, by processing thousands of transactions off-chain and only submitting a single transaction to the main network, rollups can greatly increase the scalability and throughput of an underlying Layer 1 blockchain.

Whereas the current Ethereum network can process about 30 transactions per second (TPS), rollups have the potential to increase throughput to hundreds or even thousands of TPS.

For purposes of this article, we will be limiting scope to rollups within the Ethereum ecosystem. With that context, it should also be noted that by publishing transactions on-chain, rollups inherit the security of the main Ethereum network. This structure is in contrast to some other off-chain scaling solutions like sidechains, which derive their security separately from Mainnet.

As a result, rollups are generally considered safer scaling solutions than sidechains and other alternatives like, for example, validiums which do not store transaction data on the main network.

Optimistic Rollups

Now to the first of the two main types of rollups. Optimistic rollups derive their name from the way in which they post transaction data on-chain. They post this data in an “optimistic” way?—?i.e., when posting, they assume all off-chain transactions are valid.

Taking a step back, consider for a moment what is actually occurring when rollups post off-chain transaction data back on-chain. When transactions are initially executed off-chain on a rollup, the Layer 1 has yet to finalize and recognize their occurrence.

However, when these transactions are posted on-chain, the main network must account for them and transition its “state” (i.e., its historical record of transactions, almost like a balance sheet at a single point in time) accordingly. The challenge becomes how to prevent potentially fraudulent transactions that have occurred off-chain from making their way on-chain through this posting process.

As noted above, when posting, optimistic rollups assume all off-chain transactions are valid. How can optimistic rollups do this while also ensuring fraudulent transactions do not make their way through? There is a fraud-proving scheme in place to help here.

After a rollup batch is submitted to the main network, there is a time window (called a challenge period, lasting roughly seven days) during which anyone can challenge the results of a rollup transaction by computing a fraud proof.

Without getting too into the details, if a fraud proof succeeds for a particular transaction, the rollup re-executes the batch that was previously submitted so that the invalid block/fraud is excluded the next time around. Alternatively, if the rollup batch remains unchallenged after the time window has expired, all transactions in a batch are deemed valid and accepted on the main network. Fraud proofs therefore facilitate what is known as “trustless finality”?—?as long as a transaction is valid, it is guaranteed to eventually be confirmed.

However, one risk is that this security model requires at least one honest node executing rollup transactions and submitting fraud proofs to challenge results. Otherwise, malicious operators would be able to post invalid blocks and potentially steal funds without challenge or oversight.

What are some examples of optimistic rollups out there? As of writing, Arbitrum One and Optimism are the largest in terms of total value locked (TVL) ($2.41bn and $1.44bn, respectively).

Zero-Knowledge (ZK) Rollups

At a high level, zero-knowledge (ZK) rollups are not all too different from optimistic rollups. Like optimistic rollups, transactions are executed off-chain and subsequently bundled into batches. However, instead of then posting all transaction data on-chain like optimistic rollups, ZK-rollups submit validity proofs to the main network in order to finalize.

Comparing Optimistic and Zero-Knowledge Rollups

There are a few main pros and cons that are worth noting when comparing optimistic and zero-knowledge rollups.

  • Transaction Finality. Since ZK-rollup transactions are finalized as soon as validity proofs are verified, unlike with optimistic rollups which require a challenge period (~seven days), there is no delay when moving funds from a ZK-rollup to the main network. Although this delay for optimistic rollups can potentially be mitigated for users by employing liquidity providers (who may deliver early payment in exchange for a fee), this delay is something to consider.
  • Security. If you may recall, to work successfully the security model of optimistic rollups requires at least one honest node to submit fraud proofs to challenge invalid state transitions. In contrast, ZK-rollups rely on trustless cryptographic mechanisms for security. By not having to rely on the honesty of other actors, ZK-rollups are generally considered more secure than optimistic rollups.
  • Overhead and Cost. ZK-rollups require specialized hardware to produce validity proofs (which may encourage centralized control), and the cost associated with computing and verifying these proofs can be substantial. These considerations are not as relevant in the optimistic rollup context.
  • EVM-Compatibility. Although not touched on previously, it is important to note that optimistic rollups (but not ZK-rollups) are generally EVM-compatible.
  • What EVM-compatibility actually means is a bit confusing. I like to think of it like this. The Ethereum blockchain, as essentially the world’s most popular network, has created a set of de facto global standards based on its early specifications, ranging from its programming language to its token standards. Since Ethereum is so popular, there are a myriad of tools and applications that target these Ethereum specifications. If other blockchains similarly build in accordance with these standards, they can then piggyback and take advantage of these other developer tools and keep up with the Ethereum ecosystem as it grows.
  • Blockchains that are not EVM-compatible (e.g., Solana) miss out on the above and create instead entirely new ecosystems. Although this may allow other blockchains to fundamentally change the Ethereum toolset and differentiate themselves in various ways, it makes it harder to attract developers who are used to the Ethereum standards. Given the complexity involved with zero-knowledge technology and proofs, we have not yet achieved EVM-compatibility for ZK-rollups (“ZK-EVMs”). Vitalik Buterin has even recently stated that Ethereum was not originally designed around ZK-friendliness, thus contributing to the delay in this regard. As a result, ZK-rollup developers have so far been unable to use zero-knowledge technology in an EVM setting, which has likely hindered development and the adoption of ZK-rollups to date. However, progress is being made. In July 2022 at the Ethereum Community Conference (EthCC), three separate projects (zkSync, Polygon Hermez, and Scroll) announced that they are striving to make ZK-EVMs a reality. Much progress is still to be made, but in the future the advantage that optimistic rollups have in terms of EVM-compatibility may subside.

In terms of total value locked (TVL), optimistic roll-ups are currently much more popular than ZK-rollups. This state of affairs may seem counterintuitive given that ZK-rollups appear to offer clear benefits in terms of transaction finality, security, and scalability.

However, if we consider how complicated zero-knowledge technology is to build and the fact that ZK-rollups are yet to be EVM-compatible, things start to make more sense. As technology improves and EVM-compatible ZK-rollups start being introduced, developers will likely begin to leverage the scalability and security guarantees of zero-knowledge proofs more which will help close the gap.

No posts to display

Post Comment

Please enter your comment!
Please enter your name here