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

Message signing #76

Closed
kyranjamie opened this issue Oct 12, 2021 · 4 comments
Closed

Message signing #76

kyranjamie opened this issue Oct 12, 2021 · 4 comments
Assignees

Comments

@kyranjamie
Copy link
Contributor

Hiro wants to support message signing and verification in its wallets, similar to the user flow described the MyCrypto wallet. Ledger device support is needed to offer parity between our software and hardware wallets.

The feature has been discussed in context of Hiro's wallet leather-wallet/extension#1051, and the Stacks blockchain stacks-network/stacks-core#2693

Ultimately, we'd like support for structured data signing, like Ethereum's EIP-721, though this task is scoped to prefixed bytestring message signing.

Spec

  • The device should support prefixed bytestring message signing
    • Errors should be thrown for invalid content, or messages that would exceed the device's memory limits
  • An ascii-encoded preview of the message should be printed on the device
    • Users can be warned or prohibited from passing too length content by wallet clients
  • The readable prefix should be "Stacks Signed Message", with a similar formatting specification to EIP-712
  • A new method, sign, should be added to the @zondax/ledger-blockstack package

These are relatively high-level requirements. If more details needed, let us know. We'll follow up with input from the blockchain team.

@jleni
Copy link
Member

jleni commented Nov 14, 2021

@kyranjamie can we close this issue?

@kyranjamie
Copy link
Contributor Author

@jleni The only question I have pertains to the js lib. There haven't been any changes to it. How do we interface with/consume the new text signing method? Do we use the existing sign function exposed? This only accepts type Buffer currently, so, would we first need to convert strings?

@neithanmo
Copy link
Collaborator

@jleni The only question I have pertains to the js lib. There haven't been any changes to it. How do we interface with/consume the new text signing method? Do we use the existing sign function exposed? This only accepts type Buffer currently, so, would we first need to convert string

Yes, You should use the sign function, there are no changes in the current interface as the parser internally will recognize the data as either a transaction or message. of course, the result of the parsing is shown on the screen for validation from the user before signing it the same as it is done for transactions.

@neithanmo
Copy link
Collaborator

closed via #82

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants