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

chancloser: preserve cooperative close variants

Public commit record

What the developer wrote

Authored by Olaoluwa Osuntokun

73/100 · Adequate
chancloser: preserve cooperative close variants

In this commit, we carry the selected closing-signature variant through the cooperative close state machine instead of reducing it to a single no-closee flag.

When a peer selects the closee-only transaction, we now omit the remote output while building and completing the local proposal, then reply with the matching signature field. This keeps both peers on the same transaction for legacy and taproot channels.
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Names security-relevant behavior explicitly
The short version

What changed, and why it matters

This commit fixes a bug in how the Lightning Network Daemon (LND) handles cooperative channel closes. Previously, when one peer chose a special close variant that omits the 'closee' output, the other peer would not correctly preserve that choice. This could cause both peers to build slightly different closing transactions and fail to agree on the final close. The patch makes the chosen close variant flow through the entire close process so both sides produce and sign the exact same transaction, for both older and newer taproot-style channels.

Recommended action

Reviewers should confirm that `closeSigCloseeOnly` is propagated in all close paths (not just `RemoteCloseStart`), and that omitting the remote output cannot be triggered by a malicious peer to remove a non-dust output against the BOLT spec. The new tests should be run and the change backported to affected release branches because a close-transaction mismatch can stall or break cooperative closes.

Security signals we found

01

Protocol state machine fix for cooperative close signature mismatch

02

New enum preserves all three BOLT-spec close-signature variants instead of collapsing them to a boolean

03

Adds option to omit remote closing output when building local proposal and final transaction

04

Adds tests covering legacy and taproot variants for both, closer-only, and closee-only cases

05

Adds integration test verifying both peers sign identical transaction when remote output is omitted

Risk score

Why this scored 59/100

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