-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
1271 isValidSignature #51
Conversation
Another problem raised is solution for this is work in progress here : Vectorized/solady#907 |
In case of modular account, this job is passed on to the validators and it is a question what should be responsible verifying contract (domain separator) if we choose to make ERC1271 EIP712 as base then, we could use custom implementation in validators + account if we don't care about 712 signing and stick to passing the sender on as part of the hash then below works, |
in this pull request, I have created some intermediate contracts and modified mock validator/s to showcase several possibilities |
Changes to gas cost
🧾 Summary (10% most significant diffs)
Full diff report 👇
|
Problem (found by curiousapple and alchemy) link
EIP-1271 signatures where the wallet keys sign an application message directly may be vulnerable to replay on other EIP-1271 wallets with the same set of owners
Solution/s
To implement replay protection the signature must be bound to the smart contract wallet by including its address somewhere in the signed message.
^ above was done by us with
isValidSignature -> isValidSignatureForAddress
isValidSignatureUnsafe -> isValidSignatureForAddressUnsafe
bcnmy/scw-contracts#162
Further,
solution was to wrap the incoming digest in a EIP712 wrapper
Further,
https://github.com/frangio/eip712-wrapper-for-eip1271
above repository proposes a solution to protect EIP-1271 wallets against replay attacks, while allowing full auditability of the signed message contents, by wrapping the message in an envelope that binds it to a specific EIP-1271 wallet.
with current solday implementation here