---
eip: 5094
label: ERC-5094
title: URL Format for Ethereum Network Switching
status: Stagnant
type: Standards Track
category: ERC
created: 2022-05-13
requires: 681, 831
official: https://eips.ethereum.org/EIPS/eip-5094
source: https://github.com/ethereum/ERCs/blob/master/ERCS/erc-5094.md
canonical: https://eips.huatuo.xyz/eip-5094/
lang: en
tldr: "Proposed an `ethereum:network-add@<chainId>` URL that carries a chain's RPC endpoints, name and currency, so a QR code or deep link can add a network to a wallet in one step."
tags: [url, wallets, networks, deep-link, qr]
---

# ERC-5094: URL Format for Ethereum Network Switching

> A way of representing various network configurations as URLs.

**TL;DR:** Proposed an `ethereum:network-add@<chainId>` URL that carries a chain's RPC endpoints, name and currency, so a QR code or deep link can add a network to a wallet in one step.

## What problem does it solve?

[EIP-681](/eip-681/) payment links and QR codes include a chain ID, but a chain ID alone is not enough to connect to a network: the wallet also needs an RPC endpoint, a name and the native currency. If a mobile wallet has never been configured for that chain, scanning the link simply fails.

EIP-5094 defines a URL that carries the whole network configuration, so a user can add a network by scanning or tapping a link and then use other `ethereum:` URLs on it.

## How it works

It follows the [EIP-831](/eip-831/) `ethereum:<prefix>-<payload>` pattern with the prefix `network` and the action `add`:

```
ethereum:network-add@<chain_id>/?<parameters>
```

| Parameter | Required | Meaning |
| --- | --- | --- |
| `chain_name` | yes | Human-readable network name |
| `rpc_url` | yes (1 or more) | RPC endpoint; repeat the key for several |
| `name`, `symbol` | no | Native token name and symbol |
| `decimals` | no | Native token decimals (non-negative integer) |
| `explorer_url` | no | Block explorer URL(s) |
| `icon_url` | no | Chain icon URL(s) |

`chain_id` is decimal. Values are URL-encoded, so `https://` becomes `https%3A%2F%2F`. The `network-` prefix leaves room for future `network-x` actions such as switching.

## Sample code

The spec's example for an L2 network:

```
ethereum:network-add@10/?chain_name=Optimistic%20Ethereum&rpc_url=https%3A%2F%2Fmainnet.optimism.io&name=Ethereum&symbol=ETH&decimals=18&explorer_url=https%3A%2F%2Foptimistic.etherscan.io
```

Building one in TypeScript:

```ts
function networkAddUrl(chainId: number, chainName: string, rpcUrls: string[]) {
  const q = new URLSearchParams({ chain_name: chainName });
  rpcUrls.forEach((u) => q.append("rpc_url", u));
  return `ethereum:network-add@${chainId}/?${q.toString().replace(/\+/g, "%20")}`;
}
```

## Things to know

- Status: **Stagnant**. Wallets did not broadly adopt this URL format.
- In browser dapps the equivalent action is the `wallet_addEthereumChain` RPC method from [EIP-3085](/eip-3085/), which many wallets support.
- A link can carry a malicious RPC URL that lies about balances or censors transactions. Wallets should show the full configuration and users should only add networks from sources they trust.
- [EIP-2400](/eip-2400/) is a sibling URL format for transaction receipts.


---

This is an unofficial plain-language summary. Read the full specification: https://eips.ethereum.org/EIPS/eip-5094
