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

lnwallet: make jit fees configurable, add mining fees

Public commit record

What the developer wrote

Authored by f321x

85/100 · Strong
lnwallet: make jit fees configurable, add mining fees

Make the just in time channel fees and channel size
configvars, as in practice not every provider would
use the same hardcoded fees or channel sizes.
Add the mining fees required for the funding transaction on top of the
opening fees to prevent opening channels at a loss in a higher
fee environment.
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Explains rationale or failure mode
The short version

What changed, and why it matters

This commit changes how Electrum calculates fees for 'just-in-time' (JIT) Lightning channels. Previously the channel size and opening fee were hardcoded; now they are configurable settings. More importantly, the code now adds the actual Bitcoin mining fee for the funding transaction on top of the service fee, so the Lightning Service Provider (LSP) does not accidentally open channels at a loss when on-chain fees are high. It also rejects payments that would be too small after deducting those fees. This is a business-logic/economic fix rather than a remote code-execution vulnerability.

Recommended action

Review the default values and bounds (ZEROCONF_OPENING_FEE_PPM, ZEROCONF_CHANNEL_SIZE_PERCENT, ZEROCONF_MIN_OPENING_FEE) to ensure they cannot be set to unsafe values via config or RPC. Verify that funding_tx.get_fee() is always available and correctly denominated before the fee addition. Consider whether the 1,000 msat post-fee floor is sufficient for routing reliability. No urgent patch for a remote exploit is indicated by this commit alone.

Security signals we found

01

Economic/fee-calculation logic change in JIT channel opening

02

New configurable fee and channel-size parameters with defaults and bounds

03

Mining fee now explicitly included in JIT opening fee to prevent loss-making channels

04

New lower-bound check (>= 120%) on channel size percent to preserve channel reserve buffer

05

Payment rejection added when remaining amount after fees is below 1,000 msat

Risk score

Why this scored 33/100

Our methodology →
Potential impact 8/30
Exploitability 5/25
Stealth signal 4/15
Affected reach 6/15
Confidence 7/10
Evidence quality 3/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.