#10995·electrum

Deprecate wallets with non-deterministic lightning keys??

Author: SomberNightCreated Sep 24, 2026Updated Sep 24, 2026
Labelslightning ⚡

It comes up time-to-time that it would be a major conceptual simplification and reduction of compat-matrix-size if we killed off wallets with non-deterministic lightning keys.


The matrix is complex.

Roughly the following wallets can have lightning enabled on 4.8.x:

  • (1) electrum seeds, wallet file created post-4.1, so lightning_xprv is deterministic
  • (2) electrum seeds, wallet file created pre-4.1, so lightning_xprv is non-deterministic
  • (3/a) software bip39 seeds. lightning_xprv is non-deterministic
  • (3/b) raw zprvs. lightning_xprv is non-deterministic
  • (4) watch-only/hw keystores. lightning_xprv is non-deterministic

Remarks:

  • the big question is how could this deprecation even look like?
    • disallow opening new channels, or more extreme, even start auto-closing existing channels?
    • not sure if we could ever remove such auto-closing logic, or assume there are no more wallets out there with a deprecated setup
      • Android in particular is problematic, users cannot "downgrade" the software, and some users might jump-forward many software versions at any time: someone might have a wallet file that they last opened with Electrum 4.0 and then they upgrade the code 5 years into the future to a much newer version. If the new code refuses to open the wallet file, that's a problem for the user - while on desktop they could easily revert back to an older software version, that's not possible on Android.
  • type-2 wallets we could reasonably easily deprecate: there is an existing clear-ish migration path, which the GUI has been telling users about since 4.1: they should close their channels and restore from seed.
  • for type-4, separately we are already considering auto-closing static_remotekey channels, so that would kill those off completely
  • question is, what could we do with type-3a? if we wanted to support lightning in a bip39-seeded wallet, but we kill off non-deterministic lightning, we should define some derivation paths and start deriving the keys from the seed.
    • type-3b needs extra care: a zprv might be derived from either an electrum seed or a bip39 seed (etc), and you cannot reliably distinguish those cases. Would be much easier to just disallow LN with raw zprvs.
    • the keystore does not persist the bip39 mnemonic, so we cannot distinguish an existing bip39-seeded wallet from a raw zprv
  • or do we just ultimately move towards only supporting type-1?
  • the act and approach of the deprecation itself could leave us with even more technical debt if done poorly
  • https://github.com/spesmilo/electrum/pull/10852 is an example of a bug that was introduced and not caught for a year because of this matrix being too large.

See https://github.com/spesmilo/electrum/blob/554daca66d9747686efa0ed290668738ea8245ac/electrum/wallet.py#L550 https://github.com/spesmilo/electrum/blob/554daca66d9747686efa0ed290668738ea8245ac/electrum/wallet.py#L574-L585

Prior discussions in: https://github.com/spesmilo/electrum/issues/5978 https://github.com/spesmilo/electrum/pull/7112 https://github.com/spesmilo/electrum/issues/9440