ERC-7803 · Draft · ERC · 2024-10-08
ERC-7803: EIP-712 Extensions for Account Abstraction
Draft extension to EIP-712 signing requests that adds signing domains (to bind a signature to a specific smart account) and auth methods (to tell wallets how the signature will be verified).
What problem does it solve?
Smart contract accounts sign messages through ERC-1271 (isValidSignature) or ERC-6492 for not-yet-deployed accounts. Two problems remain:
- Replay across accounts. One key can own several smart accounts. A signature produced by that key for account A could be replayed as if it came from account B, unless the signature is bound to the specific account. EIP-712 binds a signature to the verifying contract (the dapp), not to the account that signs. Workarounds such as ERC-7739 nest the account domain inside the message, which adds complexity and struggles with accounts that control other accounts.
- Unknown verification method. Some protocols try
ecrecoverbeforeisValidSignature, others the reverse. After EIP-7702 an address can be both an EOA and a contract, so the order changes the outcome. Wallets have no way to know which method a dapp will use.
How it works
eth_signTypedData requests gain two optional fields next to types, primaryType, domain and message:
signingDomains: an array of account domains, each with its own types (must include EIP712Domain) and domain. It lists the chain of accounts from the outermost (first) to the one closest to the key (last). Each layer prepends its own domain as the request passes down, for example dapp → multisig → signer's smart account → hardware wallet. The hardware wallet can then show the full chain to the user.
The bytes to sign are built recursively:
encode([first, ...rest], verifyingSep, msg) = "\x19\x02" ‖ first ‖ encode(rest, verifyingSep, msg)
encode([], verifyingSep, msg) = EIP-712 encoding of (verifyingSep, msg)
Each first is the EIP-712 hashStruct of that signing domain.
authMethods: an ordered list of how the verifying contract will try to authenticate the signature, e.g. { "id": "ECDSA" } or { "id": "ERC-1271" }, with optional parameters. The wallet can return the matching kind of signature.
Without authMethods, the returned signature must be treated as opaque bytes of any length.
Sample code
A typed-data request with both extensions (JSON):
{
"types": {
"EIP712Domain": [
{ "name": "name", "type": "string" },
{ "name": "chainId", "type": "uint256" },
{ "name": "verifyingContract", "type": "address" }
],
"Order": [{ "name": "amount", "type": "uint256" }]
},
"primaryType": "Order",
"domain": { "name": "ExampleDex", "chainId": 1, "verifyingContract": "0x1111111111111111111111111111111111111111" },
"message": { "amount": "1000" },
"signingDomains": [
{
"types": { "EIP712Domain": [
{ "name": "name", "type": "string" },
{ "name": "chainId", "type": "uint256" },
{ "name": "verifyingContract", "type": "address" }
] },
"domain": { "name": "MySmartAccount", "chainId": 1, "verifyingContract": "0x2222222222222222222222222222222222222222" }
}
],
"authMethods": [{ "id": "ERC-1271" }, { "id": "ECDSA" }]
}
The addresses above are placeholders.
Things to know
- Status is Draft. Rationale, backwards compatibility and security sections are still marked TODO.
- Both fields are optional, so existing EIP-712 requests are unaffected; wallets and dapps must both adopt it for any benefit.
ERC-{n}identifiers inauthMethodsmust not be zero-padded (ERC-1271, notERC-01271).- The
\x19\x02prefix is distinct from EIP-712's\x19\x01, so a signing-domain signature cannot be confused with a plain EIP-712 signature.