Scaling Ethereum with zkSync

While scaling Ethereum has been a conversation since the protocol was born, the popularity of DeFi and NFTs has made it an urgent concern. A superior financial system needs to remain accessible and low cost for all. While ETH 2.0 will go a long way in getting us there, that roadmap is still unfolding, and the time for layer-2 (L2) solutions is now. 

Winning L2 solutions should maintain all the properties that make Ethereum great — permissionless, secure, community-owned — at lower cost than the base chain. To date, the mixture of maturity and tradeoffs found in competing designs has created a conundrum for the community: we could either choose the superior security, throughput, and capital efficiency of ZK rollups (ZKRs), or the EVM compatibility of less-secure fraud-proof systems like Optimistic rollups (ORs). The risk we face is that some teams choose the former, while others choose the latter, prioritizing different tradeoffs, fragmenting liquidity, and breaking composability.

It would be far easier if we weren’t forced to choose at all—if we could have the security, throughput, and efficiency of ZKRs alongside EVM compatibility, making it easier to converge on a common standard. Turns out, that’s zkSync 2.0, with the zkEVM. Yes, zkSync 2.0 is EVM compatible, and shipping in Q4 2021.

For those that can’t wait, there’s already zkSync 1.x, which provides permissionless ERC-20 token listings and support for NFTs. Live since June 2020, the original zkSync has had the lowest real transaction costs across all existing and planned rollups, leading teams like Gitcoin, Argent, and Index Coop to trust zkSync with their scaling needs.

zkSync best preserves the properties that have made Ethereum successful thus far: decentralization, security, composability, capital efficiency, and instant withdrawals. At the same time, it minimizes the disruption faced by developers who are used to building contracts for the EVM. As a result, we believe zkSync paves the smoothest path to scaling DeFi, NFTs, and all other innovations happening on Ethereum.

Before we get into specifics, it’s worth reflecting on how we got here. This discussion points to the conclusion that the challenge ahead is not only to scale, but to do so in a way that safeguards the core properties that got Ethereum this far.

The road to 2021

In 2013, long before Ethereum’s first block, Vitalik published the Ethereum Whitepaper. In it, he envisioned applications of the soon-to-be smart contract protocol: stablecoins, derivatives, oracles, prediction markets, DAOs.

From early on, critics of Ethereum were quick to point out that the initial design was unlikely to support such applications on a global scale. But scalability was the least of Ethereum’s problems. It wasn’t clear who would build these things. It was even less clear whether anyone would use them.

It wasn’t long before faster, cheaper smart contract protocols emerged, amassing huge venture-backed war chests by selling heavily to insiders. These projects proclaimed Ethereum legacy tech, despite fundraising off the back of Ethereum’s 2017 success. Amidst the doom and gloom of the 2018 and 2019 bear market, Ethereum hackathons were packed. Despite every L1 and their sister claiming they were destined to eat Ethereum’s lunch, Ethereum’s developers weren’t leaving. 

Piece by piece, an ecosystem of interconnected protocols and applications have emerged on Ethereum, a large number of them financially geared. Today we call this nexus “DeFi,” and it’s one of the most dynamic and fun corners of the internet. In 2020, nearly all the applications Vitalik dreamed up in the Ethereum whitepaper were live on Ethereum, as were dozens more that couldn’t have been imagined when Ethereum was born. And not only do they exist, users are paying millions of dollars per day to use them, and they store tens of billions in value.  

It turns out, the fundamental properties of DeFi on Ethereum were more important than scalability. DeFi developers refused to sacrifice decentralization for scalability. They instead leveraged the composability and capital efficiency that Ethereum afforded them to overcome the limits of scalability. As these applications have now attracted millions of users, scalability is front and center once again.

Here, there’s good news and bad news. The good news is the Ethereum community has been preparing for this moment for years, with multiple concurrent efforts, many of which are live today. In addition to proof-of-stake (PoS) and sharding in ETH 2.0, independent teams have pursued sidechains, rollups, plasma, state channels, and countless other proposals. The “bad” news is that fully-fledged layer-one (L1) scaling is a multi-year process, and developers are inundated with L2 choices in the meantime.

We can expect a variety of L2 solutions to be useful pieces to solving the scalability puzzle. But when it comes to scaling complex, open-participation, smart contracts such as those that comprise DeFi, one set of solutions stands out. As Vitalik pointed out in his post, a rollup-centric Ethereum roadmap, the Ethereum community is likely to be focused on rollups as the core scaling strategy in the short-to-medium term. 

This makes sense: Base-layer scalability through ETH 2.0 is still a few years away, but earlier phases of ETH 2.0 are imminently useful to rollups by providing a performant, low-cost data availability layer.

How did we arrive at rollups?

Rollups were born out of Plasma. In Plasma, an L1 contract holds funds and tracks cryptographic commitments to a sidechain state. The actual sidechain state is maintained by operators off-chain, with a tiny data footprint on L1. Rollups emerged as an iteration on Plasma intended to address the challenge of data availability by publishing some data about each transaction on L1. These transactions can then be “rolled up” into a single sidechain block. 

Such a design “splits” the work between L1 and L2. L1 handles data availability, while L2 – the rollup, in this case – handles computation. While rollups can’t process as many transactions per second as Plasma, they also don’t suffer from data withholding attacks: network participants can always reconstruct the most recent L2 state from the data posted to L1. While certain types of contracts may benefit from the Plasma approach, DeFi contracts cannot afford liveness failures. Meanwhile, rollups are orders of magnitude cheaper to use than L1. 

There are two types of rollups: ORs and ZKRs. Both use L1 for data availability, but each has a different way of handling state transitions. ORs use fraud proofs: If an incorrect state transition is posted to the sidechain, someone needs to detect the fraud and successfully post a proof to the mainnet contract to prevent loss of funds. In contrast, ZKRs post a cryptographic proof that each state transition was correctly computed. Fraudulent transactions are ruled out a priori: a fraudulent proof will be rejected automatically, just as a regular Ethereum transaction with an invalid signature won’t be processed by the network. In our opinion, ZKRs are objectively superior and the likely long-term winning architecture, while ORs are an intermediate solution.

As the zkSync team says, trust math, not validators.  Crucially, security in ZKRs depends on cryptography, not game theory. Most L2 technologies, including Plasma and ORs, rely on a game of cat and mouse between the attacker and the honest parties. This type of security relies on assumptions about the behavior of different actors. Such assumptions may prove flawed as actors behave in complex ways that are hard to predict beforehand. In addition to unforeseen failure modes, game theory also increases the complexity of the design. By drawing security from pure cryptography, ZKRs offer higher reliability and simplicity, positioning them as uniquely capable of safeguarding Ethereum.

The validity-proof-based architecture also makes ZKRs significantly more capital efficient than fraud-proof L2s. State channels require full collateralization. ORs require users to lock up capital for around two weeks in order to give sufficient time for fraud proofs, in case something goes wrong. For ZKRs, this lockup is on the order of minutes. If we expect hundreds of billions worth of capital to live across L2 contracts, the difference in efficiency is determinative. Allowing capital to flow seamlessly to where it’s most valued is at the core of what’s made DeFi successful. ZKRs are our best bet of preserving this property as we migrate to L2.

Lastly, among rollups, ZKRs are poised to offer the greatest amount of raw scalability. The bottleneck for all rollups will inevitably be the cost of storing data on L1. For those who want even lower costs, there will be zkPorter which provides off-chain data availability (see below), with 20,000+ TPS available, and common transactions like “swaps” likely costing a few cents. zkPorter will ship with zkSync 2.0 in Q4 2021.

Screen Shot 2021-07-21 at 12.50.11 PM.png

Meanwhile, ZK proofs are becoming significantly more efficient, and the rate of development and innovation within the ZK community is breathtaking. ZK-architectures are quickly becoming the future. The first vector of efficiency improvement is coming through better software: The last few years have seen an explosion of new proof systems and improvements on key components of proving time and proof size. This trend shows no signs of abating and will inevitably lead to further improvements in efficiency. 

Another (independent) vector of improvement is hardware: A number of teams are building specialized hardware (FPGAs, ASICs) for ZK proofs. These efforts are expected to generate significant improvements in efficiency for generating cryptographic proofs. In other words, unlike other L2 architectures, ZKRs are benefiting from major software and hardware tailwinds. If we’re willing to bet on Moore’s law, we can expect the efficiency advantage of ZKRs to only widen with time.

Until recently, supporting expressive smart contracts had been considered the key challenge for ZKRs, and potentially one that would take years to solve. The zkSync community is bringing that solution to market in 2021 with zkSync 2.0, much sooner than expected. Given zkSync’s blistering rate of development and ability to continually hit their aggressive deadlines, we have prioritized them as the L2 protocol to work with. Our trust in them has only grown since leading their seed round in 2019, and once they have helped to scale Ethereum, the world of possibility will continue to open for this talented community of builders.

To learn more, we encourage you to check out their website, follow them on Twitter, read their Medium, and peruse their open positions.

With thanks to Alex Evans and the zkSync community for their help with this post.