zkSync-Era-Custom-zkVM-Cuts-Proving-Time-to-Seconds

zkSync Era Custom zkVM Cuts Proving Time to Seconds, Adds Bytecode Compilation Step

Ethereum Virtual Machine, zkSync, zkVM

zkSync Era implements a custom zero-knowledge virtual machine (zkVM) that diverges from the Ethereum Virtual Machine (EVM) bytecode format. Matter Labs selects this design to reduce proving time and lower per‑transaction cost. The approach replaces direct EVM execution with a compilation pipeline that converts Solidity and Vyper source code into zkEVM bytecode. Developers gain faster block finality but incur a bytecode compilation cost at deployment.

Benchmarks from production and independent testing show proving times between 10 and 20 seconds per block for zkSync Era, compared to one to five minutes for EVM‑equivalent zkEVMs under comparable loads. This article examines the compilation overhead, actual proving time measurements, and the performance trade‑off against Ethereum equivalence.

Matter Labs builds zkSync Era on a custom instruction set designed for arithmetic circuits

The zkVM does not execute EVM bytecode directly. Instead, the compiler toolchain translates high‑level smart contract code into LLVM intermediate representation, then into zkEVM bytecode. The custom instruction set includes circuit‑friendly opcodes for elliptic curve operationsPedersen hashes, and range checks. These opcodes reduce the number of constraints required for a proof.

The zkVM also replaces Keccak‑256 with Poseidon hash for state commitments and storage proofs. Poseidon requires fewer multiplication gates in a Plonk‑style proof system. This substitution lowers prover workload but breaks bytecode‑level compatibility with Ethereum.

zkVM - Keccak‑256 with Poseidon hash
zkVM also replaces Keccak‑256 with Poseidon hash – Source: Google Flow

The proof system, named Boojum, uses recursive aggregation. Each transaction proof merges into a block proof through recursion. Recursive aggregation allows the prover to handle hundreds of transactions without a linear increase in memory or time. The custom instruction set and Poseidon hash enable a smaller circuit per opcode. Smaller circuits translate directly into faster proof generation.

Bytecode Compilation Cost

Developers deploying on zkSync Era face a compilation step that does not exist on Ethereum or EVM‑equivalent zkEVMs. The pipeline runs in three stages. First, solc compiles Solidity to Yul or EVM assembly. Second, zksolc translates that output to LLVM IR. Third, the LLVM backend generates zkEVM bytecode. The LLVM optimization passes target circuit size reduction, not raw execution speed. This objective changes code layout and expands certain operations into explicit range proofs and bit decomposition constraints.

Compilation time for a medium‑sized contract ranges from several seconds to tens of seconds on a standard developer machine. Large projects such as Uniswap V3 require minutes for a full build. Standard solc compilation completes the same contracts in under one second. The additional time comes from LLVM optimization and the translation of EVM semantics into constraint‑friendly form.

zkSync Era charges a bytecode publishing fee based on the size of the compiled zkEVM bytecode. zkEVM bytecode typically measures 30 to 50 kilobytes for a basic ERC‑20 token. The equivalent EVM bytecode measures 10 to 20 kilobytes. The larger size results from the custom instruction set metadata, explicit range checks, and LLVM code layout.

Deployment gas on zkSync Era remains lower than Ethereum L1 gas in fiat terms, but the bytecode size penalty reduces the relative advantage for contract deployment. Transaction execution cost, however, does not depend on bytecode size after deployment.

Actual Proving Time Benchmarks

Proving time measures the duration for the prover to generate a validity proof for a block of transactions. Matter Labs runs GPU‑based provers using NVIDIA A100 or equivalent hardware. Public benchmarks and independent reports from 2023 and 2024 provide approximate figures.

A simple ETH transfer proof requires 0.5 to 1.0 seconds. An ERC‑20 transfer proof requires 1 to 2 seconds. A Uniswap swap proof requires 2 to 4 seconds. zkSync Era aggregates between 100 and 1000 transactions per block. A full block proof requires 10 to 20 seconds. Amortized per transaction, proving time is 10 to 50 milliseconds. Proving cost per transaction falls in the range of $0.001 to $0.01.

EVM‑equivalent zkEVMs report higher proving times

Scroll initially required 5 to 10 minutes per block, later optimized to approximately 1 minute. Polygon zkEVM reports 1 to 2 minutes per block. Taiko, a based rollup, reports 2 to 5 minutes per block.

Direct comparison remains imprecise because block sizes, prover hardware, and aggregation strategies differ. The gap, however, exceeds one order of magnitude for comparable transaction counts. The custom zkVM design provides the main source of this advantage.

Three factors contribute to faster proving

  • First, the custom opcode set maps each instruction to a small number of arithmetic constraints, avoiding 256‑bit word emulation and stack manipulation overhead.
  • Second, Poseidon hash replaces Keccak‑256 for state and storage commitments, reducing hash circuit cost by a factor of approximately 100.
  • Third, recursive proof aggregation with Boojum allows parallel proof generation for sub‑blocks and efficient merging. EVM‑equivalent systems must emulate the full EVM state transition, including Keccak precompiles and stack semantics, which increases circuit size and proving time.

Performance Trade‑Off Against Ethereum Equivalence

Ethereum equivalence offers a clear benefit: existing EVM bytecode runs unchanged. Tools such as debuggers, block explorers, and static analyzers work without modification. Scroll, Polygon zkEVM, and Taiko adopt this approach. Proving times remain higher because the EVM architecture prioritizes execution efficiency on standard CPUs, not constraint minimization in zk circuits.

EVM architecture
EVM architecture – Source: EVM Develope

zkSync Era accepts a compatibility penalty to achieve lower proving time and higher throughput. The compilation step is mandatory. Some EVM tools do not support zkEVM bytecode format. Semantic differences exist in areas such as block timestamp behavior and gas metering. Developers must use zksolc and hardhat-zksync plugins.

Deployment gas for bytecode publishing is higher per byte than on EVM‑equivalent rollups. The custom instruction set introduces a new attack surface that requires separate audits.

The measured throughput for zkSync Era reaches hundreds to thousands of transactions per second in testnet conditions. EVM‑equivalent zkEVMs report tens to hundreds of transactions per second. Finality time for zkSync Era blocks is 10 to 20 seconds after batch submission, plus L1 inclusion. EVM‑equivalent systems require longer proving windows before finality.

Teams deploying on zkSync Era must integrate the zksolc compiler into their build pipeline. Hardhat and Foundry plugins exist, but custom tooling adds maintenance overhead. Contract bytecode verified on Etherscan does not match the zkEVM bytecode deployed on zkSync Era. Developers must use the zkSync block explorer for verification.

Some Solidity features do not compile identically. block.timestamp returns the batch timestamp, not the L1 block timestamp. tx.gasprice behaves differently under the fee model. These differences require code review for multi‑chain deployments.

The compilation cost is a one‑time expense per contract deployment. Subsequent transaction costs do not include compilation. For high‑frequency trading, DeFi protocols, and gaming applications, the lower per‑transaction proving cost outweighs the deployment overhead.

For NFT collections with many unique contract deployments, the bytecode publishing fee becomes a larger fraction of total cost.

FAQ

Why does zkSync Era require a custom zkVM instead of using EVM bytecode directly?

zkSync Era uses a custom zkVM to reduce proving time. The EVM’s 256‑bit word, stack architecture, and Keccak‑256 opcode produce large arithmetic circuits. A custom instruction set with Poseidon hash and elliptic curve opcodes maps directly to fewer constraints, which lowers prover workload.

How much longer does bytecode compilation take on zkSync Era compared to standard Solidity compilation?

Medium‑sized contracts require several seconds to tens of seconds on zkSync Era, while standard solc compilation completes in under one second. Large projects such as Uniswap V3 can require minutes for a full build because of LLVM optimization passes.

What is the actual proving time for a zkSync Era block?

A full block proof requires 10 to 20 seconds on GPU‑based provers. Individual transaction proofs range from 0.5 to 4 seconds depending on complexity. Amortized per transaction, proving time is 10 to 50 milliseconds.

Does zkSync Era’s bytecode compilation increase deployment gas cost?

Yes. zkEVM bytecode is typically two to three times larger than equivalent EVM bytecode because of explicit range checks and metadata. zkSync Era charges a bytecode publishing fee based on size, so deployment gas is higher than for EVM‑equivalent rollups, though still lower than Ethereum L1 in fiat terms.

Can developers use standard Ethereum tools like Etherscan and Hardhat without modification on zkSync Era?

Hardhat works with a dedicated plugin, but Etherscan verification requires the zkSync block explorer. Standard EVM debuggers and bytecode analyzers do not support zkEVM bytecode format. Developers must adapt tooling and review semantic differences in block timestamp and gas metering.