feat(hwi): Add Hardware Wallet Support - #311
Open
tvpeter wants to merge 8 commits into
Open
Conversation
- add devices, register, address and sign tx hwi subcommands
- add hidapi dependencies to workflows to fix failing compilation
- move the register, address and sign commands to subwallet commands
13 tasks
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #311 +/- ##
==========================================
- Coverage 57.45% 52.74% -4.72%
==========================================
Files 22 24 +2
Lines 3695 4027 +332
==========================================
+ Hits 2123 2124 +1
- Misses 1572 1903 +331
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Adds hardware wallet support to the project using
async-hwilibrary. Supported hardware devices include Specter, Jade, Ledger, Coldcard, and BitBox02 together with their simulators.This supersedes #207, which was approved but went stale after the project restructure. The feature has been reimplemented from scratch on the current modular structure, and the design is reworked around the saved wallet config.
Commands:
The feature introduced two top-level commands (
hwi devicesandhwi xpub) and wallet subcommands (register,address, andsign).hwi xpub [<path>] [--type <wpkh|tr|sh-wpkh|pkh>]: reads a device extended public key. Outputs a ready-to-use key expression and external/internal descriptors.hwi devices: list every connected device (fingerprint + model).register: Wallet scoped operation (wallet -w <walletname> hwi register). It registers the wallet policy on the device (returns the HMAC where the device supports it). The policy comes from the saved wallet config.sign <psbt>: sign a PSBT with the device.fixes #194
Notes to the reviewers
xpubanddevicesare top-level because you need xpub to build a wallet.register,address,signlive under wallet and read descriptors from the saved config.create_txdefaults --offline_signer to true when built with hwi, so PSBTs carry the xpub data the hardware wallets need.Known limitations:
signproduces partial signatures only; finalize separately withfinalize_psbtHWI subcommand implementation
hwi xpubhwi deviceswallet … hwi registerwallet … hwi addresswallet … hwi signDevices tested:
Changelog notice
Checklists
All Submissions:
cargo fmtandcargo clippybefore committingNew Features:
CHANGELOG.md