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

common/close_tx: add `create_simple_close_tx()` for `option_simple_close`

Public commit record

What the developer wrote

Authored by Níckolas Goline

73/100 · Adequate
common/close_tx: add `create_simple_close_tx()` for `option_simple_close`

Adds the BOLT3 simple closing transaction builder:
- sequence 0xFFFFFFFD (RBF-signalling)
- locktime from closing_complete
- closer pays fee (their output is reduced)
- dust outputs are omitted and a zero-value OP_RETURN is used when both outputs would be dust.
✓ Specific, 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 helper function that builds a specific kind of Bitcoin closing transaction used by the Core Lightning node software when two channel peers agree on a simpler cooperative close. It follows the BOLT 3 specification, sets the transaction version and sequence number to signal replace-by-fee, uses a locktime supplied by the peer that initiated the close, subtracts the closing fee from the closer's output, and drops tiny 'dust' outputs by turning them into zero-value data outputs. There is no indication in the commit that this fixes a security bug; it appears to be a feature implementation for a new protocol option.

Recommended action

No immediate security action required. Reviewers may want to verify that callers of create_simple_close_tx() correctly compute closer_amount (closer balance minus fee) and handle the NULL-return case when both outputs are dust, and that the new function is covered by tests before it is used in production paths.

Security signals we found

01

New feature code, not a patch of existing vulnerable code

02

Follows explicit BOLT 3 specification for option_simple_close

03

Uses standard nSequence 0xFFFFFFFD RBF signalling

04

OP_RETURN outputs are forced to zero value, matching protocol requirement

05

No input validation changes, no memory-safety fixes, no bug fixes evident in diff

Risk score

Why this scored 12/100

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