Standards

Domain Separator

A domain separator is the EIP-712 value that binds signed data to a specific app, version, chain, and verifying contract.

A domain separator keeps a signature valid only in the context it was meant for.

Domain Separator Explained in Detail

The domain separator is part of EIP-712 typed data signing. It usually includes fields such as name, version, chain ID, and verifying contract.

It prevents the same signature from being valid in the wrong contract, chain, or application context.

{
    "preset": "flow",
    "autoplaySecs": 5.0,
    "edges": [
        {"idx": 0, "stepReveal": 0},
        {"idx": 1, "stepReveal": 1},
        {"idx": 2, "stepReveal": 2},
        {"idx": 3, "stepReveal": 3, "accent": true}
    ],
    "steps": [
        {"title": "Step 1 - The signer authorizes typed data", "desc": "The signature is about a specific action and parameters.", "activeNodes": ["signer", "message"], "activeEdges": [0], "tone": "info", "navLabel": "Step 1 - The signer authorizes typed data"},
        {"title": "Step 2 - The domain adds context", "desc": "The domain separator scopes that authorization to the intended app, version, chain, and contract.", "activeNodes": ["message", "domain"], "activeEdges": [1], "tone": "info", "navLabel": "Step 2 - The domain adds context"},
        {"title": "Step 3 - The verifier recomputes the scope", "desc": "The contract checks the signature against the domain it expects for this deployment.", "activeNodes": ["domain", "contract"], "activeEdges": [2], "tone": "success", "navLabel": "Step 3 - The verifier recomputes the scope"},
        {"title": "Step 4 - Replays fail elsewhere", "desc": "If chain ID or verifying contract differs, the signature should not validate.", "activeNodes": ["contract", "reject"], "activeEdges": [3], "tone": "warning", "navLabel": "Step 4 - Replays fail elsewhere"},
        {"title": "Audit lesson", "desc": "Missing or stale domain fields turn a local authorization into replayable authorization.", "activeNodes": ["domain", "reject"], "activeEdges": [3], "tone": "danger", "navLabel": "Audit lesson"}
    ]
}
  
Signature Scope

What the domain separator binds

The signed message is only safe when the domain binds it to the intended app, chain, version, and verifying contract.

SSignerApproves data
Signer intent
The user signs typed data for one specific context.
Step 1
MTyped DataAction + params
Structured message
The message says what the signer authorizes.
Step 2
DDomainName chain addr
Scope binding
Name, version, chain ID, and verifying contract bind the signature to one context.
Step 3
VVerifierExpected scope
Intended contract
The contract accepts the signature only when its computed domain matches.
Step 4
XReplay FailsWrong context
Replay defense
A different chain or contract should produce a different domain and reject reuse.
Step 5

Smart contract example

DOMAIN_SEPARATOR();

Permit implementations often expose this value for compatibility.

Domain Separator in Auditing

Domain separation is a core replay defense. If a signature can move across contracts, chains, or versions, an attacker may reuse authorization in a place the signer did not intend.

Auditors recompute the domain and compare it to the contract value.

Red flags in code

  • Chain ID or verifying contract is missing.

  • Upgradeable contracts use the implementation address instead of the proxy address.

  • Cached domain separators do not handle chain ID changes.

  • Name or version changes unexpectedly after signatures are issued.

  • Different signature systems reuse the same domain without intent.

How to test or review it

  • Recompute the EIP-712 domain from expected fields.

  • Verify signatures fail on another contract address and another chain.

  • Test proxy deployments through the proxy address.

  • Review upgrade effects on name, version, and domain data.

  • Check wallet-displayed typed data against the contract's domain.

Practice this in real audit scenarios

Definitions help, but auditors need reps. SCH turns concepts like Domain Separator into exploit labs, code review habits, and report-writing practice.

Start the free trial or see the full smart contract auditing course.

Sources