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

keepkey cosigner in multisig fails to sign #3461

Closed
SomberNight opened this issue Dec 7, 2017 · 3 comments
Closed

keepkey cosigner in multisig fails to sign #3461

SomberNight opened this issue Dec 7, 2017 · 3 comments

Comments

@SomberNight
Copy link
Member

SomberNight commented Dec 7, 2017

On git master 4e60ced.

2-of-2 p2sh-multisig wallet (not segwit)
Cosigners: keepkey and xpub.

Electrum fails to sign the unsigned tx.
Tx is typical 1-in 2-out, with the non-change output being p2pkh, so nothing fancy.

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 222, in sign_transaction
    inputs = self.tx_inputs(tx, True, keystore.is_segwit())
  File "/home/user/wspace/electrum/plugins/keepkey/plugin.py", line 270, in tx_inputs
    m=txin.get('num_sig'),
  File "/usr/local/lib/python3.5/dist-packages/protobuf-3.4.0-py3.5.egg/google/protobuf/internal/python_message.py", line 501, in init
    for val in field_value:
  File "/home/user/wspace/electrum/plugins/keepkey/plugin.py", line 264, in f
    node = self.ckd_public.deserialize(xpub)
  File "/home/user/.local/lib/python3.5/site-packages/keepkeylib/ckd_public.py", line 111, in deserialize
    raise Exception("Checksum failed")
Exception: Checksum failed

Unsigned tx (testnet):

0100000001fa2afa0d5952926edbccbc35ba286ea6c70c5049a468d0dfd10a4b130b31554300000000b40001ff01ff4cad524c53ff0488b21e000000000000000000793da0e31a825b999e78c44b5ceb24788cd78d70cb0a36caa84ef0bf0ac52f98034ed85be91b380f371b42409688d23b0dd0343f31fb2754a14dbf816f5996531c000000004c53ff0488b21e023ba18cef00000000906e9f5f6026e3085aa7ae0d97145dce6fd13e88866d66bb152cdad7bc3b90fe03c2dd965b00cc59f13f3a8269cbfb63399bb6f9d84b31b061e65c485584c35cb90000000052aefdffffff02a0860100000000001976a91436ad0a057508467452a11c0c9c842f5ac7ab5c2988ac74bd96000000000017a9142189ea188c5816aac6609b7e12a02d542903f524877d221300
$ pip3 show keepkey
Name: keepkey
Version: 4.0.0

Btw @kyuupichan already reported this a few days ago on IRC.

@kyuupichan
Copy link
Contributor

This is a bug in keepkey libraries which can be fixed locally:

keepkey/python-keepkey#18

@nickmonad
Copy link

The fix related to the particular function in this issue has been resolved in the latest release of python-keepkey, v4.0.2. Please download and reattempt with the latest version.

There have also been reports of a potential SIGHASH_FORKID issue in the keepkey firmware when signing a multi-sig BCH transaction. I posted information about that issue here: keepkey/keepkey-firmware#35

If an electrum dev is available to take a look at that issue ^ and let us know what you think, we would be appreciative. The information I posted there leads me to believe that this is not an issue with the keepkey firmware, but verification of that would be helpful. Thanks!

@SomberNight
Copy link
Member Author

I've just tested with python-keepkey 4.0.2, and it worked. Thanks.

There have also been reports of a potential SIGHASH_FORKID issue in the keepkey firmware when signing a multi-sig BCH transaction.

I don't know about the BCH issue, sorry. Consider opening an issue in https://github.com/fyookball/electrum

Closing, as the issue here is resolved.

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

3 participants