AI-generated analysisPublished automatically and not human-verified. Validated context appears in community notes below.
← Watch feed
Low 44 Bitcoin

wallet: disable_keystore: block only while lightning needs the keystore

Public commit record

What the developer wrote

Authored by Sander van Grieken

73/100 · Adequate
wallet: disable_keystore: block only while lightning needs the keystore

lnworker itself does not need the keystore, it uses lightning_xprv or
lightning_privkey2. However, without keystore it can't sweep the outputs
of force-closed or bump anchor channel closes, or claim or refund submarine
swaps.

Block disabling the keystore while there are channels that are not fully
closed, or pending submarine swaps.
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
The short version

What changed, and why it matters

This commit tightens a safety check in the Electrum Bitcoin wallet. Previously, Electrum blocked users from making a keystore 'watching-only' if they had any Lightning channels at all. The new logic only blocks this when Lightning actually still needs the keystore to recover funds, such as when a channel is not fully closed or a submarine swap is pending. Making the keystore watching-only at the wrong time could prevent the wallet from signing transactions needed to sweep funds after a force-close or to complete/refund swaps, potentially causing loss of funds. The change is defensive and reduces the window of risk.

Recommended action

No immediate user action required. This is a hardening patch. Users should keep Electrum updated and avoid making a keystore watching-only while Lightning channels are active or swaps are pending. Developers should ensure the new `lightning_needs_keystore()` predicate remains consistent with any future Lightning recovery flows that require on-chain signing.

Security signals we found

01

Funds-loss prevention: disabling keystore while Lightning still needs on-chain signing could lock user funds

02

Defense in depth: adds both GUI and backend (`disable_keystore`) enforcement

03

Lightning channel lifecycle edge case: force-closed channels and anchor close fee-bumping

04

Submarine swap refund/claim edge case

05

Test coverage added for the new guard

Risk score

Why this scored 44/100

Our methodology →
Potential impact 12/30
Exploitability 5/25
Stealth signal 8/15
Affected reach 7/15
Confidence 8/10
Evidence quality 4/5
Human-validated context

Community notes

Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.

No validated notes yet.

The AI analysis stands alone for now. Submit a note if you can add evidence or important context.