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

xpay: add regtest for blinded path fees

Public commit record

What the developer wrote

Authored by Lagrang3

68/100 · Adequate
xpay: add regtest for blinded path fees

When the paying node is the entry point to the blinded path it will send
the wrong amount to the next peer. Instead of sending AMT_MSAT it will
send AMT_MSAT+FEES_MSAT.

# we pay fees to ourselves
htlcs = l1.rpc.listhtlcs()["htlcs"]
assert len(htlcs) == 1
assert htlcs[0]["payment_hash"] == b12_decode["invoice_payment_hash"]
> assert htlcs[0]["amount_msat"] == AMT_MSAT
E assert 15000 == 10000

Changelog-None

Signed-off-by: Lagrang3 <lagrang3@protonmail.com>
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
The short version

What changed, and why it matters

This commit adds a new test case that demonstrates a bug in Core Lightning's xpay feature when paying over a 'blinded path' where the payer is the first hop. The test shows that the payer incorrectly adds fees to the amount it forwards to its direct peer, even though it is effectively paying itself. The test is marked as expected to fail (xfail), meaning the bug is known but not yet fixed in this commit. It is a test-only change, not a code fix.

Recommended action

Treat this as a known bug requiring a follow-up fix in the xpay/blinded-path routing logic. The test should be monitored; once the underlying code is fixed, the xfail marker should be removed or converted to a normal passing test. Users relying on xpay with blinded paths where they are the entry node may overpay until the bug is fixed.

Security signals we found

01

Incorrect fee handling in blinded payment path routing

02

Overpayment to direct peer due to fee double-counting when payer is blinded-path entry point

03

Test-only regression commit marked expected-to-fail, indicating an active, unfixed bug

Risk score

Why this scored 44/100

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