Overview
ERC-5267 defineseip712Domain() function that contracts implement to expose their EIP-712 domain parameters. This enables:
- Wallets to verify domain before signing
- Tools to discover domain without hardcoding
- Standardized domain querying across contracts
Function Signature
Fields Bitmap
Thefields byte indicates which domain fields are defined:
| Bit | Hex | Field | Description |
|---|---|---|---|
| 0 | 0x01 | name | Domain name present |
| 1 | 0x02 | version | Version present |
| 2 | 0x04 | chainId | Chain ID present |
| 3 | 0x08 | verifyingContract | Contract address present |
| 4 | 0x10 | salt | Salt present |
0x0f= name + version + chainId + verifyingContract0x1f= all fields present0x0d= name + chainId + verifyingContract (no version)
API
toErc5267Response
toErc5267Response(domain: DomainType): ERC5267Response
Converts Domain to ERC-5267 response format with field bitmap.
Example:
getFieldsBitmap
getFieldsBitmap(domain: DomainType): Uint8Array
Calculates fields bitmap from domain.
Example:

