> ## Documentation Index
> Fetch the complete documentation index at: https://chainstack-docs-polygon-erigon-trace-deprecation.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# zks_getL1BatchDetails | zkSync Era

> The zks_getL1BatchDetails API method offers a comprehensive look into a specific batch's details on Layer 1. zkSync Era via Chainstack.

The `zks_getL1BatchDetails` API method offers a comprehensive look into a specific batch's details on Layer 1. By inputting a batch number, developers can retrieve a wealth of information, including transaction hashes, execution details, gas prices, and the batch's overall status.

## Parameters

* `batch` — an `L1BatchNumber` that specifies the batch number on Layer 1 for which details are being requested.

## Response

Upon execution, the `zks_getL1BatchDetails` method returns a detailed object encompassing various aspects of the specified batch:

* `baseSystemContractsHashes` — contains hashes for key system contracts, offering insight into the infrastructure underpinning the transactions within the batch.
  * `bootloader` — the hash of the bootloader contract, a fundamental component in initializing contract execution.
  * `default_aa` — the hash of the default account abstraction contract, facilitating user interactions with contracts.
* `commitTxHash` — the transaction hash for the commitment phase on the network, highlighting the first step in the transaction lifecycle.
* `committedAt` — the ISO 8601 timestamp marking the commitment of the transaction to the network, providing a precise timeline.
* `executeTxHash` — the hash of the executed transaction, indicating the application of the transaction's effects on the zkSync network.
* `executedAt` — the ISO 8601 timestamp for when the transaction execution took place, marking the conclusion of its network effects.
* `l1GasPrice` — shows the gas price on Layer 1 at the time of the transaction, reflecting the execution cost on Ethereum.
* `l1TxCount` — the count of transactions in this batch on Layer 1, offering insight into the batch's complexity.
* `l2FairGasPrice` — the fair gas price within the zkSync network, guiding transaction cost efficiency on Layer 2.
* `l2TxCount` — the number of transactions processed in the zkSync network for this batch, indicating its activity level.
* `number` — the unique number of the batch.
* `proveTxHash` — the hash of the transaction providing proof on Layer 1, essential for validating the batch's integrity and finality.
* `provenAt` — the ISO 8601 timestamp when the proof transaction was verified on Layer 1, marking a crucial step in batch validation.
* `rootHash` — the root hash of the network state post-transaction, key for ensuring the consistency and integrity of the network state.
* `status` — the current status of the batch, providing immediate insight into its processing stage and overall health.
* `timestamp` — a UNIX timestamp that marks the exact time of batch processing, serving as a universal reference point.

## Use case

A smart contract developer optimizing a decentralized finance (DeFi) platform on zkSync could use the `zks_getL1BatchDetails` method to analyze gas usage across different batches. By examining details like gas prices, transaction counts, and execution times, the developer can identify patterns of high gas costs.


## OpenAPI

````yaml openapi/zksync_node_api/zks_getL1BatchDetails.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_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'
components:
  schemas:
    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.

````