Skip to content

Instantly share code, notes, and snippets.

@normoes
Last active October 22, 2018 09:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save normoes/6d086e42e93e7c0cb9f77c2effe1e5be to your computer and use it in GitHub Desktop.
Save normoes/6d086e42e93e7c0cb9f77c2effe1e5be to your computer and use it in GitHub Desktop.
Using the ledger nano s with Monero

Ledger nano s

Ledger nano s initialization

After unboxing the ledger, I just connected it via the USB cable. It powered up perfectly and started the initialization process. The ledger asked to set a PIN, then I had to copy the seed word by word and confirm it by repeating it word by word.

I had a short look into the settings and naively tried to create a HW wallet using monero-wallet-cli (see below for the actual command).

Getting the ledger recognized by the system

It turned out the ledger nano s was not detected by my linux system (ubuntu 18.04), so I searched the internet and found a script (see below) from https://support.ledgerwallet.com/hc/en-us/articles/115005165269-Fix-connection-issues

I downloaded (and checked) the mentioned script to add some udev rules for the ledger nano s to be recognized by the system:

    wget -q -O - https://raw.githubusercontent.com/LedgerHQ/udev-rules/master/add_udev_rules.sh | sudo bash

This is the script (at the time of writing this):

    #!/bin/bash
    echo "SUBSYSTEMS==\"usb\", ATTRS{idVendor}==\"2581\", ATTRS{idProduct}==\"1b7c\", MODE=\"0660\", GROUP=\"plugdev\"" >/etc/udev/rules.d/20-hw1.rules
    echo "SUBSYSTEMS==\"usb\", ATTRS{idVendor}==\"2581\", ATTRS{idProduct}==\"2b7c\", MODE=\"0660\", GROUP=\"plugdev\"" >>/etc/udev/rules.d/20-hw1.rules
    echo "SUBSYSTEMS==\"usb\", ATTRS{idVendor}==\"2581\", ATTRS{idProduct}==\"3b7c\", MODE=\"0660\", GROUP=\"plugdev\"" >>/etc/udev/rules.d/20-hw1.rules
    echo "SUBSYSTEMS==\"usb\", ATTRS{idVendor}==\"2581\", ATTRS{idProduct}==\"4b7c\", MODE=\"0660\", GROUP=\"plugdev\"" >>/etc/udev/rules.d/20-hw1.rules
    echo "SUBSYSTEMS==\"usb\", ATTRS{idVendor}==\"2581\", ATTRS{idProduct}==\"1807\", MODE=\"0660\", GROUP=\"plugdev\"" >>/etc/udev/rules.d/20-hw1.rules
    echo "SUBSYSTEMS==\"usb\", ATTRS{idVendor}==\"2581\", ATTRS{idProduct}==\"1808\", MODE=\"0660\", GROUP=\"plugdev\"" >>/etc/udev/rules.d/20-hw1.rules
    echo "SUBSYSTEMS==\"usb\", ATTRS{idVendor}==\"2c97\", ATTRS{idProduct}==\"0000\", MODE=\"0660\", GROUP=\"plugdev\"" >>/etc/udev/rules.d/20-hw1.rules
    echo "SUBSYSTEMS==\"usb\", ATTRS{idVendor}==\"2c97\", ATTRS{idProduct}==\"0001\", MODE=\"0660\", GROUP=\"plugdev\"" >>/etc/udev/rules.d/20-hw1.rules
    udevadm trigger
    udevadm control --reload-rules

I unplugged the ledger nano s and reattached it - It worked but the error mesage displayed by the monero-wallet-cli was just a different one.

Monero and ledger software

So I downloaded the ledger software from: https://www.ledger.com/pages/ledger-live

I soon realized that Monero (the Monero app) was not installed, yet. I installed it and it direclty became available on the ledger nano s - showing a wallet address.

After that, I downloaded the most recent Monero cli version (v0.13.0.2, because the hard fork (2018/10) happened upgrading the blockchain to v8, v9) and tried again to create the HW wallet..

Create HW-wallet:

I soon realized (again), that you need to be in the Monero app on the ledger nano s to make a communication with the ledger work. Furthermore, when interacting with the ledger you need to take a look at it frequently to make sure you enter your PIN or confirm requests to it.

During the process of creating the hardware wallet you will have to set a password and you will be requested to confirm the export of the view key (confirm it on the ledger itself).

This is the command I used to create the wallet:

    monero-wallet-cli --generate-from-device ledger_nano_s_wallet --subaddress-lookahead 3:200

Start HW-wallet:

This is the command I used to start the wallet:

    monero-wallet-cli --daemon-host <localhost_or_some_trusted_daemon> --wallet-file ledger_nano_s_wallet
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment