Skip to content

Make ChannelSigner solely responsible for validating commitment sigs #3878

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

tankyleo
Copy link
Contributor

As part of the custom transactions project, we want to make channel generic over any funding, htlc, and revokeable scripts used on-chain.

Hence, this commit removes the validation of holder commitment signatures from channel, as it requires building the funding, htlc, and revokeable scripts to create the expected sighash.

This signature validation is now the sole responsibility of ChannelSigner::validate_holder_commitment.

This commit updates InMemorySigner to honor this new API contract.

tankyleo added 2 commits June 21, 2025 21:50
As part of the custom transactions project, we want to make channel
generic over any funding, htlc, and revokeable scripts used on-chain.

Hence, this commit removes the validation of holder commitment
signatures from channel, as it requires building the funding, htlc, and
revokeable scripts to create the expected sighash.

This signature validation is now the sole responsibility of
`ChannelSigner::validate_holder_commitment`.

This commit updates `InMemorySigner` to honor this new API contract.
@ldk-reviews-bot
Copy link

ldk-reviews-bot commented Jun 21, 2025

👋 Thanks for assigning @TheBlueMatt as a reviewer!
I'll wait for their review and will help manage the review process.
Once they submit their review, I'll check if a second reviewer would be helpful.

@tankyleo tankyleo requested a review from TheBlueMatt June 21, 2025 22:08
Comment on lines 765 to 769
fn validate_holder_commitment(
&self, holder_tx: &HolderCommitmentTransaction,
outbound_htlc_preimages: Vec<PaymentPreimage>,
&self, channel_parameters: &ChannelTransactionParameters,
holder_tx: &HolderCommitmentTransaction, outbound_htlc_preimages: Vec<PaymentPreimage>,
secp_ctx: &Secp256k1<secp256k1::All>,
) -> Result<(), ()>;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we add a logger here ? This would add a generic on the ChannelSigner trait as far as I see.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants