bdk icon indicating copy to clipboard operation
bdk copied to clipboard

Add a custom signer for hardware wallets

Open wszdexdrf opened this issue 3 years ago • 4 comments
trafficstars

Also adds a new test in CI for building and testing on a virtual hardware wallet.

Description

This PR would enable BDK users to sign transactions using a hardware wallet. It is just the beginning hence there are no complex features, but I hope not for long. I have added a test in CI for building a ledger emulator and running the new test on it. The test is similar to the one on bitcoindevkit/rust-hwi.

Notes to the reviewers

The PR is incomplete (and wouldn't work, as the rust-hwi in cargo.toml is pointing to a local crate, temporarily) as a small change is required in rust-hwi (https://github.com/bitcoindevkit/rust-hwi/pull/42).

Checklists

All Submissions:

  • [x] I've signed all my commits
  • [x] I followed the contribution guidelines
  • [x] I ran cargo fmt and cargo clippy before committing

New Features:

  • [x] I've added tests for the new feature
  • [x] I've added docs for the new feature
  • [x] I've updated CHANGELOG.md

wszdexdrf avatar Jul 25 '22 06:07 wszdexdrf

This is exciting that rust-hwi is finally getting integrated into BDK :)

I'm wondering whether "Hardware Wallet" is the best name since we have a struct named Wallet, and there is also a portion of the Bitcoin community wary of the term "Hardware Wallet" anyway. The proposed alternative term is "Hardware Signer" and since our signing traits are already called {}Signers, I think this may be a better term.

evanlinjin avatar Jul 25 '22 08:07 evanlinjin

I'm wondering whether "Hardware Wallet" is the best name since we have a struct named Wallet

Now that you say it, it makes sense. This isn't anywhere close to the Wallet struct in terms of functionality... so maybe Hardware Signer is better...

wszdexdrf avatar Jul 25 '22 13:07 wszdexdrf

I've just published hwi 0.2.1 btw :)

danielabrozzoni avatar Aug 03 '22 18:08 danielabrozzoni

Btw, I don't like that much having the hw module under src/hardwaresigner, it feels out of place... I'd say it should be either in src/wallet/signer.rs, or maybe you could make signer.rs a module and put the hardwaresigner in src/wallet/signer/hardwaresigner.rs, as you wish

danielabrozzoni avatar Aug 05 '22 07:08 danielabrozzoni