- use_recoverable_channel is a user setting, available
only in standard wallets with a 'segwit' seed_type
- if enabled, 'lightning_xprv' is derived from seed
- otherwise, wallets use the existing 'lightning_privkey2'
Recoverable channels:
- channel recovery data is added funding tx using an OP_RETURN
- recovery data = 4 magic bytes + node id[0:16]
- recovery data is chacha20 encrypted using funding_address as nonce.
(this will allow to fund multiple channels in the same tx)
GUI:
- whether channels are recoverable is shown in wallet info dialog.
- if the wallet can have recoverable channels but has an old node_id,
users are told to close their channels and restore from seed
to have that feature.
There are three export options for exporting a PSBT.
The default option previously only put derivation path suffixes for pubkeys
(paths relative to the intermediate xpub), now it puts the full path
(if is known by the keystore).
The "export for hardware device; include xpubs" option works same as before:
it puts both full paths and also global xpubs into the PSBT.
Hence the difference between the default option and the "include xpubs" option
is now only that the latter puts global xpubs into the PSBT.
This change is largely made for user-convenient in mind.
Now exporting a PSBT should be less error-prone: particularly for the
single-signer coldcard with sdcard usage, the default option will now work.
closes#5969
related #5955
If a tx contained a derivation path for a pubkey,
with a length=2 der suffix,
with the first element of the suffix not in (0, 1),
with a fingerprint that matches either our root or intermediate fp,
then processing that tx would raise and result in a crash reporter.
Traceback (most recent call last):
File ".../electrum/electrum/gui/qt/main_window.py", line 2718, in do_process_from_text
self.show_transaction(tx)
File ".../electrum/electrum/gui/qt/main_window.py", line 1041, in show_transaction
show_transaction(tx, parent=self, desc=tx_desc)
File ".../electrum/electrum/gui/qt/transaction_dialog.py", line 84, in show_transaction
d = TxDialog(tx, parent=parent, desc=desc, prompt_if_unsaved=prompt_if_unsaved)
File ".../electrum/electrum/gui/qt/transaction_dialog.py", line 680, in __init__
self.set_tx(tx)
File ".../electrum/electrum/gui/qt/transaction_dialog.py", line 218, in set_tx
tx.add_info_from_wallet(self.wallet)
File ".../electrum/electrum/transaction.py", line 1944, in add_info_from_wallet
wallet.add_input_info(txin, only_der_suffix=only_der_suffix)
File ".../electrum/electrum/wallet.py", line 1573, in add_input_info
is_mine = self._learn_derivation_path_for_address_from_txinout(txin, address)
File ".../electrum/electrum/wallet.py", line 2609, in _learn_derivation_path_for_address_from_txinout
pubkey, der_suffix = ks.find_my_pubkey_in_txinout(txinout, only_der_suffix=True)
File ".../electrum/electrum/keystore.py", line 155, in find_my_pubkey_in_txinout
path = self.get_pubkey_derivation(pubkey, txinout, only_der_suffix=only_der_suffix)
File ".../electrum/electrum/keystore.py", line 391, in get_pubkey_derivation
if not test_der_suffix_against_pubkey(der_suffix, pubkey):
File ".../electrum/electrum/keystore.py", line 368, in test_der_suffix_against_pubkey
if pubkey != self.derive_pubkey(*der_suffix):
File ".../electrum/electrum/keystore.py", line 491, in derive_pubkey
assert for_change in (0, 1)
AssertionError
The keystore logic would need to be significantly changed to nicely
interoperate with StoredDict/json_db logic.
(just see KeyStore.__init__() and KeyStore.dump())
For now we exempt the keystore from the recursive StoredDict conversion, as
it is a smaller change that is also easier to review for correctness.
fixes#6066fixes#6401
also reverts 2d3c2eeea9 (which was an even hackier workaround for #6066)
previously, client.handler was sometimes
- an InstallWizard
- a QtHandlerBase where win was an ElectrumWindow
- a QtHandlerBase where win was an InstallWizard
- a CmdLineHandler
That's just too much dynamic untyped undocumented polymorphism...
Now it will never be an InstallWizard (replaced with QtHandlerBase where win is an InstallWizard),
and now in all cases client.handler is an instance of HardwareHandlerBase, yay.
related: #6063
Wordlist subclasses 'tuple' so it can be transparently used.
'in' and '.index()' are fast.
Use Wordlist in bip39_is_checksum_valid, which makes that faster.
Power-users that know what they are doing can use this method
to populate key origin information for keystore (bip32 root fingerprint
and derivation path prefix).
Try to make method hard to misuse.
Qt console can now be used as e.g.:
```
wallet.get_keystores()[2].add_key_origin(derivation_prefix="m/48h/1h/0h/2h", root_fingerprint="deadbeef")
```
related #5715
related #5955
related #5969
This was done to calculate the bip32 root fingerprint but it broke
the digitalbitbox. The keystore already had a different way to get
the root fingerprint for existing wallets, specifically handling this
case; the code in base_wizard used when creating new wallets was
duplicating that code originally and was then forgotten to be updated.
Now these codepaths are unified.
closes#5816