extension: signer.signRaw signing doesn't work with Ledger Nano X

Steps:

  • Install Polkadot application to Ledger
Screenshot 2021-11-24 at 20 16 01
  • Run it

photo5834931295065586028

  • Import Ledger Nano X account Screenshot 2021-11-24 at 20 06 59

  • Run the code:

    const injector = await web3FromAddress(account);
    const { signature } = await injector.signer.signRaw({
      type: 'bytes',
      address: account,
      data: hexData
    });

Current behaviour: Screenshot 2021-11-24 at 20 03 13

User see modal window where only cancel operation is available.

User should confirm the operation by Ledger but there is no change on Ledger screen.

Expected behaviour:

Open confirmation window and ask user on Ledger to confirm the signing.

Btw, it works well without Ledger and looks like this: Screenshot 2021-11-24 at 20 04 09

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 19 (12 by maintainers)

Commits related to this issue

Most upvoted comments

If I’m not mistaken and this is actual repo for ledger polkadot firmware then it seems from code that device is ready to sign any bytes provided (after some hardware package handling it ultimately boils down to this function which just signs the bytes provided).

Though ledger common libraries which are used in desktop and mobile apps just don’t have API for signing arbitrary payloads. The only place where signing is called seems to be here and it’s for transaction signing.

Anyways this has little to do with polkadotjs, I think it’s logical to raise in issue in ledger repo and then return here to ensure that everything works fine in conjunction with polkadotjs.

UPD: though after a bit more digging it seems that polkadotjs uses transport libraries to directly send messages to ledger. Than it’s less clear why arbitrary payload can’t be signed, I will research more and update here.

UPD2: ok, nevermind, didn’t notice that tx_parse() call which assumes that payload is transaction. Yes, there is not firmware support for signing messages.