Skip to main content

Bitcoin Hardware Wallet Interface

Build Status Documentation 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.

Caveat emptor: Inclusion of a specific hardware wallet vendor does not imply any endorsement of quality or security.

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 python3-dev

For Centos:

sudo yum -y install python3-devel libusbx-devel systemd-devel

For macOS:

brew install libusb

Install

git clone https://github.com/bitcoin-core/HWI.git
cd HWI
poetry install # or 'pip3 install .' or 'python3 setup.py install'

This project uses the Poetry dependency manager. HWI and its dependencies can be installed via poetry by executing the following in the root source directory:

poetry install

Pip can also be used to automatically install HWI and its dependencies using the setup.py file (which is usually in sync with pyproject.toml):

pip3 install .

The setup.py file can be used to install HWI and its dependencies so long as setuptools is also installed:

pip3 install -U setuptools
python3 setup.py install

Dependencies

See pyproject.toml for all dependencies. Dependencies under [tool.poetry.dependencies] are user dependencies, and [tool.poetry.dev-dependencies] for development based dependencies. These dependencies will be installed with any of the three above installation methods.

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>

All output will be in JSON form and sent to stdout. Additional information or prompts will be sent to stderr and will not necessarily be in JSON. This additional information is for debugging purposes.

To see a complete list of available commands and global parameters, run ./hwi.py --help. To see options specific to a particular command, pass the --help parameter after the command name; for example:

./hwi.py getdescriptors --help

Documentation

Documentation for HWI can be found on readthedocs.io.

Device Support

For documentation on devices supported and how they are supported, please check the device support page

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-2.1.1.tar.gz (189.1 kB view details)

Uploaded Source

Built Distribution

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

hwi-2.1.1-py3-none-any.whl (245.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: hwi-2.1.1.tar.gz
  • Upload date:
  • Size: 189.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.26.0 requests-toolbelt/0.9.1 urllib3/1.26.7 tqdm/4.62.3 importlib-metadata/4.11.3 keyring/21.8.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.7

File hashes

Hashes for hwi-2.1.1.tar.gz
Algorithm Hash digest
SHA256 81ebb2917291c3d2ef3252f44aa141ffb8d74f0c2abfa2a98410800426c20e3f
MD5 63186d741c9c0b4d9041c66a220b12c0
BLAKE2b-256 28645fdc22fb2c4a0b2f6f4b0a8fde716734b32cc9111e7626f5485288dbad5d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: hwi-2.1.1-py3-none-any.whl
  • Upload date:
  • Size: 245.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.26.0 requests-toolbelt/0.9.1 urllib3/1.26.7 tqdm/4.62.3 importlib-metadata/4.11.3 keyring/21.8.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.7

File hashes

Hashes for hwi-2.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 fa32223b9c26636b46eef9b5602a3d259f011f8490ae68dfb5812a5f9563d084
MD5 11d3b9ce6456b2e46ad53ee675bf30df
BLAKE2b-256 e6f3a33aad3b02b70d81037817f95ace69aadf8fe43a8c0de407cf1c05e1f33d

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 Sentry Error logging StatusPage Status page