Introduction

Hi, I'm cardene, a software engineer and technical writer focused on blockchain and AI.

I've also authored Japanese technical books on specification-driven development with LLMs and decentralized application (DApp) development.

I also build and publish a variety of tools, libraries, and open-source projects.

This article examines ERC-681, which defines URLs containing the information needed to request ETH or ERC-20 token transfers.

This article translates, summarizes, and supplements the material linked below.

I have also covered other ERCs.

Overview

The format is primarily intended for Ethereum payment requests.

When requesting a transfer of ETH or ERC-20 tokens, an application can construct a URL containing the transaction details, such as the destination address, amount, and token contract.

A compatible wallet can use the URL to prepare the requested transaction.

See the following article for ERC-20.

https://chaldene.net/erc20

For example, a URL requesting an ERC-20 transfer can identify the token contract and its transfer function.

Opening the URL in a compatible wallet allows the user to review and authorize the proposed transfer without manually entering all its parameters.

This makes payment requests more convenient and interoperable. It resembles URL-based payment initiation in conventional systems, but uses Ethereum transaction requests and contract calls.

The URL represents a proposed transaction, not proof of a completed payment or a guarantee of its safety. The wallet and user must validate the transaction details before authorization.

Motivation

Special transaction request URLs can be embedded in QR codes, web links, emails, or chat messages.

Opening such a URL can launch a compatible wallet, including supported web-based wallets and decentralized applications.

For example, scanning a QR code can populate the wallet with payment information such as the recipient, amount, and ERC-20 token contract.

The user can then review the information and approve the transaction. The transaction must still be submitted and successfully executed before the payment is complete.

This approach simplifies communication between applications. Users do not have to enter each parameter manually, reducing the risk of input errors.

A standardized URL format also allows users to choose their preferred compatible wallet, improving the payment experience.

Specification

Syntax

An Ethereum payment request URL uses the ethereum: scheme and contains the following components.

  • Scheme prefix
    • Begins with ethereum:, optionally followed by pay-.
  • Target address
    • An Ethereum address represented by 0x followed by 40 hexadecimal characters, or an ENS name.
  • Chain ID (optional)
    • A numerical identifier for the Ethereum network.
  • Function name (optional)
    • Identifies a smart contract function to invoke.
  • Parameters (optional)
    • Key-value pairs describing transaction parameters, such as value, gas, gasLimit, and gasPrice, or typed function arguments.

Values associated with value, gas, gasLimit, and gasPrice must be numbers. Other keys identify ABI types and their values must follow the applicable type syntax.

Consider the following example from the original article.

text
ethereum:0x1234567890abcdef1234567890abcdef12345678?value=10

The target address is 0x1234567890abcdef1234567890abcdef12345678.

Important unit clarification: the original article describes this example as a transfer of 10 ETH. ERC-681 expresses native value in wei, so value=10 requests 10 wei, not 10 ETH. A request for 10 ETH would use value=10e18.

This URL format makes it possible to describe payment requests and specific smart contract calls without requiring users to enter the underlying transaction parameters manually.

URL Components

Target Address (target_address)

This field is mandatory.

For a native Ether payment, it identifies the recipient. For a contract call, it identifies the target contract.

Chain ID (chain_id)

The chain ID is optional. It identifies the requested Ethereum network, including testnets and private networks.

If omitted, the wallet's currently selected network is used under the convention described in the proposal.

Function Name (function_name)

If no function name is specified, the URL requests a native Ether payment. The amount is specified using the value parameter in wei.

Scientific notation can improve readability. For example, the following request represents a transfer of 2.014 ETH.

text
ethereum:特定のアドレス?value=2.014e18

ERC-20 Token Payments

An ERC-20 payment request identifies the token contract and requests a call to its transfer function.

The function arguments include the recipient address and the amount in the token's smallest unit. The amount representing one whole token depends on the token's decimals.

The original article gives the following example.

text
ethereum:トークンコントラクトのアドレス/transfer?address=特定のアドレス&uint256=1

ENS Names

An ENS name can be used instead of a hexadecimal address. A valid hexadecimal address takes precedence when interpreting an ambiguous target.

Specifying value

The amount in a URL is a suggested payment amount, which the user may modify.

If an amount is not provided, the wallet should prompt the user to enter it.

gasLimit and gasPrice

These parameters also represent suggested values that the user may edit.

The gas parameter is an alias for gasLimit.

The format therefore allows wallets to populate transaction details while permitting users to adjust the proposed values as appropriate.

Additional Notes

The Ethereum payment URL format is designed to resemble Bitcoin's payment URL conventions because many users and developers are already familiar with them.

Amounts are expressed in base units, and scientific notation is recommended for representing human-readable quantities.

The exponent can correspond to the asset's decimal precision: 18 for Ether or the value returned by an ERC-20 token's decimals() function, when available.

Hexadecimal Ethereum addresses use the 0x prefix, helping distinguish them from ENS names composed of hexadecimal characters.

A future partially or completely incompatible upgrade may use a different prefix instead of pay-, with the prefix separated by a hyphen.

These conventions aim to make payment requests intuitive while preserving unambiguous numeric and address representations.

Backward Compatibility

A common payment request contains only the recipient's address.

For this case, the new format remains compatible with the earlier ERC-67 convention.

This supports interoperability with existing simple payment links.

Security Considerations

Confirmed Ethereum transfers generally cannot be reversed unilaterally. The authenticity and correctness of payment request URLs are therefore important.

A malicious or modified URL may contain incorrect recipient addresses or amounts. Users should obtain requests from trusted sources and independently verify the transaction displayed by their wallet.

To reduce the risk of ambiguous redirection, hexadecimal Ethereum addresses take precedence over ENS names. Wallets can warn users about names that resemble hexadecimal addresses or reject suspicious inputs.

Wallets should also display transaction amounts clearly so users can confirm that the proposed payment matches their intent.

For ERC-20 payments, a wallet that can retrieve token information should display amounts using the token's actual denomination. If it cannot determine the denomination, it should display the amount as provided and warn the user about the uncertainty.

Scientific notation using the asset's decimal precision, such as an exponent of 18 for Ether, can make payment amounts easier to inspect.

Citation

Daniel A. Nagy (@nagydani), "ERC-681: URL Format for Transaction Requests," Ethereum Improvement Proposals, no. 681, August 2017. [Online serial]. Available: https://eips.ethereum.org/EIPS/eip-681.

Conclusion

ERC-681 standardizes URL-based Ethereum transaction requests, supporting native ETH payments and ERC-20 contract calls.

If you have questions, feel free to contact me on Twitter.

Twitter @cardene777

I also publish articles on the following platforms.

https://chaldene.net/