1
0

wallet: add new config option "FREEZE_REUSED_ADDRESS_UTXOS"

Adds a new config option: `WALLET_FREEZE_REUSED_ADDRESS_UTXOS`.
This is based on Bitcoin Core's "avoid_reuse" wallet flag. [0]

This opt-in feature, if enabled:
> Automatically freeze coins received to already used addresses.
> This can eliminate a serious privacy issue where a malicious user can track your spends by sending small payments
> to a previously-paid address of yours that would then be included with unrelated inputs in your future payments.

Note that currently we only have a single coinchooser policy, `CoinChooserPrivacy`,
which interacts well with this option, as it spends all coins from any selected address.
However, if we later add a different coinchooser policy, which allowed "partial spends",
care should be taken re e.g. disallowing using that when this option is set.

Also note that this PR adds this as a config option, but arguably it could be wallet-specific instead,
such as `use_change`.

[0]: https://github.com/bitcoin/bitcoin/blob/master/doc/release-notes/release-notes-0.19.0.1.md#wallet

closes https://github.com/spesmilo/electrum/issues/7497
This commit is contained in:
SomberNight
2025-03-14 00:24:40 +00:00
parent 3ff794da12
commit d52762a2e8
4 changed files with 25 additions and 0 deletions

View File

@@ -605,6 +605,13 @@ class SimpleConfig(Logger):
short_desc=lambda: _('Send change to Lightning'),
long_desc=lambda: _('If possible, send the change of this transaction to your channels, with a submarine swap'),
)
WALLET_FREEZE_REUSED_ADDRESS_UTXOS = ConfigVar(
'wallet_freeze_reused_address_utxos', default=False, type_=bool,
short_desc=lambda: _('Avoid spending from used addresses'),
long_desc=lambda: _("""Automatically freeze coins received to already used addresses.
This can eliminate a serious privacy issue where a malicious user can track your spends by sending small payments
to a previously-paid address of yours that would then be included with unrelated inputs in your future payments."""),
)
FX_USE_EXCHANGE_RATE = ConfigVar('use_exchange_rate', default=False, type_=bool)
FX_CURRENCY = ConfigVar('currency', default='EUR', type_=str)