{"id":7997,"library":"btchip-python","title":"Ledger Nano (Original) Python Library","description":"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.","status":"abandoned","version":"0.1.32","language":"python","source_language":"en","source_url":"https://github.com/LedgerHQ/btchip-python","tags":["hardware wallet","ledger","bitcoin","cryptocurrency","security","abandoned"],"install":[{"cmd":"pip install btchip-python","lang":"bash","label":"Install btchip-python"},{"cmd":"sudo apt-get update && sudo apt-get install -y libusb-1.0-0-dev libudev-dev\npip install hidapi","lang":"bash","label":"Linux: Install hidapi system dependencies (required for btchip-python)"},{"cmd":"brew install libusb\npip install hidapi","lang":"bash","label":"macOS: Install hidapi system dependencies (required for btchip-python)"}],"dependencies":[{"reason":"Required for USB HID communication with the Ledger device.","package":"hidapi","optional":false}],"imports":[{"note":"The communication backend for USB HID.","symbol":"DongleUSB","correct":"from btchip.btchipComm import DongleUSB"},{"note":"The main interface class for sending commands to the device.","symbol":"btchip","correct":"from btchip.btchip import btchip"}],"quickstart":{"code":"from btchip.btchipComm import DongleUSB\nfrom btchip.btchip import btchip\n\n# NOTE: This library is for the *original* Ledger Nano hardware wallet,\n# NOT for Ledger Nano S/X/Stax. For modern devices, use 'ledger-python'.\n#\n# Requires the original Ledger Nano to be connected and proper USB HID\n# permissions (e.g., udev rules on Linux).\n\ndongle = None\ntry:\n    # Initialize the USB dongle communication (timeout in ms)\n    # DongleUSB() without args tries to autodetect original Nano.\n    dongle = DongleUSB(timeout=5000)\n    \n    # Initialize the btchip interface with the dongle\n    interface = btchip(dongle)\n    \n    # Example: Get firmware version\n    firmware_version_response = interface.getFirmwareVersion()\n    # getFirmwareVersion returns a BtchipFirmware object, which __str__ outputs 'VERSION_STRING STATUS_WORD'\n    firmware_version = str(firmware_version_response).split(' ')[0] # Extract only the version string\n    \n    print(f\"Successfully connected to original Ledger Nano.\")\n    print(f\"Device Firmware Version: {firmware_version}\")\n    \nexcept Exception as e:\n    print(f\"Failed to connect to original Ledger Nano: {e}\")\n    print(\"\\nTroubleshooting:\")\n    print(\"- Ensure the original Ledger Nano is connected.\")\n    print(\"- On Linux, ensure appropriate udev rules are in place for Ledger HID devices.\")\n    print(\"- Verify 'hidapi' is correctly installed with its system dependencies.\")\n    print(\"- Remember: This library does NOT work with Ledger Nano S/X/Stax.\")\nfinally:\n    if dongle:\n        dongle.close()\n","lang":"python","description":"Demonstrates connecting to an original Ledger Nano and retrieving its firmware version. This example highlights the specific hardware compatibility and common setup requirements."},"warnings":[{"fix":"For Ledger Nano S/X/Stax, use the actively maintained `ledger-python` library (PyPI: `ledger-app-builder`) or `ledgerblue` for device communication.","message":"This 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.","severity":"breaking","affected_versions":"0.1.0 - 0.1.32"},{"fix":"Migrate to `ledger-python` or `ledgerblue` for any new development or maintenance involving Ledger hardware, especially for modern devices.","message":"The `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.","severity":"deprecated","affected_versions":"0.1.0 - 0.1.32"},{"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\"`).","message":"Successful 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.","severity":"gotcha","affected_versions":"0.1.0 - 0.1.32"},{"fix":"Access the string representation and parse it, e.g., `str(firmware_object).split(' ')[0]` to get just the version number.","message":"The `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.","severity":"gotcha","affected_versions":"0.1.0 - 0.1.32"}],"env_vars":null,"search_vec":"'0.1.32':56 '2017':62 'abandon':65,73 'activ':59 'bitcoin':70 'communic':12 'cryptocurr':71 'current':53 'develop':60 'devic':32,51 'first':28 'generat':29 'hardwar':18,67 'hid':22 'indic':63 'larg':35 'ledger':1,16,31,39,45,69 'ledger-python':38 'ledgerblu':42 'librari':5,7 'modern':44 'nano':2,17,46 'origin':3,15 'provid':8 'python':4,9,40 'secur':72 'sinc':61 'specif':25 'status':66 'stax':50 'supersed':36 'usb':21 'util':10 'version':54 'wallet':19,68 'x':48","created_at":"2026-04-16T16:59:54.191223+00:00","updated_at":"2026-04-16T16:59:54.191223+00:00","problems":{"verify_error":"× Failed to build `btchip-python==0.1.32`\n  ├─▶ The build backend returned an error\n  ╰─▶ Call to `setuptools.build_meta:__legacy__.build_wheel` failed (exit\n      status: 1)\n\n      [stderr]\n      error in btchip-python setup command: 'extras_require' must be a\n      dictionary whose values are stri"},"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":"0.1.32","cli_name":"","cli_version":null,"type":"library","homepage":null,"github":"https://github.com/LedgerHQ/btchip-python","docs":null,"changelog":null,"pypi":"https://pypi.org/project/btchip-python/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["auth-security"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"install_fail","verified_at":"2026-06-28","last_verified":"2026-06-28","next_check":"2026-07-05","install_tag":null}}