EIPs Explained

ERC-3770 · Draft · ERC · 2021-08-26

ERC-3770: Chain-specific addresses

Prefixes an address with a human-readable chain short name, like `eth:0x…`, so wallets and users can tell which network an address belongs to.

What problem does it solve?

Every EVM chain uses the same 20-byte address format. 0xAbC… on Ethereum Mainnet and 0xAbC… on an L2 or sidechain look identical, but they can be completely different things: an EOA on one chain, a contract on another, or nothing at all. A classic way to lose funds is sending tokens to a smart contract wallet address on a chain where that wallet was never deployed.

The chain ID from EIP-155 already identifies networks, but it is a number designed for developers and signatures, not something people recognise at a glance. ERC-3770 gives addresses a short, readable chain label that travels with the address itself.

How it works

A chain-specific address is simply:

shortName:address
  • shortName is mandatory and must be a valid chain short name from the community registry at github.com/ethereum-lists/chains (the same list that maps short names to chain IDs).
  • address is mandatory and must be an EIP-55 checksummed hex address.
  • The two parts are separated by a single colon.

That is the whole specification. A wallet or dApp that sees a prefixed address looks up the short name in the registry, resolves it to a chain ID, and can then warn the user (or switch networks) if the address is being used on the wrong chain. Displaying addresses this way also makes copy-pasted addresses self-describing.

Sample code

Parsing and validating a chain-specific address in TypeScript (ethers v6). The short-name table here is a tiny illustrative subset; a real app should load the ethereum-lists registry.

import { getAddress } from "ethers";

// Illustrative subset; load the full registry in production.
const SHORT_NAMES: Record<string, number> = {
  eth: 1,
  oeth: 10,
  arb1: 42161,
};

export function parseChainAddress(input: string) {
  const idx = input.indexOf(":");
  if (idx <= 0) throw new Error("missing chain short name");
  const shortName = input.slice(0, idx);
  const raw = input.slice(idx + 1);

  const chainId = SHORT_NAMES[shortName];
  if (chainId === undefined) throw new Error(`unknown chain: ${shortName}`);

  const address = getAddress(raw); // throws on a bad EIP-55 checksum
  return { shortName, chainId, address };
}

export function formatChainAddress(shortName: string, address: string) {
  return `${shortName}:${getAddress(address)}`;
}

Checking the user is on the right network before sending:

const { chainId, address } = parseChainAddress(userInput);
const net = await provider.getNetwork();
if (net.chainId !== BigInt(chainId)) {
  throw new Error(`address is for chain ${chainId}, wallet is on ${net.chainId}`);
}

Things to know

  • Status: Draft. The format is used informally by some wallets and multisig tools, but the proposal itself has not been finalised.
  • The prefix is display and input metadata only. Nothing changes on-chain: contracts and transactions still use plain 20-byte addresses.
  • Short names come from an external, community-maintained registry, so correctness depends on that list. The spec warns that similar-looking short names could be used to confuse users.
  • An unprefixed address still needs outside context to know which chain it refers to.
  • For a more general, binary-and-text cross-chain address format, see ERC-7930 (Interoperable Addresses).

#address #multichain #wallet #ux

Details

Authors
Lukas Schor (@lukasschor), Richard Meissner (@rmeissner), Pedro Gomes (@pedrouid), ligi <[email protected]>
Status
Draft
Type
Standards Track / ERC
Created
2021-08-26
Required by

Machine-readable: Markdown · JSON