{"eip":3224,"title":"Described Data","description":"Contract method to compute human-readable descriptions for signable data.","authors":["Richard Moore (@ricmoo)","Nick Johnson (@arachnid)"],"status":"Stagnant","type":"Standards Track","category":"ERC","created":"2021-01-23","requires":[191],"discussionsTo":"https://github.com/ethereum/EIPs/issues/3225","repo":"ERCs","label":"ERC-3224","officialUrl":"https://eips.ethereum.org/EIPS/eip-3224","sourceUrl":"https://github.com/ethereum/ERCs/blob/master/ERCS/erc-3224.md","url":"https://eips.huatuo.xyz/eip-3224/","tldr":{"en":"Proposes that a contract computes both a human-readable description and the exact calldata or message to sign, so wallets can show users \"Send 3.14 TOKN to ricmoose.eth?\" instead of an opaque hex blob.","ja":"コントラクトが、人が読める説明文と、署名すべき正確な calldata またはメッセージの両方を計算するよう提案する。ウォレットは、意味のわからない 16 進数の塊ではなく、「ricmoose.eth に 3.14 TOKN を送りますか？」とユーザーに表示できる。","ko":"컨트랙트가 사람이 읽을 수 있는 설명과 서명해야 할 정확한 calldata 또는 메시지를 함께 계산하도록 제안한다. 지갑은 알아볼 수 없는 16진수 덩어리 대신 \"ricmoose.eth에게 3.14 TOKN을 보낼까요?\"라고 사용자에게 보여 줄 수 있다.","zh":"提议由合约同时计算人类可读的描述和需要签署的确切 calldata 或消息，这样钱包就能向用户显示“向 ricmoose.eth 发送 3.14 TOKN？”，而不是一团看不懂的十六进制。"},"tags":["wallet","signing","ux","json-rpc","security"],"explainers":{"en":{"lang":"en","tldr":"Proposes that a contract computes both a human-readable description and the exact calldata or message to sign, so wallets can show users \"Send 3.14 TOKN to ricmoose.eth?\" instead of an opaque hex blob.","tags":["wallet","signing","ux","json-rpc","security"],"related":[191,712],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/eip-3224/","markdown":"## What problem does it solve?\n\nWhen a wallet asks you to sign a transaction or message, it usually shows raw hex. Outside a few special-cased actions (like ERC-20 transfers) the user cannot tell what they are approving.\n\nDecoding the final calldata is often not enough. The spec's example is ENS `commit(bytes32)`: the name being registered is hidden inside a hash, so nothing in the calldata says which name you are committing to.\n\nERC-3224 flips the approach. Instead of the wallet decoding data, the dapp gives the wallet higher-level *inputs*, and the contract itself, running as a read-only **describer**, returns both a description and the bytes to actually sign.\n\n## How it works\n\nA describer contract implements one view method (the spec still uses a placeholder name):\n\n```solidity\nfunction eipXXXDescribe(bytes describer_inputs)\n    view returns (string description_string, bytes described_data);\n```\n\n- The wallet calls it statically with the real `to`, `from`, `value` and gas price, so the code can tailor the text.\n- `description_string` starts with a MIME type and a semicolon; only `text/plain;` is defined, e.g. `text/plain;Log into ethereum.org?`.\n- `described_data` is what gets signed: the transaction's calldata, or the message body.\n- If the method reverts, signing is aborted.\n\nThree JSON-RPC methods are proposed for wallets:\n\n| Method | Result |\n| --- | --- |\n| `eth_signDescribedMessage(address, describer, describerInput)` | description, described data and an [EIP-191](/eip-191/) signature |\n| `eth_sendDescribedTransaction(address, tx)` | description and the signed, sent transaction |\n| `eth_signDescribedTransaction(address, tx)` | description and the signed (not sent) transaction |\n\nMessages are signed under EIP-191 version `0x00` (\"data with intended validator\"), with the describer's address included, so a signature for one contract cannot be replayed against another:\n\n```text\n0x19 0x00 \u003cdescriber address\u003e \u003cdescribed data\u003e\n```\n\n## Sample code\n\nA describer for an ERC-20-style transfer (illustrative; method name per the draft):\n\n```solidity\n// SPDX-License-Identifier: MIT\npragma solidity ^0.8.20;\n\nimport {Strings} from \"@openzeppelin/contracts/utils/Strings.sol\";\n\ncontract DescribedToken {\n    function transfer(address to, uint256 amount) external returns (bool) { /* ... */ }\n\n    function eipXXXDescribe(bytes calldata input)\n        external view returns (string memory description, bytes memory data)\n    {\n        require(bytes4(input[:4]) == this.transfer.selector, \"unsupported\");\n        (address to, uint256 amount) = abi.decode(input[4:], (address, uint256));\n        description = string.concat(\n            \"text/plain;Send \", Strings.toString(amount),\n            \" units to \", Strings.toHexString(to), \"?\"\n        );\n        data = abi.encodeCall(this.transfer, (to, amount));\n    }\n}\n```\n\n## Things to know\n\n- Status is **Stagnant**. The method name is still a placeholder, and the spec's test vectors target Ropsten, a testnet that has since been shut down. Wallets did not adopt these RPC methods; structured signing with [EIP-712](/eip-712/) is the widespread alternative.\n- It only helps **honest** contracts. A malicious contract can return a misleading description; the authors rely on audits reviewing describer code alongside the contract.\n- Wallets must sanitise description text: hidden HTML, invisible whitespace, homoglyphs and right-to-left marks can make `not-ricmoo.eth` look like `ricmoo.eth`.\n- Signed messages have no built-in nonce. Describers should embed one (e.g. a timestamp) when replay matters, as in a login flow.\n"},"ja":{"lang":"ja","tldr":"コントラクトが、人が読める説明文と、署名すべき正確な calldata またはメッセージの両方を計算するよう提案する。ウォレットは、意味のわからない 16 進数の塊ではなく、「ricmoose.eth に 3.14 TOKN を送りますか？」とユーザーに表示できる。","tags":["wallet","signing","ux","json-rpc","security"],"related":[191,712],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/ja/eip-3224/","markdown":"## 何を解決するのか\n\nウォレットがトランザクションやメッセージへの署名を求めるとき、通常は生の 16 進数が表示されます。ごく一部の特別扱いされた操作（ERC-20 の転送など）を除き、ユーザーは自分が何を承認しようとしているのか判断できません。\n\n最終的な calldata をデコードするだけでは不十分なことも多くあります。仕様の例は ENS の `commit(bytes32)` です。登録しようとしている名前はハッシュの中に隠れており、calldata のどこにも、どの名前にコミットしようとしているかは書かれていません。\n\nERC-3224 はアプローチを逆転させます。ウォレットがデータをデコードする代わりに、dapp がウォレットに上位レベルの*入力*を渡し、読み取り専用の**デスクライバー（describer）**として動くコントラクト自身が、説明文と実際に署名するバイト列の両方を返します。\n\n## 仕組み\n\nデスクライバーコントラクトは、1 つの view メソッドを実装します（仕様ではメソッド名がまだプレースホルダーのままです）。\n\n```solidity\nfunction eipXXXDescribe(bytes describer_inputs)\n    view returns (string description_string, bytes described_data);\n```\n\n- ウォレットは、実際の `to`、`from`、`value`、ガス価格を指定して静的に呼び出すため、コードはテキストをそれに合わせて調整できます。\n- `description_string` は MIME タイプとセミコロンで始まります。定義されているのは `text/plain;` だけで、たとえば `text/plain;Log into ethereum.org?` のようになります。\n- `described_data` が実際に署名されるものです。トランザクションの calldata、またはメッセージ本文です。\n- メソッドが revert した場合、署名は中止されます。\n\nウォレット向けに 3 つの JSON-RPC メソッドが提案されています。\n\n| メソッド | 結果 |\n| --- | --- |\n| `eth_signDescribedMessage(address, describer, describerInput)` | 説明文、described data、[EIP-191](/eip-191/) の署名 |\n| `eth_sendDescribedTransaction(address, tx)` | 説明文と、署名・送信されたトランザクション |\n| `eth_signDescribedTransaction(address, tx)` | 説明文と、署名された（送信はされない）トランザクション |\n\nメッセージは EIP-191 のバージョン `0x00`（「意図された検証者付きデータ」）で、デスクライバーのアドレスを含めて署名されるため、あるコントラクト向けの署名を別のコントラクトに対してリプレイすることはできません。\n\n```text\n0x19 0x00 \u003cdescriber address\u003e \u003cdescribed data\u003e\n```\n\n## サンプルコード\n\nERC-20 風の transfer のデスクライバーです（説明用。メソッド名はドラフトに従っています）。\n\n```solidity\n// SPDX-License-Identifier: MIT\npragma solidity ^0.8.20;\n\nimport {Strings} from \"@openzeppelin/contracts/utils/Strings.sol\";\n\ncontract DescribedToken {\n    function transfer(address to, uint256 amount) external returns (bool) { /* ... */ }\n\n    function eipXXXDescribe(bytes calldata input)\n        external view returns (string memory description, bytes memory data)\n    {\n        require(bytes4(input[:4]) == this.transfer.selector, \"unsupported\");\n        (address to, uint256 amount) = abi.decode(input[4:], (address, uint256));\n        description = string.concat(\n            \"text/plain;Send \", Strings.toString(amount),\n            \" units to \", Strings.toHexString(to), \"?\"\n        );\n        data = abi.encodeCall(this.transfer, (to, amount));\n    }\n}\n```\n\n## 知っておくべきこと\n\n- ステータスは **Stagnant** です。メソッド名はまだプレースホルダーのままで、仕様のテストベクターは、すでに停止したテストネットである Ropsten を対象にしています。ウォレットはこれらの RPC メソッドを採用しませんでした。広く使われている代替手段は、[EIP-712](/eip-712/) による構造化署名です。\n- 役に立つのは**誠実な**コントラクトだけです。悪意のあるコントラクトは、誤解を招く説明文を返す可能性があります。作者たちは、監査がコントラクトとあわせてデスクライバーのコードもレビューすることに期待しています。\n- ウォレットは説明文のテキストをサニタイズしなければなりません。隠された HTML、不可視の空白、ホモグリフ、右から左へのマークによって、`not-ricmoo.eth` が `ricmoo.eth` のように見えることがあります。\n- 署名されたメッセージには、組み込みの nonce がありません。ログインフローのようにリプレイが問題になる場合、デスクライバーは nonce（たとえばタイムスタンプ）を埋め込むべきです。\n"},"ko":{"lang":"ko","tldr":"컨트랙트가 사람이 읽을 수 있는 설명과 서명해야 할 정확한 calldata 또는 메시지를 함께 계산하도록 제안한다. 지갑은 알아볼 수 없는 16진수 덩어리 대신 \"ricmoose.eth에게 3.14 TOKN을 보낼까요?\"라고 사용자에게 보여 줄 수 있다.","tags":["wallet","signing","ux","json-rpc","security"],"related":[191,712],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/ko/eip-3224/","markdown":"## 어떤 문제를 해결하나요?\n\n지갑이 트랜잭션이나 메시지 서명을 요청할 때는 보통 원시 16진수가 표시됩니다. 몇몇 특별 처리된 동작(ERC-20 전송 등)을 제외하면 사용자는 자신이 무엇을 승인하는지 알 수 없습니다.\n\n최종 calldata를 디코딩하는 것만으로는 충분하지 않은 경우가 많습니다. 명세의 예시는 ENS의 `commit(bytes32)`입니다. 등록하려는 이름이 해시 안에 숨어 있어서, calldata만으로는 어떤 이름에 커밋하는지 알 수 없습니다.\n\nERC-3224는 접근 방식을 뒤집습니다. 지갑이 데이터를 디코딩하는 대신 dapp이 지갑에 상위 수준의 *입력*을 주고, 읽기 전용 **디스크라이버(describer)**로 동작하는 컨트랙트 자체가 설명과 실제로 서명할 바이트를 함께 반환합니다.\n\n## 어떻게 동작하나요?\n\n디스크라이버 컨트랙트는 view 메서드 하나를 구현합니다(명세에서는 메서드 이름이 아직 자리표시자입니다).\n\n```solidity\nfunction eipXXXDescribe(bytes describer_inputs)\n    view returns (string description_string, bytes described_data);\n```\n\n- 지갑은 실제 `to`, `from`, `value`, 가스 가격으로 이를 정적 호출하므로, 코드가 텍스트를 이에 맞게 조정할 수 있습니다.\n- `description_string`은 MIME 타입과 세미콜론으로 시작합니다. 정의된 것은 `text/plain;`뿐이며, 예를 들면 `text/plain;Log into ethereum.org?`입니다.\n- `described_data`가 실제로 서명되는 것입니다. 트랜잭션의 calldata 또는 메시지 본문입니다.\n- 메서드가 revert되면 서명은 중단됩니다.\n\n지갑을 위해 세 가지 JSON-RPC 메서드가 제안되었습니다.\n\n| 메서드 | 결과 |\n| --- | --- |\n| `eth_signDescribedMessage(address, describer, describerInput)` | 설명, described data, [EIP-191](/eip-191/) 서명 |\n| `eth_sendDescribedTransaction(address, tx)` | 설명과, 서명되어 전송된 트랜잭션 |\n| `eth_signDescribedTransaction(address, tx)` | 설명과, 서명된(전송되지 않은) 트랜잭션 |\n\n메시지는 EIP-191 버전 `0x00`(\"의도된 검증자가 있는 데이터\")으로, 디스크라이버의 주소를 포함해 서명되므로, 한 컨트랙트를 위한 서명을 다른 컨트랙트에 리플레이할 수 없습니다.\n\n```text\n0x19 0x00 \u003cdescriber address\u003e \u003cdescribed data\u003e\n```\n\n## 샘플 코드\n\nERC-20 스타일 transfer를 위한 디스크라이버입니다(설명용이며 메서드 이름은 초안을 따랐습니다).\n\n```solidity\n// SPDX-License-Identifier: MIT\npragma solidity ^0.8.20;\n\nimport {Strings} from \"@openzeppelin/contracts/utils/Strings.sol\";\n\ncontract DescribedToken {\n    function transfer(address to, uint256 amount) external returns (bool) { /* ... */ }\n\n    function eipXXXDescribe(bytes calldata input)\n        external view returns (string memory description, bytes memory data)\n    {\n        require(bytes4(input[:4]) == this.transfer.selector, \"unsupported\");\n        (address to, uint256 amount) = abi.decode(input[4:], (address, uint256));\n        description = string.concat(\n            \"text/plain;Send \", Strings.toString(amount),\n            \" units to \", Strings.toHexString(to), \"?\"\n        );\n        data = abi.encodeCall(this.transfer, (to, amount));\n    }\n}\n```\n\n## 알아둘 점\n\n- 상태는 **Stagnant**입니다. 메서드 이름은 아직 자리표시자이고, 명세의 테스트 벡터는 이미 종료된 테스트넷인 Ropsten을 대상으로 합니다. 지갑들은 이 RPC 메서드를 채택하지 않았고, 널리 쓰이는 대안은 [EIP-712](/eip-712/)를 사용한 구조화된 서명입니다.\n- **정직한** 컨트랙트에서만 도움이 됩니다. 악의적인 컨트랙트는 오해를 부르는 설명을 반환할 수 있으며, 작성자들은 감사에서 컨트랙트와 함께 디스크라이버 코드도 검토하기를 기대합니다.\n- 지갑은 설명 텍스트를 정제해야 합니다. 숨겨진 HTML, 보이지 않는 공백, 동형 문자, 오른쪽에서 왼쪽으로 쓰는 표시 때문에 `not-ricmoo.eth`가 `ricmoo.eth`처럼 보일 수 있습니다.\n- 서명된 메시지에는 기본 nonce가 없습니다. 로그인 흐름처럼 리플레이가 문제가 되는 경우, 디스크라이버는 nonce(예: 타임스탬프)를 포함해야 합니다.\n"},"zh":{"lang":"zh","tldr":"提议由合约同时计算人类可读的描述和需要签署的确切 calldata 或消息，这样钱包就能向用户显示“向 ricmoose.eth 发送 3.14 TOKN？”，而不是一团看不懂的十六进制。","tags":["wallet","signing","ux","json-rpc","security"],"related":[191,712],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/zh/eip-3224/","markdown":"## 它解决什么问题？\n\n当钱包请你签署交易或消息时，通常显示的是原始十六进制数据。除了少数被特殊处理的操作（如 ERC-20 转账），用户无法知道自己批准的是什么。\n\n仅仅解码最终的 calldata 往往还不够。规范中的例子是 ENS 的 `commit(bytes32)`：要注册的名称藏在一个哈希里，calldata 中没有任何信息说明你提交的是哪个名称。\n\nERC-3224 反转了思路。不是由钱包去解码数据，而是由 dapp 给钱包提供更高层的*输入*，并由作为只读**描述器（describer）**运行的合约本身，同时返回描述和真正要签署的字节。\n\n## 它如何运作\n\n描述器合约实现一个 view 方法（规范中仍使用占位名称）：\n\n```solidity\nfunction eipXXXDescribe(bytes describer_inputs)\n    view returns (string description_string, bytes described_data);\n```\n\n- 钱包使用真实的 `to`、`from`、`value` 和 gas 价格对其进行静态调用，因此代码可以据此定制文本。\n- `description_string` 以 MIME 类型加分号开头；目前只定义了 `text/plain;`，例如 `text/plain;Log into ethereum.org?`。\n- `described_data` 就是要签署的内容：交易的 calldata，或消息正文。\n- 如果该方法 revert，签名将中止。\n\n为钱包提议了三个 JSON-RPC 方法：\n\n| 方法 | 结果 |\n| --- | --- |\n| `eth_signDescribedMessage(address, describer, describerInput)` | 描述、described data 以及一个 [EIP-191](/eip-191/) 签名 |\n| `eth_sendDescribedTransaction(address, tx)` | 描述，以及已签名并发送的交易 |\n| `eth_signDescribedTransaction(address, tx)` | 描述，以及已签名（未发送）的交易 |\n\n消息按 EIP-191 的版本 `0x00`（\"带有预期验证者的数据\"）签名，并包含描述器的地址，因此针对某个合约的签名无法被重放到另一个合约上：\n\n```text\n0x19 0x00 \u003cdescriber address\u003e \u003cdescribed data\u003e\n```\n\n## 示例代码\n\n一个 ERC-20 风格转账的描述器（仅作说明；方法名取自草案）：\n\n```solidity\n// SPDX-License-Identifier: MIT\npragma solidity ^0.8.20;\n\nimport {Strings} from \"@openzeppelin/contracts/utils/Strings.sol\";\n\ncontract DescribedToken {\n    function transfer(address to, uint256 amount) external returns (bool) { /* ... */ }\n\n    function eipXXXDescribe(bytes calldata input)\n        external view returns (string memory description, bytes memory data)\n    {\n        require(bytes4(input[:4]) == this.transfer.selector, \"unsupported\");\n        (address to, uint256 amount) = abi.decode(input[4:], (address, uint256));\n        description = string.concat(\n            \"text/plain;Send \", Strings.toString(amount),\n            \" units to \", Strings.toHexString(to), \"?\"\n        );\n        data = abi.encodeCall(this.transfer, (to, amount));\n    }\n}\n```\n\n## 需要注意\n\n- 状态为 **Stagnant**。方法名仍是占位符，规范中的测试向量针对的是 Ropsten，这个测试网已经关闭。钱包并未采用这些 RPC 方法；使用 [EIP-712](/eip-712/) 的结构化签名才是广泛采用的替代方案。\n- 它只对**诚实**的合约有帮助。恶意合约可以返回具有误导性的描述；作者寄希望于审计在审查合约的同时也审查描述器代码。\n- 钱包必须对描述文本进行清理：隐藏的 HTML、不可见的空白字符、同形异义字符和从右到左标记，都可能让 `not-ricmoo.eth` 看起来像 `ricmoo.eth`。\n- 签名消息没有内置的 nonce。在重放会造成影响时（如登录流程），描述器应当嵌入一个 nonce（例如时间戳）。\n"}}}
