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

lightningd: store base and derive pubkeys locally

Public commit record

What the developer wrote

Authored by Sangbida Chaudhuri

80/100 · Strong
lightningd: store base and derive pubkeys locally

RIP to this commit there's a good chance a lot of this code doesn't even make this into the final PR. Pour one out for the fallen lines of code.

This commit is doing the rest of the derivation. There was a significant overlap between the bip32_pubkey derivation and the bip86_pubkey derivation so that has been refactored in one place.
✓ 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 commit adds experimental support for deriving Bitcoin public keys using the BIP86 standard inside Core Lightning. It stores a new base key locally in the main daemon and adds a command-line option to turn the feature on. The change also removes a dedicated HSM permission flag for BIP86 derivation, folding it into existing capability checks. There is no clear security bug in the diff, but the commit message says much of the code may not survive review, so it looks like unfinished work-in-progress.

Recommended action

Treat this as unfinished experimental code. If reviewing for merge, verify the fall-through behavior in hsmd_check_client_capabilities is intentional and that BIP86 messages still require an appropriate capability. Confirm that ld->bip86_base is securely allocated and erased, and that the experimental option is clearly marked. No immediate patch is required solely based on this diff.

Security signals we found

01

Removal of HSM permission bit HSM_PERM_DERIVE_BIP86_KEY (512) without replacing it with another explicit permission

02

Fall-through in hsmd_check_client_capabilities for WIRE_HSMD_DERIVE_BIP86_KEY / WIRE_HSMD_CHECK_BIP86_PUBKEY after deleting the return statement

03

New local storage of sensitive extended public key (bip86_base) in lightningd process

04

New experimental CLI option --use-bip86-derivation enabling alternate key derivation path

05

Duplicated comment block suggesting the code is rough/incomplete

Risk score

Why this scored 11/100

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