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

Add Ledger for Bitcoin and Ordinals #4316

Merged
merged 2 commits into from
Nov 28, 2023
Merged

Add Ledger for Bitcoin and Ordinals #4316

merged 2 commits into from
Nov 28, 2023

Conversation

kyranjamie
Copy link
Collaborator

@kyranjamie kyranjamie commented Oct 4, 2023

Try out this version of Leather — download extension builds.

  • Single recipient transactions
  • Inscription sends
  • Support getAddresses API
  • Support sendTransfer API
  • Increase fee (but seems buggy, running into fee logic unrelated to ledger)
  • PSBTs
  • BIP-322 message signing
  • Reject legacy auth requests when no Stacks keys, insta-reject authentication
  • Hide BRC-20
  • Improve Stacks-only key error handling
  • Return bitcoin addresses in Stacks response (Gamma auth issue) Gamma doesn't work with Ledger
  • Ensure opening/closing sign ledger modal results in correct state (buggy in some flows atm) (required)
  • Refactor repeating signing code into generic hook, similar to RequestKeys flow (optional or create separate task)
  • Refactor how common errors are handled, app closed/device locked etc (optional or create separate task)
2023-11-09-000025.mp4

@kyranjamie kyranjamie force-pushed the feat/ledger-rebased branch 4 times, most recently from 3b0b9e4 to 8e51646 Compare November 6, 2023 09:49
@kyranjamie kyranjamie force-pushed the feat/ledger-rebased branch 7 times, most recently from 5c31cd4 to 3215076 Compare November 9, 2023 16:25
@markmhendrickson markmhendrickson changed the title Ledger tx signing Add Ledger for Bitcoin and Ordinals Nov 15, 2023
@markmhendrickson

This comment was marked as resolved.

@markmhendrickson

This comment was marked as resolved.

@markmhendrickson
Copy link
Collaborator

We should show the "Add new" option under collectibles, even if while connected only to Stacks that means we can only show Stacks addresses in the receive modal that appears upon selection.

Similarly, if just Bitcoin is connected, we should show just Bitcoin-related options. And both types of options if both Bitcoin and Stacks connected

Ledger with Stacks

Screenshot 2023-11-16 at 13 11 54

Software

Screenshot 2023-11-16 at 13 12 24

@markmhendrickson
Copy link
Collaborator

During the connection process, if I hover the cursor over the top area of the modal, it says "Ledger device in use" for some reason:

Screen.Recording.2023-11-17.at.12.22.54.mov

@markmhendrickson
Copy link
Collaborator

Let's hide the "Buy" option on the screen when only Bitcoin (not Stacks) is connected, ahead of adding BTC buy support with #3188

Screenshot 2023-11-17 at 12 25 52

@edgarkhanzadian note we'll want to reenable this button for Ledger as part of issue #3188

@markmhendrickson

This comment was marked as resolved.

@markmhendrickson
Copy link
Collaborator

I'm unable to connect to Gamma – which uses the legacy auth API – regardless of Bitcoin vs. Stacks connection combo:

Bitcoin only

bitcoin only

Stacks only

stacks.mov

Bitcoin and Stacks

both.mov

@kyranjamie
Copy link
Collaborator Author

During the connection process, if I hover the cursor over the top area of the modal, it says "Ledger device in use" for some reason

This is the "Why you can't close modal" message, but also not a big fan

@markmhendrickson
Copy link
Collaborator

This is the "Why you can't close modal" message, but also not a big fan

Can we just hide the modal close option while it's pending?

@markmhendrickson
Copy link
Collaborator

getAddresses is still failing for me via Unisat when connected to both Bitcoin and Stacks.

Screen.Recording.2023-11-17.at.15.38.49.mov

And also when connected to just Stacks:

Screen.Recording.2023-11-17.at.15.40.03.mov

@markmhendrickson markmhendrickson linked an issue Nov 20, 2023 that may be closed by this pull request
@kyranjamie kyranjamie force-pushed the feat/ledger-rebased branch 3 times, most recently from 514e12b to 6c27b4e Compare November 21, 2023 13:50
@@ -30,3 +61,181 @@ export function useZeroIndexTaprootAddress(accIndex?: number) {

return address;
}

Copy link
Contributor

Choose a reason for hiding this comment

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

Can you split up this file into smaller hook modules?

@@ -227,3 +245,35 @@ export function getTaprootAddress({ index, keychain, network }: GetTaprootAddres

return payment.address;
}

export function getPsbtTxInputs(psbtTx: btc.Transaction) {
Copy link
Contributor

Choose a reason for hiding this comment

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

we should have a separate psbt.utils

Copy link
Contributor

@pete-watters pete-watters 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 on this @kyranjamie 👍

I added some questions / suggestions but happy to merge as is

@kyranjamie kyranjamie force-pushed the feat/ledger-rebased branch 7 times, most recently from 107316e to 8accdd7 Compare November 28, 2023 10:39
@kyranjamie
Copy link
Collaborator Author

kyranjamie commented Nov 28, 2023

Thanks for the feedback @pete-watters @fbwoolf, very helpful to get some fresh eyes on this PR 😅 . I've listed some remaining improvements in a new issue.

I think this is good to merge, though might be nice to have some additional QA on the release

@kyranjamie kyranjamie added this pull request to the merge queue Nov 28, 2023
Merged via the queue into dev with commit 97854b0 Nov 28, 2023
26 checks passed
@kyranjamie kyranjamie deleted the feat/ledger-rebased branch November 28, 2023 10:51
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.

Add Ledger support for Bitcoin and Ordinals
4 participants