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.

auth-security
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.103.920 runs
build_error
glibc
py 3.103.920 runs
build_error
Code
Verified usage

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

The communication backend for USB HID.

from btchip.btchipComm import DongleUSB

The main interface class for sending commands to the device.

from btchip.btchip import btchip

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 footguns
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.
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.
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.
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.
Upgrade
Version history

Breaking-change detection hasn't run for this library yet.

Audit
Security & dependencies

CVE tracking and dependency tree are planned for a later release.

Agent activity
16 hits · last 30 days
gptbot
4
ahrefsbot
4
script
1
bytedance
1
chatgpt-user
1
Resources