### Install GnuPG for OpenPGP Encryption Source: https://github.com/ledgerhq/blue-loader-python/blob/master/ledgerblue/HowToRecover.md Install the GnuPG package to enable encryption of backup files using OpenPGP. ```shell apt-get install gnupg ``` -------------------------------- ### Install libsecp256k1 on MacOS Source: https://github.com/ledgerhq/blue-loader-python/blob/master/README.md Installs necessary utilities on MacOS for building the custom secp256k1 package. This step is a prerequisite for the secp256k1 installation on MacOS. ```bash brew install libtool ``` -------------------------------- ### Install Ledgerblue Documentation Dependencies Source: https://github.com/ledgerhq/blue-loader-python/blob/master/README.md Installs the necessary Python packages for generating Ledgerblue documentation. This command should be run from the top of the Git repository. ```bash pip install .[doc] ``` -------------------------------- ### Install Ledgerblue in a Virtual Environment Source: https://github.com/ledgerhq/blue-loader-python/blob/master/README.md Installs the ledgerblue package within a Python virtual environment. Ensure you activate the environment before installing. ```bash python3 -m venv ledger source ledger/bin/activate pip install ledgerblue ``` -------------------------------- ### Install libsecp256k1 with ECDH Support Source: https://github.com/ledgerhq/blue-loader-python/blob/master/README.md Installs the libsecp256k1 Python bindings with experimental ECDH support. This requires specific environment variables to be set. ```bash SECP_BUNDLED_EXPERIMENTAL=1 pip --no-cache-dir install --no-binary secp256k1 secp256k1 ``` -------------------------------- ### Generate Ledgerblue HTML Documentation Source: https://github.com/ledgerhq/blue-loader-python/blob/master/README.md Generates the HTML documentation for Ledgerblue locally. This command should be executed from the top of the Git repository after installing dependencies. ```bash (cd doc/ && make html) ``` -------------------------------- ### Execute recoverRestore.py Script Source: https://github.com/ledgerhq/blue-loader-python/blob/master/ledgerblue/HowToRecover.md Example of how to execute the `recoverRestore.py` script with mandatory arguments and optional GPG email. ```shell python3 -m ledgerblue.recoverRestore --rootPrivateKey 0d990d0c41d955a5c63c0e647f7b82a1b383bf645d140f5edffbb79786323d43 -c conf.json -s "Backup_1.json.gpg" "Backup_2.json.gpg" --gpg john.doe@mail.com ``` -------------------------------- ### Install PCSC Support for NFC Communication Source: https://github.com/ledgerhq/blue-loader-python/blob/master/README.md Installs PCSC development libraries and the pyscard Python package on Linux for NFC communication with Ledger devices. ```bash apt install libpcsclite-dev pip3 install pyscard ``` -------------------------------- ### Decrypted Ledger Recover Backup File Content Source: https://github.com/ledgerhq/blue-loader-python/blob/master/ledgerblue/HowToRecover.md Example JSON structure of a decrypted backup file, showing fields like commitments, hash, index, point, share, and words_number. ```json { "Backup 1": { "commitments": "", "hash": "", "index": "", "point": "", "public_key": "", "share": "", "share_commit": "", "words_number": 24 } } ``` -------------------------------- ### Verify GPG Key Source: https://github.com/ledgerhq/blue-loader-python/blob/master/ledgerblue/HowToRecover.md List your GPG keys to verify that the key pair was generated successfully. ```shell gpg --list-keys ``` -------------------------------- ### Configure Udev Permissions for Ledger Devices Source: https://github.com/ledgerhq/blue-loader-python/blob/master/README.md Adds udev rules to `/etc/udev/rules.d/` to grant access to Ledger devices on Linux. Replace `` with your actual username. ```udev SUBSYSTEMS=="usb", ATTRS{idVendor}=="2c97", MODE="0660", TAG+="uaccess", TAG+="udev-acl" OWNER="" KERNEL=="hidraw*", ATTRS{idVendor}=="2c97", MODE="0660" OWNER="" ``` -------------------------------- ### Execute Ledger Recover Backup Script Source: https://github.com/ledgerhq/blue-loader-python/blob/master/ledgerblue/HowToRecover.md Command to execute the recoverBackup script with mandatory arguments, configuration file, and GPG encryption. ```shell python3 -m ledgerblue.recoverBackup --rootPrivateKey 0d990d0c41d955a5c63c0e647f7b82a1b383bf645d140f5edffbb79786323d43 -c conf.json --gpg john.doe@mail.com ``` -------------------------------- ### Generate GPG Key Pair Source: https://github.com/ledgerhq/blue-loader-python/blob/master/ledgerblue/HowToRecover.md Generate a new GPG key pair. Follow the on-screen prompts to complete the process. ```shell gpg --gen-key ``` -------------------------------- ### Configuration File for Ledger Recover Backup Source: https://github.com/ledgerhq/blue-loader-python/blob/master/ledgerblue/HowToRecover.md This JSON file defines the user information, backup details, and keys for orchestrator and providers required by the recoverBackup script. ```json { "user_info": { "first_name": "John", "last_name": "Doe", "birth": "12 January 1980", "city": "PARIS" }, "backup_info": { "backup_id": "70d087ee73844c739b009db405113af8", "backup_name": "Ledger wallet backup" }, "orchestrator": { "key": "" }, "providers": [ { "name" : "Backup_1", "key" : "" }, { "name" : "Backup_2", "key" : "" }, { "name" : "Backup_3", "key" : "" } ] } ``` -------------------------------- ### Set Custom Certificate Authority Source: https://github.com/ledgerhq/blue-loader-python/blob/master/ledgerblue/HowToRecover.md Execute the `recoverSetCA.py` script to set a custom Certificate Authority on the device. The device must be in recovery mode. Ensure the `--name` and `--caPublicKey` arguments are provided. ```python python3 -m ledgerblue.recoverSetCA --name "Recover test CA" --caPublicKey 040c09e45d01494ede4bb0d814e593a964ef9324cd48f7389b9fbf242348274fda4543c204f5913b06647fc829653a5abf6d321b91f5842c9742022bf7120dff38 ``` -------------------------------- ### Decrypt Ledger Recover Backup File Source: https://github.com/ledgerhq/blue-loader-python/blob/master/ledgerblue/HowToRecover.md Command to decrypt a GPG-encrypted backup file using gpg. ```shell gpg --output Backup_1.json --decrypt Backup_1.json.gpg ``` -------------------------------- ### Set GPG Key Trust Level Source: https://github.com/ledgerhq/blue-loader-python/blob/master/ledgerblue/HowToRecover.md Set the trust level for your GPG key to the maximum (5). This requires entering the GPG prompt and using the 'trust' command. ```shell gpg --edit-key gpg > trust ``` -------------------------------- ### Generate Certificate Authority Keys Source: https://github.com/ledgerhq/blue-loader-python/blob/master/ledgerblue/HowToRecover.md Generate a pair of Certificate Authority keys using the Secp256k1 curve. The private key must be kept secure for future backup or restore operations. ```shell Public key : 040c09e45d01494ede4bb0d814e593a964ef9324cd48f7389b9fbf242348274fda4543c204f5913b06647fc829653a5abf6d321b91f5842c9742022bf7120dff38 Private key: 0d990d0c41d955a5c63c0e647f7b82a1b383bf645d140f5edffbb79786323d43 ``` -------------------------------- ### Delete App from BOLOS Device Source: https://github.com/ledgerhq/blue-loader-python/blob/master/doc/source/scripts.rst Deletes a specified application from a connected Ledger Nano S device using the command line. Ensure the device is in the dashboard application before execution. ```bash python -m ledgerblue.deleteApp --targetId 0x31100002 --appName "Hello World" ``` -------------------------------- ### Delete Custom Certificate Authority Script Source: https://github.com/ledgerhq/blue-loader-python/blob/master/ledgerblue/HowToRecover.md Execute the `recoverDeleteCA.py` script to remove a custom Certificate Authority. Ensure the device is in recovery mode and provide the mandatory `--name` and `--caPublicKey` arguments. Optional arguments like `--issuerPublicKey`, `--rootPrivateKey`, and `--targetId` can also be specified. ```shell python3 -m ledgerblue.recoverDeleteCA --name "Recover test CA" --caPublicKey 040c09e45d01494ede4bb0d814e593a964ef9324cd48f7389b9fbf242348274fda4543c204f5913b06647fc829653a5abf6d321b91f5842c9742022bf7120dff38 ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.