> ## Documentation Index
> Fetch the complete documentation index at: https://docs.chainstack.com/llms.txt
> Use this file to discover all available pages before exploring further.

# zks_L1ChainId | zkSync Era

> zkSync Era API method that returns the chain ID of the underlying Layer 1 (L1) network. zks_L1ChainId on zkSync Era via Chainstack.

zkSync Era API method that returns the chain ID of the underlying Layer 1 (L1) network. This method is essential for developers who must confirm the specific blockchain network their zkSync instance interacts with, ensuring compatibility and correct operation of their applications across different environments.

## Parameters

* `none`

## Response

* `result` — the chain ID of the underlying L1 network, returned as a hexadecimal string.

<Note>
  You can use the Chainstack [EVM Swiss Army Knife](https://web3tools.chainstacklabs.com/) to convert values.
</Note>

## **Use case**

For developers building on zkSync, `zks_L1ChainId` provides a straightforward way to verify the L1 network their applications are operating on programmatically. This is particularly useful for applications that are deployed across multiple environments to avoid common pitfalls such as contract interaction on an unintended network, which can lead to loss of funds or data integrity issues.


## OpenAPI

````yaml openapi/zksync_node_api/zks_L1ChainId.json POST /afb8312f3710a5bc469f4c87cad3a2e4
openapi: 3.0.0
info:
  title: JSON-RPC API
  version: 1.0.0
servers:
  - url: https://nd-995-911-243.p2pify.com
security: []
paths:
  /afb8312f3710a5bc469f4c87cad3a2e4:
    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'
components:
  schemas:
    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.

````