DocumentationClear signingReferencesThe ERC-7730 standard

ERC-7730 Standard

This reference document provides details on the ERC-7730 standard, which defines a JSON format for clear-signing smart contract calls and typed messages.

Standard Definition

ERC-7730 (Structured Data Clear Signing Format) is a specification that provides a JSON format carrying additional information required to correctly display structured data to humans for review on wallet screens before signing.

Standard InformationDetails
EIP Number7730
StatusDraft
TypeStandards Track - ERC
CreatedFebruary 7, 2024
AuthorLaurent Castillo (@lcastillo-ledger)
RequiresEIP-155, EIP-712

File Structure

An ERC-7730 file consists of the following core sections:

{
  "$schema": "https://eips.ethereum.org/assets/eip-7730/erc7730-v1.schema.json",
  "context": { ... },
  "metadata": { ... },
  "display": { ... }
}

Context Section

The context section provides binding context information indicating whether the ERC-7730 file applies to specific transaction data.

Smart Contract Binding Context

{
  "context": {
    "$id": "Example ERC-20",
    "contract": {
      "abi": "https://api.example.io/api?module=contract&action=getabi&address=0xdac17f958d2ee523a2206206994597c13d831ec7",
      "deployments": [
        {
          "chainId": 1,
          "address": "0xdAC17F958D2ee523a2206206994597C13D831ec7"
        }
      ]
    }
  }
}
KeyDescriptionRequired
$idInternal identifier for the ERC-7730 fileOptional
contract.abiJSON ABI or URL to ABI of the contractRequired
contract.deploymentsArray of deployment options (chainId/address pairs)Required
contract.addressMatcherURL to check if current transaction can be formatted with this fileOptional
contract.factoryObject describing factory used to deploy contractsOptional

EIP-712 Messages Binding Context

{
  "context": {
    "eip712": {
      "schemas": [
        {
          "types": {
            "EIP712Domain": [
              { "name": "name", "type": "string" },
              { "name": "version", "type": "string" },
              { "name": "chainId", "type": "uint256" },
              { "name": "verifyingContract", "type": "address" }
            ],
            "Order": [
              { "name": "maker", "type": "address" },
              { "name": "amount", "type": "uint256" }
            ]
          },
          "primaryType": "Order"
        }
      ],
      "domain": {
        "name": "Example Protocol"
      },
      "deployments": [
        {
          "chainId": 1,
          "address": "0xabcdef1234567890abcdef1234567890abcdef12"
        }
      ]
    }
  }
}
KeyDescriptionRequired
eip712.schemasArray of EIP-712 schemas or URLs to schemasRequired
eip712.domainSet of key-value pairs the message domain must matchOptional
eip712.deploymentsArray of deployment options (chainId/address pairs)Optional
eip712.domainSeparatorHex string value of the domainSeparator to checkOptional

Metadata Section

The metadata section contains information about constant values relevant to the contract/message in scope.

{
  "metadata": {
    "owner": "Example",
    "info": {
      "legalName": "Example Inc.",
      "url": "https://example.io/",
      "deploymentDate": "2017-11-28T12:41:21Z"
    },
    "token": {
      "ticker": "EXT",
      "name": "Example Token",
      "decimals": 18
    },
    "constants": {
      "nativeAssetAddress": "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE"
    },
    "enums": {
      "interestRateMode": {
        "1": "stable",
        "2": "variable"
      }
    }
  }
}
KeyDescriptionRequired
ownerDisplayable name of the contract/message ownerRequired
infoAdditional information about the ownerOptional
tokenERC-20 metadata (only for ERC-20 contracts)Optional
constantsKey-value pairs of constants used by formattersOptional
enumsNamed enumerations for replacing parameter valuesOptional

Display Section

The display section contains format instructions for fields of bound structured data.

{
  "display": {
    "definitions": {
      "sendAmount": {
        "label": "Amount to Send",
        "format": "tokenAmount",
        "params": {
          "tokenPath": "fromToken"
        }
      }
    },
    "formats": {
      "transfer(address _to,uint256 _value)": {
        "intent": "Send",
        "fields": [
          {
            "path": "_to",
            "label": "To",
            "format": "addressOrName"
          },
          {
            "path": "_value",
            "label": "Amount",
            "format": "tokenAmount",
            "params": {
              "tokenPath": "@.to"
            }
          }
        ],
        "required": ["_to", "_value"],
        "excluded": []
      }
    }
  }
}
KeyDescriptionRequired
definitionsReusable field format specificationsOptional
formatsFormat specifications for functions/messagesRequired
formats.{function}.intentHuman-readable intent of the functionRecommended
formats.{function}.fieldsArray of field format specificationsRequired
formats.{function}.requiredArray of fields that should be displayedRecommended
formats.{function}.excludedArray of fields intentionally left outOptional
formats.{function}.screensWallet-specific layout informationOptional

Field Formats

Field formats specify how to display different data types. The standard includes formats for various data types.

Integer Formats

FormatDescriptionExample
rawDisplay integer in natural representation1000
amountDisplay as amount in native currency0.19866144 ETH
tokenAmountConvert using token decimals with ticker1 DAI
dateDisplay as date in RFC 3339 format2024-02-29T08:27:12
durationDisplay as HH:MM:ss duration02:17:30
unitDisplay with units and SI prefix10h, 36ks
enumConvert using reference enumerationstable (from value 1)

Address Formats

FormatDescriptionExample
rawDisplay as EIP-55 formatted address0x5aAe...eAed
addressOrNameDisplay as trusted name or addressvitalik.eth or address

Address Types

TypeDescription
walletAddress controlled by the wallet
eoaExternally Owned Account
contractWell-known smart contract
tokenWell-known ERC-20 token
collectionWell-known NFT collection

Path References

The standard uses a limited JSON path notation to reference values in multiple documents:

Root NodeReferencesExample
#Path applies to structured data schema#.params.amountIn
$Path applies to current formatting file$.metadata.enums.interestRateMode
@Path applies to container structure@.value

Complete Example

{
  "$schema": "https://eips.ethereum.org/assets/eip-7730/erc7730-v1.schema.json",
  
  "context": {
    "$id": "Example ERC-20",
    "contract": {
      "abi": "https://api.example.io/api?module=contract&action=getabi&address=0xdac17f958d2ee523a2206206994597c13d831ec7",
      "deployments": [
        {
          "chainId": 1,
          "address": "0xdAC17F958D2ee523a2206206994597C13D831ec7"
        }
      ]
    }
  },
  
  "metadata": {
    "owner": "Example",
    "info": {
      "legalName": "Example Inc.",
      "url": "https://example.io/"
    }
  },
  
  "display": {
    "formats": {
      "transfer(address _to,uint256 _value)": {
        "intent": "Send",
        "fields": [
          {
            "path": "_to",
            "label": "To",
            "format": "addressOrName"
          },
          {
            "path": "_value",
            "label": "Amount",
            "format": "tokenAmount",
            "params": {
              "tokenPath": "@.to"
            }
          }
        ],
        "required": ["_to", "_value"]
      }
    }
  }
}

References

For the complete specification, see the official ERC-7730 document.

Ledger
Copyright © Ledger SAS. All rights reserved. Ledger, Ledger Stax, Ledger Nano S, Ledger Vault, Bolos are trademarks owned by Ledger SAS