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 are 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.

Metadata

Release files for hwi 2.4.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for hwi 2.4.0
File Size Uploaded Provenance Actions
hwi-2.4.0.tar.gz 716.7 kB Without provenance Details for hwi-2.4.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for hwi 2.4.0
File Interpreter ABI Platform Actions
hwi-2.4.0-py3-none-any.whl Python 3 none any Details for hwi-2.4.0-py3-none-any.whl

Total release size: 1.1 MB

Release files / hwi-2.4.0.tar.gz

Download URL hwi-2.4.0.tar.gz
Size 716.7 kB
Tags Source
SHA-256 checksum
How to use checksums
3eaa7593f1ab360569eacdd9507dab75532bb58e8cd991d8ad72f5c4fcb67997
BLAKE2b-256 checksum
How to use checksums
362310ae57fa0c39700cc61159cc1d75155622a53ef5cbc4e15c7dcfb09c9e8a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.7.1 CPython/3.11.6 Linux/6.7.2-arch1-1

Release files / hwi-2.4.0-py3-none-any.whl

Download URL hwi-2.4.0-py3-none-any.whl
Size 333.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7cb7ef2a4db4bc434815374d9bad43c6425491f77828314a2d2898d3e86d3f04
BLAKE2b-256 checksum
How to use checksums
1b583c705598ee3701f24d9e382b4ae60e4f27792f7732bd15d4ea699bb47792
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.7.1 CPython/3.11.6 Linux/6.7.2-arch1-1

Security for hwi 2.4.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

2.4.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page