-
Notifications
You must be signed in to change notification settings - Fork 188
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
Cw 565 sign messages #1378
Cw 565 sign messages #1378
Conversation
…CW-394-mac-auth
…CW-565-sign-messages
…CW-565-sign-messages [skip ci]
…CW-394-mac-auth
…CW-565-sign-messages � Conflicts: � lib/bitcoin/cw_bitcoin.dart � lib/entities/default_settings_migration.dart � lib/src/screens/dashboard/pages/cake_features_page.dart
…CW-565-sign-messages
…CW-565-sign-messages
…CW-565-sign-messages
…CW-565-sign-messages
…CW-565-sign-messages
return await verifySignature( | ||
message: messageBytes, | ||
signature: sigBytes, | ||
publicKey: Ed25519HDPublicKey(pubKeyBytes), |
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.
isn't this comparing with the public key included in the signature? which will always be correct, shouldn't we use publicKey: _keyPairData!.publicKey
instead and just return the sigBytes from bytesFromSigString
function? or am I missing something?
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.
so, you're right this shouldn't be using the public key from the signature
er, actually this is fine, if we can derive the same address as the address parameter and see that they match
your suggestion of using _keyPairData!.publicKey
would only work for verifying your own messages and not other peoples
basically I just need to figure out how to derive addresses from public keys and check to see if the address provided matches the one derived from the included public key
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.
update: I figured out how the address generation works I just need to test it
cw_evm/lib/evm_chain_wallet.dart
Outdated
final pk = await getPrivateKey( | ||
mnemonic: _mnemonic, | ||
privateKey: _hexPrivateKey, | ||
password: _password, | ||
); | ||
return EthSigUtil.signPersonalMessage( | ||
privateKey: bytesToHex(pk.privateKey), |
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.
better use _evmChainPrivateKey
it's already set, and it handles hardware wallet case
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.
made the change for the sign function but I'm unsure of what the flow really looks like for hardware wallets @konstantinullrich do any additional changes need to be made to the UI? will a prompt just appear if a hardware wallet is connected and signMessage is called or is there something else that needs to be added?
…CW-565-sign-messages
…CW-565-sign-messages [skip ci]
will merge and disable it for hardware wallets until it's added and tested |
Issue Number (if Applicable): Fixes #
Description
Please include a summary of the changes and which issue is fixed / feature is added.
Pull Request - Checklist