Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ledger issues tracking #103

Closed
Keith-CY opened this issue Feb 10, 2023 · 3 comments
Closed

Ledger issues tracking #103

Keith-CY opened this issue Feb 10, 2023 · 3 comments
Assignees
Labels
documentation Improvements or additions to documentation

Comments

@Keith-CY
Copy link
Member

Keith-CY commented Feb 10, 2023

Ledger device: CLA_NOT_SUPPORTED (0x6e00)

Device: Ledger Nano S Plus
App: v0.5.5
Error: failed to get firmware version,
Issue: LedgerHQ/ledger-live#2583
Status: Resolved
Response: As the logs explain, CLA_NOT_SUPPORTED or INS_NOT_SUPPORTED mean that you are sending a message that the current application can't handle. Some APDU messages such as b001000000 will work regardless of the app running and will give you information about the current app running on the device. Depending on what you are trying to do, perhaps we can help better on Discord for development.

Ledger device: UNKNOWN_ERROR(0x6e01)

Device: Ledger Nano X
App: v0.5.5
Error: TransportStatusError
Issue: nervosnetwork/neuron#2581 (comment)
Status: Resolved
Response: Fixed by keeping ledger open during operation

cannot open device with path

Device: Ledger Nano X
App: v0.5.5
Error: Error: cannot open device with path, Neuron hangs on confirming a signing action
Issue: nervosnetwork/neuron#2583
Status: Resolved
Response: Fixed by upgrading ledger ckb app to v0.5.6

Ledger device: UNKNOWN_ERROR (0x9405)

Device: Ledger Nano X
App: v0.5.5
Error: Ledger device: UNKNOWN_ERROR (0x9405), failed to sign a transaction
Issue: reported from an e-mail
Status: debugging

@homura
Copy link

homura commented Jul 29, 2024

The same error code in nervosnetwork/neuron#3095

@homura
Copy link

homura commented Jul 29, 2024

The error code 0x9405 was thrown from the Ledger Nervos App.

This error occurs in the following situations:

  1. The transaction sent to the Ledger device is incompleted https://github.com/homura/app-nervos/blob/327098db14e1972fe5941eaa67c5ce0d56e2ee24/src/apdu_sign.c#L1000-L1015
  2. Too many packets sent to the Ledger device https://github.com/homura/app-nervos/blob/327098db14e1972fe5941eaa67c5ce0d56e2ee24/src/apdu_sign.c#L1180-L1185
  3. An unexpected magic byte is encountered https://github.com/homura/app-nervos/blob/327098db14e1972fe5941eaa67c5ce0d56e2ee24/src/apdu_sign.c#L1191 https://github.com/homura/app-nervos/blob/327098db14e1972fe5941eaa67c5ce0d56e2ee24/src/apdu_sign.c#L1119
  4. An unexpected hash size is encountered when signing a message digest https://github.com/homura/app-nervos/blob/327098db14e1972fe5941eaa67c5ce0d56e2ee24/src/apdu_sign.c#L1276

It is recommended to address these specific situations instead of using the generic error code 0x9405

@homura
Copy link

homura commented Jul 30, 2024

After reviewing the source code of several Ledger Apps, including app-bitcoin, app-ethereum, and others, I noticed that these apps use error codes mostly from the APDU protocol's error code list instead of providing a detailed error code list. This seems to be a common pattern for developing a Ledger app

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
Status: ✅ Done
Status: Todo
Development

No branches or pull requests

4 participants
@Keith-CY @homura @Danie0918 and others