Home
Developer guide
Getting started
  • Getting started
  • About the testnet
    • Connecting Metamask
    • Important links
    • Feature support status
    • Known issues
    • Try it out!
    • Reporting issues
  • ZK Rollup Basics
    • Contract deployment
    • Important: Account abstraction support
    • Block numbers and time
    • 2.0 Overview
    • Handling of ETH and tokens
    • Fee model
    • Transaction types
    • Transaction formats
    • Confirmations and finality
    • Decentralization roadmap
    • L1 / L2 Interoperability
    • Current limitations
    • Web3 API
  • Understanding zkSync 2.0
  • Home
  • /
  • Getting started
  • /
  • ZK Rollup Basics

ZK Rollup Basics

What's on the page
  • What are ZK Rollups?
  • L1 and L2: what's the difference?
  • How does transaction finality work?
  • What are operators?

This page aims to introduce developers to the basic concepts behind zkSync, including topics ranging from the basics of ZK Rollups, L1 and L2 chains, and key differences in developing using zkSync over other scaling solutions.

What are ZK Rollups?

ZK Rollups ('ZK' standing for zero-knowledge) are a recent development intended to increase the scalability of Ethereum by performing calculations off-chain, rolling many transactions up into a single batch, and sending it to the main Ethereum chain for processing in one action. In zkSync, this is done via a SNARK (succinct non-interactive argument of knowledge); a cryptographic proof that performs the validation of transactions coming from the batch.

With ZK Rollups, funds are locked into the layer 1 blockchain via a smart contract. This allows transactions to be processed without the overhead of all the data typically associated with performing a transaction on the main chain, only requiring a validity proof to reach transaction finality. This significantly decreases associated transaction processing times and gas fees.

L1 and L2: what's the difference?

In decentralised ecosystems, the term layer 1 (or L1) is used to refer to the underlying primary chain architecture, such as the Ethereum network or Bitcoin. Layer 1 blockchains determine protocol rules and transaction finality, and perform the base-level functions of applications built upon them.

Layer 2 (or L2) is used to describe an overlaying application or network that operates on top of the layer 1 chain. These are most often built to provide further scalability solutions by taking on a portion of transaction-based tasks to lighten the impact on the layer-1 chain, quickening transaction times and lowering gas fees.

In the case of zkSync, the main Ethereum blockchain represents L1, and zkSync itself is the L2.

How does transaction finality work?

In the context of blockchain technology, transaction finality refers to the guarantee that transactions cannot be reverted, altered or mutated.

On Ethereum, as in Bitcoin, finality is probabilistic, i.e. the more blocks has passed since the transaction was processed, the lesser the chance that this transaction will be reverted.

In ZK Rollups, once a block has been filled and sealed, its state is committed to the main Ethereum chain. The proving step is then initiated, and a SNARK validity proof is generated for all of the block transactions. Once completed, the SNARK is submitted for verification on the L1 smart contract, and after being verified, the transaction state becomes final.

Note that finality from the zkSync perspective happens when the transaction (the SNARK verification) is processed by L1. At this stage, the guarantees are exactly like any other L1 transaction within the same L1 block; the more L1 blocks that generated after the initial block is processed, the lesser the chance that this transaction will be reverted.

At the moment, when a user sends a transaction, zkSync waits for the entire block to be filled, meaning finality time may take longer depending on the volume of transactions being submitted via zkSync. As throughput increases, the finality time will subsequently decrease.

What are operators?

Operators are the actors that perform basic ZK Rollup functionalities. They are charged with creating blocks, bundling the transactions, performing the calculations and submitting the data to the main Ethereum chain for verification.

Last updated: 7/5/2022, 1:42:16 PM
Previous
Reporting issues
Next
Contract deployment
Edit on GitHub
  • What are ZK Rollups?
  • L1 and L2: what's the difference?
  • How does transaction finality work?
  • What are operators?