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

hsmd/libhsmd: change hsmd_init to have secret_data and secret_len

Public commit record

What the developer wrote

Authored by Sangbida Chaudhuri

73/100 · Adequate
hsmd/libhsmd: change hsmd_init to have secret_data and secret_len

hsmd: plumb length-aware secret into hsmd_init; keep 32B mirror

BIP86 (from BIP39) wants the full 64-byte BIP32 seed. This commit plumbs a variable-length (32/64B) secret into hsmd and uses the accessors from the previous commit. We keep the old 32B hsm_secret mirror and, for now, only use the first 32 bytes so legacy paths keep working.

Spoiler: HKDFs will keep using the 32B seed; only wallet address derivation
will switch to the full 64B in a follow-up.
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
The short version

What changed, and why it matters

This is a preparatory code change for Core Lightning's HSM (the component that holds private keys). It changes an internal function so it can accept either a 32-byte or 64-byte root secret, keeping the existing 32-byte behavior intact. The commit itself does not change how keys are actually derived or fix any known vulnerability; it is plumbing for a future feature (BIP86 wallet addresses).

Recommended action

No immediate security action required. Treat as normal feature/refactor commit. Review the follow-up commits that actually switch wallet address derivation to the 64-byte seed to ensure correct handling of seed length and legacy compatibility.

Security signals we found

01

Refactor of HSM root secret handling with variable-length input

02

Use of sodium_mlock on the new variable-length seed

03

Use of notleak/tal_dup_arr to prevent memory-leak scanner false positives

04

Legacy 32-byte mirror retained for backward compatibility

05

No functional change to key derivation in this commit

Risk score

Why this scored 18/100

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