Skip to content

Simplify replaySafeHash to the 8130 non-EIP-712 signed-message convention - #58

Draft
amiecorso wants to merge 5 commits into
mainfrom
amie/simplify-replaysafehash
Draft

Simplify replaySafeHash to the 8130 non-EIP-712 signed-message convention#58
amiecorso wants to merge 5 commits into
mainfrom
amie/simplify-replaysafehash

Conversation

@amiecorso

Copy link
Copy Markdown
Collaborator

Summary

Simplify AccountConfiguration.replaySafeHash from a full EIP-712 digest to the 8130 non-EIP-712 signed-message convention, binding a 1271 signature to account + chainId under a fixed typehash.

Motivation

replaySafeHash was the lone EIP-712 signed-message digest in AccountConfiguration. Every other signed message (ActorInitialization/import, SignedActorChanges, SignedLockChange) is deliberately non-EIP-712 "to mitigate eth_signTypedData phishing." This aligns the ERC-1271 wrap with that house convention and removes now-redundant machinery.

  • Binds using only account + chainId (verifyingContract already uniquely identifies the account; name/version added nothing).
  • The fixed typehash provides domain separation; the deliberate absence of 0x1901 keeps eth_signTypedData from producing these digests (anti-phishing), matching the other signed-message typehashes.
  • Cross-account replay closed by account; cross-chain replay closed by block.chainid.

Changes

  • Replace the EIP-712 replaySafeHash with keccak256(abi.encode(SIGNED_MESSAGE_TYPEHASH, account, block.chainid, hash)).
  • Add SIGNED_MESSAGE_TYPEHASH = keccak256("SignedMessage(address account,uint256 chainId,bytes32 hash)").
  • Remove now-unused _EIP712_DOMAIN_TYPEHASH, _PERSONAL_SIGN_TYPEHASH, _ACCOUNT_DOMAIN_NAME_HASH, _ACCOUNT_DOMAIN_VERSION_HASH, and _accountDomainSeparator.
  • verifySignature and DefaultAccount.isValidSignature are unchanged (the account already forwards to verifySignature).

Out of scope / decisions

  • ERC-7739 TypedDataSign (readable signatures) intentionally not added; it is an account-layer concern, not core, and its readability benefit is marginal for passkey-backed / first-party-curated accounts.
  • A "replayable wrapper" (wildcard account/chainId) was considered and declined: it inverts the containment the wrap exists for, and can be added later at the account layer via authenticateActor if a concrete use case arises.

Testing

  • forge build clean.
  • forge test — all 325 unit tests pass. Tests derive digests from the contract's replaySafeHash, so behavior adapts automatically to the new formula.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant