-
Notifications
You must be signed in to change notification settings - Fork 112
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
Wallet adapter v2 #197
Wallet adapter v2 #197
Conversation
deserializedSignature.authenticator as TxnBuilderTypes.TransactionAuthenticatorEd25519; | ||
|
||
const publicKey = transactionAuthenticator.public_key.value; | ||
const signature = transactionAuthenticator.signature.value; |
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 where it is a bit weird. When trying to use this publicKey, signature and message to verifyMessage - verification fails. Failure is happening in both SDK V1 and V2.
const ed25519 = new Ed25519PublicKey(publicKey);
const verify = ed25519.verifyMessage(response, signature);
Consider the signTransaction
function is being used with wallets we can assume it works? so 2 failure options
- verifyMessage is wrong
- something in the deserialization process is wrong
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.
We can look together at the derserialized bytes to see what's going on here, but it should be pretty simple to separate and determine.
The other possibility is if this is a signed message and not a transaction, is it might not have all of the data for the message to verify.
deserializedSignature.authenticator as TxnBuilderTypes.TransactionAuthenticatorEd25519; | ||
|
||
const publicKey = transactionAuthenticator.public_key.value; | ||
const signature = transactionAuthenticator.signature.value; |
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.
We can look together at the derserialized bytes to see what's going on here, but it should be pretty simple to separate and determine.
The other possibility is if this is a signed message and not a transaction, is it might not have all of the data for the message to verify.
Wallet Adapter V2
signAndSubmitTransction
,signMessage
,signMessageAndVerify
. ForsignTransaction
we had to keep both V1 and V2 "ways" as we can't really change the function signature without introducing wallet plugin breaking changes. We can technically just use a new function with a different name only for V2 but rather to use the same function to support both v1 and v2 to easy ecosystem adoptionsign as sender
, then need to switch wallet tosign as sponsor
, and then submit transaction (everything implemented in the V2 way)sign as sender
, then you would get a private key you can import to the wallet tosign as secondary signer
, and then submit transaction (everything implemented in the V2 way)Note: I chose this way so users can experience the use of signing with a wallet and can experience the e2e flow with a wallet.
signAndSubmitTransaction
with V2 inputs -> V1signAndSubmitTransaction
or V2signAndSubmitBCSTransaction
AccountAuthenticator
fromsignTransaction
submitTransaction
to only support V2 expected flowScreen.Recording.2023-11-09.at.10.41.25.PM.mov