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.

ERC-3224 proposes a way to display the meaning of an Ethereum transaction or message before the user signs it.

This article translates, summarizes, and explains the original proposal.

Other EIP proposals are covered here.

Overview

ERC-3224 proposes a mechanism for presenting clearer descriptions of operations performed through Ethereum wallets, including MetaMask, Clef, and hardware wallets.

It defines a way to generate both a human-readable description and machine-readable data representing an executable operation. Wallets can use this information to explain what the user is about to authorize.

Motivation

When users approve a signature or transaction in an Ethereum wallet, understanding the underlying operation can be difficult. Wallets may recognize common operations such as ERC-20 transfers, but unfamiliar contract calls may be displayed as raw binary data, leaving users without a meaningful explanation of what they are approving.

ERC-3224 addresses this problem by allowing developers to provide descriptions of the operations their contracts perform. A wallet can present those descriptions before requesting authorization.

The mechanism does not prevent malicious contracts from supplying misleading descriptions. It is intended to help developers who want to provide a clearer signing experience.

Descriptions can also be audited alongside contract code. Auditors and reviewers can check whether the description accurately represents the operation, providing an additional basis for trust.

Specification

Generating descriptions

ERC-3224 defines a mechanism for generating a human-readable description and machine-readable described data together within a contract.

js
function eipXXXDescribe(bytes describer_inputs) view returns (string description_string, bytes described_data);

The function is read-only: it must not emit logs using logX or modify storage using sstore.

The following transaction context must be used when evaluating the function.

  • ADDRESS (to)
  • CALLER (from)
  • VALUE (the amount of ETH transferred, always zero for message signing)
  • GASPRICE (gas price)

Block information such as BLOCKHASH, NUMBER, TIMESTAMP, and DIFFICULTY should correspond as closely as possible to the latest block. The COINBASE address should be set to the zero address. These names reflect the original proposal's EVM terminology.

If the function reverts, signing the described operation is aborted.

New JSON-RPC methods

Ethereum clients that manage private keys would expose the following JSON-RPC methods to support the proposed described-data interface. Users could then review the meaning of transactions and messages before signing or sending them.

In an environment without a user interface, the description string is ignored and only described_data is used.

Message signing (eth_signDescribedMessage)

json
eth_signDescribedMessage(address, describer, describerInput)

This method calls the specified describer contract's eipXXXDescribe function using describerInput, obtaining description_string and described_data before signing.

The signature follows EIP-191 using the following format.

text
0x19 0x00 DESCRIBER_ADDRESS DESCRIBED_DATA

For background on EIP-191, see:

[ERC-191] Safely Using Signed Data

The result includes the description, the data to be signed, and the resulting signature.

Sending a transaction (eth_sendDescribedTransaction)

json
eth_sendDescribedTransaction(address, {
  to: "0x...",
  value: 1234,
  nonce: 42,
  gas: 42000,
  gasPrice: 9000000000,
  describerInput: "0x1234..."
})

This method calls eipXXXDescribe on the contract at the specified to address, passing describerInput to generate the description and transaction data.

If the wallet has a user interface, it displays the description alongside fee information and the transaction's value. Once the user approves, the transaction is signed and broadcast.

The returned data includes the description and the signed transaction that was submitted.

Signing without broadcasting (eth_signDescribedTransaction)

json
eth_signDescribedTransaction(address, {
  to: "0x...",
  value: 1234,
  nonce: 42,
  gas: 42000,
  gasPrice: 9000000000,
  describerInput: "0x1234..."
})

Like eth_sendDescribedTransaction, this method calls eipXXXDescribe. However, it returns the signed transaction data without broadcasting the transaction. This can be useful in workflows that separate signing from submission, including offline-signing workflows where the required description can be evaluated safely.

Description string format

A description begins with a MIME type followed by a semicolon. The original proposal specifies text/plain, as shown below.

text
text/plain;Transfer 5 tokens to 0xABC...

Future EIPs could extend the format to support richer representations such as text/markdown or multilingual descriptions resembling multipart/form-data.

Rationale

Why descriptions need an indirect representation

Earlier attempts to provide readable descriptions often tried to interpret the encoded transaction or message itself.

However, the encoded data may omit information that a user needs to understand the operation. Decoding the data alone is therefore not always sufficient.

Consider the ENS function commit(bytes32). It receives a hash that does not reveal the original name, address, or other inputs. A wallet cannot recover those inputs simply by decoding the commitment.

ERC-3224 proposes an indirect approach.

  • Original inputs
    • name, address, and secret
  • Description
    • "Commit NAME for ADDRESS using SECRET"
  • Execution data
    • commit(hash(name, address, secret))

The description is generated from the original inputs while the corresponding execution data, including the commitment hash, is computed at the same time.

Binding signatures to a contract address

ERC-3224 includes the contract address in the signed data to reduce the risk of reusing signatures across different contracts.

  • A transaction binds the destination through its to field.
  • A message includes the contract address as version-specific data under EIP-191.

This provides contract-level domain separation. It does not, by itself, prevent every form of replay, including replay within the same domain or across chains where other domain information is absent.

The zero address (0x000...0) is reserved for special purposes.

Comparison with other approaches

The proposal discusses several alternatives to its EVM-based description mechanism.

Higher-level languages such as NatSpec

NatSpec (Ethereum Natural Specification Format) provides a way to describe contract behavior in natural language. The proposal identifies the following limitations in earlier approaches that relied on higher-level runtime interpretation.

  • Full-featured evaluation can require a runtime environment that may be impractical on resource-constrained hardware wallets.
  • Describing encoded data directly does not recover information hidden inside commitments or other blinded values.

ERC-3224 instead performs description generation within the EVM, avoiding the need for a separate general-purpose description language. The security and resource requirements of evaluating contract code still need to be considered.

Custom description languages

Designing a new language capable of expressing Ethereum's complex operations could require considerable expressiveness and duplicate functionality already available in the EVM.

The proposal therefore reuses the EVM rather than introducing a separate execution language.

Format strings

Earlier trusted signing UI proposals used format strings to generate descriptions. The ERC-3224 rationale argues that their limited expressiveness is insufficient for the complex data structures and computations that Ethereum applications may require.

Relationship to EIP-712

ERC-3224 overlaps in purpose with EIP-712, which defines hashing and signing of typed structured data.

EIP-712 relies on an explicitly defined data structure. ERC-3224 takes a different approach by generating both the description and execution data dynamically through the EVM. This can accommodate operations that require computation before their execution data is available.

For background on EIP-712, see:

[EIP-712] Hashing and Signing Typed Structured Data

Security Considerations

Escaping and rendering text

Wallets must treat descriptions returned by contracts as untrusted content. Without appropriate sanitization and rendering safeguards, the descriptions could mislead users or introduce security vulnerabilities.

The proposal highlights several categories of risk.

  • Embedded HTML

    A renderer must not execute active content supplied through description text. For example, a <script> element must remain inert rather than gaining access to sensitive wallet information.

  • Visual deception

    The example "<span style='display:none'>not-</span>ricmoo.eth" illustrates how interpreting untrusted HTML can hide part of a string and change its apparent meaning.

  • Special characters

    Quotes, backslashes, newline characters (\n), tabs (\t), and unusual whitespace can cause parsing or display problems.

  • UTF-8 handling

    Incorrect Unicode handling has historically caused renderer crashes and more serious vulnerabilities. The proposal suggests substituting a replacement character such as � for problematic code points. Wallets should define explicit Unicode validation and display rules.

  • Homoglyph attacks

    Visually similar characters, such as Latin "o" and Cyrillic "о", can be used to disguise identifiers.

  • Right-to-left control characters

    Bidirectional control characters can alter the apparent ordering of displayed text.

  • Other environment-specific issues

    Additional threats may arise depending on the rendering environment.

Unambiguous signed data

Applications implementing ERC-3224 must ensure that the data being signed is unambiguous.

Appropriate encoding, such as ABI encoding, and well-defined data structures help prevent different operations from producing identical signed representations.

Mitigating enumeration attacks

Responses should not reveal whether signing was aborted internally or explicitly rejected by the user when distinguishing these cases would expose private information.

Response timing can also reveal differences between internal outcomes. The original proposal discusses randomized delays as a mitigation, although random delays alone do not guarantee resistance to timing analysis.

An enumeration attack uses observable differences in a system's responses, including timing, to infer information about its internal state.

Preventing replay of signed data

Ethereum transactions include a nonce, preventing the same transaction from being executed repeatedly on the same chain under ordinary conditions. Arbitrary message signatures do not automatically have an application-level nonce.

For login or similar use cases, an application can bind a signature to a short-lived challenge. The original discussion suggests including a time-dependent value such as block.timestamp; an application should generally use a unique nonce, enforce expiration, and record whether the challenge has already been consumed. A timestamp alone does not guarantee single use.

These protocol-level values do not necessarily need to appear in the human-readable description, provided the wallet makes the relevant authorization scope clear.

Including and validating an application-level nonce is recommended for replay-sensitive message signatures.

Citation

Richard Moore (@ricmoo), Nick Johnson (@arachnid), "ERC-3224: Described Data [DRAFT]," Ethereum Improvement Proposals, no. 3224, January 2021. [Online serial]. Available: https://eips.ethereum.org/EIPS/eip-3224.

Conclusion

ERC-3224 proposes generating a human-readable description and the associated execution data together, allowing compatible wallets to explain an operation before requesting a signature. Its usefulness depends on accurate descriptions, safe rendering, and sound signature validation. The RPC methods described here are part of the proposal, not a guarantee of support in existing wallets.

Questions are welcome through Twitter direct messages.

Twitter @cardene777

I also publish on the following platforms.

https://chaldene.net/