{"eip":6384,"title":"Human-readable offline signatures","description":"A method for retrieving a human-readable description of EIP-712 typed and structured data.","authors":["Tal Be'ery \u003ctal@zengo.com\u003e","RoiV (@DeVaz1)"],"status":"Stagnant","type":"Standards Track","category":"ERC","created":"2023-01-08","requires":[712],"discussionsTo":"https://ethereum-magicians.org/t/eip-6384-readable-eip-712-signatures/12752","repo":"ERCs","label":"ERC-6384","officialUrl":"https://eips.ethereum.org/EIPS/eip-6384","sourceUrl":"https://github.com/ethereum/ERCs/blob/master/ERCS/erc-6384.md","url":"https://eips.huatuo.xyz/eip-6384/","tldr":{"en":"Proposes an evalEIP712Buffer view function on the verifying contract so wallets can show users a plain-language description of an EIP-712 message before they sign it.","ja":"検証側コントラクトに evalEIP712Buffer view 関数を設け、ユーザーが署名する前にウォレットが EIP-712 メッセージを平易な言葉で表示できるようにすることを提案する。","ko":"검증 컨트랙트에 evalEIP712Buffer view 함수를 두어, 사용자가 서명하기 전에 지갑이 EIP-712 메시지를 쉬운 말로 보여줄 수 있게 하자고 제안한다.","zh":"提议在验证合约上提供一个 evalEIP712Buffer view 函数，让钱包能在用户签名之前向其展示对 EIP-712 消息的通俗描述。"},"tags":["signatures","eip712","wallet","phishing","ux"],"explainers":{"en":{"lang":"en","tldr":"Proposes an evalEIP712Buffer view function on the verifying contract so wallets can show users a plain-language description of an EIP-712 message before they sign it.","tags":["signatures","eip712","wallet","phishing","ux"],"related":[712,2612,5267],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/eip-6384/","markdown":"## What problem does it solve?\n\nOff-chain signatures in [EIP-712](/eip-712/) format are everywhere: token permits ([ERC-2612](/eip-2612/)), NFT marketplace listings, order books. They are gas-free for the user, but the signature can later be used on chain by someone else. Phishing sites exploit this: they ask the victim to sign a message that, for example, lists their NFT for sale at almost zero price. Wallets typically display the raw typed fields, which most users cannot interpret, so they sign blindly.\n\nERC-6384 proposes letting the contract that will eventually consume the signature explain the message in human-readable terms.\n\n## How it works\n\nEIP-712 messages already name a `verifyingContract` in their domain. ERC-6384 asks such contracts to implement a `view` function:\n\n```solidity\nfunction evalEIP712Buffer(\n    bytes32 domainHash,          // the EIP-712 domain separator\n    string memory primaryType,   // the EIP-712 primaryType\n    bytes memory typedDataBuffer // ABI-encoded message part\n) external view returns (string[] memory);\n```\n\nFlow:\n\n1. A dApp asks the wallet to sign an EIP-712 message.\n2. The wallet calls `evalEIP712Buffer` on the `verifyingContract` with the message data (a free `eth_call`).\n3. The contract returns one or more plain strings, e.g. \"Sell NFT #1234 for 0.0001 ETH\". The wallet shows them to the user, optionally enriched (for example by resolving addresses to names).\n\nThe trust argument: the message comes from a possibly malicious website, but the verifying contract is controlled by the legitimate protocol. An attacker cannot swap in a different contract, because then the signature would not be accepted on chain.\n\nRules worth knowing:\n\n- An array is returned so multi-part messages (several transfers) can be shown one per line.\n- The strings must be treated as **untrusted input** and rendered as plain text, not HTML.\n- If the domain has no `verifyingContract`, wallets must not use this method and should fall back to their normal display.\n\n## Sample code\n\nA contract describing its own `TransferWithSig` message (simplified):\n\n```solidity\n// SPDX-License-Identifier: MIT\npragma solidity ^0.8.20;\n\nimport {Strings} from \"@openzeppelin/contracts/utils/Strings.sol\";\n\ncontract MyToken {\n    function evalEIP712Buffer(bytes32, string memory primaryType, bytes memory buf)\n        external view returns (string[] memory out)\n    {\n        require(keccak256(bytes(primaryType)) == keccak256(\"TransferWithSig\"), \"unknown type\");\n        (address from, address to, uint256 amount, , ) =\n            abi.decode(buf, (address, address, uint256, uint256, uint256));\n        out = new string[](1);\n        out[0] = string.concat(\n            \"Transfer \", Strings.toString(amount), \" tokens from \",\n            Strings.toHexString(from), \" to \", Strings.toHexString(to)\n        );\n    }\n}\n```\n\nWallet side (ethers v6):\n\n```ts\nconst c = new Contract(domain.verifyingContract, [\n  \"function evalEIP712Buffer(bytes32,string,bytes) view returns (string[])\",\n], provider);\nconst lines: string[] = await c.evalEIP712Buffer(domainHash, primaryType, encodedMessage);\nlines.forEach((l) =\u003e ui.appendText(l)); // render as plain text\n```\n\n## Things to know\n\n- **Status: Stagnant.** Few contracts or wallets are known to implement it; do not rely on it being available.\n- It only helps when the verifying contract is honest. A malicious contract could return misleading text, but the spec argues such a contract could already cause harm without this function.\n- The description is only as accurate as the contract's decoding code, and adding it costs contract size for every supported message type.\n- [ERC-5267](/eip-5267/) is a related, Final standard that lets wallets retrieve a contract's EIP-712 domain.\n"},"ja":{"lang":"ja","tldr":"検証側コントラクトに evalEIP712Buffer view 関数を設け、ユーザーが署名する前にウォレットが EIP-712 メッセージを平易な言葉で表示できるようにすることを提案する。","tags":["signatures","eip712","wallet","phishing","ux"],"related":[712,2612,5267],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/ja/eip-6384/","markdown":"## 何を解決するのか\n\n[EIP-712](/eip-712/) 形式のオフチェーン署名は、トークンの permit（[ERC-2612](/eip-2612/)）、NFT マーケットプレイスの出品、オーダーブックなど、あらゆるところにあります。ユーザーにとってガス代はかかりませんが、その署名は後から別の誰かがオンチェーンで使えます。フィッシングサイトはこれを悪用します。たとえば、被害者の NFT をほぼゼロの価格で売りに出すメッセージに署名させるのです。ウォレットは通常、生の型付きフィールドを表示しますが、ほとんどのユーザーには解釈できず、中身を理解しないまま署名してしまいます。\n\nERC-6384 は、最終的にその署名を消費するコントラクト自身に、メッセージを人が読める言葉で説明させることを提案します。\n\n## 仕組み\n\nEIP-712 メッセージは、すでにドメイン内で `verifyingContract` を指定しています。ERC-6384 は、そうしたコントラクトに `view` 関数を実装することを求めます。\n\n```solidity\nfunction evalEIP712Buffer(\n    bytes32 domainHash,          // the EIP-712 domain separator\n    string memory primaryType,   // the EIP-712 primaryType\n    bytes memory typedDataBuffer // ABI-encoded message part\n) external view returns (string[] memory);\n```\n\n流れは次のとおりです。\n\n1. dApp がウォレットに EIP-712 メッセージの署名を求めます。\n2. ウォレットは、メッセージのデータを使って `verifyingContract` の `evalEIP712Buffer` を呼び出します（無料の `eth_call`）。\n3. コントラクトは 1 つ以上の平易な文字列を返します。たとえば「NFT #1234 を 0.0001 ETH で売却」のようなものです。ウォレットはそれをユーザーに表示し、必要に応じて内容を補強します（たとえばアドレスを名前に解決するなど）。\n\n信頼の論拠はこうです。メッセージは悪意のある可能性のあるウェブサイトから来ますが、検証側コントラクトは正規のプロトコルが管理しています。攻撃者は別のコントラクトにすり替えることはできません。そうするとオンチェーンで署名が受け付けられなくなるからです。\n\n知っておくべきルール:\n\n- 配列が返されるので、複数部分からなるメッセージ（複数の送金など）を 1 行ずつ表示できます。\n- 文字列は**信頼できない入力**として扱い、HTML ではなくプレーンテキストとして描画しなければなりません。\n- ドメインに `verifyingContract` がない場合、ウォレットはこのメソッドを使ってはならず、通常の表示にフォールバックすべきです。\n\n## サンプルコード\n\n自身の `TransferWithSig` メッセージを説明するコントラクト（簡略版）:\n\n```solidity\n// SPDX-License-Identifier: MIT\npragma solidity ^0.8.20;\n\nimport {Strings} from \"@openzeppelin/contracts/utils/Strings.sol\";\n\ncontract MyToken {\n    function evalEIP712Buffer(bytes32, string memory primaryType, bytes memory buf)\n        external view returns (string[] memory out)\n    {\n        require(keccak256(bytes(primaryType)) == keccak256(\"TransferWithSig\"), \"unknown type\");\n        (address from, address to, uint256 amount, , ) =\n            abi.decode(buf, (address, address, uint256, uint256, uint256));\n        out = new string[](1);\n        out[0] = string.concat(\n            \"Transfer \", Strings.toString(amount), \" tokens from \",\n            Strings.toHexString(from), \" to \", Strings.toHexString(to)\n        );\n    }\n}\n```\n\nウォレット側（ethers v6）:\n\n```ts\nconst c = new Contract(domain.verifyingContract, [\n  \"function evalEIP712Buffer(bytes32,string,bytes) view returns (string[])\",\n], provider);\nconst lines: string[] = await c.evalEIP712Buffer(domainHash, primaryType, encodedMessage);\nlines.forEach((l) =\u003e ui.appendText(l)); // render as plain text\n```\n\n## 知っておくべきこと\n\n- **ステータス: Stagnant。** 実装しているコントラクトやウォレットはほとんど知られていません。利用できることを前提にしないでください。\n- 役に立つのは、検証側コントラクトが誠実な場合だけです。悪意のあるコントラクトは誤解を招く文章を返す可能性がありますが、仕様は、そのようなコントラクトはこの関数がなくてもすでに害を及ぼせると論じています。\n- 説明の正確さは、コントラクトのデコード処理の正確さに左右され、追加するとサポートするメッセージタイプごとにコントラクトサイズが増えます。\n- [ERC-5267](/eip-5267/) は関連する Final の標準で、ウォレットがコントラクトの EIP-712 ドメインを取得できるようにします。\n"},"ko":{"lang":"ko","tldr":"검증 컨트랙트에 evalEIP712Buffer view 함수를 두어, 사용자가 서명하기 전에 지갑이 EIP-712 메시지를 쉬운 말로 보여줄 수 있게 하자고 제안한다.","tags":["signatures","eip712","wallet","phishing","ux"],"related":[712,2612,5267],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/ko/eip-6384/","markdown":"## 어떤 문제를 해결하나요?\n\n[EIP-712](/eip-712/) 형식의 오프체인 서명은 어디에나 있습니다. 토큰 permit([ERC-2612](/eip-2612/)), NFT 마켓플레이스 리스팅, 오더북 등입니다. 사용자에게는 가스비가 들지 않지만, 그 서명은 나중에 다른 누군가가 온체인에서 사용할 수 있습니다. 피싱 사이트는 이를 악용합니다. 예를 들어 피해자의 NFT를 거의 0에 가까운 가격으로 판매 등록하는 메시지에 서명하게 만듭니다. 지갑은 보통 원시 타입 필드를 보여주는데 대부분의 사용자는 이를 해석할 수 없어서, 내용을 모른 채 서명하게 됩니다.\n\nERC-6384는 결국 그 서명을 사용하게 될 컨트랙트가 메시지를 사람이 읽을 수 있는 말로 설명하게 하자고 제안합니다.\n\n## 어떻게 동작하나요?\n\nEIP-712 메시지는 이미 도메인에 `verifyingContract`를 명시합니다. ERC-6384는 그런 컨트랙트가 `view` 함수를 구현하도록 요청합니다.\n\n```solidity\nfunction evalEIP712Buffer(\n    bytes32 domainHash,          // the EIP-712 domain separator\n    string memory primaryType,   // the EIP-712 primaryType\n    bytes memory typedDataBuffer // ABI-encoded message part\n) external view returns (string[] memory);\n```\n\n흐름은 다음과 같습니다.\n\n1. dApp이 지갑에 EIP-712 메시지 서명을 요청합니다.\n2. 지갑이 메시지 데이터를 담아 `verifyingContract`의 `evalEIP712Buffer`를 호출합니다(무료 `eth_call`).\n3. 컨트랙트가 하나 이상의 평문 문자열을 반환합니다. 예: \"NFT #1234를 0.0001 ETH에 판매\". 지갑은 이를 사용자에게 보여주며, 선택적으로 내용을 보강합니다(예: 주소를 이름으로 변환).\n\n신뢰의 논거는 이렇습니다. 메시지는 악의적일 수 있는 웹사이트에서 오지만, 검증 컨트랙트는 정당한 프로토콜이 제어합니다. 공격자는 다른 컨트랙트로 바꿔치기할 수 없습니다. 그러면 온체인에서 서명이 받아들여지지 않기 때문입니다.\n\n알아둘 만한 규칙:\n\n- 배열이 반환되므로, 여러 부분으로 된 메시지(여러 건의 전송)를 한 줄씩 보여줄 수 있습니다.\n- 문자열은 **신뢰할 수 없는 입력**으로 취급해야 하며 HTML이 아니라 평문으로 렌더링해야 합니다.\n- 도메인에 `verifyingContract`가 없으면 지갑은 이 메서드를 사용해서는 안 되며 일반적인 표시 방식으로 되돌아가야 합니다.\n\n## 샘플 코드\n\n자신의 `TransferWithSig` 메시지를 설명하는 컨트랙트입니다(단순화).\n\n```solidity\n// SPDX-License-Identifier: MIT\npragma solidity ^0.8.20;\n\nimport {Strings} from \"@openzeppelin/contracts/utils/Strings.sol\";\n\ncontract MyToken {\n    function evalEIP712Buffer(bytes32, string memory primaryType, bytes memory buf)\n        external view returns (string[] memory out)\n    {\n        require(keccak256(bytes(primaryType)) == keccak256(\"TransferWithSig\"), \"unknown type\");\n        (address from, address to, uint256 amount, , ) =\n            abi.decode(buf, (address, address, uint256, uint256, uint256));\n        out = new string[](1);\n        out[0] = string.concat(\n            \"Transfer \", Strings.toString(amount), \" tokens from \",\n            Strings.toHexString(from), \" to \", Strings.toHexString(to)\n        );\n    }\n}\n```\n\n지갑 쪽(ethers v6)입니다.\n\n```ts\nconst c = new Contract(domain.verifyingContract, [\n  \"function evalEIP712Buffer(bytes32,string,bytes) view returns (string[])\",\n], provider);\nconst lines: string[] = await c.evalEIP712Buffer(domainHash, primaryType, encodedMessage);\nlines.forEach((l) =\u003e ui.appendText(l)); // render as plain text\n```\n\n## 알아둘 점\n\n- **상태: Stagnant.** 이를 구현한 컨트랙트나 지갑은 거의 알려져 있지 않습니다. 사용할 수 있다고 가정하지 마세요.\n- 검증 컨트랙트가 정직할 때만 도움이 됩니다. 악의적인 컨트랙트는 오해를 부르는 문구를 반환할 수 있지만, 사양은 그런 컨트랙트는 이 함수가 없어도 이미 해를 끼칠 수 있다고 주장합니다.\n- 설명의 정확도는 컨트랙트의 디코딩 코드만큼만 정확하며, 이를 추가하면 지원하는 메시지 유형마다 컨트랙트 크기가 늘어납니다.\n- [ERC-5267](/eip-5267/)은 지갑이 컨트랙트의 EIP-712 도메인을 가져올 수 있게 해 주는 관련된 Final 표준입니다.\n"},"zh":{"lang":"zh","tldr":"提议在验证合约上提供一个 evalEIP712Buffer view 函数，让钱包能在用户签名之前向其展示对 EIP-712 消息的通俗描述。","tags":["signatures","eip712","wallet","phishing","ux"],"related":[712,2612,5267],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/zh/eip-6384/","markdown":"## 它解决什么问题？\n\n[EIP-712](/eip-712/) 格式的链下签名无处不在：代币 permit（[ERC-2612](/eip-2612/)）、NFT 市场挂单、订单簿。它们对用户来说不需要 gas，但签名之后可以被别人在链上使用。钓鱼网站正是利用这一点：它们让受害者签署一条消息，例如以几乎为零的价格挂出其 NFT。钱包通常显示原始的类型化字段，大多数用户无法理解，于是只能盲签。\n\nERC-6384 提议让最终会使用该签名的合约，用人类可读的方式解释这条消息。\n\n## 它如何运作\n\nEIP-712 消息已经在其 domain 中指定了 `verifyingContract`。ERC-6384 要求这类合约实现一个 `view` 函数：\n\n```solidity\nfunction evalEIP712Buffer(\n    bytes32 domainHash,          // the EIP-712 domain separator\n    string memory primaryType,   // the EIP-712 primaryType\n    bytes memory typedDataBuffer // ABI-encoded message part\n) external view returns (string[] memory);\n```\n\n流程：\n\n1. dApp 请求钱包对一条 EIP-712 消息签名。\n2. 钱包带着消息数据对 `verifyingContract` 调用 `evalEIP712Buffer`（免费的 `eth_call`）。\n3. 合约返回一个或多个普通字符串，例如\"以 0.0001 ETH 出售 NFT #1234\"。钱包将其展示给用户，还可以选择性地加以丰富（例如把地址解析为名称）。\n\n信任论证：消息来自可能是恶意的网站，但验证合约由合法的协议控制。攻击者无法换成另一个合约，因为那样的话签名在链上将不被接受。\n\n值得了解的规则：\n\n- 返回的是数组，因此多部分消息（多笔转账）可以逐行展示。\n- 这些字符串必须被视为**不可信输入**，并以纯文本而不是 HTML 渲染。\n- 如果 domain 没有 `verifyingContract`，钱包不得使用该方法，应当回退到其常规显示方式。\n\n## 示例代码\n\n一个描述自己 `TransferWithSig` 消息的合约（简化版）：\n\n```solidity\n// SPDX-License-Identifier: MIT\npragma solidity ^0.8.20;\n\nimport {Strings} from \"@openzeppelin/contracts/utils/Strings.sol\";\n\ncontract MyToken {\n    function evalEIP712Buffer(bytes32, string memory primaryType, bytes memory buf)\n        external view returns (string[] memory out)\n    {\n        require(keccak256(bytes(primaryType)) == keccak256(\"TransferWithSig\"), \"unknown type\");\n        (address from, address to, uint256 amount, , ) =\n            abi.decode(buf, (address, address, uint256, uint256, uint256));\n        out = new string[](1);\n        out[0] = string.concat(\n            \"Transfer \", Strings.toString(amount), \" tokens from \",\n            Strings.toHexString(from), \" to \", Strings.toHexString(to)\n        );\n    }\n}\n```\n\n钱包一侧（ethers v6）：\n\n```ts\nconst c = new Contract(domain.verifyingContract, [\n  \"function evalEIP712Buffer(bytes32,string,bytes) view returns (string[])\",\n], provider);\nconst lines: string[] = await c.evalEIP712Buffer(domainHash, primaryType, encodedMessage);\nlines.forEach((l) =\u003e ui.appendText(l)); // render as plain text\n```\n\n## 需要注意\n\n- **状态：Stagnant。** 已知实现它的合约或钱包很少；不要依赖它一定可用。\n- 只有在验证合约诚实时它才有帮助。恶意合约可能返回具有误导性的文字，但规范认为，这样的合约即使没有这个函数也已经能造成危害。\n- 描述的准确程度取决于合约自身的解码代码，并且每支持一种消息类型都会增加合约体积。\n- [ERC-5267](/eip-5267/) 是一个相关的 Final 标准，让钱包可以获取合约的 EIP-712 domain。\n"}}}
