ZKsync Documentation

website·Indexed 40 days ago

https://docs.zksync.io

Developer resources for ZKsync, including the ZK Stack for launching and operating ZKsync chains, ZKsync OS, and ZKsync Era. Features documentation on the Prividium™ private permissioned blockchain, Airbender RISC-V proof system, ZKsync Connect for cross-chain asset transfers and messaging, and guides for deploying smart contracts using standard EVM tooling.

Tokens
21.5K
Snippets
42
Records
164
Agent score
72%

What's inside ZKsync

  1. Introduction to ZK Stack for deploying ZKsync chains

    ZK Stack is a developer-friendly modular framework designed for customizing and deploying interoperable ZK-powered blockchains. All chains deployed using ZK Stack within the ecosystem share users and liquidity, facilitating a cohesive network of ZKsync chains and rollup clusters.
  2. Overview of Prividium™ architecture and privacy

    Prividium™ is a licensed, permissioned blockchain designed for institutions to operate within their own infrastructure or cloud. It functions as a Validium chain, meaning it stores state off-chain in a secure database to achieve high throughput and low latency, while anchoring every transaction to Ethereum using zero-knowledge proofs for security and finality.

    Key privacy characteristics include:

    • Off-chain Data: Transaction inputs, addresses, and calldata are not posted to Ethereum; only state roots and ZK proofs are public.
    • Selective Disclosure: Operators can optionally expose specific verified metrics (e.g., total token supply or contract bytecode) to auditors or regulators via public read-only endpoints.
    • Public Visibility: Only interactions with public networks (like deposits or withdrawals) remain visible on the receiving chain.
  3. Overview of ZKsync Transaction Bundles

    Transaction bundles allow a group of transactions to be sent from an origin ZKsync chain to a destination ZKsync chain. Transactions within a bundle are executed sequentially in the order they were sent. Bundles can be configured for permissionless execution or restricted to a specific address. Note: As of the current documentation, transaction bundles are not yet live on any mainnet or testnet chains and will be added in a future protocol upgrade.
  4. Overview of the ZKsync Network (Elastic Network)

    The ZKsync Network, also known as the Elastic Network, is a system of interconnected chains (rollups or validiums) that use cryptographic validity proofs to provide scalable, low-cost transactions on Ethereum. Computation and most data are handled off-chain, with transactions bundled into batches. Because validity proofs are proven on Ethereum (L1), the network inherits Ethereum's security warranties without relying on third parties.
  5. Overview of ZK Stack core components

    A ZKsync Chain is composed of several key functional components that handle sequencing, proof generation, exploration, and fee management:

    • ZKsync OS: The core operating system for ZKsync Chains.
    • ZKsync OS Server: A high-performance sequencer designed for ZKsync OS.
    • ZKsync Airbender: A horizontally scalable implementation of the ZK proof generator.
    • Block Explorer: Provides an API and user interface for verifying contracts and exploring transactions.
    • Fee Withdrawer: A utility tool used to automate the transfer of collected fees from the ZKsync chain back to a base layer address.
  6. Overview of the Prividium SDK

    The Prividium SDK is a TypeScript library used to integrate applications with the Prividium authorization system. It is distributed under the MIT License and provides tools for authentication flows and secure RPC communication, including popup-based OAuth authentication, JWT token management, Viem integration, and a proxy CLI for local authenticated JSON-RPC proxying.
    npm install prividium
  7. Overview of ZKsync and the Elastic Network

    ZKsync provides a network of interoperable chains secured by Zero-Knowledge (ZK) proofs. Developers can either launch their own custom ZK rollups using the ZK Stack or build decentralized applications (dApps) that operate across the Elastic Network.
  8. Overview of ZKsync Chains and Rollup Clusters

    ZKsync chains are part of a "rollup cluster" architecture consisting of parallel-running chains that achieve consensus and finality on Ethereum Layer 1 (L1) via a shared bridge. They are fully interoperable within the Elastic Network. To remain trusted and interoperable, chains must be built using the ZK Stack, which ensures consistent execution and security derived from Ethereum. The architecture is modular, allowing developers to customize most components except for the zkEVM core.
  9. Overview of ZKsync Connect crosschain asset transfers

    Crosschain asset transfers allow users to move supported assets directly from one ZKsync chain to another via ZKsync Connect, eliminating the need to withdraw assets to L1 and bridge them again.

    Current Status: As of the current documentation, crosschain asset transfers are not yet live on any mainnet or testnet chains and will be introduced in a future protocol upgrade.

    Technical Workflow:

    • Assets are tracked natively across chains using Asset Router, Native Token Vault, and asset tracker contracts (deployed on L1 and participating L2s).
    • Transfers are executed via transaction bundles. On the destination chain, the InteropHandler executes the bundle by calling the L2AssetRouter to finalize the transfer.
    • ERC20 Tokens: Burned on the source chain and minted on the destination chain.
    • Other Assets: The Asset Router calls the specific asset's handler to perform the transfer logic.
  10. Overview of ZKsync Airbender Architecture

    ZKsync Airbender provides ZK proving for RISC-V execution using the following architectural components:

    • RISC-V 32I+M Architecture: Implements a 32-bit integer instruction set with multiplication extensions.
    • Modular Circuit Design: Uses "machine variants" to enable/disable features based on the use case (e.g., general-purpose kernel vs. recursive proving).
    • Cryptographic Primitives: Includes precompiled circuits for Blake2s, Blake3, and 256-bit big integer operations.
    • Proof Generation Scale: Supports up to 2³⁰ CPU cycles per proving run, processing in batches of approximately 2²² cycles per chunk.
    • Hybrid Prover: Uses a CPU for preliminary witness generation and a GPU for circuit-specific proving.
  11. Overview of ZKsync Era Architecture

    ZKsync Era is a Layer 2 zero-knowledge rollup (ZK rollup) built with the ZK Stack to scale Ethereum. It executes transactions off-chain, aggregates them into batches, and generates a zero-knowledge validity proof. This proof is submitted to Ethereum to ensure correctness and finality while reducing gas costs. It utilizes the EraVM, a high-performance virtual machine compatible with the Ethereum Virtual Machine (EVM).
  12. Understand ZKsync OS Architecture

    ZKsync OS is the operating system of the ZK Stack that defines the system-level state transition function and supports multiple Execution Environments (EEs). It uses a "one program, two targets" model implemented in Rust: the same codebase is compiled to x86 for the Sequencer runtime and RISC-V for the Airbender proving system. This ensures that the execution and proving logic are identical, reducing the audit surface and eliminating discrepancies between runtime and proof generation.

    The architecture consists of two primary layers:

    1. Execution layer: Handles transaction logic, memory, and IO to compute new state from previous blocks.
    2. Proving layer: Generates ZK proofs attesting to the correctness of the state transition.