curl --request POST \
--url https://nd-995-911-243.p2pify.com/afb8312f3710a5bc469f4c87cad3a2e4 \
--header 'Content-Type: application/json' \
--data '
{
"jsonrpc": "2.0",
"id": 1,
"method": "zks_L1ChainId",
"params": []
}
'{
"jsonrpc": "2.0",
"id": 1,
"result": {
"chainId": 123
}
}curl --request POST \
--url https://nd-995-911-243.p2pify.com/afb8312f3710a5bc469f4c87cad3a2e4 \
--header 'Content-Type: application/json' \
--data '
{
"jsonrpc": "2.0",
"id": 1,
"method": "zks_L1ChainId",
"params": []
}
'{
"jsonrpc": "2.0",
"id": 1,
"result": {
"chainId": 123
}
}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.Documentation Index
Fetch the complete documentation index at: https://chainstack-mintlify-flesh-empty-pages.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
noneresult — the chain ID of the underlying L1 network, returned as a hexadecimal string.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.Was this page helpful?