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

SUI ledger transactions failing when connected with bluetooth #19273

Open
sharma66mahesh opened this issue Sep 9, 2024 · 3 comments
Open

SUI ledger transactions failing when connected with bluetooth #19273

sharma66mahesh opened this issue Sep 9, 2024 · 3 comments
Assignees

Comments

@sharma66mahesh
Copy link

Steps to Reproduce Issue

The same transaction below goes through, if I connect my ledger to my phone via USB tho.

  1. Pair my mobile to my ledger via bluetooth.
  2. Lookup for available ledger wallet addresses and select a particular one for my usecase.
  3. Try to send out an transaction. But it fails with error code: 0x6802

Expected Result

The transaction is expected to go through just like when connected via USB.

Actual Result

Sending out a ledger transaction on mobile using mysten-labs JS libraries via:

  1. bluetooth connection: the code fails with error code: 0x6802
  2. USB connection: the transaction signature prompt pops up on the ledger device and the transaction goes through.

Libraries Information

  • Platform: Android
  • Programming language: JS
  • Framework: React-Native, Expo
  • Libraries used to send ledger transactions:
    • @mysten/ledgerjs-hw-app-sui: v0.4.1
    • @mysten/sui: v1.8.0
    • @ledgerhq/react-native-hw-transport-ble: v6.32.0
    • @ledgerhq/react-native-hid: v6.31.1
    • @ledgerhq/hw-transport: v6.30.1
@williamrobertson13
Copy link
Contributor

williamrobertson13 commented Sep 9, 2024

Hey @sharma66mahesh! Do you have a minimal repro you could share by chance? We haven't gotten around to adding bluetooth Ledger support to Sui Wallet, so you're in uncharted territory 😆. I'm glad to look into it though!

Try to send out an transaction. But it fails with error code: 0x6802

Mind providing a little more info about this? e.g., what type of transaction is it, does it fail immediately or after you go through the prompts on the Ledger app, what Ledger device are you using (X or Nano S), do you have blind signing enabled in your Sui Ledger app settings?

@williamrobertson13 williamrobertson13 self-assigned this Sep 9, 2024
@sharma66mahesh
Copy link
Author

@williamrobertson13 thanks for the info.

Do you plan on adding the bluetooth support soon?

I currently do not have a repo setup that I can share with you. However, I can create a minimal project and share one with you soon.

To answer your queries,

  • The transaction is a simple SUI token transfer from the ledger to another wallet. I tried with other transactions like transferring non-native tokens too, but all resulted in the same outcome.
  • The code does trigger the ledger to sign the transaction. However, the transaction data is never prompted on the ledger device to sign. My code simply fails with the 0x6802 code. This same transaction goes through if I connect the ledger to my smartphone visa USB tho.
  • I'm trying with Nano X. I believe Nano S doesn't support bluetooth.
  • Yes I do have blind signing enabled.

@MystenLabs MystenLabs deleted a comment Sep 10, 2024
@williamrobertson13
Copy link
Contributor

This is all helpful information! And yeah thanks for the clarification - I forgot the Nano X is the only one with bluetooth (well the Stax/Flex do too but we don't support those devices yet). I don't have an ETA for when Ledger support will be added to our new wallet app, but it is on the radar!

So the error code 0x6802 corresponds to a SyscallError::InvalidParameter error in the Sui Ledger app, which happens in a few places in the sign_apdu function which handles transaction signing: https://github.com/LedgerHQ/app-sui/blob/da59b2d75c29098d4bdd29b14a00429255441ba7/rust-app/src/implementation.rs#L687.

If it's not too much of a hassle, a minimal repro would save me some time and guessing since I had a few other questions about your project setup / package versioning 🙏🏼. I'll also flag this with some folks on our team that are more familiar with the APDU communication and transport pieces in the meantime.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants