Simplify replaySafeHash to the 8130 non-EIP-712 signed-message convention - #58
Draft
amiecorso wants to merge 5 commits into
Draft
Simplify replaySafeHash to the 8130 non-EIP-712 signed-message convention#58amiecorso wants to merge 5 commits into
amiecorso wants to merge 5 commits into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Simplify
AccountConfiguration.replaySafeHashfrom a full EIP-712 digest to the 8130 non-EIP-712 signed-message convention, binding a 1271 signature toaccount+chainIdunder a fixed typehash.Motivation
replaySafeHashwas the lone EIP-712 signed-message digest inAccountConfiguration. 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.account+chainId(verifyingContractalready uniquely identifies the account; name/version added nothing).0x1901keepseth_signTypedDatafrom producing these digests (anti-phishing), matching the other signed-message typehashes.account; cross-chain replay closed byblock.chainid.Changes
replaySafeHashwithkeccak256(abi.encode(SIGNED_MESSAGE_TYPEHASH, account, block.chainid, hash)).SIGNED_MESSAGE_TYPEHASH = keccak256("SignedMessage(address account,uint256 chainId,bytes32 hash)")._EIP712_DOMAIN_TYPEHASH,_PERSONAL_SIGN_TYPEHASH,_ACCOUNT_DOMAIN_NAME_HASH,_ACCOUNT_DOMAIN_VERSION_HASH, and_accountDomainSeparator.verifySignatureandDefaultAccount.isValidSignatureare unchanged (the account already forwards toverifySignature).Out of scope / decisions
account/chainId) was considered and declined: it inverts the containment the wrap exists for, and can be added later at the account layer viaauthenticateActorif a concrete use case arises.Testing
forge buildclean.forge test— all 325 unit tests pass. Tests derive digests from the contract'sreplaySafeHash, so behavior adapts automatically to the new formula.