-
Notifications
You must be signed in to change notification settings - Fork 81
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
[4337] User Operation with Custom Singleton Signers #159
Merged
Conversation
This file contains 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
nlordell
force-pushed
the
signer-singleton
branch
from
November 20, 2023 09:29
fa3ade3
to
6903dae
Compare
Pull Request Test Coverage Report for Build 6967672785
💛 - Coveralls |
nlordell
force-pushed
the
signer-singleton
branch
2 times, most recently
from
November 22, 2023 10:27
850fee4
to
451f639
Compare
nlordell
changed the title
Add Staked Safe Factory
[4337] User Operation with Custom Signing Scheme
Nov 22, 2023
nlordell
force-pushed
the
signer-singleton
branch
from
November 22, 2023 15:31
05d9aec
to
806ec41
Compare
nlordell
force-pushed
the
signer-singleton
branch
from
November 23, 2023 09:13
ec9424d
to
a12a0f4
Compare
nlordell
changed the title
[4337] User Operation with Custom Signing Scheme
[4337] User Operation with Custom Singleton Signers
Nov 23, 2023
nlordell
commented
Nov 23, 2023
|
||
contract TestSingletonSigner is ISignatureValidator { | ||
struct Key { | ||
uint256 _dummy; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is just to verify this model would work for P256 signatures (which require 2 uint256
slots, one for the X and one for the Y coordinate of the public key - which is a point on the curve).
akshay-ap
approved these changes
Nov 24, 2023
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Fixes #148
This PR introduces an E2E test using the official bundler where we deploy a Safe that uses a custom (and silly 🤪) signing scheme over ERC-1271. Specifically, the signing scheme is deployed as a singleton contract that can be shared by multiple Safes using a
mapping(safe => data)
to differentiate between signers. In theory, this could be adapted to, for example, checking a signature using P256 curve in order to integrate with WebAuthn, and is meant to “prove” that the Safe with the ERC-4337 module would work with existing WebAuthn signer implementations.The actual implementation is a little convoluted for a few reasons. Namely, ERC-4337 only allows a single
CREATE2
per user operation that MUST result in theuserOp.sender
account. Because of this, deploying ad-hoc signers in theSafe.setup
call is not possible, and we have instead opted for a “singleton signer” pattern, where the logic for verifying signatures is shared and a mapping is used to store per-Safe context relevant to signature verification.Additionally, In order for this to work with ERC-4337, a staked factory is needed (as accessing associated storage for user operations with
initCode
require a factory). Unfortunately, staked factories add all kinds of complexities:For these reasons, I would recommend exploring #149.