🔵 Base
eth_chainId

eth_chainId RPC Method

The eth_chainId method returns the unique chain ID of the connected Ethereum-compatible network.
This ID helps applications confirm they’re connected to the correct network, especially when working with multiple chains like Base, Ethereum, or testnets.

✅ Use this to prevent replay attacks
✅ Double-check you're on Base Mainnet (chain ID: 8453 or 0x2105 - hex encoded)

Need RPC API keys?

Get 12.5M archival requests for free today.


🔁 Returns

  • chainId — Hexadecimal value representing the network’s chain ID.
    Example: "0x2105" = Base Mainnet (hex encoded)

🚫 Parameters

None.


📤 Request

POST https://base-mainnet.chainnodes.org/YOUR-API-KEY

Replace YOUR-API-KEY with your key from the CHAINNODES Dashboard (opens in a new tab).
You may replace base-mainnet with another supported network, if needed.


📥 Example

💡

Confusing? Ask blockchain developers in Chainnodes Telegram Chat (opens in a new tab)

curl https://base-mainnet.chainnodes.org/YOUR-API-KEY \
  -X POST \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","method":"eth_chainId","params":[],"id":1}'

📦 Response

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

JSON-RPC Base API Documentation by CHAINNODES is based on Erigon node client. Contact us if you are interested in specific methods that are only available on geth, besu, Nethermind or reth