计划执行与检查节点
executing-plans
按既定实施计划完成工作,保持过程检查和反馈。
bitcoin-hardware-hwi【效率与协作】HWI (Hardware Wallet Interface): standardized Python API across HW vendors (Trezor, Ledger, Coldcard, BitBox02, Jade, etc.). Used by Bitcoin Core, Sparrow, Specter for cross-vendor signing. USE WHEN: integrating multi-vendor HW signing, building wallets that support several HW.
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
Python library + CLI for vendor-agnostic HW wallet operations.
Maintained by Bitcoin Core team (bitcoin-core/HWI).
In issue #850 "Future of this repo"
(opened 18 August 2026; covered by Optech on 28 August 2026) Ava Chow
(achow101) set out the end-of-life plan: finish MuSig2, cut what will
likely be the final release, then hold in minimal maintenance mode
until a drop-in replacement is ready, at which point the repo is
archived.
Stated reasons: HWI has been essentially a solo project for years, and Python's limitations prevent deterministic builds, so it can never ship inside Bitcoin Core — the goal it was originally written for.
Effective immediately from that announcement:
The announcement names BHWI — Wizardsardine's Rust reimplementation, still self-described as WIP as of September 2026 — as the promising successor. Treat BHWI as the forward-looking integration target; HWI remains the right choice for anything shipping today.
Each HW vendor has its own protocol (Trezor's, Ledger's BOLOS, Coldcard's CKCC, BitBox02's, Jade's). HWI unifies them under one API:
enumerate — list connected devices.getmasterxpub / getxpub.displayaddress.signtx / signpsbt.signmessage.setupdevice, wipe, etc.As of HWI 3.2.0 (February 2026). Frozen — no new devices are being accepted (see Project status).
HWI does not model-discriminate Coldcards. Its own support matrix
(docs/devices/index.rst) has a single Coldcard column, and the
CKCC driver enumerates on one Coinkite HID VID/PID (0xd13e:0xcc10),
always reporting "model": "coldcard" (only _simulator / _edge
suffixes are appended). So the Coldcard Mk5 — announced 10 March 2026,
a month after 3.2.0 shipped — works on released HWI with no code
change and no PR that ever names it: it runs the same Mk4 firmware
builds over the same protocol and the same VID/PID.
3.2.0 also added Testnet4 support, native Jade PSBT signing and PSBT MuSig2 fields.
# Detect devices
hwi enumerate
# Since 3.0.0 (April 2024) emulators/simulators are ignored by default;
# opt back in with --emulators
hwi --emulators enumerate
# Get xpub
hwi -t trezor getxpub "m/84'/0'/0'"
# Sign a PSBT
hwi -t coldcard signtx <psbt_base64>
# Display an address for verification
hwi -t ledger displayaddress --path "m/84'/0'/0'/0/0"
import hwilib.commands
devices = hwilib.commands.enumerate()
device = devices[0] # pick one
xpub = hwilib.commands.getxpub(device, "m/84'/0'/0'")
signed_psbt = hwilib.commands.signtx(device, base64_psbt)
Bitcoin Core's external-signer interface uses HWI:
bitcoin-cli -rpcwallet=hot \
-named externalsigner_setup \
command="hwi --chain main"
# Now wallet RPC funded via external signer
bitcoin-cli -rpcwallet=hot getnewaddress
# Generates address; user verifies on device.
bitcoin-cli -rpcwallet=hot walletprocesspsbt <psbt>
# Calls HWI to sign on device.
HWI handles wallet policies for multisig, but where the registration happens differs by release:
Released HWI (through 3.2.0, February 2026) — there is no registration subcommand. The workflow is:
hwi signtx; iterate over devices, each signs
partial.bip32_derivation fields and calls register_wallet inline on every
signtx / displayaddress. The user re-confirms the policy on the
device each run; the returned HMAC is not persisted between calls.On master, unreleased as of September 2026 — PRs #841 and #792 (merged August 2026) add explicit BIP-388 policy plumbing:
hwi registerdescriptor <name> <descriptor> returns
{"registration": "..."}.hwi displayaddress --registration <reg> --index N [--change].hwi signtx --registration <reg> (repeatable for multiple policies).Whether this ships depends on the final MuSig2 release (see Project status).