Single EIP-712 atomic, dynamic, array, or struct encoding
validate
(typedData: TypedData)
void
Validates domain, type definitions, and message structure
format
(typedData: TypedData)
string
Human-readable representation for display/debugging
Domain Fields
EIP712Domain includes only the fields present on domain, encoded in canonical order:
Order
Field
Solidity Type
Purpose
1
name
string
Human-readable signing domain name
2
version
string
Domain schema version
3
chainId
uint256
EIP-155 chain ID (prevents cross-chain replay)
4
verifyingContract
address
Contract verifying the signature (prevents cross-contract replay)
5
salt
bytes32
Optional disambiguating salt
Security Considerations
Always bind chainId and verifyingContract in domain, and include a per-signer nonce and deadline in the signed struct. Without them, valid signatures can be replayed across forks, contracts, or indefinitely on the same chain.
Prefix collision safety: The 0x19 0x01 prefix (EIP-191 version 0x01) cannot collide with RLP-encoded transactions or EIP-191 personal messages (\x19Ethereum Signed Message:\n).
Dynamic field hashing:string and bytes values are hashed with keccak256 before being placed in their 32-byte slot; arrays hash the concatenation of their encoded elements.
Errors: Invalid types, missing fields, or cyclic type references throw Eip712Error / Eip712EncodingError / Eip712InvalidDomainError.