Connecting Ledger with NNS on Linux

Hello,

I am trying to setup a Ledger wallet so I can use accounts from the wallet within the NNS for creating neurons and voting. However, I came across connection issues in several browsers so I’ll be truly grateful for any guidance :slight_smile: Let me describe what I’ve done

  1. I installed both ICP and Fido U2F apps on my Ledger
  2. Created an account in ICP app via Ledger application (and funded it from a CEX)
  3. Authenticated with IC identity to the NNS app - The Main account is being correctly shown
  4. I couldn’t add an account from ICP app to Firefox (because WebUSB is not supported)
  5. I opened Brave, disabled Shields, authenticated to the NNS again and successfully imported the Ledger ICP account
  6. However, I can’t sign any transactions because the following error occurs
There was an error with the hardware wallet. Server returned an error: Code: 403 () 
Body: Failed to authenticate request 0x79538517864c3246d562f92f1b63a378150dc7ab04d44edd082c776aa610cd85 due to: Invalid signature: 
Invalid basic signature: EcdsaSecp256k1 signature could not be verified: public key 04f1d10614f3d007e969e6ffe55eacdc1ae1f2fd93816ccb15f6e6ae81654329cda4d80d9a81aeb8777cb7b1b1e6a308e2407f38102e43f7c193e217d1c9a83549, 
signature 05130fc7a67429ebc9dae2dab1258e4dba7aaa9795e89878261644877e430e8f348ac962eb855d142cf4aa26baefe8291da5bcfb937e6f1db8531e31f1e4ee96, 
error: verification failed

What I’ve tried

  • signing TX while having ICP app opened on Ledger (and closed)
  • signing TX while having the Ledger application opened on my laptop (also closed)
  • I also installed Chromium (from the repository since I found out that the snap version has some problems with WebUSB), imported the account again but I am getting this error while signing the TX (I also tried opening and closing both ICP app on Ledger and Ledger app on laptop)
Sorry, there was an error trying to execute the transaction. 
Either you have other wallet applications open (e.g. Ledger Live), or your browser doesn't support WebHID, which is necessary to communicate with your Ledger hardware wallet. Supported browsers: Chrome (Desktop) v89+, Edge v89+, Opera v76+. Error: NotAllowedError: Failed to open the device.

So out of desperation I also found how to change udev rules in order to give browsers permissions to the Ledger USB device but unfortunately haven’t succeeded as well. This is my /etc/udev/rules.d/hw-21.rules entry

SUBSYSTEMS=="usb", ATTRS{idVendor}=="2c97", ATTRS{idProduct}=="0005|5000|5001|5002|5003|5004|5005|5006|5007|5008|5009|500a|500b|500c|500d|500e|500f|5010|5011|5012|5013|5014|5015|5016|5017|5018|5019|501a|501b|501c|501d|501e|501f", TAG+="uaccess", TAG+="udev-acl"

lsusb gives me Bus 003 Device 015: ID 2c97:5011 Ledger Nano S Plus so that seems about right.

I also see this in browsers`s log

[119014:119014:0112/175642.123197:VERBOSE1:device_event_log_impl.cc(194)] [17:56:42.123] HID: EVENT: hid_service_linux.cc:435 Access denied opening device read-write, trying read-only.
[119014:119014:0112/175642.123253:VERBOSE1:device_event_log_impl.cc(194)] [17:56:42.123] HID: EVENT: hid_service_linux.cc:442 Failed to open '/dev/hidraw1': FILE_ERROR_ACCESS_DENIED

So after trying all these options, I am getting kinda desperate. I will certainly appreciate any help here - the reason I am fighting this is that I am trying to set up a secure account for a node provider.

Thanks again for any help.

My environment is

  • Ledger Nano S Plus
  • Ubuntu 22.04 LTS
  • Brave v1.61.116
  • Chromium (installed via apt) Version 120.0.6099.199 (Official Build) snap (64-bit)

EDIT - I realized I was using the Chromium snap version anyway so I downloaded a DEB package directly from Chrome and tried signing the TX. And I’ve encountered exactly the same error as with Brave (403).

Small update - I’ve tried the same thing in Edge on Microsoft laptop and it ended up with the same result. So that brought to the idea that maybe the Ledger firmware is outdated so I did an upgrade - and still the same. So I guess now I am completely clueless :smiley:

Hi!

Which specific action are you trying to perform in the NNS Dapp that is giving you those errors?

Some people in the team use Linux with the Hardware Wallet and it’s working fine. But probably we’re missing some context trying to replicate the problem.

Thanks!

Thanks for your reply. Well, I was trying to send ICP to a different account as a test before I put in more - and even this simple one failed with the error above. Are you using IC accounts that are stored in the Ledger ICP app or your local IC accounts generated by the NNS app?

They use the accounts of the HW.

It shows as a “Hardware Wallet”, right?

What do you mean by the local accounts? The ones that belong the the Internet Identity user?

Did you try another action? There are two simple ones:

  • Go the the wallet page of the hardware wallet.
  • Click “Show Neurons”.
  • Click “Show Principal And Address On Device”

Do those work?

Thanks!