-
Notifications
You must be signed in to change notification settings - Fork 32
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
webusb and no verify xpub export #24
webusb and no verify xpub export #24
Conversation
changes `return await` => `return` per https://eslint.org/docs/rules/no-return-await
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.
Just some small nits. Nice to get all the linting fixes in though!
One question I had is where can I find the changes related to the no verify xpub export
part? I'm less familiar with this library so I'm probably just not looking in the right spot.
I think you may need to run |
forgot to respond to the other commentary, but the |
@@ -108,7 +108,7 @@ | |||
"max-classes-per-file": "off", | |||
"max-depth": "error", | |||
"max-len": "off", | |||
"max-lines": "error", | |||
"max-lines": "off", |
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.
What is the rationale for this?
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.
Most of the files in this package are over 300 lines (arbitrary) so this causes errors that aren't actually errors. I'm open to suggestion -- this was easier than saying ignore this particular rule in each file.
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.
A couple of issues I'm seeing:
- I am still seeing the ledger instructions and images very briefly when importing an xpub. These need to be reworked and shown only during the fallback case.
- Importing and signing doesn't work at all in firefox (in linux at least, haven't tried windows). I get
navigator.usb is undefined
and that's it. I thought we had a fallback for cases when webusb wasn't supported.
oops, one sec - got trigger happy on review requests. |
@waldenraines - you should be able to test now. NOTE: while you can use the Bitcoin Testnet app on the ledger for the webusb transport - you still cannot sign with the u2f transport (in firefox) without switching to the main Bitcoin app. |
Nice, will have a look. |
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.
Here are the results of my testing.
Tested with:
- ledger nano s: bitcoin app 1.4.2, secure element 1.6.0, mcu 1.11
- ledger nano x: bitcoin app 1.4.2, secure element 1.2.4-1, mcu 2.8
And the results:
- I was able to import pubkeys and xpubs in chrome, brave, and firefox in both linux and windows.
- I was able to sign in chrome and brave on both linux and windows
- I was able to sign in firefox on windows
- I was unable to sign in firefox in linux (
Ledger device: Internal error, please report (0x6f01)
) - For some reason the nano x didn't work for me in chrome in windows at all but worked wonderfully in linux, would be nice for someone else to confirm.
All in all I think that this is a vast improvement over the previous implementation and it falls back to u2f nicely in firefox.
@bucko13 did you have any further comments? Looks like you're still marked as "requesting changes". |
src/ledger.js
Outdated
@@ -40,7 +40,7 @@ import { | |||
DirectKeystoreInteraction, | |||
} from "./interaction"; | |||
|
|||
import IMAGES from "./images"; | |||
//import IMAGES from "./images"; |
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.
Wow, we're not using the images at all anymore? I guess we don't use them or have them yet for signing?
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.
we were only showing images for xpubs/pubkeys at the moment
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.
we were only showing images for xpubs/pubkeys at the moment
See also unchained-capital/caravan#112
re: @kajalkris looks like others have reported nano X not showing up on windows ... LedgerHQ/ledgerjs#456 -- I don't know how to handle that one. For Ledger S -- I could sign on FF on mac (u2f) but had to try multiple times sometimes to finally get it to succeed (it failed, but I just kept trying, I exited and re-launched the btc app) |
LGTM! Tested in Chrome and Safari. Safari also throws the transport error but this isn't something we claim to support either right? |
I think we should go ahead and merge this and if there is anything we can do on our side to fix ledger nano x then we can do that in a follow-up PR. Thoughts @bucko13 @humanumbrella? |
This PR mostly contains style changes and automatic fixes. However, there were a few bugs and linted errors. E.g. this PR changes several return await in async functions to return per https://eslint.org/docs/rules/no-return-await and finally fixes a couple additional typos.
Tests passing, and test suite ran locally with success.