Skip to the article
Token Wire

News from across crypto

Why Does MetaMask Show a Chain ID Mismatch?

You can identify a MetaMask chain ID mismatch by finding the two network numbers that disagree. MetaMask reports it when network identifiers in a request…

The Token Wire Desk3 min read

Why Does MetaMask Show a Chain ID Mismatch?

You can identify a MetaMask chain ID mismatch by finding the two network numbers that disagree. MetaMask reports it when network identifiers in a request conflict. A chain ID is the number a blockchain uses to identify itself for transaction signing. To add a custom network, you supply that ID and an RPC URL, the server address MetaMask uses to reach the chain. The server answers a request called eth_chainId. MetaMask checks its answer against the supplied ID.

  • Identify whether the conflict involves a custom network entry or the selected network.
  • Compare numeric IDs, then check the intended network’s published ID and RPC URL.

A common mistake is to read a SyncSwap request to change networks as proof that your RPC URL is wrong. Comparing syncswap vs uniswap helps you choose the exchange for your intended trading network before you change MetaMask’s selected network. A switch prompt concerns the active chain; an RPC validation error concerns the ID and URL in a network entry.

Chain IDs can look different while naming the same chain. Decimal 1 and hexadecimal 0x1 represent the same chain ID: the 0x prefix marks hexadecimal notation. Compare their numeric values before changing a setting. For a larger example, hexadecimal 0x89 equals decimal 137 because 8 times 16 plus 9 equals 137. An entry showing 137 and an endpoint returning 0x89 agree.

An actual mismatch pairs one chain’s ID with another chain’s RPC endpoint. Suppose an entry says 1, but its URL answers 0x89: after conversion, those values are 1 and 137. EIP-695 defines eth_chainId as a hexadecimal response from the connected chain. The proposed EIP-3085 specification requires rejection of wallet_addEthereumChain, a request to add a network, when the supplied ID differs from any listed RPC endpoint’s response.

Read the exact error before editing the wallet. “Chain ID returned by the custom network does not match the submitted chain ID” points to the custom entry or the site’s add-network request. Wording asking you to switch to a named network points to the application and MetaMask’s selected network. Check the network menu. If the requested chain is already saved, select it and retry the action.

Restore a bad entry with the intended chain’s published settings. In MetaMask’s network settings, compare both the chain ID and RPC URL with that chain’s official documentation. Replace the pair together if either belongs to another chain. Check every RPC URL offered in an add-network request, since each must report the supplied ID. Save the entry and retry; a repeated error means the URL still reports a different chain or the application requests another selected network.