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

feat: hardware wallet support #684

Open
wants to merge 13 commits into
base: main
Choose a base branch
from
Open

feat: hardware wallet support #684

wants to merge 13 commits into from

Conversation

michael1011
Copy link
Member

@michael1011 michael1011 commented Oct 5, 2024

Closes #680
Closes #681

We should lazy load the LedgerSigner, because its dependencies are heavy

@kilrau needs translations

Copy link

vercel bot commented Oct 5, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
webapp ✅ Ready (Inspect) Visit Preview Oct 21, 2024 0:26am
webapp-mainnet ✅ Ready (Inspect) Visit Preview Oct 21, 2024 0:26am

@kilrau
Copy link
Member

kilrau commented Oct 10, 2024

My nano s is connected and unlocked (it's recognized by Ledger Live and also Sparrow) but can't click "Ledger". What am I missing? image image

EDIT: seems to be a FF issue (missing WebHID). So the ledger button should throw sth like "Browser not supported" when clicking

@kilrau
Copy link
Member

kilrau commented Oct 10, 2024

If the wrong (not Ethereum/RSK) app open on Ledger it throws
image
image
Error should say "Please open Ethereum/RSK app on your Ledger"

@kilrau
Copy link
Member

kilrau commented Oct 10, 2024

If no app open at all - Ledger doesn't show in the dialogue. I bet some users wouldn't know why. I would always bring up this menu with ALL available options (Trezor, Ledger, Metamask) so that you can throw proper errors when clicking them (never disable click but throw "No Trezor wallet connected":
Screenshot from 2024-10-10 17-27-58

It's common UX to bring up a "select wallet" menu
image
image

@kilrau
Copy link
Member

kilrau commented Oct 10, 2024

Hmm soo connecting (which prompts me to open the ethereum app on my ledger) sometimes work sometimes hangs in this state forever (ethereum app on ledger is open):
image
and then when refreshing and trying to connect again throws:
Screenshot from 2024-10-10 17-39-16
image
image

@kilrau
Copy link
Member

kilrau commented Oct 10, 2024

Also, when I "disconnect" "Create Atomic Swap button is still enabled and let's me create the swap. It should be disabled. Now I am in a state where claiming my swap doesn't work because ledger is disconnected. As this can happen for other reasons too, this claiming step needs a "connect" button if the wallet is disconnected.
image

EDIT: when refreshing it switches to "connect to swap address". Hmm maybe we can hint on the refresh?
image

@kilrau
Copy link
Member

kilrau commented Oct 10, 2024

I connected my ledger again then it was hanging in this state without continuing
Screenshot from 2024-10-10 17-55-01

@kilrau
Copy link
Member

kilrau commented Oct 10, 2024

Then I refreshed, connected to swap address again, pressed continue and then this one
Screenshot from 2024-10-10 17-55-40

My ledger showing Error: Blind signing must be enabled in settings which makes sense as I never used this Ledger for Ethereum transactions before but Web App needs to catch this error and show this properly:
image
image

@kilrau
Copy link
Member

kilrau commented Oct 10, 2024

Refreshing, again hanging here not succeeding to connect
image

I tried several times no luck, always closing Ethereum app on my ledger before refreshing the site so that it prompted me to open it (which I did). When leaving Ethereum App open, refreshing - it finally succeeded. I reproduced several more times: when I have Ethereum app closed and Ledger prompts me to open it, Boltz Web App hangs.

@kilrau
Copy link
Member

kilrau commented Oct 10, 2024

Then again this one, want me to enable blind signing to continue? @michael1011

image

@kilrau
Copy link
Member

kilrau commented Oct 10, 2024

PS: Ethereum App Version is 1.12.1

@kilrau
Copy link
Member

kilrau commented Oct 10, 2024

Blind signing works now, but please hint me to look at my ledger and choose "accept risk and sign"
image

@kilrau
Copy link
Member

kilrau commented Oct 10, 2024

Ethereum app on Ledger crashed twice and I had to retry but finally made it:
Screenshot from 2024-10-10 18-26-06
Screenshot from 2024-10-10 18-26-25

Copy link
Member

@kilrau kilrau left a comment

Choose a reason for hiding this comment

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

above

@kilrau
Copy link
Member

kilrau commented Oct 10, 2024

good
image

@kilrau
Copy link
Member

kilrau commented Oct 10, 2024

Now I can't make my nano s to appear in the HID list at all. No matter if with ethereum app open or not. I think I'll leave it be for today.
image

Copy link
Member

@kilrau kilrau left a comment

Choose a reason for hiding this comment

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

Nano S shows in Browser's HID device list and I can select it but no matter how I try to connect it to Boltz Web App (RSK testnet derivation path on testnet deployment or ETH/RSK derivation path on mainnet deployment) everything fails with Wallet connection failed: Failed to open the device. No matter if with an app open or none open. Device is connected and unlocked and works fine with e.g. Ledger Live.
image

@michael1011
Copy link
Member Author

On Testnet only show derivation path of Testnet. Mainnet doesn't display Testnet - all good.

That's done. Regtest shows all

No matter if with an app open or none open. Device is connected and unlocked and works fine with e.g. Ledger Live.

Reload the page and/or plug in the device again. Nothing we can do about this flakiness

Copy link
Member

@kilrau kilrau left a comment

Choose a reason for hiding this comment

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

For Submarine Swaps (Chromium, no Metamask or other Web3 wallet installed) I get this when pressing "Connect to swap address", it doesn't open the ledger/trezor dialogue.
Screenshot from 2024-10-21 16-28-48
image

For Reverse Swaps the connection prompt comes up but still "fails to open device", just like in my review from last week. above The browser HIW recognized my nano s and I connected it beforehand.
image

Both tested on Testnet and Mainnet.

@kilrau
Copy link
Member

kilrau commented Oct 21, 2024

With Brave USB connection works pretty well. Some more feedback: if I don't have any app open (not every time but quite often) I get web app into the state where it loads the derivation path infinitely. Also happens if derivation path select menu (ETH vs RSK) came up and I have my ETH app open. It just keeps loading. Refresh web app, do it again and it works.
image

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.

Trezor support Ledger support
2 participants