spesmilo / electrum

Electrum Bitcoin Wallet
https://electrum.org
MIT License
7.41k stars 3.08k forks source link

keepkey p2sh-segwit wallet can't spend #3462

Closed SomberNight closed 6 years ago

SomberNight commented 6 years ago

On git master 4e60cedea9c295b2c2fa62b94d20eba3c515e5d9.

Keepkey standard wallet with p2wpkh-p2sh script type (BIP49 derivation path) fails to sign unsigned transactions.

Typical 1-in 2-out tx.

Traceback (most recent call last):
  File "/home/user/wspace/electrum/gui/qt/util.py", line 579, in run
    result = task.task()
  File "/home/user/wspace/electrum/lib/wallet.py", line 1152, in sign_transaction
    k.sign_transaction(tx, password)
  File "/home/user/wspace/electrum/plugins/keepkey/plugin.py", line 59, in sign_transaction
    self.plugin.sign_transaction(self, tx, prev_tx, xpub_path)
  File "/home/user/wspace/electrum/plugins/keepkey/plugin.py", line 224, in sign_transaction
    signed_tx = client.sign_tx(self.get_coin_name(), inputs, outputs, lock_time=tx.locktime)[1]
  File "/home/user/wspace/electrum/plugins/keepkey/clientbase.py", line 218, in wrapped
    return func(self, *args, **kwargs)
  File "/home/user/.local/lib/python3.5/site-packages/keepkeylib/client.py", line 148, in wrapped_f
    return f(*args, **kwargs)
  File "/home/user/.local/lib/python3.5/site-packages/keepkeylib/client.py", line 871, in sign_tx
    res = self.call(proto.TxAck(tx=msg))
  File "/home/user/.local/lib/python3.5/site-packages/keepkeylib/client.py", line 148, in wrapped_f
    return f(*args, **kwargs)
  File "/home/user/.local/lib/python3.5/site-packages/keepkeylib/client.py", line 189, in call
    msg = handler(resp)
  File "/home/user/wspace/electrum/plugins/keepkey/clientbase.py", line 35, in callback_Failure
    raise RuntimeError(msg.message)
RuntimeError: Failed to compile output
$ pip3 show keepkey
Name: keepkey
Version: 4.0.0
SomberNight commented 6 years ago

Tested again on 3851e78454f559ec4368a4b04dd61c2b9a1f9dc1 with python-keepkey 4.0.2. Issue still persists.

bsbits commented 6 years ago

can you try to just sign the transaction and broadcast it using a different tool like blockchain info pushtx ?

SomberNight commented 6 years ago

can you try to just sign the transaction

Sign how? Using a different tool? The problem occurs when I try to sign it using Electrum.

bitsolemn commented 6 years ago

I too have coins trapped on BIP49 keepkey. Are these lost permanently or could these be recovered if keepkey upgrades firmware?

SomberNight commented 6 years ago

@bitsolemn No, not trapped. You can:

bitsolemn commented 6 years ago

Ah right. The stress clouded my thinking. Thanks~