How a chain ID works
When you sign a transaction, the wallet mixes the chain ID into the signature. A node on another network sees a different chain ID and rejects the transaction, which prevents replay attacks.[1]
EIP-155 took effect with the Spurious Dragon hard fork at block 2,675,000. Before it, a signature covered six fields: nonce, gas price, gas limit, recipient, value and data. After it, the signing hash covers nine: the same six plus the chain ID and two zeros.[1]
The chain ID also shows up in the signature's v value, which EIP-155 sets to {0,1} + CHAIN_ID × 2 + 35. On Ethereum (chain ID 1) that gives v = 37 or 38, and the example transaction in the EIP ends up with v = 37. Legacy signatures with v = 27 or 28 are still valid, which means they carry no chain ID and are not protected from replay.[1]
How a chain ID is used
You enter it when adding a network to a wallet by hand, and apps use it to check that your wallet is on the right network before you sign.
Apps read the chain ID from your wallet or node with the eth_chainId JSON-RPC method, which returns the number as a hex string. The EIP's own example returns "0x3d", which is 61. EIP-695 tells apps to prefer eth_chainId over the older net_version call so they can reliably identify the chain they are talking to.[3]
When a site asks your wallet to add a network, it uses wallet_addEthereumChain from EIP-3085. The chainId field is the only required field, and it must be a hex string. The wallet must reject the request if the RPC URLs are missing, or if the chain ID does not match what eth_chainId returns from those URLs.[4]
Signed messages use the chain ID too. EIP-712 typed data can include a chainId in its domain, and the wallet should refuse to sign if that value does not match the chain it is currently on.[5]
Example: converting and checking a chain ID
Base lists chain ID 8453 for mainnet and 84532 for Base Sepolia, its testnet. The values in this example come from those docs; the RPC call is illustrative.[7]
Decimal to hex: 8453 = 2 × 4,096 + 1 × 256 + 0 × 16 + 5, so the hex digits are 2, 1, 0, 5 and the hex value is 0x2105. The same method turns 84532 into 0x14a34.
In an EIP-155 signature on Base, v = 8453 × 2 + 35 = 16,941 (or 16,942 depending on the parity bit). A node on Ethereum mainnet expects v = 37 or 38 and will not accept it.[1]
To check an RPC endpoint yourself, send {"jsonrpc":"2.0","method":"eth_chainId","params":[],"id":1} to it. A Base endpoint should return "0x2105". Any other value means the endpoint serves a different chain.[3]
Common chain IDs
The chainid.network registry lists these values: Ethereum Mainnet 1 (0x1), OP Mainnet 10 (0xa), BNB Smart Chain 56 (0x38), Polygon 137 (0x89), zkSync 324 (0x144), Base 8453 (0x2105), Arbitrum One 42161 (0xa4b1), Linea 59144 (0xe708) and Scroll 534352 (0x82750).[6]
Testnets have their own IDs: Sepolia is 11155111 (0xaa36a7), Hoodi is 560048 (0x88bb0) and Base Sepolia is 84532 (0x14a34). EIP-155 also reserves 1337 as the default for private Geth chains, so local development networks often use it.[6]
A chain ID does not tell you the gas token. In the same registry, Base, Arbitrum One and OP Mainnet use ETH, while Polygon 137 uses POL and BNB Smart Chain 56 uses BNB.[6]
Common mistakes
Typing the hex value into a field that expects decimal, or the reverse, gives a different network: 0x2105 is 8453, but the digits 2105 read as decimal are a different chain ID. JSON-RPC responses and EIP-3085 requests use hex.[4]
Picking a testnet ID by mistake is another frequent error. A wallet set to 84532 shows Base Sepolia balances, which are separate from Base mainnet balances at the same address.[7]
The Bottom Line
The chain ID tells wallets and nodes which network a transaction belongs to. Copy it from a trusted source when adding a network.
Educational content, not financial advice.