Skip to content
Bitcoin Hardware Wallet Interaction scripts
Branch: master
Clone or download
achow101 Merge #147: Add udev rules for all supported devices
397993b [ci skip] Document udev rules (Andrew Chow)
1222d9a Add udev rules for all supported devices (Andrew Chow)

Pull request description:

  It's useful to have all of the udev rules needed for all devices in one location instead of having to go to every vendor's webpage to find these.

  Original sources:
  `20-hw1.rules` (Ledger):
  `51-coinkite.rules` (Coldcard):
  `51-hid-digitalbitbox.rules`, `52-hid-digitalbitbox.rules` (Digital Bitbox):
  `51-trezor.rules` (Trezor):
  `51-usb-keepkey.rules` (Keepkey):

ACKs for commit 397993:

Tree-SHA512: c2dbe4dcff6e54ecb71724faeacc1aaca06b5a90dbc22289694ff40e0af30c756f42af8e52208c155d9fef54b099ac51679d9f9cbc0f0de1384ce47e39c00b3c
Latest commit 6e92b7d Apr 16, 2019
Type Name Latest commit message Commit time
Failed to load latest commit information.
docs Document how to handle binary format files from command line with bas… Mar 15, 2019
hwilib Import HID in Ledger driver Apr 15, 2019
test Add interactive option and move setup and restore to interactive only Mar 14, 2019
udev [ci skip] Document udev rules Apr 16, 2019
hwi.spec Add a hwi.spec file for pyinstaller to build standalone binaries Mar 8, 2019
poetry.lock Add pyproject.toml and poetry.lock for poetry dependency manager Mar 2, 2019
pyproject.toml bump version number to 1.0.0 Mar 15, 2019

Bitcoin Hardware Wallet Interface

Build Status

The Bitcoin Hardware Wallet Interface is a Python library and command line tool for interacting with hardware wallets. It provides a standard way for software to work with hardware wallets without needing to implement device specific drivers. Python software can use the provided library (hwilib). Software in other languages can execute the hwi tool.


Python 3 is required. The libraries and udev rules for each device must also be installed. Some libraries will need to be installed

For Ubuntu/Debian:

sudo apt install libusb-1.0-0-dev libudev-dev

For macOS:

brew install libusb

This project uses the Poetry dependency manager. Once HWI's source has been downloaded with git clone, it and its dependencies can be installed via poetry by execting the following in the root source directory:

poetry install

Pip can also be used to install all of the dependencies (in virtualenv or system):

pip3 install hidapi # HID API needed in general
pip3 install ecdsa
pip3 install pyaes
pip3 install typing_extensions
pip3 install mnemonic
pip3 install libusb1


git clone
cd HWI


To use, first enumerate all devices and find the one that you want to use with

./ enumerate

Once the device type and device path is known, issue commands to it like so:

./ -t <type> -d <path> <command> <command args>

Device Support

The below table lists what devices and features are supported for each device.

Please also see docs for additional information about each device.

Feature \ Device Ledger Nano S Trezor One Digital BitBox KeepKey Coldcard
Support Planned Yes Yes Yes Yes Yes
Implemented Yes Yes Yes Yes Yes
xpub retrieval Yes Yes Yes Yes Yes
Message Signing Yes Yes Yes Yes Yes
Device Setup N/A Yes Yes Yes N/A
Device Wipe N/A Yes Yes Yes N/A
Device Recovery N/A Yes N/A Yes N/A
Device Backup N/A N/A Yes N/A Yes
P2PKH Inputs Yes Yes Yes Yes Yes
P2SH-P2WPKH Inputs Yes Yes Yes Yes Yes
P2WPKH Inputs Yes Yes Yes Yes Yes
P2SH Multisig Inputs Yes Yes Yes Yes N/A
P2SH-P2WSH Multisig Inputs Yes No Yes No N/A
P2WSH Multisig Inputs Yes No Yes Yes N/A
Bare Multisig Inputs Yes N/A Yes N/A N/A
Aribtrary scriptPubKey Inputs Yes N/A Yes N/A N/A
Aribtrary redeemScript Inputs Yes N/A Yes N/A N/A
Arbitrary witnessScript Inputs Yes N/A Yes N/A N/A
Non-wallet inputs Yes Yes Yes Yes Yes
Mixed Segwit and Non-Segwit Inputs N/A Yes Yes Yes Yes
Display on device screen Yes Yes N/A Yes Yes

Using with Bitcoin Core

See Using Bitcoin Core with Hardware Wallets.


This project is available under the MIT License, Copyright Andrew Chow.

You can’t perform that action at this time.