ERC-7969 · Draft · ERC · 2025-06-11
ERC-7969: DomainKeys Identified Mail (DKIM) Registry
A standard on-chain registry of DKIM public-key hashes per email domain, so contracts can check that a signed email really came from that domain, enabling email-based wallets and recovery.
What problem does it solve?
Every major email provider signs outgoing mail with DKIM: a signature over the message made with a key whose public half is published in the domain's DNS. If a smart contract (or a zero-knowledge proof of an email, the "ZK Email" approach) can verify that signature, the user can prove "I control [email protected]" on-chain, for example to approve a transaction or recover a lost wallet (ERC-4337 accounts).
Contracts cannot query DNS, though. They need a trusted on-chain record of which DKIM keys belong to which domain. ERC-7969 standardises the interface of such a registry so wallets and verifiers can share one.
How it works
The registry stores pairs of hashes:
domainHash: hash of the lowercase domain, e.g.keccak256("example.com"). Each subdomain is a separate entry;mail.example.comdoes not inherit fromexample.com.keyHash: hash of the DKIM public key exactly as it appears in the DNS TXT record'sp=value (base64, no PEM headers, no whitespace). Implementations may use keccak256 or a ZK-friendly hash such as Poseidon.
The required interface is tiny:
interface IDKIMRegistry {
event KeyHashRegistered(bytes32 domainHash, bytes32 keyHash);
event KeyHashRevoked(bytes32 domainHash);
function isKeyHashValid(bytes32 domainHash, bytes32 keyHash) external view returns (bool);
}
Its ERC-165 interface ID is given as 0xdee3d600. How keys get registered (owner, oracle, DAO) is up to the implementation; the reference uses an Ownable contract with setKeyHash, setKeyHashes and revokeKeyHash.
Sample code
Computing the hashes off-chain and checking them against a registry (ethers v6):
import { Contract, keccak256, toUtf8Bytes } from "ethers";
// value of p= from the DNS TXT record, whitespace removed
const dkimPubKey = "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQ...IDAQAB";
const domainHash = keccak256(toUtf8Bytes("example.org"));
const keyHash = keccak256(toUtf8Bytes(dkimPubKey));
const registry = new Contract(
registryAddress,
["function isKeyHashValid(bytes32,bytes32) view returns (bool)"],
provider,
);
console.log(await registry.isKeyHashValid(domainHash, keyHash));
A verifier contract would call isKeyHashValid with the key hash proven inside its ZK circuit before accepting the email proof.
Things to know
- Status: Draft. The interface may still change.
- The registry is only as trustworthy as whoever writes to it. Access control, key rotation and revocation are left to implementations, and the security section flags all three.
- The hash function is not fixed by the standard, so a verifier must know which hash a given registry uses. Changing it later is disruptive.
- Domains rotate DKIM keys. Old keys must be revoked, and proofs over old emails may need the historical key to still be valid.
- The spec text says the key must be an RSA key in RFC 6376 format. Domains using other DKIM key types are not covered.