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

lightningd: accept OP_RETURN closer_scriptpubkey in simple-close check

Public commit record

What the developer wrote

Authored by Níckolas Goline

83/100 · Strong
lightningd: accept OP_RETURN closer_scriptpubkey in simple-close check

A peer's closing_complete may set closer_scriptpubkey to a spec-valid
OP_RETURN, but close_tx_check only whitelisted the two stored shutdown
scripts, so master rejected our own signed tx and force-closed the
channel. Accept a zero-value OP_RETURN output, only when
option_simple_close is negotiated. Adds a regression test.

Reported-by: 0xaudron
Changelog-None: option_simple_close is experimental and unreleased.
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Mentions testing or verification
The short version

What changed, and why it matters

This commit fixes a bug in Core Lightning's experimental simple-close feature. When two Lightning nodes tried to close a channel cooperatively using the new 'simple close' protocol, one peer was allowed by the specification to burn its own share of the funds to an unusable 'OP_RETURN' output instead of sending it to a normal address. Core Lightning's safety check did not recognize this valid case, so it rejected the mutually signed closing transaction and force-closed the channel on-chain instead. The fix teaches Core Lightning to accept a zero-value OP_RETURN output from the peer, but only when simple close was negotiated and only if the output carries no funds. A regression test is included.

Recommended action

Treat as a bug-fix commit with limited security impact. Reviewers should verify that is_valid_op_return correctly implements BOLT 2's length rules and that amount_sat_eq cannot be bypassed. Because the feature is experimental, no urgent release action is required, but the regression test should be run in CI.

Security signals we found

01

Denial of service / unwanted force-close: a spec-compliant peer could cause the local node to force-close a channel, incurring on-chain fees and delays.

02

Funds not stolen: the OP_RETURN output is unspendable, so accepting it cannot redirect funds to an attacker.

03

Value-zero check prevents burning real funds: the patch enforces AMOUNT_SAT(0) on the OP_RETURN output.

04

Feature-gated: the exception applies only when OPT_SIMPLE_CLOSE was negotiated.

05

Experimental feature: the changelog notes option_simple_close is experimental and unreleased, limiting real-world exposure.

Risk score

Why this scored 43/100

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