Skip to content

Commit 61c28c1

Browse files
committed
Expose TxCreationKeys in LocalCommitmentTransaction via a method
This makes it obvious to signer implementers that the pre-derived keys are a local cache and should not be trusted in a validating signer.
1 parent e0fad6f commit 61c28c1

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

lightning/src/ln/chan_utils.rs

+7-2
Original file line numberDiff line numberDiff line change
@@ -535,8 +535,7 @@ pub struct LocalCommitmentTransaction {
535535
// Which order the signatures should go in when constructing the final commitment tx witness.
536536
// The user should be able to reconstruc this themselves, so we don't bother to expose it.
537537
our_sig_first: bool,
538-
/// The key derivation parameters for this commitment transaction
539-
pub local_keys: TxCreationKeys,
538+
pub(crate) local_keys: TxCreationKeys,
540539
/// The feerate paid per 1000-weight-unit in this commitment transaction. This value is
541540
/// controlled by the channel initiator.
542541
pub feerate_per_kw: u32,
@@ -601,6 +600,12 @@ impl LocalCommitmentTransaction {
601600
}
602601
}
603602

603+
/// The pre-calculated transaction creation public keys.
604+
/// An external validating signer should not trust these keys.
605+
pub fn trust_key_derivation(&self) -> &TxCreationKeys {
606+
&self.local_keys
607+
}
608+
604609
/// Get the txid of the local commitment transaction contained in this
605610
/// LocalCommitmentTransaction
606611
pub fn txid(&self) -> Txid {

0 commit comments

Comments
 (0)