Skip to main content
GET
/
{chain_id}
/
api
/
v2
/
zksync
/
batches
/
{batch_number_param}
Get batch by number.
curl --request GET \
  --url https://api.blockscout.com/{chain_id}/api/v2/zksync/batches/{batch_number_param} \
  --header 'Authorization: Bearer <token>'
{
  "commit_transaction_hash": "<string>",
  "commit_transaction_timestamp": "2023-11-07T05:31:56Z",
  "end_block_number": 1,
  "execute_transaction_hash": "<string>",
  "execute_transaction_timestamp": "2023-11-07T05:31:56Z",
  "l1_gas_price": "<string>",
  "l1_transactions_count": 1,
  "l2_fair_gas_price": "<string>",
  "l2_transactions_count": 1,
  "number": 1,
  "prove_transaction_hash": "<string>",
  "prove_transaction_timestamp": "2023-11-07T05:31:56Z",
  "root_hash": "<string>",
  "start_block_number": 1,
  "timestamp": "2023-11-07T05:31:56Z"
}

Authorizations

Authorization
string
header
required

API key passed as a Bearer token in the Authorization header.

Path Parameters

batch_number_param
integer
required

Batch number

Required range: x >= 0
chain_id
string
required

The ID of the blockchain

Response

Batch info.

ZkSync rollup batch - a group of rollup blocks settled together on the parent chain - with the corresponding parent-chain lifecycle data.

commit_transaction_hash
string | null
required

Hash of the parent-chain transaction that committed this batch. null until the commit transaction is observed.

Pattern: ^0x([A-Fa-f0-9]{64})$
commit_transaction_timestamp
string<date-time> | null
required

Timestamp of the parent-chain transaction that committed this batch. null until the commit transaction is observed.

end_block_number
integer
required

Last rollup block included in the batch.

Required range: x >= 0
execute_transaction_hash
string | null
required

Hash of the parent-chain transaction that executed this batch. null until the execute transaction is observed.

Pattern: ^0x([A-Fa-f0-9]{64})$
execute_transaction_timestamp
string<date-time> | null
required

Timestamp of the parent-chain transaction that executed this batch. null until the execute transaction is observed.

l1_gas_price
string
required

Parent-chain gas price observed for this batch, in wei.

Pattern: ^([1-9][0-9]*|0)$
l1_transactions_count
integer
required

Number of transactions in the batch originating on the parent chain.

Required range: x >= 0
l2_fair_gas_price
string
required

Rollup fair gas price for this batch, in wei.

Pattern: ^([1-9][0-9]*|0)$
l2_transactions_count
integer
required

Number of transactions in the batch originating on the rollup.

Required range: x >= 0
number
integer
required

Batch number on the rollup.

Required range: x >= 0
prove_transaction_hash
string | null
required

Hash of the parent-chain transaction that proved this batch. null until the prove transaction is observed.

Pattern: ^0x([A-Fa-f0-9]{64})$
prove_transaction_timestamp
string<date-time> | null
required

Timestamp of the parent-chain transaction that proved this batch. null until the prove transaction is observed.

root_hash
string
required

State root hash committed for this batch on the parent chain.

Pattern: ^0x([A-Fa-f0-9]{64})$
start_block_number
integer
required

First rollup block included in the batch.

Required range: x >= 0
status
enum<string>
required

Lifecycle status of the batch:

  • Sealed on L2 - Batch is finalized on the rollup and no parent-chain lifecycle transaction has been observed yet.
  • Sent to L1 - Commit transaction has been submitted on the parent chain.
  • Validated on L1 - Prove transaction has been submitted on the parent chain.
  • Executed on L1 - Execute transaction has been submitted on the parent chain.
Available options:
Executed on L1,
Validated on L1,
Sent to L1,
Sealed on L2
timestamp
string<date-time>
required

Timestamp when the batch was sealed on the rollup.