zkSync: Rolling up the Tech

Ethereum scaling buzz can overwhelm anyone — it’s just too much stuff: various L2s, SNARKs, Roll-ups, Validity proofs and that’s only the face of it. Here’s your most technical non-technical guide on ZKSync, a key Ethereum scaling solution, that tries to be substantial enough without bordering technical documentation.

Technicalities

The Scaling Problem

If you used Ethereum at least once, you know why scaling is such an issue. Transactions compete for limited throughput, which causes gas fees to spike. Fees have reached thousands of dollars with no upper limit in sight. This is where L2s come in.

Blockchains on top of Blockchain

The way to go is to process transactions off of Ethereum Mainnet. This allows bundling transactions together before posting them back to Mainnet in a compressed form or sending proofs instead of them (more on that later).

To maintain security, separate Layer 2 blockchains are introduced that extend Ethereum's capabilities. These L2 chains work through submitted transactions, perform computations, and execute them. They then bundle transactions into a batch (basically, one transaction) that gets rolled up and submitted to Ethereum Mainnet.

This roll-up approach spares Mainnet from processing each individual transaction, while still utilizing its security to validate the final bundled transactions. Fees are split between the transactions in each roll-up batch.

Optimism vs. Pessimism

The two key types of Rollups are Optimistic Rollups and zkRollups. What’s the difference, you say?

One aspect previously ignored (brazenly so) is how to validate transactions that occur on L2 chains. Naturally, if validation happens solely within the L2, you lose Ethereum's security guarantees — and the chain is not much of an L2 anyway.

The core of any L2 relies on Ethereum smart contracts to verify bundled transactions once posted from the L2. But work needs to happen on the L2 first.

Should optimism be of service when it comes to finances, the solution is to initially assume L2 transactions are valid before Ethereum verification — hence Optimistic Rollups. They use Fraud Proofs, allowing transactions to be challenged on Ethereum Mainnet during a set period. Optimistic Rollups must post all transaction data to Ethereum, which is naturally compressed.

A pessimist's path is to validate L2 transactions first, before submitting summarized data and Validity Proofs to Ethereum. These proofs show the L2's new state properly follows from its previous state based on executed transactions. Ethereum only verifies the proofs themselves are valid. These rollups are called zkRollups.

Why not just cheat the system?

Ethereum serves as the settlement layer for L2s by verifying the final state of each rollup batch, and identifying any invalid blocks. So, you can’t cheat, because it’s all backed by Ethereum.

Slashing, a key mechanism in Proof of Stake, a validation mechanism most L2s use, helps ensure validators provide correct data. Nodes must lock up funds as a bond. If they post an invalid block, this bond can be slashed — meaning those staked funds are taken away as a penalty. This means validators risk losing funds if they misbehave.

This gives validators a vested interest in providing valid data.

ZK-SNARKs/ZK-STARKs

Zero-knowledge (ZK) validity proofs allow checking if a transaction is true without revealing the transaction details. More so, anyone can verify the proof's validity without seeing the actual data.

In other words, ZK proofs convince others that a statement is true without exposing the statement itself. For instance, you could prove you know a certain number needed to access something, without sharing the actual number.

zkRollups leverage these proofs to confirm transaction correctness without re-running them on Ethereum. This is accomplished using ZK-SNARKs.

ZK-SNARKs are a protocol that generates succinct and efficient ZK proofs. However, they require "public parameters" that if the information that went into their creation is compromised, could allow false proof creation.

To keep things secure, multiple participants contribute random values to set up the parameters. These parties then destroy their value information — if even one removes their data, the whole input becomes irrecoverable.

ZK-STARKs are similar but don't need trusted parties, using publicly verifiable randomness instead. They also provide better scalability and even quantum security we’ll hopefully need in 2370. Still, these kinds of proofs are quite large.

ZKSync

zkSync, created by Matter Labs, is an L2 solution built on top of Ethereum that uses zkRollups technology. Building a zkRollup is much harder than an optimistic rollup, but zkRollups offer stronger security guarantees based on advanced maths rather than relying solely on game theory, that is human behavior.

The projected peak TPS of zkSync is around 2,000, which is higher than Optimistic Rollups. When enhanced with zkPorter, an off-chain data storage solution, zkSync can reach approximately 20,000 TPS.

Actually, two versions of zkSync exist: zkSync 1.0 (Lite) which has been around since 2020, and the recently released zkSync 2.0 (Era).

To understand why there are two major iterations and what took over three years of development, let's dive into the issue of programmability.

Programmability: What’s zkEVM?

Creating a basic transaction network is one thing. But a blockchain that can run executable smart contract programs? Now that's some next-level stuff. Especially if you want security AND high throughput.

Smart contract blockchains need a virtual machine environment — like EVM — where the network state lives on nodes.

To efficiently run Solidity and other EVM-compatible code on an L2 chain requires rethinking the virtual machine design. This is the idea behind zkSync's zkEVM. And a lot of work has gone into building an EVM that can achieve zkSync's goals.

Meet zkSync Era

zkSync 1.0 (Lite) focused on being a fast and inexpensive L2 for basic transactions, with minimal smart contract support. You could mainly just send funds.

zkSync 2.0 (zkSync Era) introduces the zkEVM for full smart contract capabilities.

Matter Labs has not announced an end to support for zkSync Lite. It could very well be the case though. No surprise here, as zkSync Era offers much more.

zkSync Era Superpowers

The tech developed for building zkSync 1.0 was later used for zkSync 2.0. These are the features it inherited from zkSync Lite.

  • Super fast, real-time transactions — How? Validators stake a sizable bond on Ethereum. They then confirm transactions in seconds by producing 2/3 majority confirmation that the tx will appear in the next block. If it doesn't, the bond is slashed — compensating the user and burning the rest.

  • Security, Better Censorship Resistance — There are Validators who process transactions and generate proofs and Guardians who monitor activity. Guardians identify censoring behavior and can trigger validators’ slashing.

  • Even More Secure with a Novel zk-SNARK— zkSync uses the RedShift SNARK, which provides short proofs unlike zk-STARKs while eliminating the need for a trusted setup. It is also universal, meaning it works for any computation, and conceivably provides quantum security.

And what did zkSync bring to the table? Let’s take a look:

  • Even Faster with Powerful LLVM Compiler — The LLVM compiler optimizes execution of EVM languages, boosting efficiency further.

  • Cheaper due to Data Compression — Data costs gas on L2s. zkSync's zkEVM posts compressed state updates vs. transaction inputs, reducing fees.

  • Great UX due to Native Account Abstraction — Account abstraction means your account capabilities go beyond a basic Ethereum address. For example, you can pay fees in custom tokens rather than just ETH. This allows much more flexible user experiences.

zkPorter and zkSync’s vision

zkPorter is a supplementary scaling solution developed by Matter Labs that enables off-chain data availability storage. It is secured by Guardians who face slashing penalties for misbehavior. This sacrifices some decentralization compared to purely on-chain data availability on Ethereum but enables much faster and cheaper transactions.

Source: Matter Labs

zkRollups alone provide approximately 100x scalability gains — still not enough for many financial use cases. Increased user activity will inevitably cause fee spikes. Off-chain data availability via zkPorter avoids these limitations without fully compromising security or decentralization.

With zkPorter, gas fees can be as low as $0.03, as most of the transaction fee stems from Ethereum data availability costs.

zkSync's vision is to offer a spectrum of solutions balanced for speed, cost, security, and decentralization. Users can choose fast and inexpensive zkPorter transactions, or more decentralized and secure zkRollup-only transactions, based on their needs. With the advent of mass adoption, we’ll need both.

Why all the buzz?

As a zkRollup, zkSync surpasses solutions based on Optimistic Rollups like Optimism and Arbitrum in security, as it relies on cryptographic proofs rather than game theory and behavioral patterns. zkSync's novel zkSNARK, RedShift, eliminates the need for a trusted setup while still producing short proofs, unlike a zkSTARK. Combined with zkPorter for off-chain data availability, zkSync is expected to have much lower fees and reach 20,000 TPS. Once Ethereum sharding is implemented, it could reach 100,000 TPS.

Vitalik Buterin has expressed that while Optimistic Rollups may have some advantages, zkRollups will win long-term.

zkSync faces competition from other zkRollup solutions like Polygon zkEVM, Polygon Zero, Aztec Network, StarkNet, and Loopring. It's hard to predict technological winners, but zkSync has some key advantages:

  1. First mover advantage — zkSync is among the first live zkRollups, having processed over 16 million transactions and accumulated 100M+ in total value locked.

  2. Lower projected fees with zkPorter — off-chain data could make fees negligible.

  3. zkSNARK without trusted setup — zkSync's zkSNARK produces short proofs unlike StarkNet, yet eliminates setup risks.

  4. Built-in account abstraction — provides excellent UX similar to fintech apps.

Credits

  1. Introducing zkSync: the missing link to mass adoption of Ethereum by Alex Gluchowski

  2. zkSync 2.0: Hello Ethereum! by Matter Labs

  3. gm zkEVM! by Matter Labs

  4. zkPorter: a breakthrough in L2 scaling by Matter Labs

  5. The zkEVM World: An Overview of zkSync by Binance Research

  6. zkSync Era Basics, zkSynk Docs

  7. Validity Proofs vs. Fraud Proofs Strike Back by StakWare’s Avihu Levy & Uri Kolodny

  8. Layer 2 by Ethereum Foundation

  9. ZERO-KNOWLEDGE ROLLUPS by Ethereum Foundation’s contributors

  10. OPTIMISTIC ROLLUPS by Ethereum Foundation’s contributors

  11. An incomplete Guide to Rollups by Vitalik Buterin

Subscribe to Solodan
Receive the latest updates directly to your inbox.
Mint this entry as an NFT to add it to your collection.
Verification
This entry has been permanently stored onchain and signed by its creator.