Let's Rock 'n Rollup

Let's Rock 'n Rollup

Unless we’ve been hiding under a rock, there’s a very good chance we’ve heard of the latest excitement in Ethereum Layer 2 scaling — Rollups.

Ethereum gas prices hit an all-time high (ATH) of more than 477 Gwei this week, perhaps foretelling the arrival of Twei’s (szabo’s) sometime soon.

The network hasn’t been this congested since the ICO days of 2017 — it’s arguably much worse now. The block gas limit is at an ATH of 12.5 million. The transaction count hit levels of 2017 peak and the block size is also at an ATH.

While this is encouraging news for the increased utility of the Ethereum network (at least by these metrics), one can argue that the current scalability (or lack thereof) of the base layer is considerably limiting applications and significantly hindering user experience. But, this is not a new realization. The Ethereum community foresaw this problem years ago and has been exploring numerous solutions ever since.

Ethereum 2.0 with Proof-of-Stake (PoS) and sharding in Layer 1 is the biggest ongoing effort and we will soon start seeing rollout of its phase 0 in coming months. However, computational scaling (i.e. state execution in shards with smart contracts) in Eth2 will only happen in phase 2, which is currently anticipated in 2021+.

All problems in computer science can be solved by another level of indirection - David Wheeler

Layer 2 solutions effectively introduce a level of indirection by resolving transactions at their layer while going to Layer 1 only when necessary. Several categories of such solutions — State Channels, Sidechains, Plasma — have been explored by multiple projects for many years now and have seen considerable progress and evolution.

Most recently, Bitfinex’s Tether — that powers USDt, the largest stablecoin by market capitalization and consistently in the top Ethereum gas consumers — switched to OMG Network’s More Viable Plasma Layer 2 solution.

Reddit’s “The Great Reddit Scaling Bake-Off” contest to help scale its Ethereum-based “Community Points” program (currently implemented only on two subreddits) to all its users has seen 22 submissions across these various Layer 2 solutions.

However, note that Layer 1 and Layer 2 scaling solutions are not mutually exclusive — they’re multiplicative.

So while Ethereum 2.0 rolls out in phases over the next couple of years, Layer 2 solutions hope to provide the much needed scalability until then and even beyond.

State Channels and Plasma projects dominated Layer 2 explorations in the last couple of years but the category of Rollups is lately seeing considerable excitement and gaining real traction.

So in this article, we dive into Rollups and summarize the why, what and who aspects. We review conceptual ideas of the two broad categories of Rollups — ZK Rollups and Optimistic Rollups — and then reference some of their leading implementations. Finally, we touch upon the various initiatives at Status Network that could benefit from Layer 2 scaling and project where we may be headed in the near future.

Rollups: Why?

Basics: Scaling solutions that are built on top of Ethereum without requiring any changes to the underlying base Layer 1 protocols are known as Layer 2 solutions. They resolve transactions without always requiring interactions with the Ethereum network. They anchor their security guarantees to the base layer of Ethereum via smart contracts.

Layer 2 solutions are appealing because there can be multiple such solutions running on Ethereum only for specific applications that are Layer 2 aware and enabled without requiring everyone to upgrade the base layer infrastructure (which is a significant effort involving a lot of risk). While they don’t always offer the same level of security and finality guarantees as Layer 1, they could be sufficient enough for certain applications that require increased throughput, decreased costs and a better overall user experience than what Layer 1 offers currently.

The most promising Layer 2 solutions until recently were State Channels and Plasma.

State Channels are typically best suited for applications where the number of participants is well defined, need to exchange many state updates over time and have strong availability guarantees to account for challenge periods. Connext Network is a representative example of a project that is currently using State Channels to help scale DApps.

Plasma was introduced in August 2017 by Vitalik Buterin and Joseph Poon. It is a framework for scaling where assets are transferred into/out-of child chain(s) via a smart contract on the root chain, all transaction execution happens on child chain(s) with state commitments (via Merkle root created from all state updates in the block) posted to the root chain which may later be used in fraud proofs during exits to the root chain. There have been many variants of Plasma proposed including Minimum Viable Plasma, More Viable Plasma, Cash, Debit and Prime. OMG Network’s More Viable Plasma is a recent example of a Plasma project that has seen market adoption.

Drawbacks: The biggest drawback of State Channels is its liveness assumption — users or their representatives need to be constantly monitoring Layer 1 to be available for any challenges. And Plasma not only inherits this liveness assumption but also has a data availability assumption — users need to trust the operators to make available all the transaction data required to verify correctness if/when required. In the absence of that, they could exit the Plasma chain but that could lead to a mass exit problem in the worst-case scenario. Also, both State Channels and Plasma do not support smart contracts, in general, which severely limits applications that require EVM compatibility.

Looking at the comparative illustration above, Rollups do not need to make the two described limiting assumptions that could be a deal breaker in many scenarios. This makes Rollups more promising than State Channels and Plasma for a wide variety of applications.

So let’s look at what Rollups are and why they do not have the limiting assumptions of State Channels and Plasma.

Rollups: What?

Rollups are very similar to Plasma with one big difference to avoid its data availability assumption — all Layer 2 transactions are “rolled up” into a block which is committed to Layer 1 in one transaction’s calldata (calldata is the read-only area where data parameters of an Ethereum transaction are held).

Given that calldata is much cheaper than Layer 1 storage, this approach allows Layer 2 transaction data — unlike only the Merkle root in Plasma — to be available on Layer 1 anytime someone needs it for validating a state transition. So Layer 2 data once committed is always available on Layer 1. This property removes the requirements of both liveness and data availability assumptions giving Rollups the edge over both State Channels and Plasma.

Depending on the approach to validating state transitions, there are two types of Rollups: ZK Rollups and Optimistic Rollups.

ZK Rollups (ZkR): In ZkR, operator(s) must generate a zk-SNARK validity proof for every state transition on Layer 2 and submit these to the Rollup contract on Layer 1 which verifies that there are valid proofs for state transitions to go from the old Merkle root to the new one. The guarantees here are cryptographic in nature, albeit using novel primitives.

Optimistic Rollups (OR): In OR, operator(s) submit the new Merkle root along with transaction data to the Rollup contract on Layer 1 and everyone optimistically moves forward with the assumption that this is a valid transition (without verifying like in ZkR) but if not, one of the participants will challenge it with a fraud proof. The guarantees here are cryptoeconomic in nature because operators are incentivized to be honest with token rewards along with staking and slashing.

To summarize from a deep-dive comparative analysis, ZkRs today are best suited for token transfers with faster time-to-finality (~1-20 minutes) but do not support EVM-compatible smart contracts for generalized applications. In contrast, ORs today are best suited for applications requiring EVM-compatible smart contract support but with the downside of slower time-to-finality (~1-2 weeks) by default to account for the fraud proof challenge window. (There are however techniques to provide economic guarantees for achieving faster finality or withdrawal times with ORs.)

Rollups: Who?

There are multiple projects working on ZkR and OR implementations with different assumptions and properties suitable for different scenarios.

ZkR: zkSync from Matter Labs is live on Ethereum mainnet. Loopring has launched a DEX and payments using ZkR. StarkEx from StarkWare is a ZkR technology that uses zk-STARK (instead of zk-SNARK) and therefore is not dependent on a trusted setup, more scalable and currently quantum resistant.

OR: There are at least nine projects working on different variations of OR as shown in the below comparison table from this article. The biggest differentiators are support for EVM compatibility and the interactivity requirements of challenges with fraud proofs. For example, Celer, Nutberry and Optimism support EVM-compatible smart contracts with single-round fraud proofs.

Status Network

A big part of the vision at Status is being the “Window onto Ethereum.” While Status Messenger does not interface directly with the Ethereum blockchain, the app bundles a secure crypto wallet and web3 browser which interact with Ethereum and therefore are directly affected by the soaring gas prices due to the aforementioned scalability challenges.

The Keycard product which is part of Status Network is exploring a payments network whose design requirements of credit-card level scalability and near-instant finality are not fulfilled by the Ethereum network today.

Additionally, there are numerous other initiatives within Status Network such as Kudos rewards, Tribute-to-Talk and ENS names, all of which desperately need lower gas prices for feasible deployment and reasonable user experience.

While the Nimbus team at Status Network works on Ethereum 2.0 along with other client teams, the various Status initiatives mentioned above would tremendously benefit from a Layer 2 scalability solution immediately.

Therefore, we at Status have been evaluating Layer 2 solutions for some time now. Rollups are definitely a top contender for reasons described earlier and Optimistic Rollups seem particularly appealing for their smart contract support which is desirable in all our use cases.

P2P: All current Rollup constructions rely on operator(s) to aggregate transactions from clients and produce blocks using a traditional client-server architecture. The downside is this becomes a vector for centralization, censorship and privacy loss.

Therefore at Status, we are also exploring how client-operator(s) interactions at Layer 2 can leverage our decentralised peer-to-peer (P2P) protocols, such as Waku, to provide privacy-preserving routing and censorship resistance. For example, using Waku topics to route transactions to multiple operators would preserve privacy of clients and give them multiple paths to publishing transactions while resisting censorship.

Conclusion

While we prepare for a massive upgrade to Eth2 in coming years, Layer 2 solutions have evolved in the last few years with State Channels and Plasma making way for Rollups.

In this article, we motivated the need for Rollups by providing a high-level survey of the Layer 2 landscape to summarize alternative approaches along with their pros and cons. Finally, we articulated the motivation at Status for exploring Layer 2 solutions.

Neither Status nor Rollups existed in 2017 but we may be coming together in 2020. So stay tuned for updates on this.

Meanwhile, we will rollup our sleeves and get down to scaling up Status on Ethereum.

(Thanks to Barry Gitarts, John Lea, Jonathan Zerah and Robin Percy for reviewing drafts of this article and providing helpful feedback. Thanks to Alex Howell for the thoughtful illustration.)