-
Notifications
You must be signed in to change notification settings - Fork 0
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
Use bytes for signature instead of v,r,s #223
Conversation
419119d
to
f5502a5
Compare
bffc5ee
to
8e664aa
Compare
cea6a75
to
aca7392
Compare
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.
LGTM
@@ -448,7 +409,8 @@ contract QuarkWallet is IERC1271 { | |||
revert InvalidEIP1271Signature(); | |||
} | |||
} else { | |||
(address recoveredSigner, ECDSA.RecoverError recoverError) = ECDSA.tryRecover(digest, v, r, s); | |||
// For EOA signers, this implementation of the QuarkWallet only supports ECDSA signatures | |||
(address recoveredSigner, ECDSA.RecoverError recoverError) = ECDSA.tryRecover(digest, signature); |
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.
oh nice, OZ did the decoding for us 👍
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.
looks good. one comment on the natspec
8e664aa
to
09f8e8d
Compare
aca7392
to
b3badc0
Compare
QuarkWallets
currently takev
,r
,s
as inputs for the ECDSA signature. This limits the wallet to only support ECDSA signatures, even if thesigner
of the wallet is a EIP-1271 smart contract that supports other signature schemes (e.g. BLS, Passkey). To make the wallet more flexible and be able to support other signature schemes, we change the signature input to a genericbytes
type.Note: This only increases flexibility for Quark wallets that have an EIP-1271 contract as a signer, where the EIP-1271 contract is upgradeable. Quark wallets owned by EOA signers will still need to be migrated over to a new wallet implementation in order to support other types of signature schemes.
Gas impact: Seems like this change bumps up gas usage by 900-1k (negligible). This is likely because the wallet now needs to take the extra step of decoding
bytes signature
intov,r,s
. The tests that fail the gas snapshot are all ones that runexecuteQuarkOperation
multiple times, exceeding the gas diff tolerance.