Skip to main content

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.

Prerequisites

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

Install

git clone https://github.com/bitcoin-core/HWI.git
cd HWI

Usage

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

./hwi.py enumerate

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

./hwi.py -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.

License

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

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

hwi-1.0.0.tar.gz (85.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

hwi-1.0.0-py3-none-any.whl (367.7 kB view details)

Uploaded Python 3

File details

Details for the file hwi-1.0.0.tar.gz.

File metadata

  • Download URL: hwi-1.0.0.tar.gz
  • Upload date:
  • Size: 85.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/0.12.11 CPython/3.6.8 Linux/4.14.74-1.pvops.qubes.x86_64

File hashes

Hashes for hwi-1.0.0.tar.gz
Algorithm Hash digest
SHA256 15c80e718d1a6810fe4e28bb491a66d67ee28c735714fc1891e2158d0812c3e4
MD5 684bf129a6d6f411e6513cbfe09b2a62
BLAKE2b-256 f3f764102770942c3f583d0bac407fb453a7055405808643507af1c0bc4c621f

See more details on using hashes here.

File details

Details for the file hwi-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: hwi-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 367.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/0.12.11 CPython/3.6.8 Linux/4.14.74-1.pvops.qubes.x86_64

File hashes

Hashes for hwi-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7a1060f34e14d9cfe94c0764119145f0b5aed0d673599bdf3cda7341a7a21779
MD5 a2849a297b988899afe69777a72ed57c
BLAKE2b-256 f46d535ae08b628ae400f096dc35d3ab5211d1860094d39cfaea8ca55379a9fc

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page