What is chain ID?

A number that identifies which chain a transaction is valid on, included in the signature so the same signed transaction cannot be replayed elsewhere.

Not yet verifiedHow we verify

3 min read

In this entry

A number that identifies which chain a transaction is valid on, included in the signature so the same signed transaction cannot be replayed elsewhere.

It was introduced after the DAO fork produced two chains with identical histories, on which any transaction signed for one was equally valid on the other. Ethereum mainnet carries chain ID 1 (source: EIP-155), and every compatible network has its own value. This is what a wallet is checking when it warns that you are connected to the wrong network.

The costly version of getting this wrong is not a rejected transaction. It is sending funds to the right address on the wrong chain, where the exchange or contract you meant to reach may not be controlled by anyone at all.

How it works

Before EIP-155, an Ethereum transaction signature covered the nonce, gas price, gas limit, recipient, value, and data. Nothing in it named a network, so two chains sharing a history accepted each other's signed transactions.

EIP-155 folded the chain ID into the data being signed. A transaction signed for chain 1 therefore produces a signature that fails validation on any chain with a different ID, which ends replay entirely.

Wallets use the same number for routing. When a site asks your wallet to switch networks, it sends a chain ID and the wallet matches it against its configured list of networks and RPC endpoints. Adding a custom network means supplying a chain ID alongside the endpoint, which is why a wrong entry silently points you at a different chain than you expect.

The number is not registered by any authority. Public lists exist and collisions are avoided by convention rather than by rule.

Example

Illustrative. Your wallet holds the same address on Ethereum mainnet and on a compatible chain, because the address derives from your key rather than from the network. You withdraw a token from an exchange, choosing the mainnet network, but paste an address you use on the other chain. Both are the same string, so nothing looks wrong. The tokens arrive on mainnet at an address whose key you hold, which is recoverable. Reverse the situation, sending to an exchange deposit address on a network that exchange does not support, and the exchange does not control that address on that chain, so the funds are usually unrecoverable.

Why it matters when you buy

Every withdrawal from an exchange asks you to pick a network, and that choice is a chain ID underneath. Pick the one the receiving wallet or exchange actually supports, not the cheapest one offered. The chain pages show which networks each asset runs on, and the deposit instructions on your receiving venue name the networks it accepts.

evm — why so many chains share an address format; deposit address — the address the exchange issues you; eip — the proposal process that produced this; network fee — what differs between chains; bridge — the intended way to move between them.

Questions

What happens if I send to the wrong network?

If you control the receiving address on that chain, the funds are there and recoverable by adding the network to your wallet. If the address belongs to an exchange that does not operate on that chain, recovery depends entirely on whether that exchange offers a manual retrieval service, and many do not.

Why does my wallet show the same address on every chain?

An Ethereum-style address is derived from your public key, not from the network. The same key produces the same address on every compatible chain, which is convenient and is also why network selection errors are so easy to make.

Where do I find a chain's ID?

The chain's own documentation publishes it alongside its RPC endpoint. Verify against that rather than against a third-party list, since a wrong chain ID in a custom network entry sends transactions somewhere you did not intend.