zkSync

zkSync Era is a Layer 2 ZK rollup for Ethereum, developed by Matter Labs and powered by ZK Stack. It scales Ethereum through validity proofs, called cryptographic SNARKs, that verify the correctness of transaction batches before they settle on L1, delivering low fees and near-instant finality without compromising Ethereum's security guarantees.

The network is EVM-equivalent: Solidity and Vyper contracts compile to zkSync-compatible bytecode via the zksolc and zkvyper compilers, and developers can use existing tooling such as Hardhat, Foundry, ethers.js, viem, and Web3.js with minimal changes.

zkSync Era extends the standard Ethereum JSON-RPC interface with a zks_* namespace for L2-specific operations — bridge contract addresses, L1 batch lookups, fee parameters, paymaster integration, and Merkle proof generation across its unique single-level binary tree architecture.

Key Features

  • ZK Rollup Architecture: Validity proofs (SNARKs) cryptographically guarantee that every L2 state transition is correct before it's accepted on L1 — no fraud-proof challenge window
  • EVM-Equivalent: Deploy existing Solidity / Vyper contracts with minimal changes; full support for Hardhat, Foundry, ethers.js, viem, Web3.js, and zksync-ethers
  • Native Account Abstraction: First-class support for smart accounts at the protocol level (not bolted on via EIP-4337); paymasters can sponsor gas or accept payment in any token
  • EraVM: A custom register-based VM optimized for ZK proving, with an EVM Bytecode Interpreter for full equivalence
  • Hyperchains: zkSync's ZK Stack lets any team launch their own ZK rollup that interoperates with zkSync Era through a shared bridgehub
  • Paymasters: Built-in protocol-level support for gas sponsorship and ERC-20 fee payment
  • Sub-Second Block Times: ~1 second block production for low-latency UX
  • L1 Batches: Transactions are grouped into batches, then committed, proven, and executed on L1 — explorers and indexers operate at the batch granularity via zks_* methods
  • Bridgehub Architecture: All canonical bridge contracts are coordinated through the bridgehub, exposed via zks_getBridgehubContract and zks_getBridgeContracts
  • Sepolia Testnet: Public testnet at chain ID 300 for development and testing

TECHNICAL DISCLAIMER: AUTHORITATIVE JSON-RPC SPECIFICATION

GetBlock’s zkSync Era API reference documentation is provided exclusively for informational purposes and to optimize the developer experience. The standard Ethereum JSON-RPC base is specified by the Ethereum community at ethereum.org/developers/docs/apis/json-rpc. The canonical specification for the zks_* namespace, debug_* traces, and pubsub subscriptions specific to zkSync is published at docs.zksync.io/zksync-protocol/api. For protocol-level details on EraVM, account abstraction, and the bridgehub, consult the official zkSync documentation.

Network Information

PropertyValue
Network NamezkSync Era Mainnet
Mainnet Chain ID324 (0x144)
TestnetSepolia testnet (chain ID 300, 0x12c)
Native CurrencyEther (ETH)
Decimals18
Block Time~1 second
ConsensusZK Rollup (validity proofs settled to Ethereum L1)
Settlement LayerEthereum mainnet
Smart Contract VMEraVM (with EVM Bytecode Interpreter for full equivalence)
EVM CompatibleYes (EVM-equivalent — full Solidity / Vyper support)
Address FormatEthereum-style (0x…, 20 bytes)
Block Explorerexplorer.zksync.io
L1 Exploreretherscan.io (for L1 batch commit / prove / execute transactions)

Base URL

bashhttps://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/

All zkSync Era JSON-RPC methods are called by sending a POST request to the base URL with a standard JSON-RPC 2.0 body. For real-time subscriptions (new blocks, logs) use the WebSocket scheme: wss://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/.

Supported Networks

NetworkJSON-RPCWSSFrankfurt, Germany
Mainnet✅✅✅
Sepolia Testnet✅✅✅

Quickstart

In this section, you will learn how to make your first call with either:

  • Axios (JavaScript / Node.js)
  • Python (Requests library)

Before you begin, you must have already installed npm or yarn on your local machine (for the Axios example) or Python and pip (for the Python example).

  1. Setup project

    bashmkdir zksync-api-quickstart
    cd zksync-api-quickstart
    npm init --yes
  2. Install Axios

    bashnpm install axios
  3. Create file

    Create a new file named index.js. This is where you will make your first call.

  4. Set ES module type

    Set the ES module "type": "module" in your package.json.

  5. Add code

    index.js

    javascriptimport axios from 'axios';
    
    const data = JSON.stringify({
        "jsonrpc": "2.0",
        "method": "eth_chainId",
        "params": [],
        "id": "getblock.io"
    });
    
    const config = {
        method: 'post',
        url: 'https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/',
        headers: {
            'Content-Type': 'application/json'
        },
        data: data
    };
    
    axios(config)
        .then(response => console.log(JSON.stringify(response.data, null, 2)))
        .catch(error => console.log(error));

    Replace <ACCESS-TOKEN> with your actual GetBlock access token.

  6. Run the script

    bashnode index.js

    Expected output:

    json{
        "jsonrpc": "2.0",
        "id": "getblock.io",
        "result": "0x144"
    }

    The result field 0x144 confirms you are connected to zkSync Era mainnet (chain ID 324).

  1. Setup the project directory

    bashmkdir zksync-api-quickstart
    cd zksync-api-quickstart
  2. Create and activate a virtual environment

    bashpython -m venv venv
    source venv/bin/activate
    
    # On Windows, use venv\Scripts\activate
  3. Install requests

    bashpip install requests
  4. Create script

    main.py

    pythonimport requests
    import json
    
    url = "https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/"
    
    payload = json.dumps({
        "jsonrpc": "2.0",
        "method": "eth_chainId",
        "params": [],
        "id": "getblock.io"
    })
    
    headers = {
        'Content-Type': 'application/json'
    }
    
    response = requests.post(url, headers=headers, data=payload)
    print(response.text)

    Replace <ACCESS-TOKEN> with your actual access token from GetBlock.

  5. Run the script

    bashpython main.py

Available API Methods

zkSync Era exposes the full Ethereum JSON-RPC method set, plus the zks_* namespace for L2-specific operations, plus debug_* tracing, plus standard eth_subscribe WebSocket subscriptions.

Ethereum: Blocks & Chain

MethodDescription
eth_blockNumberReturns the current latest L2 block number
eth_chainIdReturns the chain ID (0x144 = 324 for zkSync Era mainnet)
eth_getBlockByNumberReturns block information by block number
eth_getBlockByHashReturns block information by block hash
eth_getBlockTransactionCountByNumberNumber of transactions in a block by block number
eth_getBlockTransactionCountByHashNumber of transactions in a block by block hash
eth_getBlockReceiptsAll transaction receipts for a given block
eth_syncingSync status or false if node is fully synced

Ethereum: Account & State

MethodDescription
eth_getBalanceReturns the ETH balance of an account (in wei)
eth_getCodeReturns the contract bytecode at a given address
eth_getStorageAtReturns the value at a specific storage slot
eth_getTransactionCountReturns the transaction count (nonce) for an account

Ethereum: Transactions

MethodDescription
eth_sendRawTransactionBroadcasts a signed transaction
eth_getTransactionByHashReturns a transaction by its hash
eth_getTransactionReceiptReturns the receipt for a transaction by hash
eth_callExecutes a read-only call against contract state
eth_estimateGasEstimates gas required for a transaction

Ethereum: Gas, Fees, & Logs

MethodDescription
eth_gasPriceReturns the current gas price
eth_maxPriorityFeePerGasReturns the suggested max priority fee per gas (EIP-1559)
eth_feeHistoryReturns historical base fees and priority fees
eth_getLogsReturns logs matching a given filter

WebSocket Subscriptions

MethodDescription
eth_subscribeSubscribes to events (newHeads, logs)
eth_unsubscribeCancels an existing subscription

Network & Client Info

MethodDescription
net_versionReturns the network ID (324 for mainnet, 300 for Sepolia testnet)
net_listeningReturns true if the client is actively listening for connections
net_peerCountReturns the number of peers connected to the node
web3_clientVersionReturns the client software version
web3_sha3Returns the Keccak-256 hash of the given data

zkSync: Bridge & Contracts (zks_*)

MethodDescription
zks_getBridgehubContractReturns the L1 bridgehub contract address
zks_getBridgeContractsReturns canonical bridge contract addresses (L1/L2 ERC-20, WETH)
zks_getMainContractReturns the main L1 zkSync diamond contract address
zks_getTestnetPaymasterReturns the testnet paymaster address (testnet only)

zkSync: L1 Batches & Blocks (zks_*)

MethodDescription
zks_L1BatchNumberReturns the current L1 batch number
zks_getL1BatchBlockRangeReturns the L2 block range contained in a given L1 batch
zks_getL1BatchDetailsReturns details for a specific L1 batch (commit/prove/execute hashes)
zks_getBlockDetailsReturns zkSync-specific details for a block (status, gas, batch)

zkSync: Fees, Gas, & Proofs (zks_*)

MethodDescription
zks_getFeeParamsReturns current fee parameters (L1 gas price, pubdata price, etc.)
zks_getL1GasPriceReturns the current L1 gas price (used in L1→L2 fee calculations)
zks_gasPerPubdataReturns the scaled gas-per-pubdata limit for the currently open batch
zks_estimateGasL1ToL2Estimates gas required for an L1 to L2 transaction
zks_getProofReturns Merkle proofs for storage values (zkSync's binary tree)
zks_getL2ToL1LogProofReturns the proof for an L2→L1 log (used for withdrawals)

zkSync: Transactions & Bytecode (zks_*)

MethodDescription
zks_getTransactionDetailsReturns zkSync-specific transaction details (L1 commit/prove/execute hashes)
zks_getBytecodeByHashReturns contract bytecode by its hash
unstable_sendRawTransactionWithDetailedOutputBroadcast tx and return optimistic storage logs + events

Debug & Tracing (debug_*)

MethodDescription
debug_traceTransactionReplay and trace a transaction by hash
debug_traceCallTrace a call at a specific block
debug_traceBlockByHashTrace all transactions within a block specified by hash
debug_traceBlockByNumberTrace all transactions within a block specified by number

Support

For technical support and questions:

See Also