sparrowwallet / sparrow

Desktop Bitcoin Wallet focused on security and privacy. Free and open source.
https://sparrowwallet.com/
Apache License 2.0
1.36k stars 192 forks source link

Sign Messages with MicroSD #1491

Closed mjg-foundation closed 2 months ago

mjg-foundation commented 2 months ago

Would it be possible to add an option to sign messages with a given address via MicroSD from this screen? I'm working on the signing end of this with Passport, since some messages can be a bit too much to scan in a single QR code. sign_message

craigraw commented 2 months ago

Do you mean saving a file in the Coldcard format? https://coldcard.com/docs/sign-text-file/#text-file-format

mjg-foundation commented 2 months ago

I'd like the standard (electrum) format if possible

craigraw commented 2 months ago

I'd like the standard (electrum) format if possible

Is this documented anywhere?

mjg-foundation commented 2 months ago

Not anywhere great, but it's already exported via QR here in the sparrow ui, and it follows this format:

signmessage <derivation path> ascii: <message>

for example:

signmessage m/84h/0h/0h/0/0 ascii: chancellor on the brink of second bailout
mjg-foundation commented 2 months ago

I'll have to double check in the morning if my code strips leading spaces on the message. It wasn't too clear to me if a space would be inserted between the colon and the message as part of the standard.

craigraw commented 2 months ago

I think it would be better to use the same format as Coldcard, rather than introduce an effectively new format for this media? The format used for QRs is not really material, and is poorly documented as you say.

mjg-foundation commented 2 months ago

Ok, I can adapt to that. Thanks!

craigraw commented 2 months ago

Implemented in 17093dbf. As per the Coldcard spec the message is saved as a single line (newlines are removed) but no further checks or amendments are made.

Screenshot 2024-09-03 at 12 06 10