0%
Overview page background
HomeOverviewsLayer 2
What is ZKsync Era? An Overview For Ethereum Developers

What is ZKsync Era? An Overview For Ethereum Developers

Sankrit K headshot

Written by Sankrit K

Brady Werkheiser headshot

Reviewed by Brady Werkheiser

Published on May 9, 20245 min read

ZK rollups emerged as a promising solution for blockchain scalability — they improved privacy through zero-knowledge proofs (ZKPs), increased transaction speeds, and greatly reduced fees. Yet, they lacked adoption as ZK rollups were not compatible with the Ethereum Virtual Machine (EVM).

The EVM is the crux of Ethereum that allows developers to build and deploy dapps using Solidity. As traditional ZK rollups were not EVM-compatible, developers had to rewrite smart contracts altogether for the ZK rollup environment. Consequently, despite its potential upsides, it turned out to be a roadblock for the technology’s adoption. ZKsync aims to change that.

ZKsync by Matter Labs is a first-of-its-kind layer 2 scaling solution for Ethereum. Within just six months of unveiling their vision of a trustless and privacy-focused scaling solution for Ethereum, ZKsync stunned the blockchain space by achieving the seemingly impossible: EVM compatibility.

Eventually, ZKsync evolved into two; ZKsync Lite and ZKsync Era.

This article gets into the weeds of ZKsync Era, how it differs from ZKsync Lite, and how it stands out from other ZK-blockchains.

ZKsync is a general-purpose layer 2 Ethereum solution and the world’s first EVM-compatible ZK rollup.

It addresses two persistent problems of the Ethereum mainnet: scalability and high transaction fees.

A graph of zkSync Era TVL
zkSync Era TVL

With its LLVM-based compiler, developers building for Ethereum through ZKsync can write smart contracts in languages like Solidity, and Vyper. Most EVM-based smart contracts can be migrated to leverage the full potential of ZK rollups without rewriting a single line of code.

EVMs are completely transparent — and for good reason, i.e., verifiability. Only through transparency, could an EVM-based blockchain ensure that all transactions are not only visible but also verifiable by any participant.

This level of openness guarantees that all operations adhere to the consensus rules set by the network, thereby preventing fraud and ensuring that the network remains secure and decentralized.

But the goal was never transparency. It was trustlessness. Transparency was merely the path towards trustlessness before ZK rollups.

For example, an honest actor (say, a regular user), might prefer their transactions and other information to remain private as a personal preference. Blockchains, traditionally, did not allow this.

But with zkEVMs, any transaction on the blockchain can be proven probabilistically rather than reveal every piece of information in the transaction.

A diagram of a zkEVM transaction.
zkEVM transaction diagram

Matter Labs’ first iteration of ZKsync was ZKsync 1.0 — a layer 2 solution primarily focused on enabling secure and cost-effective token transfers on Ethereum. It was later renamed “ZKsync Lite”.

ZKsync Lite bundles tractions off-chain to generate validity proofs, which are then submitted on the Ethereum mainnet for verification. However, it does not have full EVM compatibility, hence the array of supported dApps is restricted.

ZKsync Lite’s limitations prompted a second iteration, ZKsync 2.0 that we now know as “ZKsync Era”.

Chain

ZKsync Lite

ZKsync Era

Focus

Scalable payments and token transfers

Fully programmable scaling solution

EVM Compatibility

Limited

Full

Smart Contract Support

Basic (swaps, transfers)

Extensive (DeFi, NFTs, DAOs, etc.)

Architecture

Pure ZK rollup

Hybrid (ZK rollup and zkPorter for greater scalability)

Integration Speed

Fast

Slower than ZKsync Lite

Use Cases

Payments, simple transactions

Payments, complex dApps, DeFi protocols, NFT marketplaces, games, etc.

Learn more in the documentation.

Older or legacy blockchains struggle to implement account abstraction innovations natively at the protocol level. As they are much more mature, integrating AA tech stack at the protocol level would cause backward compatibility issues.

ZKsync, on the other hand, is a relatively new solution that has enshrined AA through an integration similar to ERC-4337.

Here’s how the protocol natively implements AA:

zkSync account abstraction diagram. Source: Clave
zkSync account abstraction diagram

Transactions are sent from EOAs and contracts to the mempool. This includes regular transfers, contract interactions, and other transaction types.

The Bundler (Operator Sequencer) picks up transactions from the mempool and bundles them into a batch.

This process includes the generation of cryptographic proofs (likely zero-knowledge proofs) by the Entrypoint (BootLoader) that attest to the validity of all transactions in the batch without revealing underlying transaction data.

The bundled transactions and their proofs are submitted to the Rollup Contract on Ethereum L1.

The Rollup Contract verifies these proofs and, upon successful validation, finalizes the transactions.

This step effectively writes the results of the Layer 2 computations back to the main Ethereum blockchain.

Once the transactions are confirmed by the Rollup Contract, they are considered finalized.

The finality of the block on Ethereum ensures that all included transactions are immutable and officially part of the Ethereum ledger.

“ZK tech is the holy grail of scaling. And this is how, eventually, Ethereum and all blockchains will scale.”

Alex Gluchowski | Co-Founder and CEO of Matter Labs

Zero-knowledge proof, specifically recursive ZK-SNARKs, are central to the technology used in ZKsync.

SNARKs are a specific type of zero-knowledge proof that are both succinct (meaning they are small in size and quick to verify) and non-interactive (requiring no back-and-forth communication between the prover and the verifier).

Recursive SNARKs expand on this by allowing a SNARK proof to verify another SNARK. This enables the construction of a "proof pyramid," where each layer depends on the validity of the previous one, allowing for scalable and efficient verification of a potentially vast number of computations or transactions.

Therefore, even devices with comparatively low computational power, like smartphones, can verify a large number of transactions with minimal resources.

A zkSync block verification diagram created by Matter Labs
zkSync block verification diagram. Source: Matter Labs

Supporting ZKsync technology is its framework, ZK Stack.

ZK Stack is a modular, open-source framework based on the principles of ZK Credo for building ZK-powered Hyperchains.

These Hyperchains are like standalone blockchains that benefit from seamless interoperability within the ZK Sync ecosystem.

A diagram of ZK-powered hyperchain structure.
ZK hyperchain diagram. Source: Matter Labs

ZK Stack’s modularity provides developers granular control over:

  • Data Availability: Choose between rollup, validium, or volition configurations for optimal privacy and scalability trade-offs.

  • Tokenomics: Design your Hyperchain with Ether as the base token, a custom token, or even support multiple tokens.

  • Sequencing: Implement different sequencer setups for centralized efficiency (high-frequency trading) or decentralized permissionless security.

Until a few years ago, the community sought after sidechains and plasma for Ethereum scalability. Now, however, rollups have taken center stage as the technology to scale Ethereum effectively.

Since their introduction in 2018, ZK rollups, in particular, have gathered significant mindshare and adoption with large projects like Polygon adopting them and thought leaders like Vitalik Buterin advocating for them.

A ZK Proofs and Scaling Diagram.
ZK Proofs and Scaling Diagram. Source: Linea

According to L2 beat, there are already 11 active ZK rollup-based layer 2 scaling solutions and 14 more coming soon, at the time of writing. Given such a wide array of options, how do development teams make the sound decision of choosing the right rollup to build on?

A list of ZK rollup-based layer 2 scaling solutions.
ZK rollup-based layer 2 scaling solutions. Source: L2Beat

There are three factors to take into consideration when building a dApps:

  1. Choosing the Right Chain: Evaluate scalability, security, and developer support. Select the blockchain that aligns with project needs in these areas.

  2. Considering a Multichain Strategy: Balance the broader market access and risk mitigation of a multichain approach against increased complexity and costs.

  3. Assessing Engineering Overhead: Consider integration ease, operational maintenance, and developer skills required. Estimate the total costs and time commitments involved.

Let’s see how ZKsync Era differs from Starknet and Polygon zkEVM.

Starknet is the leading ZK rollup scaling solution for Ethereum (in terms of TVL) and shares a similar goal as ZKsync Era — to scale Ethereum and facilitate mass adoption.

ZKsync Era focused on backwards compatibility so that developers have an easy time migrating their projects or building with their existing knowledge of Solidity and Vyper.

Starknet, on the other hand, prioritized an approach that could possibly entice newcomers who are not familiar with any of the mainstream blockchain development languages and can continue with the supposedly simpler language, Cairo.

Below is a table that elucidates the difference between ZKsync Era and Starknet.

Chain

ZKsync Era

Starknet

Proof Generation

ZK-SNARK

ZK-STARK

Proof Size

Small

Large

Trustlessness

Less

More

Verification Cost

~460,000 gas per batch

Polylogarithmic (lower with EIP-4844)

EVM Compatibility

Yes

No

Developer Experience

Easier for Ethereum devs

Learning curve for Ethereum devs

Programming Languages

Solidity, Vyper

Cairo

Compiler

LLVM

Warp

ZKsync Era and Polygon zkEVM launched less than one week apart and both are based on similar technology with nuanced differences. Particularly, Polygon zkEVM is an EVM-equivalent rollup while ZKsync Era is an EVM-compatible rollup.

“EVM-compatible” means its underlying virtual machine can understand and execute code written for the Ethereum Virtual Machine (EVM). Developers can easily port existing Ethereum smart contracts to ZKsync Era with minimal modifications.

“EVM-equivalent” means it achieves similar functionality to the EVM but uses a different virtual machine under the hood. Developers might need to adapt their existing Ethereum smart contracts to work flawlessly on Polygon zkEVM.

The comparison table below highlights crucial differences between ZKsync Era and Polygon zkEVM.

Chain

ZKsync Era

Polygon zkEVM

Proof Generation

ZK-SNARK

ZK-SNARK and zk-STARK

Proof Size

Small

Large

Trustlessness

Less

More

EVM Compatibility

Compatible

Equivalent

Developer Experience


Easy migration of Ethereum smart contracts

Might require some code adaptation

Programming Languages

Solidity, Vyper

Solidity

Compiler

LLVM

No compiler used

ZKsync is now live on Alchemy.

This integration removes the burden of running and maintaining ZKsync nodes, allowing you to focus on your application's unique value proposition.

Access ZKsync Era's mainnet and testnet RPC endpoints through Alchemy's supernodes. With Alchemy’s APIs, developers get high reliability and a streamlined development experience.

  1. Sign up for a free account: Visit Alchemy and create your account.

  2. Obtain ZKsync Era RPC Endpoints: Look for the ZKsync Era (mainnet and testnet) endpoints on your Alchemy dashboard.

  3. Start Building: Integrate these endpoints into your dApp.

Check out the ZKsync Era API Quickstart documentation for more information.

Overview cards background graphic
Section background image

Build blockchain magic

Alchemy combines the most powerful web3 developer products and tools with resources, community and legendary support.

Get your API key