Registry / auth-security / btchip-python

btchip-python

JSON →
library0.1.32pypypiunverified

This library provides Python utilities to communicate with the *original* Ledger Nano hardware wallet over USB HID. It is specific to the first generation of Ledger devices and is largely superseded by `ledger-python` and `ledgerblue` for modern Ledger Nano S, X, and Stax devices. The current version is 0.1.32, with no active development since 2017, indicating an abandoned status.

pip install btchip-python
INSTALL
IMPORT
SIG · BTCHIP-PYTHON
B
btchip-python
auth-securitypythonv0.1.32
Install
—
Import
—
Disk
—
Pass rate
0/ 10
Env Coverage0 / 10
glibc
3.9–3.13
musl
3.9–3.13
Install & Compatibility
Where this runs
tested against v? · pip install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.10–3.920 runs
build_error
glibc
py 3.10–3.920 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

DongleUSB
✓ from btchip.btchipComm import DongleUSB
The communication backend for USB HID.
btchip
✓ from btchip.btchip import btchip
The main interface class for sending commands to the device.

Demonstrates connecting to an original Ledger Nano and retrieving its firmware version. This example highlights the specific hardware compatibility and common setup requirements.

from btchip.btchipComm import DongleUSB from btchip.btchip import btchip # NOTE: This library is for the *original* Ledger Nano hardware wallet, # NOT for Ledger Nano S/X/Stax. For modern devices, use 'ledger-python'. # # Requires the original Ledger Nano to be connected and proper USB HID # permissions (e.g., udev rules on Linux). dongle = None try: # Initialize the USB dongle communication (timeout in ms) # DongleUSB() without args tries to autodetect original Nano. dongle = DongleUSB(timeout=5000) # Initialize the btchip interface with the dongle interface = btchip(dongle) # Example: Get firmware version firmware_version_response = interface.getFirmwareVersion() # getFirmwareVersion returns a BtchipFirmware object, which __str__ outputs 'VERSION_STRING STATUS_WORD' firmware_version = str(firmware_version_response).split(' ')[0] # Extract only the version string print(f"Successfully connected to original Ledger Nano.") print(f"Device Firmware Version: {firmware_version}") except Exception as e: print(f"Failed to connect to original Ledger Nano: {e}") print("\nTroubleshooting:") print("- Ensure the original Ledger Nano is connected.") print("- On Linux, ensure appropriate udev rules are in place for Ledger HID devices.") print("- Verify 'hidapi' is correctly installed with its system dependencies.") print("- Remember: This library does NOT work with Ledger Nano S/X/Stax.") finally: if dongle: dongle.close()
Debug
Known issues
breakingThis library is designed exclusively for the *original* Ledger Nano hardware wallet. It is NOT compatible with modern Ledger Nano S, Nano X, or Stax devices. Using it with newer devices will result in 'No dongle found' errors or incorrect behavior.
fix
For Ledger Nano S/X/Stax, use the actively maintained `ledger-python` library (PyPI: `ledger-app-builder`) or `ledgerblue` for device communication.
affects: 0.1.0 - 0.1.32
deprecatedThe `btchip-python` library has been abandoned since its last update in 2017. It receives no further development or security updates. Its functionality is largely superseded by newer Ledger-supported libraries.
fix
Migrate to `ledger-python` or `ledgerblue` for any new development or maintenance involving Ledger hardware, especially for modern devices.
affects: 0.1.0 - 0.1.32
gotchaSuccessful device communication requires the `hidapi` library and proper system-level USB HID permissions, particularly on Linux (e.g., udev rules). Without these, the library will fail to detect the device.
fix
Install `hidapi`'s system dependencies (e.g., `libusb-1.0-0-dev` on Debian/Ubuntu, `hidapi-devel` on Fedora, `libusb` on macOS) before `pip install hidapi`. On Linux, add udev rules for Ledger devices (e.g., `SUBSYSTEM=="usb", ATTR{idVendor}=="2c97", MODE="0660", GROUP="plugdev", TAG+="uaccess"`).
affects: 0.1.0 - 0.1.32
gotchaThe `getFirmwareVersion()` method returns a `BtchipFirmware` object, which, when converted to a string, includes both the version and a status word (e.g., '0.1.0 9000'). Extracting only the version number requires parsing.
fix
Access the string representation and parse it, e.g., `str(firmware_object).split(' ')[0]` to get just the version number.
affects: 0.1.0 - 0.1.32
Upgrade
Version history
0.1.32latest on PyPI · released Feb 9, 2021
Audit
Dependencies
hidapirequiredRequired for USB HID communication with the Ledger device.
Agent activity
25 hits · last 30 days
node
20
OpenAI (training)
1
Resources
btchip-python — pip install btchip-python · libregistry