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

lnwallet/chancloser: fix local session nonce rotation bug

Public commit record

What the developer wrote

Authored by Olaoluwa Osuntokun

65/100 · Adequate
lnwallet/chancloser: fix local session nonce rotation bug

We weren't properly using the latest closee nonce from the remote party
when signing.
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides an explanatory body
The short version

What changed, and why it matters

This commit fixes a bug in LND's cooperative channel-closing code for Taproot (MuSig2) channels. The wrong order of operations meant the wallet sometimes tried to create a closing signature before it had loaded the remote party's latest nonce, which could cause the cooperative close to fail with a 'final signature is invalid' error. The patch reorders the steps so the nonce is loaded first, and renames a helper function to make clear which nonce it is handling. A new test was added to enforce the correct order.

Recommended action

Reviewers should confirm that the nonce used to initialize the local MuSig2 session is always the previously committed remote closee nonce, not the freshly received NextCloseeNonce, and that the regression test covers both the success path and any failure/rollback paths. Consider whether other state transitions (e.g., RemoteOfferSent) have the same ordering assumption.

Security signals we found

01

Incorrect nonce ordering in MuSig2 cooperative close signature path

02

Potential 'final signature is invalid' failure during cooperative close

03

State-machine transition bug in RBF cooperative channel close

04

Regression test added to enforce correct initialization order

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.