eth_chainId - Ethereum

eth_chainId. Returns the current network/chain ID, used to sign replay-protected transaction introduced in EIP-155

eth_chainId - ethereum [Value: 0CU]
Returns the current network/chain ID, used to sign replay-protected transaction introduced in EIP-155.
Use cases

Use cases

  • Verify chain ID before signing new transactions
  • Ensure transactions are compatible with the head block
  • Identify the Ethereum chain for network-specific operations
Constraints

Constraints

  • Chain ID must correspond to current head block
  • Client must handle missing chain ID with errors
  • Prefer eth_chainId over net_version for reliability
Get started
Unlock Access to 50+ chains
Boost your app's speed and reliability with dRPC - get your access API key

Language

Request
Examples
curl --request POST \
    --url https://eth.drpc.org \
    --header 'accept: application/json' \
    --header 'content-type: application/json' \
    --data '
{
 "id": 1,
 "jsonrpc": "2.0",
 "method": "eth_chainId"
}
'
Copy
Response
200
{
  "jsonrpc": "2.0",
  "id": 1,
  "result": "0x1"
}
Copy

Request params

idinteger
jsonrpcstring
methodstring
ParametersThis method does not accept any parameters.

Response

200
Returns integer of the current chain ID.

Response params

object
idinteger
jsonrpcstring
resultstring
HEX string representing the current chain/network ID.