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-2400, which proposes a standardized URI format for Ethereum transaction hashes.

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

I have also covered other EIPs.

Overview

A transaction hash alone lacks the context needed to identify its chain or explain the operation it represents.

The format proposed by ERC-2400 can include the information needed to display a transaction:

  • Chain ID (chainId).
  • Signature of the called method.
  • Signatures of emitted events.

This enables applications to interpret transaction details that are not apparent from the hash alone.

Motivation

The primary objective of ERC-2400 is to improve interoperability between Ethereum clients. Different systems can handle a submitted transaction hash in a common format and understand and display its details.

The standard also defines a URI that can contain information needed to decode transaction data.

Use Cases

The standard can be used in the following scenarios.

  • QR codes
    • Display a QR code representing a submitted transaction, for example when buying or selling cryptocurrency.
  • Web links and hyperlinks
    • Links embedded in web pages, emails, or chat messages can let users inspect transactions in their preferred explorer.
  • Web3 applications
    • DApps, mining pools, and exchanges can display transaction information according to the user's environment.
  • Wallets
    • Make it easier for users to share transaction receipts.
  • Chat applications
    • Provide transaction information directly in response to an ERC-681 payment request.

See the following article for ERC-681.

[ERC-681] URLs for Sending ETH and ERC-20 Tokens

Specification

ERC-2400 defines the syntax and semantics for representing an Ethereum transaction receipt as a URI. This provides a consistent format for sharing and displaying transaction information.

Syntax

The transaction receipt URI uses the ethereum scheme and follows this structure.

text
ethereum:tx-<transaction_hash>@<chain_id>?<parameters>

The components are as follows.

  • transaction_hash Required. Specifies the transaction hash as 64 hexadecimal digits preceded by 0x.

  • chain_id Optional. Specifies the Ethereum chain ID in decimal according to EIP-155. If omitted, Ethereum Mainnet (chainId = 1) is assumed.

See the following article for EIP-155.

[EIP-155] Preventing Replay Attacks Across Ethereum Networks

  • parameters Optional. Lists information about method calls and events in key=value form. Multiple parameters are joined with &.

Two parameter keys are available.

  • method Signature of the called function, such as transfer(address,uint256).

  • events Signatures of emitted events separated by semicolons (;), such as Transfer(!address,!address,uint256).

A type prefixed with !, such as !address, denotes an indexed event argument. Type names, function names, and event names follow Ethereum's ABI conventions. Strings are URL-encoded as required.

Semantics

  • transaction_hash Required. Look up the specified transaction on the chain identified by chain_id. If it cannot be found, return an error indicating that the transaction does not exist.

  • Pending transactions Continue checking until the transaction is included in a block, and display it once it has reached the required confirmation threshold (historically described in the proposal as typically 12 blocks). Confirmation policies and protocol finality should not be treated as interchangeable.

  • method If specified, the first four bytes of transaction calldata (the function selector) must match the corresponding first four bytes of the keccak256 hash of the specified function signature. Otherwise, report a method verification error.

  • events If specified and the transaction succeeded, verify that the corresponding events occur in the logs. Report an event verification error if any specified event is missing.

When method or events is omitted, the relevant details are not required or have not been supplied.

Examples

  • Simple URI for an ETH transfer

    text
    ethereum:tx-0x1143b5e38fe3cf585fb026fb9b5ce35c85a691786397dc8a23a07a62796d8172@1
  • ERC-20 token transfer

    text
    ethereum:tx-0x5375e805b0c6afa20daab8d37352bf09a533efb03129ba56dee869e2ce4f2f92@1?method="transfer(address,uint256)"&events="Transfer(!address,!address,uint256)"
  • Complex contract call

    text
    ethereum:tx-0x4465e7cce3c784f264301bfe26fc17609855305213ec74c716c7561154b76fec@1?method="issueAndActivateBounty(address,uint256,string,uint256,address,bool,address,uint256)"&events="Transfer(!address,!address,uint256);BountyIssued(uint256);ContributionAdded(uint256,!address,uint256);BountyActivated(uint256,address)"

This format allows transaction details to be shared consistently with other applications and users, particularly wallets, explorers, QR codes, and chat applications.

Additional Notes

ERC-2400 provides a URI for communicating information about a submitted transaction. Actual transaction data must still be retrieved from the blockchain or the pending transaction pool, allowing its existence to be checked.

A newly submitted transaction may not be immediately discoverable by its hash. Other possible explanations include the following.

  • The transaction was never actually broadcast.
  • It was replaced by another transaction with the same nonce, for example one with a higher gas price.
  • The block containing it was removed from the canonical chain due to a fork or reorganization, including stale blocks in the historical proof-of-work context.

Correctly interpreting transaction calldata and emitted events requires the corresponding ABI (Application Binary Interface) information.

A transaction signer who knows the functions and events involved can optionally include decoding information, such as function signatures and event definitions, in the URI. This allows a recipient to obtain useful decoding information directly from the URI even without a separately supplied ABI. Such information must be checked against the actual transaction and logs rather than assumed to be trustworthy.

Compatibility

The format proposed by ERC-2400, such as ethereum:tx-..., is designed to accommodate future changes and extensions.

If a partially or entirely backward-incompatible upgrade is introduced, the tx- prefix can be replaced to distinguish the new version. The prefix must be separated from the following value by a hyphen (-).

For example, a future version could use a prefix such as tx2- or receipt- to avoid collisions with existing URIs while introducing new functionality.

Citation

Ricardo Guilherme Schmidt (@3esmit), Eric Dvorsak (@yenda), "ERC-2400: Transaction Receipt URI [DRAFT]," Ethereum Improvement Proposals, no. 2400, November 2019. [Online serial]. Available: https://eips.ethereum.org/EIPS/eip-2400.

Conclusion

ERC-2400 proposes a standardized URI format for referencing Ethereum transactions and their receipt information.

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

Twitter @cardene777

I also publish articles on the following platforms.

https://chaldene.net/