[BREAKGLASS] Append-only mirror of github.com/coldcard/HWI
Go to file
Andrew Chow d8cf9f120b
Merge #157: Indicate in enumerate whether a device needs a passphrase or a pin
4d21f29 ignore other devices when checking that the coldcard has started (Andrew Chow)
54e14ba Change the order devices are tested in (Andrew Chow)
1c33312 Test need_passphrase_sent and need_pin_sent (Andrew Chow)
bca8535 Add needs_pin_sent to indicate whether promptpin needs to be used (Andrew Chow)
d2696cf Add needs_passphrase_sent to enumerate output (Andrew Chow)

Pull request description:

  This adds two fields to `numerate`: `needs_passphrase_sent` and `needs_pin_sent` which indicate whether a command with a `-p` option is needed or `promptpin` and `sendpin` need to be done. These fields will be true in the instances that a passphrase needs to be sent and have not been cached by the device. To avoid a chicken and egg problem with fingerprints on Trezors, if the device needs a passphrase but one was not specified in `enumerate`, the fingerprint won't be retrieved in order to not contaminate the passphrase cache on device.

  Built on #152 because it has some interactions with it that needed to be addressed.

ACKs for commit 4d21f2:

Tree-SHA512: 4164a8e541a9441b615205b84561966dd2f199f5f5e738cc55f12c60866483e458f3a5c05ac22c69baf862c37f6beeb3ca78f01c7b63770b9440f47a56811173
2019-06-16 10:44:09 -04:00
contrib pin poetry version to 0.12.12 as 0.12.14 is broken 2019-04-30 14:09:23 -04:00
docs Merge #161: Mention in Ledger doc that Bitcoin App needs to be running 2019-04-29 13:15:44 -04:00
hwilib Test need_passphrase_sent and need_pin_sent 2019-05-30 18:44:18 -04:00
test ignore other devices when checking that the coldcard has started 2019-05-30 18:44:18 -04:00
udev [ci skip] Document udev rules 2019-04-16 14:30:36 -04:00
.gitignore Add scripts to run tests and prepare test environments 2018-12-04 10:32:23 -05:00
.python-version Add build scripts and documentation for building releases 2019-03-08 00:17:33 -05:00
.travis.yml pin poetry version to 0.12.12 as 0.12.14 is broken 2019-04-30 14:09:23 -04:00
hwi.py Refactor to make hwilib more like a library 2019-01-19 16:58:31 -05:00
hwi.spec Add installudevrules command for linux 2019-05-28 15:43:54 -03:00
LICENSE Add MIT license 2017-08-11 13:04:02 -07:00
poetry.lock Add pyproject.toml and poetry.lock for poetry dependency manager 2019-03-01 19:47:07 -05:00
pyproject.toml Add packages to pyproject.toml to allow generating a working setup.py 2019-04-29 19:47:46 +00:00
README.md Add Trezor Model T 2019-04-21 22:20:19 +02:00
setup.py Add packages to pyproject.toml to allow generating a working setup.py 2019-04-29 19:47:46 +00:00

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 Trezor Model T Digital BitBox KeepKey Coldcard
Support Planned Yes Yes Yes Yes Yes Yes
Implemented Yes Yes Yes Yes Yes Yes
xpub retrieval Yes 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 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 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.