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

hsmd: fix derivation for non-taproot addresses in modern mnemonic (25.12+) nodes.

Public commit record

What the developer wrote

Authored by Rusty Russell

91/100 · Strong
hsmd: fix derivation for non-taproot addresses in modern mnemonic (25.12+) nodes.

This is a fix from https://github.com/rauaap who correctly diagnosed the problem:

```
Error broadcasting transaction: error code: -26\nerror message\nmempool-script-verify-flag-failed (Script failed an OP_EQUALVERIFY operation), input 0 of ...
```

The decision to use the changed derivation for all addresses, not just
taproot, came up during review. Unfortunately, the signing code
(here) was not changed to match the address generation code (in the
wallet).

Reported-by: https://github.com/postanissue
Fixes: https://github.com/ElementsProject/lightning/issues/8804
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Changelog-Fixed: lightningd: we now correctly sign for non-taproot addresses given by nodes created by v25.12 or newer.
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Mentions testing or verification✓ Links an issue, advisory, or supporting reference
The short version

What changed, and why it matters

This commit fixes a bug where Core Lightning nodes created with a modern mnemonic (version 25.12 or newer) could not correctly sign transactions that spend from non-Taproot on-chain addresses. The address generation code was updated to use a new key derivation method for all address types, but the signing code still only used that method for Taproot addresses. As a result, the private key used to sign did not match the public key in the address, causing transaction broadcast failures with an OP_EQUALVERIFY script error. The fix makes the signing code use the new derivation for all address types when the node uses the modern mnemonic format.

Recommended action

Nodes created with v25.12+ mnemonics should upgrade to a release containing this fix if they expect to spend from non-Taproot on-chain addresses. Operators who generated non-Taproot addresses on such nodes and encountered broadcast failures should retry after upgrading. Review whether any funds sent to affected non-Taproot addresses are recoverable only after applying the fix.

Security signals we found

01

Key derivation mismatch between address generation and signing

02

Transaction broadcast failure due to invalid signature for scriptPubkey

03

OP_EQUALVERIFY script verification failure

04

Fix for regression introduced by prior derivation change

Risk score

Why this scored 62/100

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