HomePhabricator

[electrum] fix hardware wallets (except Trezor)

Description

[electrum] fix hardware wallets (except Trezor)

Summary:
It seems like I did all my recent hardware wallet test tih a trezor device, and meanwhile the other were broken because of recent change.

The main two issues that this diff fixes are:

  • KeyStore.get_tx_derivations now returns a dict indexed by xpubkeys as bytes, and the code still expected it to use hex strings
  • updating the signatures in the coin dict returned by Transaction.inputs() no longer has any effect, as the dicts are build on demand for convenience but are no longer used by Transaction

In addition to this, D14567 introduced a bug for satochip when computing the hash of the tx preimage by hashing the hex version of the preimage instead of bytes. The Hash function supports both bytes and strings as inputs, but it does not assume that strings are hex encoded bytes but rather text to be encoded as "utf-8"

Test Plan: With a satochip device and a ledger device, test sending a transaction. Test creating and signing an unsigned tx in a multisig setup.

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

Differential Revision: https://reviews.bitcoinabc.org/D14613

Details

Provenance
PiRKAuthored on Oct 9 2023, 05:51
PiRKPushed on Oct 9 2023, 18:22
Reviewer
Restricted Project
Differential Revision
D14613: [electrum] fix hardware wallets (except Trezor)
Parents
rABCb553c4bb709f: [avalanche] Update the staking rewards ratio
Branches
Unknown
Tags
Unknown