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-4430, which proposes generating executable contract code and a corresponding human-readable description to support safer interactions.
This article translates, summarizes, and supplements the material linked below.
I have also covered other EIPs.
Overview
ERC-4430 proposes defining virtual functions in contracts that generate executable bytecode alongside human-readable descriptions.
Users can review and approve the description in a user interface before the actual bytecode is executed.
The mechanism presents what will be executed in understandable language before a transaction proceeds with the user's consent.
Motivation
Ethereum wallets, including MetaMask, Clef, and hardware wallets, require users to approve transactions before submission. However, many Ethereum transactions are complex, making their contents difficult for wallets to explain adequately.
Historically, only certain familiar operations, such as ERC-20 token transfers, received specialized visualization. For many other operations, users had to sign binary data they could not readily interpret.
ERC-4430 aims to improve the user experience by providing contract developers with a way to generate human-readable explanations.
It is not a mechanism for detecting or preventing malicious contracts. It is intended for honest contracts whose developers want to make interactions understandable.
Descriptions can be audited together with contract code, allowing auditors to assess their accuracy. The goal is to help users understand what they are approving before proceeding.
Specification
The function defined by the proposal has the following signature.
function eipXXXDescribe(bytes inputs, bytes32 reserved) view returns (string description, bytes execcode)It produces two outputs.
description- A human-readable description represented as a string.
execcode- The actual EVM bytecode to execute, represented as binary data.
The mechanism provides an explanation for the user and executable code for the EVM. For example, a wallet or DApp can call the function, display the description, and obtain the execution code required for the transaction.
Execution Constraints
-
The function must execute in a
viewcontext.Logging instructions (
logX), storage writes (sstore), and other side effects are prohibited. -
The execution context must match the transaction context.
The relevant values are:
ADDRESS— Executing contract address.CALLER— Sender address.VALUE— Transferred value.GASPRICE— Gas price.
This allows the function to generate a description using the relevant execution context.
- When executing
execcode, block-related information should match the actual block as closely as possible. BLOCKHASH,NUMBER,TIMESTAMP, andDIFFICULTYare recommended to match the latest block.COINBASE, the fee recipient address referred to as the miner's reward address in the original proposal, should be set to the zero address.
Error Handling
If eipXXXDescribe reverts, the signing process is interrupted and the transaction is not executed.
Additional Notes
The Concept of Meta-Descriptions
Many earlier approaches to this problem attempted to decode transaction or message data directly. This approach has limitations because the final binary data may not contain all the information required to generate a meaningful description.
ERC-4430 uses indirect descriptions rather than directly describing encoded data.
For example, the ENS function commit(bytes32) stores a commitment hash on-chain. The hash contains a commitment to information such as a name (NAME), owner address (ADDRESS), and secret (SECRET), but those original values cannot be read directly from the transaction data.
To generate a meaningful description, such as committing to NAME and ADDRESS using SECRET, the description must be constructed while the original inputs are still available.
This is the approach taken by ERC-4430.
Such blinded data is also used in Layer 2 systems for privacy and data compression, and the proposal anticipates that it will become more common.
Binding to the Contract Address
ERC-4430 implicitly includes the destination contract address (the to field) in the transaction to prevent signed data from being reused with a different contract.
This clarifies the intended execution destination and improves security.
Comparison with Other Approaches
-
NatSpec
NatSpec provides a relatively complex mechanism for directly describing transaction data. Such an approach may require a substantial runtime, memory, and a secure sandbox, making it unsuitable for constrained environments such as hardware wallets. It also cannot recover blinded information from encoded data alone.
-
Custom languages
Ethereum transactions are highly complex, so creating an entirely new general-purpose language for describing them is impractical. The EVM already provides an execution environment that can be reused.
-
Format strings (for example, Trustless Signing UI Protocol)
Format strings are limited to the expressive power of a regular language. The proposal argues that this is insufficient to represent complex Ethereum transactions, a limitation encountered in early attempts.
Relationship to EIP-712
ERC-4430 is conceptually similar to EIP-712, which addresses signed structured data. Both aim to provide human-readable information together with a machine-processable representation so that users can make more informed signing decisions.
See the following article for EIP-712.
[EIP-712] Hashing and Signing Typed Structured Data
Security
Embedded HTML
If a displayed string contains HTML tags, particularly script tags such as <script>, a web-based wallet could mistakenly execute the embedded content.
Malicious scripts could compromise sensitive wallet data, including private keys.
Misleading Visual Presentation
A description can be manipulated to appear different from its actual contents. The original proposal discusses examples such as hidden HTML text and unusual whitespace that could cause a name to be displayed misleadingly.
Wallets should treat descriptions as untrusted text, rather than interpreting them as HTML, and make potentially misleading characters visible.
Special and Control Characters
Characters in a description can cause unexpected rendering or behavior, including:
- Double quotes (
"). - Newlines (
\n), tabs (\t), and form feeds (\f). - Backslashes (
\). - Unusual whitespace characters.
UTF-8 Vulnerabilities
UTF-8 handling requires care. Historical UTF-8 implementation bugs have led to arbitrary code execution or renderer crashes.
Applications should validate text and handle unexpected or invalid encodings safely, for example using replacement characters where appropriate.
Homoglyph Attacks
Visually similar characters with different code points, such as Greek α and Cyrillic а, can make a string resemble another legitimate string. This is known as a homoglyph attack.
Right-to-Left Marks
Unicode includes control characters that change text direction, including right-to-left marks. These characters can alter the apparent order of displayed text and create misleading visual representations.
Other Attacks
Additional security risks may arise depending on the rendering engine and display environment. Implementations should adopt safeguards appropriate to their environments.
Citation
Richard Moore (@ricmoo), Nick Johnson (@arachnid), "ERC-4430: Described Transactions [DRAFT]," Ethereum Improvement Proposals, no. 4430, November 2021. [Online serial]. Available: https://eips.ethereum.org/EIPS/eip-4430.
Conclusion
ERC-4430 proposes generating executable contract code together with a human-readable description, allowing users to review the intended operation before approving execution.
If you have questions, feel free to contact me on Twitter.
I also publish articles on the following platforms.



