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

swaps: improve prepayment invoice handling

Public commit record

What the developer wrote

Authored by f321x

45/100 · Thin
swaps: improve prepayment invoice handling
✓ Descriptive subject✓ Names a concrete action or component! No meaningful explanatory body
The short version

What changed, and why it matters

This commit tightens how Electrum handles upfront 'prepayment' invoices for submarine swaps (a way to exchange on-chain and Lightning bitcoin). Previously the client calculated the prepayment using a local transaction-batcher fee estimate and had no check on what the swap server actually charged in its fee invoice. The patch switches the prepayment calculation to a known 'mining_fee' value and, crucially, rejects the swap if the server's fee invoice exceeds twice that announced mining fee. This closes a path where a malicious or buggy swap server could demand a larger prepayment than the user expected.

Recommended action

Review how self.mining_fee is negotiated or sourced from the swap server offer to ensure the bound itself cannot be manipulated; confirm the new validation is covered by tests; consider user-facing messaging when a swap is rejected due to fee mismatch.

Security signals we found

01

adds server-supplied fee bound validation

02

replaces local fee estimate with announced mining_fee for prepayment calculation

03

prevents swap server from inflating prepayment invoice

04

partial patch: does not show whether mining_fee itself is trustworthily obtained

Risk score

Why this scored 47/100

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