Thanks to their distributed structure, blockchains tend to be slow. If a single transaction has to be verified across thousands of Ethereum’s nodes, this also makes the network expensive to use. Layer 2 systems are a potential answer to this issue, with rollups as the most popular scaling method.
Zero-knowledge (ZK) rollups use the minimum data necessary to verify transactions by unburdening Ethereum from excess network workload. This makes Ethereum both faster and cheaper.
Rollups: Layer 2 Scaling To Make Ethereum Fast and Cheap
There are a number of ways to improve Ethereum’s performance. These scaling techniques range from rollups to sidechains and state channels. Judging by the total-value-locked (TVL) in these Layer 2 networks, rollups are by far the most popular scaling technology.
As you can see, rollups are divided into two types: Optimistic and Zero-Knowledge (ZK). Both types do one job — rollups reduce the Layer 1 network’s (Ethereum) workload by scooping up, or rolling, hundreds of incoming transactions as a single transaction.
This bundled single transaction is then verified and added back to Ethereum, as another data block on its public ledger. Because of this continuous offloading of transactions from Ethereum, the Layer 1 network remains uncongested. And when Ethereum is not congested, it is much cheaper to use because its ETH gas fees fall down drastically.
That’s because public, decentralized blockchains have limited block space to contain transactions. Accordingly, when the network traffic is higher, the demand for block space increases, leading to validators charging more for each transaction to be validated.
After all, every computer network requires some bandwidth/computational resources to be expended. In the case of decentralized blockchain networks, that cost falls onto users themselves.
This is why Layer 2 networks are so important. Rollups, in particular, have a dual impact — granting fast and affordable user experience to the Ethereum ecosystem.
What Are ZK-Rollups?
Rollups are smart contracts that reduce Ethereum’s computing and storage requirements for validating a transaction block. As noted previously, they do so by rolling up hundreds of transactions into a single one.
It is the job of the rollup smart contract to then disassemble and verify all of those transfers held in a single transaction, before it is sent as a new block to Ethereum. Zero-knowledge proof is one of the methods to accomplish that.
Zero-knowledge proof executes that rollup on a Layer 2 network, such as ZK-Sync, by submitting a validity proof. This proof acts as a receipt that the rolled up transactions are indeed authentic, and as such added to Ethereum. The zero-knowledge cryptography comes into play here because it only uses minimal data to provide authenticity proof.
In other words, ZK-rollup presents the public validity of the block, without revealing its details. By reducing transaction data load, ZK-rollups improve privacy, and enable cheap and fast transactions.
How Do ZK-Rollups Work?
ZK-rollups rely on two smart contracts: the main contract and the verifier contract. Both run on Ethereum and work in tandem to link Layer 1 and Layer 2 networks:
- The main smart contract stores rolled up transactions, or blocks. It also compares the blockchain’s state to determine the state of users’ withdrawals and new deposits.
- The verifier smart contract authenticates these transactions in a block with zero-knowledge proof.
Working off-chain (not on Ethereum), a virtual machine runs the ZK-rollup. This is the offloading part, where ZK-rollups execute transactions so that Ethereum is left uncongested. Just like Ethereum Virtual Machine (EVM), ZK virtual machine is a software that runs smart contracts, much like a video game engine runs all the game’s assets to make it playable.
With this virtual machine, ZK-rollups batch Ethereum transactions off-chain into a single batched transaction. Nevertheless, they still rely on Ethereum itself as they submit the transaction as validity proof back to the Layer 1 network.
The implication of this process is that ZK-rollups are as secure as Ethereum itself because all updates on ZK-derived data are confirmed by Ethereum — its EVM — for correctness.
Lastly, because the ZK-batched transaction is submitted as a validity proof, it is also known as a succinct, non-interactive argument of knowledge (SNARK), or succinct, transparent argument of knowledge (STARK).
Pros and Cons of ZK-Rollups
Unlike Optimistic rollups, which use a fully EVM-compatible virtual machine, ZK-rollups use their own virtual machine. This produces the downside of needing high computing power to generate zero-knowledge proof.
For this reason, transaction data needs to be further optimized to achieve maximum throughput. Likewise, greater computational power of ZK-rollups exerts slightly higher transaction costs than with Optimistic rollups.
Nonetheless, in contrast to Optimistic rollups, ZK-rollups do not have a challenge period for funds to be withdrawn. That’s because ZK’s virtual machine already submits transactions as validity proof, which resolves transaction disputes beforehand. As a result, ZK-rollups are faster than both Optimistic rollups and Plasma.
Another advantage of ZK-rollups is that they promote decentralization because transactions are computed in parallel. Moreover, because zero-knowledge proof removes the need for extra data, each transaction holds only the minimum required. Needless to say, this greatly increases Layer 2 networks throughput, which also reflects on reduced Ethereum congestion as well.
With all that said, one of the bigger ZK-rollup hiccups is the potential for censorship. This danger comes from some ZK-rollups using single nodes as transaction data sequencers.
Live ZK-Rollup Networks
ZK-rollup technology is gaining traction at a rapid pace. Here are some of the most popular networks that employ this scaling technology:
- ImmutableX – a general purpose scalability provider for NFT and Web3 gaming
- zkSync – one of the most advanced ZK networks, as the first one that is EMV-compatible under zkSync 2.0
- StarkNet – another Layer 2 scalability for Ethereum’s dApps
- Aztec Connect – leverages ZK-rollup privacy to create a VPN-like service for blockchains
- Polygon Hermez – as a part of Ethereum scaling solution within Polygon
As far as usable dApps that take advantage of ZK-rollups, one of the most popular are lending dApp Yearn Finance and dYdX, a decentralized exchange and leveraged derivatives trading platform. Other notable DeFi dApps are largely present on zkSync: Curve, Taker, and ZigZag, with dozens yet to go live.
Are ZK-Rollups the Future of Ethereum Scaling?
Before 2022, Optimistic rollups were the only rollups that allowed for smart contracts to be executed off-chain because they run on a fully EVM-compatible virtual machine. Accordingly, ZK-rollups could only process basic token transfers or swaps.
This all changed in 2022 with zkSync 2.0, offering both EVM compatibility and up to 100,000 transactions per second (tps) speed. By leveraging Ethereum’s security, as the largest DeFi network, ZK-rollups provide superior security than other scaling solutions.
Although this scaling technology still faces some challenges, such as sequencer node centralization, it is likely to become Ethereum’s top scaling solution.
This series article is intended for general guidance and information purposes only for beginners participating in cryptocurrencies and DeFi. The contents of this article are not to be construed as legal, business, investment, or tax advice. You should consult with your advisors for all legal, business, investment, and tax implications and advice. The Defiant is not responsible for any lost funds. Please use your best judgment and practice due diligence before interacting with smart contracts.