-
Notifications
You must be signed in to change notification settings - Fork 11.2k
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-kit] Add support for signMessage
#8690
[wallet-kit] Add support for signMessage
#8690
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
messageWithIntent(IntentScope.PersonalMessage, message), | ||
); | ||
|
||
return { | ||
// TODO: Should this include the intent, or just be the raw bytes that are signed? |
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.
yes we should definitely include the intent bytes, otherwise one might ask you to sign a transaction masqueraded like a personal message.
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 todo isn't for the message that the user is asked to sign, it's for if the return value includes the intent, or if we just automatically add the intent when verifying the message instead.
@@ -156,6 +156,11 @@ export type SignedTransaction = { | |||
signature: SerializedSignature; | |||
}; | |||
|
|||
export type SignedMessage = { |
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.
I'd suggest renaming this to SignedPersonalMessage as this is the standard term; and avoid confusion with a transaction message (many times in crypto we generically use the term message to define any message type).
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.
I think in the SDK context it's fairly unambiguous, as we have signMessage
+ SignedMessage
and signTransaction
+ SignedTransaction
.
"@mysten/sui.js": minor | ||
--- | ||
|
||
Change `signMessage` to return message bytes. Add support for sui:signMessage in the wallet standard |
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.
ditto, signPersonalMessage
, let's use the term personalMessage everywhere
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.
sui:signMessage
naming is designed to align with wallet standards from other chains, so would like to keep that the same. We could change the internal method names but then they don't align across our SDK, which seems non-ideal.
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.
Not that I like what the other wallets do, as we're probably the first blockchain who puts the intent as part of the default L1 specs (not as a community proposal), but I'm fine assuming we have documentation that we refer to personal message and the only reason was compatibility with the industry. (because at the same time we are now incompatible with our rust specs re intents that we call it PersonalMessage)
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.
Yeah I get the desire to keep alignment with rust, although we abstract over that by adding the intent automatically, so the PersonalMessage
intent is effectively invisible to consumers of these APIs.
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.
yes that's fine, I think a small doc comment could slightly help here, but overall we're good with the PR
Description
This adds support for
signMessage
in the wallet kit ecosystem (adapters + UI + standard).Test Plan
Validated TypeScript types
If your changes are not user-facing and not a breaking change, you can skip the following section. Otherwise, please indicate what changed, and then add to the Release Notes section as highlighted during the release process.
Type of Change (Check all that apply)
Release notes