EIPs Explained

ERC-7730 · Draft · ERC · 2024-02-07

ERC-7730: Structured Data Clear Signing Format

A JSON descriptor format that tells wallets how to display contract calls and EIP-712 messages in human terms ("Send 100 USDT to alice.eth") so users can clear-sign instead of blind-sign.

What problem does it solve?

When you approve a transaction on a hardware wallet, you often see a raw function selector and hex parameters. Even with the ABI or EIP-712 types, the wallet only knows primitive types: it does not know that a uint256 is a token amount with 6 decimals, that another uint256 is a deadline, or that an address field is the token being spent. Users end up "blind signing", which is how many phishing and front-end compromise attacks succeed.

ERC-7730 defines a file that app developers write once, describing how each function or message should be rendered. Any wallet supporting the standard can then show a clear, human-readable review screen.

How it works

A descriptor is a JSON document with three main sections:

  • context: binding constraints. Either a contract (list of deployments as chainId + address, or a factory) or an eip712 binding (domain values, deployments, or a domainSeparator). A wallet MUST verify these match before applying the file.
  • metadata: trusted constants such as the owner name, contract name, enums and maps.
  • display.formats: keyed by a human-readable function signature like transfer(address to,uint256 value) (the wallet derives the selector from it) or by an EIP-712 type. Each entry has an intent ("Send"), an optional interpolatedIntent ("Send {value} to {to}") and a list of fields, each with a path, label and format.

Formats include raw, amount (native currency), tokenAmount (decimals and ticker from a token address, with an optional "Unlimited" threshold), date, duration, unit, enum, chainId, nftName, addressName and more. Paths use three roots: # for decoded data, $ for the descriptor itself, and @ for container values like @.to, @.value, @.chainId.

The schema is versioned with semver; a descriptor's $schema key tells the wallet which major version applies, and the 1.x line is deprecated.

Sample code

A descriptor for an ERC-20 transfer (addresses are placeholders):

{
  "$schema": "https://eips.ethereum.org/assets/eip-7730/erc7730-v2.schema.json",
  "context": {
    "$id": "Example ERC-20",
    "contract": {
      "deployments": [
        { "chainId": 1, "address": "0x1111111111111111111111111111111111111111" }
      ]
    }
  },
  "metadata": {
    "owner": "Example",
    "contractName": "Example Token"
  },
  "display": {
    "formats": {
      "transfer(address to,uint256 value)": {
        "intent": "Send",
        "interpolatedIntent": "Send {value} to {to}",
        "fields": [
          { "path": "value", "label": "Amount", "format": "tokenAmount", "params": { "tokenPath": "@.to" } },
          { "path": "to", "label": "To", "format": "addressName" }
        ]
      }
    }
  }
}

Here tokenPath: "@.to" tells the wallet that the token being sent is the contract the transaction is addressed to, so it can look up decimals and ticker.

Things to know

  • Status: Draft. The schema is under active development; target the alias file of the currently "Active" major line and pin $schema accordingly.
  • The format only helps if the descriptor is trustworthy. The spec warns about registry poisoning and misleading but well-formed files, and says registries need verifiable provenance, tamper-evident history and a way to link files to contract ownership. Curation itself is out of scope.
  • Binding context must be restrictive; a loose binding lets a legitimate-looking format be applied to a malicious contract.
  • The spec also covers proxies, ERC-4337 user operations (ERC-4337), batched calls (EIP-5792) and encrypted fields.

#wallets #clear-signing #security #eip712 #json

Details

Authors
Laurent Castillo (@lcastillo-ledger), Derek Rein (@arein), Pierre Aoun (@paoun-ledger), Arik Galansky (@arikg), Bartosz Rozwarski (@llbartekll), Kaan Uzdogan (@kuzdogan), Fredrik (@Fredrik0x), Alex Forshtat (@forshtat)
Status
Draft
Type
Standards Track / ERC
Created
2024-02-07
Requires
Required by

Machine-readable: Markdown · JSON