---
eip: 831
label: ERC-831
title: URI Format for Ethereum
status: Stagnant
type: Standards Track
category: ERC
created: 2018-01-15
requires: 67, 681
official: https://eips.ethereum.org/EIPS/eip-831
source: https://github.com/ethereum/ERCs/blob/master/ERCS/erc-831.md
canonical: https://eips.huatuo.xyz/eip-831/
lang: en
tldr: "Defines the general ethereum: URI container, with an optional use-case prefix such as pay-, so QR codes and links can open the user's wallet; specific formats like ERC-681 plug into it."
tags: [uri, qr-code, wallet, interoperability, stagnant]
---

# ERC-831: URI Format for Ethereum

> A way of creating Ethereum URIs for various use-cases.

**TL;DR:** Defines the general ethereum: URI container, with an optional use-case prefix such as pay-, so QR codes and links can open the user's wallet; specific formats like ERC-681 plug into it.

## What problem does it solve?

URIs in QR codes, web pages, emails and chat messages are a simple way for unrelated apps to hand work to a user's wallet. [EIP-67](/eip-67/) introduced `ethereum:` links, but it tied the whole scheme to a single use case: sending a transaction.

While [ERC-681](/eip-681/) was refining payment requests, its authors needed a lighter **container** that would not lock `ethereum:` into one purpose. EIP-831 defines that container. Each use case gets its own prefix and its own ERC for the payload, and existing EIP-67 links keep working.

## How it works

The grammar is short:

```
request = "eth" [ "ereum" ] ":" [ prefix "-" ] payload
prefix  = STRING
payload = STRING
```

- The scheme may be `ethereum:` or the short form `eth:`.
- `prefix` names the use case, for example `pay`. It is optional.
- **If there is no prefix, `pay-` is assumed.** In that case the payload must start with `0x`, and no prefix may start with `0x`. So a URI that begins with `0x` clearly has no prefix, which keeps EIP-67 style URIs valid.
- `payload` is required. Its structure is defined by the ERC for that prefix, not by EIP-831. [ERC-681](/eip-681/) defines the `pay-` payload: a target address or ENS name, an optional chain ID, an optional function name and its parameters.

The open-ended prefix lets the scheme grow to new use cases without reserving `ethereum:` for the few that existed in 2018.

## Sample code

Valid URIs under this container:

```text
ethereum:0xfb6916095ca1df60bb79Ce92ce3ea74c37c5d359?value=2.014e18
ethereum:pay-0xfb6916095ca1df60bb79Ce92ce3ea74c37c5d359?value=2.014e18
ethereum:pay-0xfb6916095ca1df60bb79Ce92ce3ea74c37c5d359@1?value=1e16
```

The first two mean the same thing, because `pay-` is the default.

A small parser that splits a URI into prefix and payload (TypeScript):

```ts
function parseEthereumUri(uri: string) {
  const m = /^eth(?:ereum)?:(.+)$/i.exec(uri);
  if (!m) throw new Error("not an ethereum URI");
  const rest = m[1];
  if (rest.startsWith("0x")) return { prefix: "pay", payload: rest };
  const dash = rest.indexOf("-");
  if (dash < 1) throw new Error("missing prefix or payload");
  return { prefix: rest.slice(0, dash), payload: rest.slice(dash + 1) };
}

parseEthereumUri("ethereum:pay-0xfb6916095ca1df60bb79Ce92ce3ea74c37c5d359?value=1e18");
// { prefix: "pay", payload: "0xfb6916095ca1df60bb79Ce92ce3ea74c37c5d359?value=1e18" }
```

## Things to know

- **This proposal is Stagnant.** The `pay-` payload format it points to, [ERC-681](/eip-681/), is Final and uses the same `ethereum:` / `pay-` scheme.
- Older EIP-67 parsers may fail on URIs that use a prefix. The spec accepts this as the cost of extensibility.
- The spec does not register any prefixes other than `pay`. A new use case needs its own ERC.
- URIs come from untrusted sources. A wallet should decode the request and show it clearly before the user signs.


---

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