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

Feature: Message signing via QR code #1567

Merged
merged 32 commits into from
May 25, 2022

Conversation

moneymanolis
Copy link
Collaborator

@moneymanolis moneymanolis commented Feb 9, 2022

Flow

You ideally come from a wallet and a specific address, but you could also input the derivation path by hand directly from the devices setting where the first approach is redirecting to.

Visuals

Screen.Recording.2022-02-08.at.21.15.42.mov

Known issues

  • Refactoring of get_descriptor() currently breaks stuff with displayAddressOnDevice()
  • Cypress tests not working due to an EventListener in device.jinja

TODOs

  • Fix issues and tests
  • Implement signature handling / displaying in Specter Desktop
  • Adjust DIY code
  • Polish UIUX
  • Check USB message signing flow (anything broken, any easy UX improvements?)

@netlify
Copy link

netlify bot commented Feb 9, 2022

Deploy Preview for specter-desktop-docs ready!

Name Link
🔨 Latest commit 3e9dedc
🔍 Latest deploy log https://app.netlify.com/sites/specter-desktop-docs/deploys/628e7f701a81c40008a37a2c
😎 Deploy Preview https://deploy-preview-1567--specter-desktop-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@moneymanolis moneymanolis marked this pull request as draft February 9, 2022 14:47
@moneymanolis moneymanolis changed the title Qr message signing Feature: Message signing via QR code Feb 9, 2022
@moneymanolis moneymanolis linked an issue Feb 9, 2022 that may be closed by this pull request
2 tasks
@moneymanolis moneymanolis requested a review from k9ert February 9, 2022 15:12
@@ -425,15 +427,26 @@ def addressinfo(wallet_alias):
wallet = app.specter.wallet_manager.get_by_alias(wallet_alias)
address = request.form.get("address", "")
if address:
descriptor = wallet.get_descriptor(address=address)
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the old version this descriptor was a class: <class 'embit.descriptor.descriptor.Descriptor'>

@@ -425,15 +427,26 @@ def addressinfo(wallet_alias):
wallet = app.specter.wallet_manager.get_by_alias(wallet_alias)
address = request.form.get("address", "")
if address:
descriptor = wallet.get_descriptor(address=address)
descriptor = add_checksum(
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the changed version we are generating two descriptors as strings at the api endpoint (and not as before in a confusing way with JS objects in the jinja template): one with pubkey and one with an xpub.

… to single sig wallets and (for now) DIY devices, UI flow added to get signature from scanning DIY QR code back into Specter
@moneymanolis
Copy link
Collaborator Author

moneymanolis commented May 11, 2022

Update

Commit: e0dd454:

  • Message signing button better integrated in address info
  • Restriction to single sig wallets and (for now) DIY devices
  • UI flow added to get signature from DIY QR code back into Specter

Current visuals

qr_code_signing_part_1.mov

After scanning the QR code on the Specter DIY:

qr_code_signing_part_2_1.mov

TODOs

  • If UIUX is aggreed upon, add Cypress test for the signing flow
  • Adjust DIY code
  • Check USB message signing flow (anything broken, any easy UX improvements?) and display on device (just to be sure nothing broke here)
  • Fix issues and tests
  • Double checking with external service: Valid signature on verifybitcoinmessage

@moneymanolis moneymanolis marked this pull request as ready for review May 11, 2022 08:49
@b30wulffz
Copy link
Contributor

image
I don't think that it's a good idea to give device name within the button, as it will vary the widths for different names.
Have you handled the case, when device name causes the text to wrap? Basically how will the icon and the text aligns.

@moneymanolis
Copy link
Collaborator Author

moneymanolis commented May 18, 2022

image I don't think that it's a good idea to give device name within the button, as it will vary the widths for different names. Have you handled the case, when device name causes the text to wrap? Basically how will the icon and the text aligns.

@b30wulffz, first off, the device name is pretty useful here IMO in the UX flow to point the user in the right direction (that he will sign with the device associated with the wallet, so he should also not be surprised to end up on the respective device endpoint). In short: I'd leave it like this.

You have a valid point, though, we need to make sure that longer device names don't mess up the UI.

I think there are two options here:

  1. Usingwidth: min-contentfor the button (and only for the signing button), would look like this:

image

2) Using a `max-width `on the button and making the text a div and using `word-wrap: anywhere`, would look like this:

image

What do you think?

Update:

@b30wulffz I went with 2) in 72785d1

moneymanolis and others added 2 commits May 23, 2022 11:01
… path, fixed usb signing front end stuff, changed css in address-data.html to allow for long device names without breaking the font end.
Copy link
Contributor

@k9ert k9ert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work! Works nicely.

…red and use of ghost machine keys in this spec file.
@k9ert k9ert merged commit 307a5c0 into cryptoadvance:master May 25, 2022
ankur12-1610 pushed a commit to ankur12-1610/specter-desktop that referenced this pull request Jun 2, 2022
* Added tests/bitcoin to gitignore

* First draft.

* message signing button better integrated in address info, restriction to single sig wallets and (for now)  DIY devices, UI flow added to get signature from scanning DIY QR code back into Specter

* fixed regex in wallets_api to allow for electrum's shorter derivation path, fixed usb signing front end stuff, changed css in address-data.html to allow for long device names without breaking the font end.

* cypress test for qr code signing flow & renaming of spec_node_configured and use of ghost machine keys in this spec file.

* adjustments in cypress tests to account for new ghost wallet
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

Successfully merging this pull request may close these issues.

implement QR-code based message signing in Specter
3 participants