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

reverse swaps: in the CLI, replace 'server_mining_fee' with 'prepayment', which corresponds to the trusted part of the lightning payment.

Public commit record

What the developer wrote

Authored by ThomasV

73/100 · Adequate
reverse swaps: in the CLI, replace 'server_mining_fee' with
'prepayment', which corresponds to the trusted part of the
lightning payment.

We use 2*sm.mining_fee, where 'mining_fee' is the flat part of
the server fee. However, future protocol should probably allow
to set a value that does not depend on 'mining_fee'.
(note that LND uses a hardcoded amount).
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
The short version

What changed, and why it matters

This commit renames and doubles a fee parameter used when doing reverse submarine swaps (a way to move funds from Lightning back to on-chain Bitcoin) in the Electrum wallet. The old name suggested it was just the swap provider's mining fee; the new name, 'prepayment', reflects that the user must pay this amount upfront over Lightning and trust the provider to return it if the swap fails. The change is mostly a terminology and parameter refactor, but it also adjusts the safety check so the allowed prepayment equals twice the mining fee rather than twice the prepayment. There is no direct evidence in the commit that this fixes an active security vulnerability.

Recommended action

Treat this as a routine refactor with minor security-relevant clarification rather than a vulnerability fix. Reviewers should verify that `prepayment_sat` is always derived as `2 * mining_fee` and that the new validation `fee_lnaddr.get_amount_sat() > prepayment_sat` does not accidentally allow larger fee invoices when callers pass a custom prepayment. If the protocol later allows arbitrary prepayments, stricter server-side/user confirmation checks should be added.

Security signals we found

01

Parameter rename clarifies a trusted prepayment rather than a pure mining fee

02

Validation threshold changed from `server_mining_fee_sat * 2` to `prepayment_sat`

03

User-visible CLI argument renamed and documented as non-trustless

04

No bounds check or input sanitization changes beyond the rename

Risk score

Why this scored 28/100

Our methodology →
Potential impact 5/30
Exploitability 5/25
Stealth signal 5/15
Affected reach 5/15
Confidence 5/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.