Skip to content
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

Incorrect prefix for message signing #1328

Closed
kyranjamie opened this issue Jul 26, 2022 · 2 comments · Fixed by #1329 or #1370
Closed

Incorrect prefix for message signing #1328

kyranjamie opened this issue Jul 26, 2022 · 2 comments · Fixed by #1329 or #1370
Assignees
Projects

Comments

@kyranjamie
Copy link
Contributor

kyranjamie commented Jul 26, 2022

We use the wrong phrasing for the message signing prefix:

// 'Stacks Message Signing:\n'.length // = 24
// 'Stacks Message Signing:\n'.length.toString(16) // = 18
const chainPrefix = '\x18Stacks Message Signing:\n';

Following the Ethereum format, already followed on the Ledger app, the message should be Stacks Signed Message, not Stacks Message Signing.

This is a change of length, too, so if I'm not mistaken about how the prefixing works, should be:

\x17Stacks Signed Message:\n

"Stacks Signed Message:\n".length.toString(16) // 17

Useful info on prefix here https://blog.ricmoo.com/verifying-messages-in-solidity-50a94f82b2ca

@friedger
Copy link
Collaborator

Do we have a SIP for that?

@janniks
Copy link
Collaborator

janniks commented Sep 21, 2022

I don't believe there is a SIP for general message signing (with prefix for safety) yet. Only SIP-018 with a separate prefix (which might also cause problems with ledger).

There are also more comments and information in the PR: #1329

janniks added a commit that referenced this issue Sep 29, 2022
BREAKING CHANGE:
The message signing prefix was changed from `Stacks Message Signing` to `Stacks Signed Message`.
janniks added a commit that referenced this issue Sep 29, 2022
BREAKING CHANGE:
The message signing prefix was changed from `Stacks Message Signing` to `Stacks Signed Message`.
janniks added a commit that referenced this issue Sep 29, 2022
BREAKING CHANGE:
The message signing prefix was changed from `Stacks Message Signing` to `Stacks Signed Message`.
janniks added a commit that referenced this issue Sep 29, 2022
BREAKING CHANGE:
The message signing prefix was changed from `Stacks Message Signing` to `Stacks Signed Message`.
stacks.js automation moved this from 💻 In development to 🚀 Done Sep 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
stacks.js
  
🚀 Done
3 participants