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

lightningd: use BIP86 derivation in p2wpkh_for_keyidx when available

Public commit record

What the developer wrote

Authored by Sangbida Chaudhuri

85/100 · Strong
lightningd: use BIP86 derivation in p2wpkh_for_keyidx when available

When a peer doesn't support OPT_SHUTDOWN_ANYSEGWIT, we fall back to P2WPKH for the shutdown script. For BIP86 wallets, we need to use bip86_pubkey for derivation (matching p2tr_for_keyidx), otherwise the resulting script won't be recognized after restart.
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Explains rationale or failure mode
The short version

What changed, and why it matters

This change fixes a wallet bug in Core Lightning. When closing a payment channel with a peer that only supports older Bitcoin address formats, the software was deriving the refund address using the wrong key path for modern BIP86 wallets. After a restart, the wallet might not recognize those funds because it looks for keys at the BIP86 path. The patch makes the fallback address use the same derivation method as modern Taproot addresses, so the wallet can always find the funds.

Recommended action

Treat as a bug-fix patch with low-to-moderate operational/financial risk. Users relying on BIP86 wallets should upgrade to avoid potential unrecognizable channel-close outputs. No emergency response is indicated; no remote exploit vector is present.

Security signals we found

01

Funds-recovery/wallet-recognition bug in channel close fallback path

02

Incorrect key derivation path for BIP86 wallets

03

No cryptographic weakness or remote exploit introduced

Risk score

Why this scored 31/100

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