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.
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
muslpy 3.10–3.920 runs
build_error
glibcpy 3.10–3.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()
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.