EIP-712 (Ethereum Improvement Proposal 712) is a standard for hashing and signing typed structured data in Ethereum, enabling wallets to display human-readable transaction information instead of opaque hexadecimal byte strings before a user signs a message. It defines a domain separator (chainId, contract address, version) that binds a signature to a specific deployment context to prevent cross-chain or cross-contract replay attacks, and a type-encoding scheme that recursively hashes structured fields to produce a deterministic 32-byte digest that the ECDSA private key signs. EIP-712 is the foundation of off-chain signing workflows — gasless approvals, meta-transactions, permit() functions (EIP-2612), delegated votes, and order book signatures in decentralised exchanges — making it one of the most widely deployed Ethereum standards.

Content

  • Before EIP-712, Ethereum wallet signing (eth_sign) produced signatures over arbitrary byte blobs, exposing users to phishing: a malicious dApp could request a signature over a disguised transaction. EIP-712 introduced a structured encoding pipeline: first a domain separator is computed from the chain ID, verifying contract address, and a human-readable name/version; then typed data is recursively encoded by hashing struct definitions concatenated with encoded field values. The final message hash is the keccak256 of a well-known prefix (0x1901) concatenated with the domain separator hash and the struct data hash.
  • Wallet implementations (MetaMask, WalletConnect-compatible wallets) display EIP-712 payloads as structured JSON objects — field names, types, and values — in their approval UI, so users can verify what they are authorising. This is critical for permit()-style approvals (EIP-2612), where a signed message rather than an on-chain approve transaction grants an allowance, saving gas and enabling sponsored transactions.
  • Decentralised exchanges (Uniswap v2, 0x Protocol, Seaport) use EIP-712 signatures extensively for off-chain order matching: makers sign orders describing token pairs and prices, and takers submit signed bundles on-chain for settlement. This pattern shifts the gas cost of failed or unfilled orders to off-chain infrastructure rather than burdening the blockchain. Governance protocols (Compound, Uniswap) use EIP-712 for delegated voting and proposal signing.
  • Security considerations include correct domain-separator construction — omitting the chain ID allows the same signature to be replayed on a forked chain — and struct versioning: if a contract upgrades its message format, the type string must change to prevent old signatures being accepted by new logic. EIP-712 has become the de facto standard and is a prerequisite for any wallet seeking compatibility with the wider DeFi and NFT ecosystem.