bdk
bdk copied to clipboard
Add a custom signer for hardware wallets
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 fmtandcargo clippybefore 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
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.
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...
I've just published hwi 0.2.1 btw :)
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