Client side implementation for KeepKey-compatible Bitcoin hardware wallets.
This is a modified version of python-trezor. The changes made were to support KeepKey's protocol, as well as the additional feature set of KeepKey. For example, by default, device_recovery command invokes KeepKey's style of device recovery using the Recovery Cipher.
See http://www.keepkey.com for more information.
also found in
.. code:: python
from keepkeylib.client import KeepKeyClient from keepkeylib.transport_hid import HidTransport
# List all connected KeepKeys on USB devices = HidTransport.enumerate() # Check whether we found any if len(devices) == 0: print('No KeepKey found') return # Use first connected device transport = HidTransport(devices) # Creates object for manipulating KeepKey client = KeepKeyClient(transport) # Print out KeepKey's features and settings print(client.features) # Get the first address of first BIP44 account # (should be the same address as shown in KeepKey wallet Chrome extension) bip32_path = client.expand_path("44'/0'/0'/0/0") address = client.get_address('Bitcoin', bip32_path) print('Bitcoin address:', address) client.close()
if name == 'main': main()
When you are asked for PIN, you have to enter scrambled PIN. Follow the numbers shown on KeepKey display and enter the their positions using the numeric keyboard mapping:
=== === === 7 8 9 4 5 6 1 2 3 === === ===
Example: your PIN is 1234 and KeepKey is displaying the following:
=== === === 2 8 3 5 4 6 7 9 1 === === ===
You have to enter: 3795
To run unit tests that don't require a device:
.. code:: shell
$ python tests/unit/*.py
The KeepKey Bridge is a standalone TCP-to-webusb bridge the KeepKey. It runs a python-keepkey client based process that allows a localhost-based process to communicate with the KeepKey wallet, thus bypassing the need for a webusb connection from a browser based platform.
The KeepKey Bridge is recommended only for advanced users who have problems connecting the KeepKey on Windows.
Download the KeepKey Bridge installer
kkbsetup.exe for Windows in the release package here:
When running the KeepKey Bridge, a blank cmd window with the title "KepKey Bridge" will be visible. To stop the bridge, simply close the cmd window.
From a command prompt terminal window, run
python wbsetup.py py2exe -d windows/dist
This will create a
windows\dist folder with the Windows stand-alone executable file
This tool builds and packages the executable for install on Windows. Build with the provided installer script (modify version, etc., as needed)
This will produce an executable install app