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 Information | Details |
---|---|
EIP Number | 7730 |
Status | Draft |
Type | Standards Track - ERC |
Created | February 7, 2024 |
Author | Laurent Castillo (@lcastillo-ledger) |
Requires | EIP-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"
}
]
}
}
}
Key | Description | Required |
---|---|---|
$id | Internal identifier for the ERC-7730 file | Optional |
contract.abi | JSON ABI or URL to ABI of the contract | Required |
contract.deployments | Array of deployment options (chainId/address pairs) | Required |
contract.addressMatcher | URL to check if current transaction can be formatted with this file | Optional |
contract.factory | Object describing factory used to deploy contracts | Optional |
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"
}
]
}
}
}
Key | Description | Required |
---|---|---|
eip712.schemas | Array of EIP-712 schemas or URLs to schemas | Required |
eip712.domain | Set of key-value pairs the message domain must match | Optional |
eip712.deployments | Array of deployment options (chainId/address pairs) | Optional |
eip712.domainSeparator | Hex string value of the domainSeparator to check | Optional |
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"
}
}
}
}
Key | Description | Required |
---|---|---|
owner | Displayable name of the contract/message owner | Required |
info | Additional information about the owner | Optional |
token | ERC-20 metadata (only for ERC-20 contracts) | Optional |
constants | Key-value pairs of constants used by formatters | Optional |
enums | Named enumerations for replacing parameter values | Optional |
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": []
}
}
}
}
Key | Description | Required |
---|---|---|
definitions | Reusable field format specifications | Optional |
formats | Format specifications for functions/messages | Required |
formats.{function}.intent | Human-readable intent of the function | Recommended |
formats.{function}.fields | Array of field format specifications | Required |
formats.{function}.required | Array of fields that should be displayed | Recommended |
formats.{function}.excluded | Array of fields intentionally left out | Optional |
formats.{function}.screens | Wallet-specific layout information | Optional |
Field Formats
Field formats specify how to display different data types. The standard includes formats for various data types.
Integer Formats
Format | Description | Example |
---|---|---|
raw | Display integer in natural representation | 1000 |
amount | Display as amount in native currency | 0.19866144 ETH |
tokenAmount | Convert using token decimals with ticker | 1 DAI |
date | Display as date in RFC 3339 format | 2024-02-29T08:27:12 |
duration | Display as HH:MM:ss duration | 02:17:30 |
unit | Display with units and SI prefix | 10h , 36ks |
enum | Convert using reference enumeration | stable (from value 1 ) |
Address Formats
Format | Description | Example |
---|---|---|
raw | Display as EIP-55 formatted address | 0x5aAe...eAed |
addressOrName | Display as trusted name or address | vitalik.eth or address |
Address Types
Type | Description |
---|---|
wallet | Address controlled by the wallet |
eoa | Externally Owned Account |
contract | Well-known smart contract |
token | Well-known ERC-20 token |
collection | Well-known NFT collection |
Path References
The standard uses a limited JSON path notation to reference values in multiple documents:
Root Node | References | Example |
---|---|---|
# | 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.