1
0
Commit Graph

22 Commits

Author SHA1 Message Date
SomberNight
d2cf21fc2b qml wizard: enforce homogeneous master keys in multisig
- {xpub, Ypub, Zpub} categories cannot be mixed
- old mpk must not be used in multisig
2023-05-11 10:13:51 +00:00
SomberNight
499f51535f bip32: fix hardened char "h" vs "'" compatibility for some hw wallets
in particular, ledger: fix sign_message for some wallets

```
156.02 | E | plugins.ledger.ledger |
Traceback (most recent call last):
  File "...\electrum\electrum\plugins\ledger\ledger.py", line 1265, in sign_message
    result = base64.b64decode(self.client.sign_message(message, address_path))
  File "...\Python310\site-packages\ledger_bitcoin\client.py", line 230, in sign_message
    sw, response = self._make_request(self.builder.sign_message(message_bytes, bip32_path), client_intepreter)
  File "...\Python310\site-packages\ledger_bitcoin\command_builder.py", line 176, in sign_message
    bip32_path: List[bytes] = bip32_path_from_string(bip32_path)
  File "...\Python310\site-packages\ledger_bitcoin\common.py", line 68, in bip32_path_from_string
    return [int(p).to_bytes(4, byteorder="big") if "'" not in p
  File "...\Python310\site-packages\ledger_bitcoin\common.py", line 68, in <listcomp>
    return [int(p).to_bytes(4, byteorder="big") if "'" not in p
ValueError: invalid literal for int() with base 10: '84h'
```

Regression from df2bd61de6, where the
default hardened char was changed from "'" to "h". Note that there was
no corresponding wallet db upgrade, so some files use one char and
others use the other.
2023-04-27 17:03:16 +00:00
SomberNight
312f2641e7 don't use bare except
use "except Exception", or if really needed explicitly "except BaseException"
2023-04-24 12:58:01 +00:00
SomberNight
7746cc8e60 bip32: (trivial) rename method strpath_to_intpath, for symmetry
Required a much higher mental load to parse the name "convert_bip32_path_to_list_of_uint32"
than to parse "convert_bip32_strpath_to_intpath".
And we already have the ~inverse: "convert_bip32_intpath_to_strpath".
2023-03-10 14:23:17 +00:00
SomberNight
e7849bce94 descriptor.py: clean-up and test PubkeyProvider.get_full_derivation_* 2023-03-03 16:40:28 +00:00
SomberNight
d2f75b7da5 descriptor.py: don't allow ypub/zpub inside descriptors 2023-03-01 17:53:45 +00:00
SomberNight
9d3f53932b add descriptor.py from bitcoin-core/HWI 2023-03-01 17:53:37 +00:00
SomberNight
373db76ac9 util: kill bh2u
no longer useful, and the name is so confusing...
2023-02-17 11:43:11 +00:00
SomberNight
df2bd61de6 bip32: change hardened char "'"->"h" when encoding derivation paths
We accept either when decoding - this only changes what we use when encoding.
Single quotes are annoying to use in a shell, as they often need to be escaped.
2023-02-14 12:19:10 +00:00
SomberNight
c744fc4e3d follow-up prev: do all checks, and add tests 2020-02-27 05:13:31 +01:00
SomberNight
2cf2135528 ecc: abstract away some usage of python-ecdsa: bytes<->int conversions 2020-02-11 16:41:49 +01:00
SomberNight
59c5efb090 keystore: cache BIP32Node.from_xkey(self.xpub)
This results in significant performance improvements for
keystore.can_sign() and wallet._add_txinout_derivation_info()
2019-12-09 03:43:47 +01:00
SomberNight
dd14a3fde5 psbt: follow-ups: fix digital bitbox 2019-11-05 22:06:46 +01:00
SomberNight
e6c841d05f psbt: put fake xpubs into globals. keystores handle xfp/der_prefix missing 2019-11-04 22:24:59 +01:00
SomberNight
bafe8a2fff integrate PSBT support natively. WIP 2019-11-04 22:24:36 +01:00
SomberNight
9e21b76c91 wallet: stricter validation in export_private_key
fixes #5422
2019-06-12 18:09:38 +02:00
SomberNight
3385a94753 logging: basics 2019-05-02 15:19:03 +02:00
SomberNight
11733d6bc2 wizard: normalize bip32 derivation path
so that what gets put in storage is "canonical"
(from now on... we could storage upgrade existing wallets
but it's not critical)
2019-02-22 18:50:29 +01:00
SomberNight
85a7aa291e bip32: refactor whole module. clean-up. 2019-02-22 18:50:24 +01:00
SomberNight
d7c5949365 prefer int.from_bytes over int('0x'+hex, 16) 2018-11-26 01:16:26 +01:00
SomberNight
47b6d3c52c wizard: make native segwit (bech32) the default for bip39/hw 2018-11-08 13:01:40 +01:00
SomberNight
a88a2dea82 split bip32 from bitcoin.py 2018-10-25 22:20:33 +02:00