EIPs Explained

ERC-7856 · Draft · ERC · 2025-01-01

ERC-7856: Chain-Specific Payment Requests

A cspr:// URI scheme for payment requests that names the exact chain, recipient, token and amount, so "send me X of token Y on chain Z" cannot be fulfilled on the wrong network.

What problem does it solve?

With mainnet plus many L2s, "send me 100 USDC" is ambiguous: the same asset exists on many chains, often at different addresses. Payment links and QR codes need to say exactly which chain the payment belongs on, or users risk sending funds where the recipient cannot use them.

ERC-681 already defines ethereum: payment URIs, but it is Ethereum-specific and includes many low-level transaction parameters. ERC-7856 proposes a small, chain-agnostic format focused on just the payment.

How it works

cspr://<recipient>/<amount>/<token-address>?on-success=<url>&on-error=<url>
  • cspr://: "Chain-Specific Payment Request".
  • <recipient> (required): a CAIP-10 account ID such as eip155:8453:0x…, which encodes both the chain and the address. This is what makes the request chain-specific.
  • <amount> (required): integer or decimal, in the token's human units.
  • <token-address> (required): the ERC-20 contract address, or the literal native for the chain's native currency.
  • on-success / on-error (optional): URLs to redirect the user to after the transaction confirms or fails.

Gas settings and other transaction details are deliberately left to the wallet. ENS names are not supported; CAIP-10 is used instead. Because CAIP-10 covers non-EVM chains, the same scheme can express, for example, a Bitcoin payment.

Wallets must validate the recipient format and show an error for anything malformed.

Sample code

Examples from the spec:

# 1 ETH on Base (chain 8453), with a success callback
cspr://eip155:8453:0x1111111111111111111111111111111111111111/1/native?on-success=https://example.com

# 100 USDC on Ethereum mainnet
cspr://eip155:1:0xab16a96D359eC26a11e2C2b3d8f8B8942d5Bfcdb/100/0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48

A minimal parser (TypeScript):

function parseCspr(uri: string) {
  const u = new URL(uri.replace(/^cspr:\/\//, "https://cspr.invalid/"));
  const [recipient, amount, token] = u.pathname.slice(1).split("/").map(decodeURIComponent);
  const [namespace, reference, address] = recipient.split(":"); // CAIP-10
  if (!namespace || !reference || !address || !amount || !token) throw new Error("invalid cspr URI");
  return {
    chain: `${namespace}:${reference}`,   // e.g. "eip155:8453"
    address,
    amount,                               // keep as string; convert with the token's decimals
    token,                                // contract address or "native"
    onSuccess: u.searchParams.get("on-success"),
    onError: u.searchParams.get("on-error"),
  };
}

Things to know

  • Status: Draft.
  • Not compatible with ERC-681 or ERC-831 URIs because of the different prefix.
  • The spec says the token address is "represented as a base64 encoded string", yet its examples use plain hex addresses; check the latest draft before relying on either reading.
  • Treat these URIs like any payment link: the recipient and amount can be tampered with, so wallets should show the amount clearly in token units, validate callback URLs against phishing, and refuse native on chains without a native currency.

#uri #payments #wallet #multichain #draft

Details

Authors
Jack Chuma (@jackchuma)
Status
Draft
Type
Standards Track / ERC
Created
2025-01-01

Machine-readable: Markdown · JSON