HWI (Hardware Wallet Interface)
A standard interface so Bitcoin Core and other software can talk to hardware wallets the same way.
Basically
HWI is a tool that lets Bitcoin Core and other wallet software talk to hardware wallets. It works with devices from Ledger, Trezor, Coldcard, and others.
Key Takeaways
- HWI (Hardware Wallet Interface) is a Python library and command-line tool with a unified API for multiple hardware wallets, removing the need for device-specific driver code.
- It uses PSBTs and output descriptors as standard formats, enabling direct integration with Bitcoin Core and other descriptor-aware wallets.
- HWI supports multisig setups with mixed hardware vendors, making it possible to build quorum-based custody schemes without vendor lock-in.
What Is HWI?
HWI (Hardware Wallet Interface) is an open-source Python library and command-line tool, maintained under the bitcoin-core GitHub organisation, that gives software a single way to communicate with hardware signing devices. Developers call HWI's commands instead of writing custom integration code for each vendor, while the tool handles device-specific protocols behind a consistent JSON-based interface.
Andrew Chow, a Bitcoin Core contributor, created the project because Bitcoin Core had no built-in way to talk to hardware wallets. Users who wanted the privacy and verification benefits of running their own full node had to rely on vendor software that often used third-party servers, so HWI bridges that gap by connecting Bitcoin Core's PSBT workflow directly to hardware devices. The MIT-licensed tool supports Ledger, Trezor, Coldcard, BitBox, KeepKey, and Blockstream Jade, among others.
How It Works
HWI operates as a middleware layer between wallet software and hardware devices. The core workflow uses BIP-174 Partially Signed Bitcoin Transactions (PSBTs): wallet software constructs an unsigned or partially signed transaction, HWI sends it to the hardware device for signing, and the device returns the signed result.
Key Commands
HWI provides commands that cover the full lifecycle of hardware wallet interactions. All output is returned as JSON on stdout:
The getdescriptors command retrieves output descriptors from the device, which can be imported directly into Bitcoin Core's descriptor wallet. Bitcoin Core can then track addresses and construct transactions without ever needing access to private keys.
Bitcoin Core Integration
Bitcoin Core has supported an external signer interface through the -signer startup flag since version 0.21.0. Bitcoin Core can automatically call HWI to enumerate devices, import public keys, and request transaction signatures when launched with -signer=hwi:
Users can build, sign, and broadcast transactions entirely through Bitcoin Core's interface while keeping private keys secured on the hardware device. The self-custodial vs. custodial wallets comparison offers a deeper look at self-custody workflows.
Supported Devices
HWI supports a range of hardware wallets with varying feature coverage. The project maintains a compatibility matrix that tracks which commands each device supports:
The project's inclusion policy requires devices to have a publicly documented communication protocol. Entirely closed-source devices are rejected, which encourages transparency and allows security researchers to audit the communication layer between HWI and each device.
Full Node with Hardware Signing
The primary use case for HWI is pairing a personal Bitcoin Core full node with a hardware wallet. The full node validates transactions independently without trusting a third-party server, while the hardware wallet keeps private keys in a secure element, isolated from internet-connected computers, giving users the strongest self-custody setup. Users without HWI previously needed manual PSBT file transfers or vendor-specific workarounds to achieve this setup.
Multi-Vendor Multisig
HWI's device-agnostic design is especially valuable for multisig wallets. A 2-of-3 multisig setup can use a Coldcard, a Trezor, and a Ledger as the three signers, with HWI handling communication to all three through the same interface and removing single-vendor dependency. The remaining devices still function if one manufacturer discontinues a product line or introduces a vulnerability; for more on multisig architecture, see the multisig wallets explained research article.
Automated Signing Infrastructure
HWI's programmatic interface allows integration into scripts and applications that manage signing workflows. Businesses running cold storage operations can build tooling that constructs PSBTs, routes them through HWI to the appropriate device, and handles the signed output without custom driver code for each hardware vendor. The JSON-based output makes it straightforward to parse results in any programming language.
Wallet Software Development
Wallet developers can use HWI, or its Python library hwilib, as a dependency instead of implementing each vendor's proprietary USB protocol. Software written in languages other than Python can shell out to the hwi command-line tool and parse its JSON output. A Rust reimplementation also exists for native integration in Rust-based wallet projects.
Software Supply Chain
HWI runs on a general-purpose computer between you and your hardware device, so a compromised machine could let an attacker substitute a malicious PSBT that displays a different destination address before it reaches the device. You must always verify transaction details on the hardware wallet's own screen before approving; the displayaddress command helps with address verification, but you must actually compare the displayed address. The hardware wallet attack vectors research provides a broader discussion of attack surfaces.
Device Compatibility Gaps
Devices differ in their HWI feature support. Some devices lack Taproot signing support, others have limited multisig capabilities, and air-gapped workflows via SD card rather than USB may require additional steps outside HWI's standard flow. You should consult the compatibility matrix in the project documentation before relying on a specific device-command combination.
Experimental Status
Bitcoin Core's documentation notes that the external signer integration is experimental and has received less review than Bitcoin Core itself. HWI has been in active development since 2018 and is widely used in the Bitcoin community, but users handling significant funds should test their workflow thoroughly on testnet or signet before using it in production.
USB and Host Dependencies
HWI requires Python 3, libusb, and, on Linux, udev rules configured for each device vendor. Setting up these dependencies can be nontrivial, especially on restricted systems. Users comfortable with air-gapped workflows may prefer transferring PSBTs via SD card or QR code, bypassing HWI entirely for the signing step while still using it for key export and descriptor generation.
The glossary entry is for informational purposes only and does not constitute financial or investment advice. Always do your own research before using any protocol or technology.