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

electrum 4.4.0-4.4.2 not working with legacy ledger bitcoin app (pre-2.1): no sig for <compressed_pubkey> #8365

Closed
howTOdoIT2 opened this issue Apr 28, 2023 · 8 comments

Comments

@howTOdoIT2
Copy link

Starting from electrum version 4.4.0 ledger won't work but is working fine with version 4.3.4
There is no info to sign the transaction.

@SomberNight
Copy link
Member

SomberNight commented Apr 28, 2023 via email

@howTOdoIT2
Copy link
Author

howTOdoIT2 commented Apr 28, 2023

What do you mean by not working? Do you get any specific error message? Please enable debug logging and attach a debug log. See https://electrum.readthedocs.io/en/latest/faq.html#how-to-enable-debug-logging What do you mean by "ledger nano"? Original nano? "Nano S"? Nano S plus? Nano X? What is the version of the bitcoin app on your device?

check this tweet https://twitter.com/Edward2100/status/1651547697260666881 is the same for me

tested by me with Ledger nano and ledger nano S, electrum v4.4.0 v4.4.1, with v4.3.4 is working I can sign the transaction

I will not add any logs from my electrum wallet, sorry but privacy matter for us.. I know I know si safe. maybe not but in the future who knows?


EDIT(sombernight): the tweet contains an image with an error popup, saying:

no sig for 02705cfc...

(i.e. no sig for <compressed_pubkey>)

@SomberNight
Copy link
Member

I was not able to reproduce.
Without a trace or more info, it's hard to tell, but perhaps this is related to 499f515. That fix will be released in 4.4.2.
Please reopen if it's still not fixed at that point.

@howTOdoIT2
Copy link
Author

is still not working,
Do you have a ledger nano S , windows 10 and electrum wallet v4.4.1 ?
its only work on version electrum4.3.4

@SomberNight
Copy link
Member

Have you tried with 4.4.2 though?

Do you have a ledger nano S , windows 10 and electrum wallet v4.4.1 ?

Yes, I have tested with exactly that scenario and it works for me. There are other variables and you still haven't answered all my questions from before, for example:

What is the version of the bitcoin app on your device?

If it still does not work on 4.4.2, please provide an exception traceback from the debug logs.
You can manually remove anything you deem sensitive from the traceback (I guess part of the filesystem path potentially).

is still not working,

Please try to understand that this statement is completely unusable and has approximately zero information value.

@SomberNight SomberNight changed the title electrum-4.4.1 not working with ledger nano electrum 4.4.0-4.4.2 not working with legacy ledger bitcoin app (pre-2.1) May 9, 2023
@SomberNight SomberNight added this to the 4.4.3 milestone May 9, 2023
@SomberNight SomberNight changed the title electrum 4.4.0-4.4.2 not working with legacy ledger bitcoin app (pre-2.1) electrum 4.4.0-4.4.2 not working with legacy ledger bitcoin app (pre-2.1): no sig for <compressed_pubkey> May 9, 2023
@SomberNight
Copy link
Member

SomberNight commented May 9, 2023

There was another report on bitcointalk now and it specifically said "Ledger Nano S with bitcoin app version 1.6.0".
Using a ledger nano S with bitcoin app version 1.6.3, I can reproduce.

The issue occurs on any modern ledger device when using an old bitcoin app (pre-2.1, I believe). <-- having to use an old bitcoin app was the piece of the puzzle missing before.

Below traceback and modified log for a p2wpkh wallet, but the issue affects all script types. It is a regression from 4.4.0 (from #8230).

 33.36 | W | transaction | heyheyhey. cp1. include_sigs=True force_legacy=False use_segwit_ser=True
 33.36 | W | transaction | heyheyhey. cp2. branch1
 33.37 | E | plugins.ledger.ledger | 
Traceback (most recent call last):
  File "...\electrum\electrum\plugins\ledger\ledger.py", line 669, in sign_transaction
    rawTx = tx.serialize_to_network()
  File "...\electrum\electrum\transaction.py", line 945, in serialize_to_network
    witness = ''.join(self.serialize_witness(x, estimate_size=estimate_size) for x in inputs)
  File "...\electrum\electrum\transaction.py", line 945, in <genexpr>
    witness = ''.join(self.serialize_witness(x, estimate_size=estimate_size) for x in inputs)
  File "...\electrum\electrum\transaction.py", line 839, in serialize_witness
    sol = desc.satisfy(allow_dummy=estimate_size, sigdata=txin.part_sigs)
  File "...\electrum\electrum\descriptor.py", line 378, in satisfy
    sol = self._satisfy_inner(sigdata=sigdata, allow_dummy=allow_dummy)
  File "...\electrum\electrum\descriptor.py", line 574, in _satisfy_inner
    raise MissingSolutionPiece(f"no sig for {pubkey.hex()}")
electrum.descriptor.MissingSolutionPiece: no sig for 033e92e55923ea25809790f292ee9bd410355ee02492472d9a1ff1b364874d0679
 33.38 | I | plugins.ledger.ledger | no sig for 033e92e55923ea25809790f292ee9bd410355ee02492472d9a1ff1b364874d0679

Here is how that unsigned tx hex looks in 4.3.4:

 17.60 | W | transaction | heyheyhey. cp1. include_sigs=True force_legacy=False use_segwit_ser=True
 17.60 | W | transaction | heyheyhey. cp2. branch1
 17.60 | W | transaction | serialize_witness. cp1. entered
 17.60 | W | transaction | serialize_witness. cp2. pubkeys=['022d4280feb2ecf993fff6162d708a876eeac137007dbf58a8ddb04495c8e7aea4'] sig_list=['']
 17.60 | W | transaction | serialize_witness. cp3. wit='020021022d4280feb2ecf993fff6162d708a876eeac137007dbf58a8ddb04495c8e7aea4'
 17.60 | W | transaction | serialize_witness. cp1. entered
 17.61 | W | transaction | serialize_witness. cp2. pubkeys=['0304234dbfc8b78e6fdb313f4530168bb7a6ffe0d83cb235323ec6ee2b7ee5b3a3'] sig_list=['']
 17.61 | W | transaction | serialize_witness. cp3. wit='0200210304234dbfc8b78e6fdb313f4530168bb7a6ffe0d83cb235323ec6ee2b7ee5b3a3'
 17.61 | W | transaction | heyheyhey. cp2.1. witness='020021022d4280feb2ecf993fff6162d708a876eeac137007dbf58a8ddb04495c8e7aea40200210304234dbfc8b78e6fdb313f4530168bb7a6ffe0d83cb235323ec6ee2b7ee5b3a3'
 17.61 | W | plugins.ledger.ledger | heyheyhey. ledger plugin. rawTx='020000000001028d584d655d2892209a1e97ea847db58c615ed40d494dec6bf2f997d8476a23641300000000fdffffff8d584d655d2892209a1e97ea847db58c615ed40d494dec6bf2f997d8476a23642000000000fdffffff0274850100000000001600142cc701ab46749e55833ccb8062171266a2a1c051a0860100000000001600144ab5f845e069c83a817070f768ea4c5241a299fa020021022d4280feb2ecf993fff6162d708a876eeac137007dbf58a8ddb04495c8e7aea40200210304234dbfc8b78e6fdb313f4530168bb7a6ffe0d83cb235323ec6ee2b7ee5b3a3d21c2500'

Apparently we had been giving garbage in past versions in the witness (and scriptSig) to the device, and that worked ok.
New electrum however cannot serialize an unsigned tx with such garbage anymore.

Based on my testing, with wallets using script types pkh(), sh(wpkh(), wpkh(), and all three similar (2of2) multisigs, we can give the device a tx serialized with empty scriptSig and empty witness.

@sandman21vs
Copy link

I just found out that this same problem is happening with the diy version of jade blocstream, can you tell me which version of electrum can work

@SomberNight
Copy link
Member

@sandman21vs see #8463

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

No branches or pull requests

3 participants