Add funding redeem script to `SplicePending' event
What changed, and why it matters
This commit adds the funding redeem script (the cryptographic lock script for a Lightning channel's funding output) to the SplicePending event that LDK emits when a splice is being negotiated. It is an API/data-visibility change, not a logic fix. There is no direct evidence in the commit that this resolves a security vulnerability; it appears to give downstream wallet software the information it needs to recognize and spend the new funding output after a splice.
Treat as a routine feature/API completeness patch. Review downstream consumers of Event::SplicePending to ensure they handle the new field and persist it if needed for recovery/backup. No urgent security action is indicated by the diff alone.
Security signals we found
Adds previously omitted cryptographic material (funding redeem script) to a public event
Could reduce operational risk of lost/ unspendable splice funding UTXOs for downstream wallets
No signature, authorization, or state-machine logic changes observed
No vendor disclosure or CVE references present in commit or supplied materials
Evidence from the diff
The change threads funding_redeem_script from Channel::SpliceFundingNegotiated through ChannelManager into Event::SplicePending, and serializes it as TLV field 11. The redeem script is required to construct the witness that spends the 2-of-2 multisig funding output. Previously the event only exposed the new funding txo and channel type; without the redeem script, an event consumer might be unable to identify or spend the new splice funding UTXO in some wallet flows. The commit is additive (+15 lines, no deletions) and does not alter consensus, signature, or transaction validation logic.
Changed components
lightning/src/events/mod.rslightning/src/ln/channel.rslightning/src/ln/channelmanager.rsEvent::SplicePending serialization/deserializationSpliceFundingNegotiated structInspect captured patch +15 / −0
diff --git a/lightning/src/events/mod.rs b/lightning/src/events/mod.rs
index 3c52016..b9c4b1c 100644
--- a/lightning/src/events/mod.rs
+++ b/lightning/src/events/mod.rs
@@ -1536,6 +1536,8 @@ pub enum Event {
/// The features that this channel will operate with. Currently, these will be the same
/// features that the channel was opened with, but in the future splices may change them.
channel_type: ChannelTypeFeatures,
+ /// The witness script that is used to lock the channel's funding output to commitment transactions.
+ new_funding_redeem_script: ScriptBuf,
},
/// Used to indicate that a splice for the given `channel_id` has failed.
///
@@ -2313,6 +2315,7 @@ impl Writeable for Event {
ref counterparty_node_id,
ref new_funding_txo,
ref channel_type,
+ ref new_funding_redeem_script,
} => {
50u8.write(writer)?;
write_tlv_fields!(writer, {
@@ -2321,6 +2324,7 @@ impl Writeable for Event {
(5, user_channel_id, required),
(7, counterparty_node_id, required),
(9, new_funding_txo, required),
+ (11, new_funding_redeem_script, required),
});
},
&Event::SpliceFailed {
@@ -2936,6 +2940,7 @@ impl MaybeReadable for Event {
(5, user_channel_id, required),
(7, counterparty_node_id, required),
(9, new_funding_txo, required),
+ (11, new_funding_redeem_script, required),
});
Ok(Some(Event::SplicePending {
@@ -2944,6 +2949,7 @@ impl MaybeReadable for Event {
counterparty_node_id: counterparty_node_id.0.unwrap(),
new_funding_txo: new_funding_txo.0.unwrap(),
channel_type: channel_type.0.unwrap(),
+ new_funding_redeem_script: new_funding_redeem_script.0.unwrap(),
}))
};
f()
diff --git a/lightning/src/ln/channel.rs b/lightning/src/ln/channel.rs
index 0595d6d..54bae46 100644
--- a/lightning/src/ln/channel.rs
+++ b/lightning/src/ln/channel.rs
@@ -6862,6 +6862,9 @@ pub struct SpliceFundingNegotiated {
/// The features that this channel will operate with.
pub channel_type: ChannelTypeFeatures,
+
+ /// The redeem script of the funding output.
+ pub funding_redeem_script: ScriptBuf,
}
/// Information about a splice funding negotiation that has failed.
@@ -8939,12 +8942,14 @@ where
let funding_txo =
funding.get_funding_txo().expect("funding outpoint should be set");
let channel_type = funding.get_channel_type().clone();
+ let funding_redeem_script = funding.get_funding_redeemscript();
pending_splice.negotiated_candidates.push(funding);
let splice_negotiated = SpliceFundingNegotiated {
funding_txo: funding_txo.into_bitcoin_outpoint(),
channel_type,
+ funding_redeem_script,
};
let splice_locked = pending_splice.check_get_splice_locked(
diff --git a/lightning/src/ln/channelmanager.rs b/lightning/src/ln/channelmanager.rs
index 23b68dd..399c51b 100644
--- a/lightning/src/ln/channelmanager.rs
+++ b/lightning/src/ln/channelmanager.rs
@@ -6489,6 +6489,8 @@ where
user_channel_id: chan.context.get_user_id(),
new_funding_txo: splice_negotiated.funding_txo,
channel_type: splice_negotiated.channel_type,
+ new_funding_redeem_script: splice_negotiated
+ .funding_redeem_script,
},
None,
));
@@ -9732,6 +9734,7 @@ This indicates a bug inside LDK. Please report this error at https://github.com/
user_channel_id: channel.context.get_user_id(),
new_funding_txo: splice_negotiated.funding_txo,
channel_type: splice_negotiated.channel_type,
+ new_funding_redeem_script: splice_negotiated.funding_redeem_script,
},
None,
));
@@ -10801,6 +10804,7 @@ This indicates a bug inside LDK. Please report this error at https://github.com/
user_channel_id: chan.context.get_user_id(),
new_funding_txo: splice_negotiated.funding_txo,
channel_type: splice_negotiated.channel_type,
+ new_funding_redeem_script: splice_negotiated.funding_redeem_script,
},
None,
));
Why this scored 19/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.