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

Merge PR 'Move holder commit sig checks to `InMemorySigner`' (#4885)

Public commit record

What the developer wrote

Authored by Matt Corallo

81/100 · Strong
Merge PR 'Move holder commit sig checks to `InMemorySigner`' (#4885)

from 2026-08-signer-validates-commits into main

Reviewed-on: https://git.rust-bitcoin.org/lightningdevkit/rust-lightning/pulls/4885
Reviewed-by: Matt Corallo <matt@noreply.git.rust-bitcoin.org>
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Links an issue, advisory, or supporting reference
The short version

What changed, and why it matters

This commit moves the checks that validate a counterparty's signatures on the holder's commitment and HTLC transactions out of the general channel code and into the signer module (InMemorySigner). Previously, these signature checks were done directly inside the channel state machine. Now, the signer itself is responsible for verifying those signatures. This is a security-relevant refactor: it makes the signer the authoritative place for validating signatures, which is important for users running LDK with external or hardware signers. The commit also adds tests that corrupt signatures to ensure invalid signatures are rejected. There is no direct evidence in the commit message or diff that this fixes a known exploitable vulnerability, but it strengthens the architecture so that custom signers cannot accidentally skip these checks.

Recommended action

Review the new validate_holder_commitment implementation in InMemorySigner to confirm it correctly reconstructs funding scripts, sighashes, and HTLC transactions for all channel types (anchors, non-anchors, splicing). Ensure external signer implementations that implement ChannelSigner are updated to perform equivalent validation, since the channel code no longer checks these signatures itself. Run the new corrupted-signature tests and fuzz targets to verify no regressions.

Security signals we found

01

Moved signature validation from channel state machine into signer module

02

Added new tests that corrupt signatures and verify rejection

03

Changed error message from 'Invalid commitment tx signature from peer' / 'Invalid funding_created signature from peer' to 'Failed to validate our commitment'

04

TestChannelSigner now explicitly delegates signature validation to inner signer

05

ChannelSigner trait documentation updated to warn validating signers not to trust caller-supplied channel parameters

06

Large refactor touching 24 files with +626/-310 lines

Risk score

Why this scored 61/100

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