zkPorter: a breakthrough in L2 scaling

Ending the debate between ZK and optimistic rollups

Matter Labs
Matter Labs

--

A mass migration to Layer 2 is about to take place. As protocols move from the Ethereum base layer to optimistic rollups and EVM-compatible zkRollups, many hope we’ll finally make on-chain fees manageable. But everyone working on Ethereum scaling knows the industry’s dirty secret: even with rollups, we’ll probably end up right back where we started. This is because any realistic increase in throughput will quickly get eaten up by induced demand.

Rollups can only offer a linear increase in throughput — all data still must be propagated to all full nodes. But to bring true scalability, we need an exponential gain in throughput.

That’s why we believe this is such an important breakthrough. We have designed a system with 20,000+ TPS that offers more security than optimistic rollups. More importantly, it is coming to mainnet in 6 months with zkSync 2.0.

Why aren’t rollups enough?

In October 2020, Vitalik announced a rollup-centric Ethereum roadmap, predicting Ethereum could achieve ~3000 net TPS if all L1 activity were to move to rollups. This will soon become a reality: both optimistic and zkRollups now support EVM compatibility, facilitating a quick and simple migration of applications from L1 to L2.

Ethereum is growing at an explosive, exponential rate. In one year, the number of DeFi Users increased from 150k to 1.8 millionbut gas fees grew 16 times faster! (from $0.20 to $36 per Uniswap trade)

Why? Because any improvement of scalability will be accompanied by an increase in financial activity / trading, on top of new use cases. Consider what happened during the same period:

Compared to mainnet, optimistic rollups will only offer a ~25x increase in scalability and zkRollups a ~100x increase. Before we know it, we’ll be back to square one: unaffordable gas fees and an Ethereum unaffordable for most normal users.

Crypto is about to go mainstream. And in a world with 3.8 billion smartphones (compared to Metamask’s 3 million monthly active users), we need a 1000x increase to handle what’s coming. This scalability gap is what motivated us to build zkPorter.

zkPorter: the engine for mass crypto adoption

In zkSync 2.0, the L2 state will be divided into 2 sides: zkRollup with on-chain data availability and zkPorter with off-chain data availability.

Both parts will be composable and interoperable: contracts and accounts on the zkRollup side will be able to seamlessly interact with accounts on the zkPorter side, and vice versa. That’s right! From a user’s perspective, the only perceptible difference will be a 100x reduction in fees for zkPorter accounts.

Picture this: Uniswap deploys their smart contract on the zkRollup side, and retail users on a zkPorter account can swap for <$0.03 in fees. How can it possibly be so cheap? It’s because the overwhelming majority of rollup fees are due to the costs of publishing data on Ethereum. zkPorter accounts can make thousands of swaps on the Uniswap contract, but only a single update needs to be published to Ethereum.

The data availability of zkPorter accounts will be secured by zkSync token holders, termed Guardians. They will keep track of state on the zkPorter side by signing blocks to confirm data availability of zkPorter accounts. Guardians participate in proof of stake (PoS) with the zkSync token, so any failure of data availability will cause them to get slashed. This gives cryptoeconomic guarantees of the data availability.

It is important to note that PoS in zkSync is significantly more secure than PoS in other systems such as sidechains. This is because zkSync guardians are essentially powerless: guardians cannot steal funds. They can only freeze the zkPorter state (freezing their own stake).

Every user is free to opt into their own security threshold. Any user who wants all data available on-chain can stay completely on the rollup side. But if you are a fee-sensitive user, you can choose to make zkPorter your home. (We suspect that traders and new users will most likely use zkPorter.)

This design falls under the broader solution class called Volition, pioneered by StarkWare. The difference of our approach is in strict focus on decentralization, which led to some profound architectonic changes.

This unlocks an entire category of applications that were uneconomical on L1s or even on traditional rollups. They can now also have a home on Ethereum and serve Ethereum users.

zkPorter vs optimistic rollups

This is all only possible because of the cryptography of zero-knowledge proofs. Optimistic rollups cannot achieve this kind of scaling in the way zkPorter does. If data availability were moved off-chain in an optimistic rollup, a malicious operator would be able to steal all the money in the rollup without anyone being able to challenge them.

At the same time, zkPorter has stronger security guarantees than optimistic rollups. To understand why, let’s briefly sketch out the costs and gains of potential attacks.

1) Attack costs

As of today, the cost of attacking an optimistic rollup via a 51% hashpower coordination is less than $70M (this will be less of an issue when Proof of Stake arrives). On the other hand, to make data in zkPorter unavailable, an attacker would need to accumulate ⅔ of all staked token value (which will almost certainly be greater than $70M). Moreover, since the attacker would incur significant slippage in buying up tokens (and staked tokens are not available for purchase), effecting such an attack would be significantly more expensive than the spot price would imply.

2) Attack gains

If an optimistic rollup is successfully attacked, hackers can steal all funds inside the rollup. This drastically increases the incentive to attack. An attack on zkPorter cannot be directly exploited: if it is successful, the attacker can only stop producing blocks, not steal user funds. The difficulty of monetizing a service disruption significantly decreases the incentives for such an attack.

Building on zkPorter

zkPorter is coming. The Matter Labs team is working to make this production-ready in 6 months. Soon, we can have our cake, and eat it too.

zkPorter will be available in zkSync 2.0 — our next generation smart contracts platform, which will ship with Solidity support. We aim at making the public testnet available May, and go live later in the Summer.

Meanwhile, you can use zkSync 1.x for payments (which has been live on mainnet since June 2020). In a few weeks it will support trading and NFTs.

Want an early access or support from our team? Talk to us: hello@zksync.io

Help us bring Ethereum to billions

zkSync is a mission-driven project. If you share our values, vision, and results-oriented culture, come work with us!

The hottest roles right now (full list):

Special thanks to Haseeb Qureshi for his review and comments on this post!

--

--