DomainSeparator
EIP-712 domain separator - a 32-byte keccak256 hash used for domain-specific signature verification.Overview
DomainSeparator is a brandedHash type representing the keccak256 hash of an EIP-712 domain separator. It ensures signatures are valid only within a specific domain context, preventing replay attacks across different contracts or chains.
Type Definition
Usage
Create from Hex
Create from Bytes
Convert to Hex
Compare Separators
Computing Domain Separators
UseDomain.toHash() to compute domain separators:
Error Handling
DomainSeparator operations throw typed errors for precise error handling:InvalidDomainSeparatorLengthError
Thrown when the input bytes length is not exactly 32 bytes.Specification
- EIP-712: https://eips.ethereum.org/EIPS/eip-712
- Size: 32 bytes
- Format: keccak256 hash of encoded domain separator
- Purpose: Domain separation for signatures

