Chainstack zkSync Era Node API

Chainstack-managed zkSync Era JSON-RPC nodes with zks_ namespace extensions.

OpenAPI Specification

chainstack-zksync-node-api-openapi.yml Raw ↑
openapi: 3.0.3
info:
  title: Chainstack zkSync Era Node API
  version: 1.0.0
  description: Chainstack-managed RPC node API for the zkSync Era blockchain. Endpoints follow the canonical JSON-RPC over
    HTTPS interface for the network. Authenticate against your Chainstack node's per-node URL (e.g. https://nd-XXX-XXX-XXX.p2pify.com/<key>).
    Merged from the Chainstack Developer Portal per-method fragments at https://github.com/chainstack/dev-portal/tree/main/openapi/zksync_node_api.
  contact:
    name: Chainstack API Support
    email: [email protected]
  license:
    name: Chainstack Terms
    url: https://chainstack.com/terms-of-service/
servers:
- url: https://{node_id}.p2pify.com/{api_key}
  description: Chainstack-managed node endpoint
  variables:
    node_id:
      default: nd-000-000-000
      description: Your Chainstack node identifier
    api_key:
      default: <api-key>
      description: Per-node access key
tags:
- name: General
paths:
  /zks_L1BatchNumber:
    post:
      summary: zks_L1BatchNumber | zkSync Era
      operationId: zks_L1BatchNumber
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/JsonRpcRequestForL1BatchNumber'
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/JsonRpcResponseForL1BatchNumber'
      tags:
      - General
  /zks_L1ChainId:
    post:
      summary: zks_L1ChainId | zkSync Era
      operationId: zks_L1ChainId
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/JsonRpcRequestForL1ChainId'
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/JsonRpcResponseForL1ChainId'
      tags:
      - General
  /zks_estimateFee:
    post:
      summary: zks_estimateFee example
      operationId: zks_estimateFee
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/JsonRpcRequest'
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/JsonRpcResponse'
      tags:
      - General
  /zks_estimateGasL1ToL2:
    post:
      summary: zks_estimateGasL1ToL2 | zkSync Era
      operationId: zks_estimateGasL1ToL2
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/JsonRpcRequestGasL1ToL2'
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/JsonRpcResponseGasL1ToL2'
      tags:
      - General
  /zks_getAllAccountBalances:
    post:
      summary: zks_getAllAccountBalances | zkSync Era
      operationId: zks_getAllAccountBalances
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/JsonRpcRequestForBalances'
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/JsonRpcResponseForBalances'
      tags:
      - General
  /zks_getBlockDetails:
    post:
      summary: zks_getBlockDetails | zkSync Era
      operationId: zks_getBlockDetails
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/JsonRpcRequestForBlockDetails'
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/JsonRpcResponseForBlockDetails'
      tags:
      - General
  /zks_getBridgeContracts:
    post:
      summary: zks_getBridgeContracts | zkSync Era
      operationId: zks_getBridgeContracts
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/JsonRpcRequestForBridgeContracts'
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/JsonRpcResponseForBridgeContracts'
      tags:
      - General
  /zks_getBytecodeByHash:
    post:
      summary: zks_getBytecodeByHash | zkSync Era
      operationId: zks_getBytecodeByHash
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/JsonRpcRequestForBytecodeByHash'
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/JsonRpcResponseForBytecodeByHash'
      tags:
      - General
  /zks_getL1BatchBlockRange:
    post:
      summary: zks_getL1BatchBlockRange | zkSync Era
      operationId: zks_getL1BatchBlockRange
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/JsonRpcRequestForL1BatchBlockRange'
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/JsonRpcResponseForL1BatchBlockRange'
      tags:
      - General
  /zks_getL1BatchDetails:
    post:
      summary: zks_getL1BatchDetails | zkSync Era
      operationId: zks_getL1BatchDetails
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/JsonRpcRequestForL1BatchDetails'
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/JsonRpcResponseForL1BatchDetails'
      tags:
      - General
  /zks_getL2ToL1LogProof:
    post:
      summary: zks_getL2ToL1LogProof | zkSync Era
      operationId: zks_getL2ToL1LogProof
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/JsonRpcRequestForL2ToL1LogProof'
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/JsonRpcResponseForL2ToL1LogProof'
      tags:
      - General
  /zks_getMainContract:
    post:
      summary: zks_getMainContract | zkSync Era
      operationId: zks_getMainContract
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/JsonRpcRequestForMainContract'
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/JsonRpcResponseForMainContract'
      tags:
      - General
  /zks_getRawBlockTransactions:
    post:
      summary: zks_getRawBlockTransactions | zkSync Era
      operationId: zks_getRawBlockTransactions
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/JsonRpcRequestForRawBlockTransactions'
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/JsonRpcResponseForRawBlockTransactions'
      tags:
      - General
  /zks_getTestnetPaymaster:
    post:
      summary: zks_getTestnetPaymaster | zkSync Era
      operationId: zks_getTestnetPaymaster
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/JsonRpcRequestForTestnetPaymaster'
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/JsonRpcResponseForTestnetPaymaster'
      tags:
      - General
  /zks_getTransactionDetails:
    post:
      summary: zks_getTransactionDetails | zkSync Era
      operationId: zks_getTransactionDetails
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/JsonRpcRequestForTransactionDetails'
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/JsonRpcResponseForTransactionDetails'
      tags:
      - General
components:
  schemas:
    JsonRpcRequestForL1BatchNumber:
      type: object
      required:
      - jsonrpc
      - id
      - method
      - params
      properties:
        jsonrpc:
          type: string
          example: '2.0'
          default: '2.0'
        id:
          type: integer
          example: 1
          default: 1
        method:
          type: string
          example: zks_L1BatchNumber
          default: zks_L1BatchNumber
        params:
          type: array
          default: []
    JsonRpcResponseForL1BatchNumber:
      type: object
      required:
      - jsonrpc
      - id
      - result
      properties:
        jsonrpc:
          type: string
          example: '2.0'
          default: '2.0'
        id:
          type: integer
          default: 1
        result:
          type: object
          properties:
            batchNumber:
              type: integer
              description: The latest L1 batch number.
    JsonRpcRequestForL1ChainId:
      type: object
      required:
      - jsonrpc
      - id
      - method
      - params
      properties:
        jsonrpc:
          type: string
          example: '2.0'
          default: '2.0'
        id:
          type: integer
          example: 1
          default: 1
        method:
          type: string
          example: zks_L1ChainId
          default: zks_L1ChainId
        params:
          type: array
          default: []
    JsonRpcResponseForL1ChainId:
      type: object
      required:
      - jsonrpc
      - id
      - result
      properties:
        jsonrpc:
          type: string
          example: '2.0'
          default: '2.0'
        id:
          type: integer
          default: 1
        result:
          type: object
          properties:
            chainId:
              type: integer
              description: The chain ID of Layer 1.
    JsonRpcRequest:
      type: object
      required:
      - jsonrpc
      - id
      - method
      - params
      properties:
        jsonrpc:
          type: string
          example: '2.0'
          default: '2.0'
        id:
          type: integer
          example: 2
          default: 2
        method:
          type: string
          example: zks_estimateFee
          default: zks_estimateFee
        params:
          type: array
          default:
          - from: '0x7AeD074cA56F5050D5A2E512eCc5bf7103937d76'
            to: '0x6B7f71BB1f5B74fB0Ff82cf4EA20A5F90d43E509'
            data: 0x
          items:
            type: object
            properties:
              from:
                type: string
                example: '0x7AeD074cA56F5050D5A2E512eCc5bf7103937d76'
                default: '0x7AeD074cA56F5050D5A2E512eCc5bf7103937d76'
              to:
                type: string
                example: '0x6B7f71BB1f5B74fB0Ff82cf4EA20A5F90d43E509'
                default: '0x6B7f71BB1f5B74fB0Ff82cf4EA20A5F90d43E509'
              data:
                type: string
                example: 0x
                default: 0x
    JsonRpcResponse:
      type: object
      required:
      - jsonrpc
      - id
      - result
      properties:
        jsonrpc:
          type: string
          example: '2.0'
          default: '2.0'
        id:
          type: integer
          default: 2
        result:
          type: object
          additionalProperties: true
    JsonRpcRequestGasL1ToL2:
      type: object
      required:
      - jsonrpc
      - id
      - method
      - params
      properties:
        jsonrpc:
          type: string
          example: '2.0'
          default: '2.0'
        id:
          type: integer
          example: 2
          default: 2
        method:
          type: string
          example: zks_estimateGasL1ToL2
          default: zks_estimateGasL1ToL2
        params:
          type: array
          default:
          - from: '0x7AeD074cA56F5050D5A2E512eCc5bf7103937d76'
            to: '0x6B7f71BB1f5B74fB0Ff82cf4EA20A5F90d43E509'
            data: 0x
          items:
            type: object
            properties:
              from:
                type: string
                example: '0x7AeD074cA56F5050D5A2E512eCc5bf7103937d76'
                default: '0x7AeD074cA56F5050D5A2E512eCc5bf7103937d76'
              to:
                type: string
                example: '0x6B7f71BB1f5B74fB0Ff82cf4EA20A5F90d43E509'
                default: '0x6B7f71BB1f5B74fB0Ff82cf4EA20A5F90d43E509'
              data:
                type: string
                example: 0x
                default: 0x
    JsonRpcResponseGasL1ToL2:
      type: object
      required:
      - jsonrpc
      - id
      - result
      properties:
        jsonrpc:
          type: string
          example: '2.0'
          default: '2.0'
        id:
          type: integer
          default: 2
        result:
          type: object
          additionalProperties: true
    JsonRpcRequestForBalances:
      type: object
      required:
      - jsonrpc
      - id
      - method
      - params
      properties:
        jsonrpc:
          type: string
          example: '2.0'
          default: '2.0'
        id:
          type: integer
          example: 1
          default: 1
        method:
          type: string
          example: zks_getAllAccountBalances
          default: zks_getAllAccountBalances
        params:
          type: array
          default:
          - '0xB240316e290e976e31f1557b3B312Dd698efac4c'
          items:
            type: string
            example: '0xB240316e290e976e31f1557b3B312Dd698efac4c'
            default: '0xB240316e290e976e31f1557b3B312Dd698efac4c'
    JsonRpcResponseForBalances:
      type: object
      required:
      - jsonrpc
      - id
      - result
      properties:
        jsonrpc:
          type: string
          example: '2.0'
          default: '2.0'
        id:
          type: integer
          default: 1
        result:
          type: object
          additionalProperties:
            type: object
            properties:
              balance:
                type: string
              symbol:
                type: string
              decimals:
                type: integer
    JsonRpcRequestForBlockDetails:
      type: object
      required:
      - jsonrpc
      - id
      - method
      - params
      properties:
        jsonrpc:
          type: string
          example: '2.0'
          default: '2.0'
        id:
          type: integer
          example: 1
          default: 1
        method:
          type: string
          example: zks_getBlockDetails
          default: zks_getBlockDetails
        params:
          type: array
          default:
          - 27163792
          items:
            type: integer
            example: 27163792
            default: 27163792
    JsonRpcResponseForBlockDetails:
      type: object
      required:
      - jsonrpc
      - id
      - result
      properties:
        jsonrpc:
          type: string
          example: '2.0'
          default: '2.0'
        id:
          type: integer
          default: 1
        result:
          type: object
          properties:
            blockNumber:
              type: integer
            blockHash:
              type: string
            parentHash:
              type: string
            transactions:
              type: array
              items:
                type: object
                properties:
                  txHash:
                    type: string
                  from:
                    type: string
                  to:
                    type: string
                  value:
                    type: string
                  gasUsed:
                    type: integer
    JsonRpcRequestForBridgeContracts:
      type: object
      required:
      - jsonrpc
      - id
      - method
      - params
      properties:
        jsonrpc:
          type: string
          example: '2.0'
          default: '2.0'
        id:
          type: integer
          example: 1
          default: 1
        method:
          type: string
          example: zks_getBridgeContracts
          default: zks_getBridgeContracts
        params:
          type: array
          default: []
          items: {}
    JsonRpcResponseForBridgeContracts:
      type: object
      required:
      - jsonrpc
      - id
      - result
      properties:
        jsonrpc:
          type: string
          example: '2.0'
          default: '2.0'
        id:
          type: integer
          default: 1
        result:
          type: object
          properties:
            bridgeContractAddresses:
              type: object
              additionalProperties:
                type: string
    JsonRpcRequestForBytecodeByHash:
      type: object
      required:
      - jsonrpc
      - id
      - method
      - params
      properties:
        jsonrpc:
          type: string
          example: '2.0'
          default: '2.0'
        id:
          type: integer
          example: 1
          default: 1
        method:
          type: string
          example: zks_getBytecodeByHash
          default: zks_getBytecodeByHash
        params:
          type: array
          default:
          - '0x0100067d861e2f5717a12c3e869cfb657793b86bbb0caa05cc1421f16c5217bc'
          items:
            type: string
            example: '0x0100067d861e2f5717a12c3e869cfb657793b86bbb0caa05cc1421f16c5217bc'
            default: '0x0100067d861e2f5717a12c3e869cfb657793b86bbb0caa05cc1421f16c5217bc'
    JsonRpcResponseForBytecodeByHash:
      type: object
      required:
      - jsonrpc
      - id
      - result
      properties:
        jsonrpc:
          type: string
          example: '2.0'
          default: '2.0'
        id:
          type: integer
          default: 1
        result:
          type: string
          description: The bytecode of the transaction.
    JsonRpcRequestForL1BatchBlockRange:
      type: object
      required:
      - jsonrpc
      - id
      - method
      - params
      properties:
        jsonrpc:
          type: string
          example: '2.0'
          default: '2.0'
        id:
          type: integer
          example: 1
          default: 1
        method:
          type: string
          example: zks_getL1BatchBlockRange
          default: zks_getL1BatchBlockRange
        params:
          type: array
          default:
          - 443314
          items:
            type: integer
            example: 443314
            default: 443314
    JsonRpcResponseForL1BatchBlockRange:
      type: object
      required:
      - jsonrpc
      - id
      - result
      properties:
        jsonrpc:
          type: string
          example: '2.0'
          default: '2.0'
        id:
          type: integer
          default: 1
        result:
          type: object
          properties:
            startBlock:
              type: integer
              description: The starting block number of the L1 batch.
            endBlock:
              type: integer
              description: The ending block number of the L1 batch.
    JsonRpcRequestForL1BatchDetails:
      type: object
      required:
      - jsonrpc
      - id
      - method
      - params
      properties:
        jsonrpc:
          type: string
          example: '2.0'
          default: '2.0'
        id:
          type: integer
          example: 1
          default: 1
        method:
          type: string
          example: zks_getL1BatchDetails
          default: zks_getL1BatchDetails
        params:
          type: array
          default:
          - 443314
          items:
            type: integer
            example: 443314
            default: 443314
    JsonRpcResponseForL1BatchDetails:
      type: object
      required:
      - jsonrpc
      - id
      - result
      properties:
        jsonrpc:
          type: string
          example: '2.0'
          default: '2.0'
        id:
          type: integer
          default: 1
        result:
          type: object
          properties:
            batchId:
              type: integer
              description: The ID of the L1 batch.
            transactions:
              type: array
              items:
                type: object
                properties:
                  txHash:
                    type: string
                  from:
                    type: string
                  to:
                    type: string
                  value:
                    type: string
                  gasUsed:
                    type: integer
            status:
              type: string
              description: The status of the L1 batch.
            submissionTime:
              type: string
              format: date-time
              description: The submission time of the L1 batch.
    JsonRpcRequestForL2ToL1LogProof:
      type: object
      required:
      - jsonrpc
      - id
      - method
      - params
      properties:
        jsonrpc:
          type: string
          example: '2.0'
          default: '2.0'
        id:
          type: integer
          example: 1
          default: 1
        method:
          type: string
          example: zks_getL2ToL1LogProof
          default: zks_getL2ToL1LogProof
        params:
          type: array
          default:
          - '0xf8a7e5649718e84649a4caa93f5e537704a6a0e8769a7dbbe4de967ba14fc748'
          items:
            type: string
            example: '0xf8a7e5649718e84649a4caa93f5e537704a6a0e8769a7dbbe4de967ba14fc748'
            default: '0xf8a7e5649718e84649a4caa93f5e537704a6a0e8769a7dbbe4de967ba14fc748'
    JsonRpcResponseForL2ToL1LogProof:
      type: object
      required:
      - jsonrpc
      - id
      - result
      properties:
        jsonrpc:
          type: string
          example: '2.0'
          default: '2.0'
        id:
          type: integer
          default: 1
        result:
          type: object
          properties:
            logProof:
              type: object
              description: The log proof information.
              properties:
                blockNumber:
                  type: integer
                  description: The block number.
                logIndex:
                  type: integer
                  description: The log index within the block.
                transactionHash:
                  type: string
                  description: The transaction hash associated with the log.
                logEntries:
                  type: array
                  items:
                    type: string
                    description: Log entry data.
    JsonRpcRequestForMainContract:
      type: object
      required:
      - jsonrpc
      - id
      - method
      - params
      properties:
        jsonrpc:
          type: string
          example: '2.0'
          default: '2.0'
        id:
          type: integer
          example: 1
          default: 1
        method:
          type: string
          example: zks_getMainContract
          default: zks_getMainContract
        params:
          type: array
          default: []
    JsonRpcResponseForMainContract:
      type: object
      required:
      - jsonrpc
      - id
      - result
      properties:
        jsonrpc:
          type: string
          example: '2.0'
          default: '2.0'
        id:
          type: integer
          default: 1
        result:
          type: object
          properties:
            contractAddress:
              type: string
              description: The address of zkSync main contract on L1.
    JsonRpcRequestForRawBlockTransactions:
      type: object
      required:
      - jsonrpc
      - id
      - method
      - params
      properties:
        jsonrpc:
          type: string
          example: '2.0'
          default: '2.0'
        id:
          type: integer
          example: 1
          default: 1
        method:
          type: string
          example: zks_getRawBlockTransactions
          default: zks_getRawBlockTransactions
        params:
          type: array
          default:
          - 27221521
          items:
            type: integer
            example: 27221521
            default: 27221521
    JsonRpcResponseForRawBlockTransactions:
      type: object
      required:
      - jsonrpc
      - id
      - result
      properties:
        jsonrpc:
          type: string
          example: '2.0'
          default: '2.0'
        id:
          type: integer
          default: 1
        result:
          type: array
          items:
            type: object
            properties:
              transactions_details:
                type: object
                description: The details of transactions in the block.
    JsonRpcRequestForTestnetPaymaster:
      type: object
      required:
      - jsonrpc
      - id
      - method
      - params
      properties:
        jsonrpc:
          type: string
          example: '2.0'
          default: '2.0'
        id:
          type: integer
          example: 1
          default: 1
        method:
          type: string
          example: zks_getTestnetPaymaster
          default: zks_getTestnetPaymaster
        params:
          type: array
          default: []
    JsonRpcResponseForTestnetPaymaster:
      type: object
      required:
      - jsonrpc
      - id
      - result
      properties:
        jsonrpc:
          type: string
          example: '2.0'
          default: '2.0'
        id:
          type: integer
          default: 1
        result:
          type: object
          properties:
            paymasterAddress:
              type: string
              description: The address of the testnet paymaster.
    JsonRpcRequestForTransactionDetails:
      type: object
      required:
      - jsonrpc
      - id
      - method
      - params
      properties:
        jsonrpc:
          type: string
          example: '2.0'
          default: '2.0'
        id:
          type: integer
          example: 1
          default: 1
        method:
          type: string
          example: zks_getTransactionDetails
          default: zks_getTransactionDetails
        params:
          type: array
          default:
          - '0x721ee3e8774620c2bd2add404efbd58563b592be75ad12a96684c24b95dce0d2'
          items:
            type: string
            example: '0x721ee3e8774620c2bd2add404efbd58563b592be75ad12a96684c24b95dce0d2'
            default: '0x721ee3e8774620c2bd2add404efbd58563b592be75ad12a96684c24b95dce0d2'
    JsonRpcResponseForTransactionDetails:
      type: object
      required:
      - jsonrpc
      - id
      - result
      properties:
        jsonrpc:
          type: string
          example: '2.0'
          default: '2.0'
        id:
          type: integer
          default: 1
        result:
          type: object
          properties:
            txDetails:
              type: object
              description: The details of the transaction.