🍱 Rollup Roundup: Understanding Ethereum's Emerging Layer 2 — Issue No. 80

đź“°News

This week, The Plasma Group announced they are pivoting away from their state channel based layer 2 scaling solution, choosing instead to pursue a scaling solution using Optimistic Rollups. The public benefit company has also rebranded under the name "Optimism." Link.

The Optimism team is the latest of several to announce their aim to bring faster throughput to the Ethereum network via so-called "rollup" layer 2 constructions. In this issue, we'll review the way this novel family of scaling solutions works and look at four projects making progress on actually building them.

Rollup Review

The ideas that enable rollup constructions have been around for years, but the design of current iterations began in September 2018 with a post by Vitalik Buterin on the Eth Research message boards. Link.

Image

In that write up, Vitalik described a scheme where off-chain relayers collect transactions sent from users, generate a zero knowledge cryptographic proof which guarantees their validity, then submit both the proof and the bundled transactions to a smart contract on the Ethereum mainnet. The mainnet contract verifies the proof and updates a single hash representing the state. All transactions are available in the network's block history, but the signature data remains off the chain, as does the computation needed to verify them and execute layer 2 smart contracts. Both are enforced through the "magic" of the ZK proof.

The scheme laid out by Vitalik, now referred to colloquially as ZK Rollup, could enable throughput of up to 500 transactions per second. This would be a major improvement over the 15 tps possible today, but there's a catch. It's currently prohibitively difficult and slow to generate ZK proofs for arbitrary computations, making it impossible to support general purpose smart contracts without major advances in the underlying cryptographic techniques.

Optimistic Rollups

To cope with current limitations in ZK proofs, teams building rollup solutions have generally made one of two tradeoffs. One option is to ditch support for general purpose smart contracts in favor of efficient, special purpose ZK proofs built for specific use cases. The other option is to retain general purpose smart contracting, but ditch the ZK proofs, substituting a deposit based cryptoeconomic incentive mechanism instead. The latter is known as an Optimistic Rollup, and it's what the folks at the newly renamed Optimism company are building. I covered Optimistic Rollups extensively in issue 69 of this newsletter. Link.

The great thing about Optimistic Rollups is that everything needed to make them work exists today. There's no handwaving away problems with future technical breakthroughs. That doesn't mean they're easy to build— it just means they're possible to build. It will still take some time for the Optimism team to get an Optimistic Rollup chain deployed to mainnet.

In the meantime, another team working with Optimistic Rollups is looking to ship sooner rather than later. The folks at Fuel Labs are not only opting for Optimistic Rollups over ZK Rollups, they're also limiting the scope of their rollup chain to focus on ERC-20 token payments. Their contracts and client are currently undergoing a security audit before a planned mainnet release. If successful, the Fuel Labs implementation could enable a 5x increase in throughput for token transactions. While this a modest improvement compared to other scaling solutions, it may give Ethereum some much needed breathing room, especially as usage of stablecoins like Tether threaten to clog the network. Link.

Image

App Specific ZK Rollups

Speaking of narrowly scoped rollup chains, there are also a number of teams using purpose built ZK proofs to enable scaleability for specific use cases. One of these teams is Loopring, and they're building infrastructure aimed at enabling high frequency order book DEXs (decentralized exchanges). In essence, the system implements the architecture laid out by Vitalik in 2018, but rather than a general proof that works with any smart contract, it uses several zero knowledge circuits specifically designed for generating proofs about trading activities. Link.

Earlier this month, the Loopring team completed an invite only mainnet beta in conjunction with WeDEX. The test saw 600,000+ transactions made over the course of two weeks, some of which were organic, but many of which were generated explicitly as tests. The average cost per trade came in at half a penny. Link.

Image

If we're being honest, it's obvious speculative trading is still the biggest use case for crypto. Given that, building out a trustless, non-custodial DEX that is nonetheless performant is probably a good beachhead to land on. This is a project worth following, not only because it might scale, but because there might actually be demand for all that extra throughput if it succeeds.

The Kitchen Sync

While many projects are aiming to make rollups a reality by simplifying Vitalik's original architecture, at least one team is going in the other direction. The folks at Matter Labs recently announced a construction they call "ZK Sync." It starts with the core ZK Rollup architecture, then adds to it in the hopes of providing a better user experience. I'd describe ZK Sync as ZK Rollups on steroids. Link.

Image

The biggest difference between most rollup schemes and ZK Sync is that the latter limits the set of validators that can produce blocks to about 100 known entities. These validators are defined in a mainnet smart contract. This has a few advantages.

First, it allows computational and bandwidth requirements for being a validator to be very high. This enables more complex proofs to be used, and also allows for faster response times to users making requests.

Second, it allows the known validator set to use a voting mechanism to determine which transactions must be included in the next rollup block. Once a transaction is signed by 2/3 of the known validators, it can reasonably be considered final, and since the validators will be fast, well-connected machines, this can happen in a matter of a second or two. In order to enforce this mechanism, validators must post a bond to the contract. That bond can be slashed if a validator votes to include a transaction, then fails to include it in a rollup block they produce.

Now, these properties are great, but this scheme leads to an obvious question: isn't a known set of only 100 validators an obvious point of centralization? Yes and no. For one, because of the way ZK Rollups work, there isn't much these validators can do in terms of bad behavior. They can't steal funds, they can't rewind or reorg the chain, and they can't prevent you from exiting with your funds on the mainnet at absolutely any time. Because all data is submitted to the mainnet and validated by a cryptographic proof, the only action a validator can take is to move the chain forward.

This does mean a validator could choose not to move the chain forward, which is the one real risk that comes with a limited validator set. They could collude to halt the chain completely— or to keep transactions from certain users from being included. While the downside here is limited because, again, they can't stop you from exiting, it's still a risk.

To prevent this, the ZK Sync architecture includes a delegation system similar to the one used by networks like Tezos. Any token holder can act as a "guardian" and assign their stake to a would-be validator. The network determines the validator set based on this stake weighted vote. Presumably, if a validator (or group of validators) misbehaves, they will be voted out of the set, forfeiting the fees they earn for participating. While I'm generally skeptical of stake delegation on layer 1, it makes sense here given the limited downside involved.

Image

As if all this wasn't enough, the Matter Labs team has other big plans for the future of ZK Sync. While the version in development now will only support token transfers, the team intends to support generalized smart contracts in the future. They're also making plans to build privacy preserving tech into a future version. To achieve either of these goals, they'll have to push the boundary of what's possible with zero knowledge proofs.

Rollups And Ethereum 2.0

It's interesting to me that workable layer 2 scaling is getting close to launching on Ethereum just as the first phase of Ethereum 2.0 is on the verge of going live. I wonder if we won't see a bit of tension between these two in the coming months?

To be clear, there's nothing mutually exclusive about rollups and ETH 2.0. In fact, for a number of reasons, rollups would work even better on the fully launched Ethereum 2.0 network than they do on the 1.x chain. That said, it's still easy to imagine a world where the success of ETH 1.x layer 2 leads some in the community to question whether the transition to Ethereum 2.0 is worth the risk. This would be a good problem to have!

Let's not get ahead of ourselves, though. There's still a lot of work to be done before ETH 2.0 or rollups are ready for primetime. Stay tuned, though; it seems like progress is being made, and smart folks are clearly working on both.