Skip to main content
EVM

eth_chainId

Summary: Get chainId

This request returns the chain ID, a unique identifier across all EVM-compatible networks. This value is critical for transaction replay protection introduced by EIP-155.

Parameters

This method doesn't accept any parameters.

Returns

eth_chainIdResponse
string

Hexadecimal representation of the chain ID.

Pattern: ^0x([1-9a-f]+[0-9a-f]*|0)$

Customize request
Parameter
Value

Request

curl https://linea-mainnet.infura.io/v3/<YOUR-API-KEY> \
-X POST \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "eth_chainId",
"params": [],
"id": 1
}'

Example response

{
"id": 1,
"jsonrpc": "2.0",
"result": "0xe728"
}