Overview

Learn about the ZKsync VM's functionality, its role in the ZK Stack compared to the EVM in Ethereum, and how it handles smart contracts and transaction fees.

The ZKsync VM (zero-knowledge Ethereum Virtual Machine) is an essential component of the ZK Stack, designed to execute transactions similarly to the Ethereum Virtual Machine (EVM) but with a unique set of functionalities tailored to the needs of rollups.

ZKsync VM and its role in ZK Stack

Unlike the EVM that operates Ethereum's smart contracts directly, the ZKsync VM is specifically engineered to efficiently run the State Transition Function (STF), which is vital for producing proofs of correct execution in a rollup context. This STF is defined by the Bootloader, which implements and runs it.

Execution of transactions

Transactions executed by the ZKsync VM are primarily written in native ZKsync VM bytecode, enabling straightforward execution. In the future, the system will also accommodate EVM bytecode through an efficient interpreter built into the ZKsync VM.


Special features of ZKsync VM

The ZKsync VM incorporates several specialized features to meet the demands of rollups, including:

  • Storage and Gas Metering: Adaptations in storage handling and gas metering to suit the rollup model.
  • Precompiles and System Contracts: The ZKsync VM supports predeployed contracts known as precompiles and system contracts. While both are integral, system contracts have special permissions and are mainly invoked by the Bootloader, not by user transactions. These system contracts are crucial for managing specialized operations and are outlined in more detail here.

User-facing features

To enhance user experience, the ZKsync VM supports account abstraction, allowing users to customize how transaction fees are paid. This flexibility is part of the ZK Stack's efforts to improve usability and accessibility.


Fee model

The ZKsync VM's fee model differs significantly from Ethereum's due to the unique requirements of running a rollup. It considers the various costs associated with rollup operations, including:

  • Data and Proof Execution Costs on L1: Ensures that the rollup's data and proof computations are financially sustainable when settled on Ethereum.
  • Sequencer and Prover Costs: Covers expenses related to sequencing transactions and generating zero-knowledge proofs.

The zkEVM plays a critical role in the ZK Stack by ensuring efficient execution of transactions within the unique operational environment of rollups. Its specialized features and innovative fee model are designed to maintain functionality and scalability while providing a seamless experience for users. For further exploration of these concepts, consider reading more about account abstraction and the fee mechanism in our documentation.


Made with ❤️ by the ZKsync Community