Skip to content

Commit e885d0a

Browse files
committed
Swap key_derivation_params (u64, u64) for channel_keys_id [u8; 32]
Instead of `key_derivation_params` being a rather strange type, we call it `channel_keys_id` and give it a generic 32 byte array. This should be much clearer for users and also more flexible.
1 parent 879e309 commit e885d0a

File tree

8 files changed

+52
-52
lines changed

8 files changed

+52
-52
lines changed

fuzz/src/chanmon_consistency.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ impl KeysInterface for KeyProvider {
179179
SecretKey::from_slice(&[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, self.node_id]).unwrap(),
180180
[id, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, self.node_id],
181181
channel_value_satoshis,
182-
(0, 0),
182+
[0; 32],
183183
);
184184
let revoked_commitment = self.make_revoked_commitment_cell(keys.commitment_seed);
185185
EnforcingChannelKeys::new_with_revoked(keys, revoked_commitment, false)

fuzz/src/full_stack.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ impl KeysInterface for KeyProvider {
279279
SecretKey::from_slice(&[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, ctr]).unwrap(),
280280
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, ctr],
281281
channel_value_satoshis,
282-
(0, 0),
282+
[0; 32]
283283
)
284284
} else {
285285
InMemoryChannelKeys::new(
@@ -291,7 +291,7 @@ impl KeysInterface for KeyProvider {
291291
SecretKey::from_slice(&[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, ctr]).unwrap(),
292292
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, ctr],
293293
channel_value_satoshis,
294-
(0, 0),
294+
[0; 32]
295295
)
296296
})
297297
}

lightning/src/chain/channelmonitor.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -632,7 +632,7 @@ pub struct ChannelMonitor<ChanSigner: ChannelKeys> {
632632
counterparty_payment_script: Script,
633633
shutdown_script: Script,
634634

635-
key_derivation_params: (u64, u64),
635+
channel_keys_id: [u8; 32],
636636
holder_revocation_basepoint: PublicKey,
637637
funding_info: (OutPoint, Script),
638638
current_counterparty_commitment_txid: Option<Txid>,
@@ -728,7 +728,7 @@ impl<ChanSigner: ChannelKeys> PartialEq for ChannelMonitor<ChanSigner> {
728728
self.destination_script != other.destination_script ||
729729
self.broadcasted_holder_revokable_script != other.broadcasted_holder_revokable_script ||
730730
self.counterparty_payment_script != other.counterparty_payment_script ||
731-
self.key_derivation_params != other.key_derivation_params ||
731+
self.channel_keys_id != other.channel_keys_id ||
732732
self.holder_revocation_basepoint != other.holder_revocation_basepoint ||
733733
self.funding_info != other.funding_info ||
734734
self.current_counterparty_commitment_txid != other.current_counterparty_commitment_txid ||
@@ -786,7 +786,7 @@ impl<ChanSigner: ChannelKeys> Writeable for ChannelMonitor<ChanSigner> {
786786
self.counterparty_payment_script.write(writer)?;
787787
self.shutdown_script.write(writer)?;
788788

789-
self.key_derivation_params.write(writer)?;
789+
self.channel_keys_id.write(writer)?;
790790
self.holder_revocation_basepoint.write(writer)?;
791791
writer.write_all(&self.funding_info.0.txid[..])?;
792792
writer.write_all(&byte_utils::be16_to_array(self.funding_info.0.index))?;
@@ -967,7 +967,7 @@ impl<ChanSigner: ChannelKeys> ChannelMonitor<ChanSigner> {
967967
let counterparty_htlc_base_key = counterparty_channel_parameters.pubkeys.htlc_basepoint;
968968
let counterparty_tx_cache = CounterpartyCommitmentTransaction { counterparty_delayed_payment_base_key, counterparty_htlc_base_key, on_counterparty_tx_csv, per_htlc: HashMap::new() };
969969

970-
let key_derivation_params = keys.key_derivation_params();
970+
let channel_keys_id = keys.channel_keys_id();
971971
let holder_revocation_basepoint = keys.pubkeys().revocation_basepoint;
972972

973973
let secp_ctx = Secp256k1::new();
@@ -1006,7 +1006,7 @@ impl<ChanSigner: ChannelKeys> ChannelMonitor<ChanSigner> {
10061006
counterparty_payment_script,
10071007
shutdown_script,
10081008

1009-
key_derivation_params,
1009+
channel_keys_id,
10101010
holder_revocation_basepoint,
10111011
funding_info,
10121012
current_counterparty_commitment_txid: None,
@@ -2206,7 +2206,7 @@ impl<ChanSigner: ChannelKeys> ChannelMonitor<ChanSigner> {
22062206
per_commitment_point: broadcasted_holder_revokable_script.1,
22072207
to_self_delay: self.on_holder_tx_csv,
22082208
output: outp.clone(),
2209-
key_derivation_params: self.key_derivation_params,
2209+
channel_keys_id: self.channel_keys_id,
22102210
revocation_pubkey: broadcasted_holder_revokable_script.2.clone(),
22112211
});
22122212
break;
@@ -2215,7 +2215,7 @@ impl<ChanSigner: ChannelKeys> ChannelMonitor<ChanSigner> {
22152215
spendable_output = Some(SpendableOutputDescriptor::StaticOutputCounterpartyPayment {
22162216
outpoint: OutPoint { txid: tx.txid(), index: i as u16 },
22172217
output: outp.clone(),
2218-
key_derivation_params: self.key_derivation_params,
2218+
channel_keys_id: self.channel_keys_id,
22192219
});
22202220
break;
22212221
} else if outp.script_pubkey == self.shutdown_script {
@@ -2332,7 +2332,7 @@ impl<'a, ChanSigner: ChannelKeys, K: KeysInterface<ChanKeySigner = ChanSigner>>
23322332
let counterparty_payment_script = Readable::read(reader)?;
23332333
let shutdown_script = Readable::read(reader)?;
23342334

2335-
let key_derivation_params = Readable::read(reader)?;
2335+
let channel_keys_id = Readable::read(reader)?;
23362336
let holder_revocation_basepoint = Readable::read(reader)?;
23372337
// Technically this can fail and serialize fail a round-trip, but only for serialization of
23382338
// barely-init'd ChannelMonitors that we can't do anything with.
@@ -2547,7 +2547,7 @@ impl<'a, ChanSigner: ChannelKeys, K: KeysInterface<ChanKeySigner = ChanSigner>>
25472547
counterparty_payment_script,
25482548
shutdown_script,
25492549

2550-
key_derivation_params,
2550+
channel_keys_id,
25512551
holder_revocation_basepoint,
25522552
funding_info,
25532553
current_counterparty_commitment_txid,
@@ -2675,7 +2675,7 @@ mod tests {
26752675
SecretKey::from_slice(&[41; 32]).unwrap(),
26762676
[41; 32],
26772677
0,
2678-
(0, 0)
2678+
[0; 32]
26792679
);
26802680

26812681
let counterparty_pubkeys = ChannelPublicKeys {

lightning/src/chain/keysinterface.rs

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ pub enum SpendableOutputDescriptor {
100100
output: TxOut,
101101
/// The channel keys state used to proceed to derivation of signing key. Must
102102
/// be pass to KeysInterface::derive_channel_keys.
103-
key_derivation_params: (u64, u64),
103+
channel_keys_id: [u8; 32],
104104
/// The revocation_pubkey used to derive witnessScript
105105
revocation_pubkey: PublicKey
106106
},
@@ -118,7 +118,7 @@ pub enum SpendableOutputDescriptor {
118118
output: TxOut,
119119
/// The channel keys state used to proceed to derivation of signing key. Must
120120
/// be pass to KeysInterface::derive_channel_keys.
121-
key_derivation_params: (u64, u64),
121+
channel_keys_id: [u8; 32],
122122
}
123123
}
124124

@@ -130,22 +130,20 @@ impl Writeable for SpendableOutputDescriptor {
130130
outpoint.write(writer)?;
131131
output.write(writer)?;
132132
},
133-
&SpendableOutputDescriptor::DynamicOutputP2WSH { ref outpoint, ref per_commitment_point, ref to_self_delay, ref output, ref key_derivation_params, ref revocation_pubkey } => {
133+
&SpendableOutputDescriptor::DynamicOutputP2WSH { ref outpoint, ref per_commitment_point, ref to_self_delay, ref output, ref channel_keys_id, ref revocation_pubkey } => {
134134
1u8.write(writer)?;
135135
outpoint.write(writer)?;
136136
per_commitment_point.write(writer)?;
137137
to_self_delay.write(writer)?;
138138
output.write(writer)?;
139-
key_derivation_params.0.write(writer)?;
140-
key_derivation_params.1.write(writer)?;
139+
channel_keys_id.write(writer)?;
141140
revocation_pubkey.write(writer)?;
142141
},
143-
&SpendableOutputDescriptor::StaticOutputCounterpartyPayment { ref outpoint, ref output, ref key_derivation_params } => {
142+
&SpendableOutputDescriptor::StaticOutputCounterpartyPayment { ref outpoint, ref output, ref channel_keys_id } => {
144143
2u8.write(writer)?;
145144
outpoint.write(writer)?;
146145
output.write(writer)?;
147-
key_derivation_params.0.write(writer)?;
148-
key_derivation_params.1.write(writer)?;
146+
channel_keys_id.write(writer)?;
149147
},
150148
}
151149
Ok(())
@@ -164,13 +162,13 @@ impl Readable for SpendableOutputDescriptor {
164162
per_commitment_point: Readable::read(reader)?,
165163
to_self_delay: Readable::read(reader)?,
166164
output: Readable::read(reader)?,
167-
key_derivation_params: (Readable::read(reader)?, Readable::read(reader)?),
165+
channel_keys_id: Readable::read(reader)?,
168166
revocation_pubkey: Readable::read(reader)?,
169167
}),
170168
2u8 => Ok(SpendableOutputDescriptor::StaticOutputCounterpartyPayment {
171169
outpoint: Readable::read(reader)?,
172170
output: Readable::read(reader)?,
173-
key_derivation_params: (Readable::read(reader)?, Readable::read(reader)?),
171+
channel_keys_id: Readable::read(reader)?,
174172
}),
175173
_ => Err(DecodeError::InvalidValue),
176174
}
@@ -221,10 +219,10 @@ pub trait ChannelKeys : Send+Clone + Writeable {
221219
fn release_commitment_secret(&self, idx: u64) -> [u8; 32];
222220
/// Gets the holder's channel public keys and basepoints
223221
fn pubkeys(&self) -> &ChannelPublicKeys;
224-
/// Gets arbitrary identifiers describing the set of keys which are provided back to you in
225-
/// some SpendableOutputDescriptor types. These should be sufficient to identify this
222+
/// Gets an arbitrary identifier describing the set of keys which are provided back to you in
223+
/// some SpendableOutputDescriptor types. This should be sufficient to identify this
226224
/// ChannelKeys object uniquely and lookup or re-derive its keys.
227-
fn key_derivation_params(&self) -> (u64, u64);
225+
fn channel_keys_id(&self) -> [u8; 32];
228226

229227
/// Create a signature for a counterparty's commitment transaction and associated HTLC transactions.
230228
///
@@ -375,7 +373,7 @@ pub struct InMemoryChannelKeys {
375373
/// The total value of this channel
376374
channel_value_satoshis: u64,
377375
/// Key derivation parameters
378-
key_derivation_params: (u64, u64),
376+
channel_keys_id: [u8; 32],
379377
}
380378

381379
impl InMemoryChannelKeys {
@@ -389,7 +387,7 @@ impl InMemoryChannelKeys {
389387
htlc_base_key: SecretKey,
390388
commitment_seed: [u8; 32],
391389
channel_value_satoshis: u64,
392-
key_derivation_params: (u64, u64)) -> InMemoryChannelKeys {
390+
channel_keys_id: [u8; 32]) -> InMemoryChannelKeys {
393391
let holder_channel_pubkeys =
394392
InMemoryChannelKeys::make_holder_keys(secp_ctx, &funding_key, &revocation_base_key,
395393
&payment_key, &delayed_payment_base_key,
@@ -404,7 +402,7 @@ impl InMemoryChannelKeys {
404402
channel_value_satoshis,
405403
holder_channel_pubkeys,
406404
channel_parameters: None,
407-
key_derivation_params,
405+
channel_keys_id,
408406
}
409407
}
410408

@@ -468,7 +466,7 @@ impl ChannelKeys for InMemoryChannelKeys {
468466
}
469467

470468
fn pubkeys(&self) -> &ChannelPublicKeys { &self.holder_channel_pubkeys }
471-
fn key_derivation_params(&self) -> (u64, u64) { self.key_derivation_params }
469+
fn channel_keys_id(&self) -> [u8; 32] { self.channel_keys_id }
472470

473471
fn sign_counterparty_commitment<T: secp256k1::Signing + secp256k1::Verification>(&self, commitment_tx: &CommitmentTransaction, secp_ctx: &Secp256k1<T>) -> Result<(Signature, Vec<Signature>), ()> {
474472
let trusted_tx = commitment_tx.trust();
@@ -600,8 +598,7 @@ impl Writeable for InMemoryChannelKeys {
600598
self.commitment_seed.write(writer)?;
601599
self.channel_parameters.write(writer)?;
602600
self.channel_value_satoshis.write(writer)?;
603-
self.key_derivation_params.0.write(writer)?;
604-
self.key_derivation_params.1.write(writer)?;
601+
self.channel_keys_id.write(writer)?;
605602

606603
Ok(())
607604
}
@@ -622,8 +619,7 @@ impl Readable for InMemoryChannelKeys {
622619
InMemoryChannelKeys::make_holder_keys(&secp_ctx, &funding_key, &revocation_base_key,
623620
&payment_key, &delayed_payment_base_key,
624621
&htlc_base_key);
625-
let params_1 = Readable::read(reader)?;
626-
let params_2 = Readable::read(reader)?;
622+
let keys_id = Readable::read(reader)?;
627623

628624
Ok(InMemoryChannelKeys {
629625
funding_key,
@@ -635,7 +631,7 @@ impl Readable for InMemoryChannelKeys {
635631
channel_value_satoshis,
636632
holder_channel_pubkeys,
637633
channel_parameters: counterparty_channel_data,
638-
key_derivation_params: (params_1, params_2),
634+
channel_keys_id: keys_id,
639635
})
640636
}
641637
}
@@ -731,19 +727,19 @@ impl KeysManager {
731727
/// Derive an old set of ChannelKeys for per-channel secrets based on a key derivation
732728
/// parameters.
733729
/// Key derivation parameters are accessible through a per-channel secrets
734-
/// ChannelKeys::key_derivation_params and is provided inside DynamicOuputP2WSH in case of
730+
/// ChannelKeys::channel_keys_id and is provided inside DynamicOuputP2WSH in case of
735731
/// onchain output detection for which a corresponding delayed_payment_key must be derived.
736-
pub fn derive_channel_keys(&self, channel_value_satoshis: u64, params_1: u64, params_2: u64) -> InMemoryChannelKeys {
737-
let chan_id = ((params_1 & 0xFFFF_FFFF_0000_0000) >> 32) as u32;
732+
pub fn derive_channel_keys(&self, channel_value_satoshis: u64, params: &[u8; 32]) -> InMemoryChannelKeys {
733+
let chan_id = byte_utils::slice_to_be64(&params[0..8]);
734+
assert!(chan_id <= std::u32::MAX as u64); // Otherwise the params field wasn't created by us
738735
let mut unique_start = Sha256::engine();
739-
unique_start.input(&byte_utils::be64_to_array(params_2));
740-
unique_start.input(&byte_utils::be32_to_array(params_1 as u32));
736+
unique_start.input(params);
741737
unique_start.input(&self.seed);
742738

743739
// We only seriously intend to rely on the channel_master_key for true secure
744740
// entropy, everything else just ensures uniqueness. We rely on the unique_start (ie
745741
// starting_time provided in the constructor) to be unique.
746-
let child_privkey = self.channel_master_key.ckd_priv(&self.secp_ctx, ChildNumber::from_hardened_idx(chan_id).expect("key space exhausted")).expect("Your RNG is busted");
742+
let child_privkey = self.channel_master_key.ckd_priv(&self.secp_ctx, ChildNumber::from_hardened_idx(chan_id as u32).expect("key space exhausted")).expect("Your RNG is busted");
747743
unique_start.input(&child_privkey.private_key.key[..]);
748744

749745
let seed = Sha256::from_engine(unique_start).into_inner();
@@ -778,7 +774,7 @@ impl KeysManager {
778774
htlc_base_key,
779775
commitment_seed,
780776
channel_value_satoshis,
781-
(params_1, params_2),
777+
params.clone()
782778
)
783779
}
784780
}
@@ -800,8 +796,12 @@ impl KeysInterface for KeysManager {
800796

801797
fn get_channel_keys(&self, _inbound: bool, channel_value_satoshis: u64) -> Self::ChanKeySigner {
802798
let child_ix = self.channel_child_index.fetch_add(1, Ordering::AcqRel);
803-
let ix_and_nanos: u64 = (child_ix as u64) << 32 | (self.starting_time_nanos as u64);
804-
self.derive_channel_keys(channel_value_satoshis, ix_and_nanos, self.starting_time_secs)
799+
assert!(child_ix <= std::u32::MAX as usize);
800+
let mut id = [0; 32];
801+
id[0..8].copy_from_slice(&byte_utils::be64_to_array(child_ix as u64));
802+
id[8..16].copy_from_slice(&byte_utils::be64_to_array(self.starting_time_nanos as u64));
803+
id[16..24].copy_from_slice(&byte_utils::be64_to_array(self.starting_time_secs));
804+
self.derive_channel_keys(channel_value_satoshis, &id)
805805
}
806806

807807
fn get_secure_random_bytes(&self) -> [u8; 32] {

lightning/src/ln/channel.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4657,7 +4657,7 @@ mod tests {
46574657
// These aren't set in the test vectors:
46584658
[0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff],
46594659
10_000_000,
4660-
(0, 0)
4660+
[0; 32]
46614661
);
46624662

46634663
assert_eq!(chan_keys.pubkeys().funding_pubkey.serialize()[..],

lightning/src/ln/functional_tests.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4662,7 +4662,7 @@ macro_rules! check_spendable_outputs {
46624662
Event::SpendableOutputs { ref outputs } => {
46634663
for outp in outputs {
46644664
match *outp {
4665-
SpendableOutputDescriptor::StaticOutputCounterpartyPayment { ref outpoint, ref output, ref key_derivation_params } => {
4665+
SpendableOutputDescriptor::StaticOutputCounterpartyPayment { ref outpoint, ref output, ref channel_keys_id } => {
46664666
let input = TxIn {
46674667
previous_output: outpoint.into_bitcoin_outpoint(),
46684668
script_sig: Script::new(),
@@ -4681,7 +4681,7 @@ macro_rules! check_spendable_outputs {
46814681
};
46824682
spend_tx.output[0].value -= (spend_tx.get_weight() + 2 + 1 + 73 + 35 + 3) as u64 / 4; // (Max weight + 3 (to round up)) / 4
46834683
let secp_ctx = Secp256k1::new();
4684-
let keys = $keysinterface.derive_channel_keys($chan_value, key_derivation_params.0, key_derivation_params.1);
4684+
let keys = $keysinterface.derive_channel_keys($chan_value, channel_keys_id);
46854685
let remotepubkey = keys.pubkeys().payment_point;
46864686
let witness_script = Address::p2pkh(&::bitcoin::PublicKey{compressed: true, key: remotepubkey}, Network::Testnet).script_pubkey();
46874687
let sighash = Message::from_slice(&bip143::SigHashCache::new(&spend_tx).signature_hash(0, &witness_script, output.value, SigHashType::All)[..]).unwrap();
@@ -4691,7 +4691,7 @@ macro_rules! check_spendable_outputs {
46914691
spend_tx.input[0].witness.push(remotepubkey.serialize().to_vec());
46924692
txn.push(spend_tx);
46934693
},
4694-
SpendableOutputDescriptor::DynamicOutputP2WSH { ref outpoint, ref per_commitment_point, ref to_self_delay, ref output, ref key_derivation_params, ref revocation_pubkey } => {
4694+
SpendableOutputDescriptor::DynamicOutputP2WSH { ref outpoint, ref per_commitment_point, ref to_self_delay, ref output, ref channel_keys_id, ref revocation_pubkey } => {
46954695
let input = TxIn {
46964696
previous_output: outpoint.into_bitcoin_outpoint(),
46974697
script_sig: Script::new(),
@@ -4709,7 +4709,7 @@ macro_rules! check_spendable_outputs {
47094709
output: vec![outp],
47104710
};
47114711
let secp_ctx = Secp256k1::new();
4712-
let keys = $keysinterface.derive_channel_keys($chan_value, key_derivation_params.0, key_derivation_params.1);
4712+
let keys = $keysinterface.derive_channel_keys($chan_value, channel_keys_id);
47134713
if let Ok(delayed_payment_key) = chan_utils::derive_private_key(&secp_ctx, &per_commitment_point, &keys.inner.delayed_payment_base_key) {
47144714

47154715
let delayed_payment_pubkey = PublicKey::from_secret_key(&secp_ctx, &delayed_payment_key);

lightning/src/util/enforcing_trait_impls.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ impl ChannelKeys for EnforcingChannelKeys {
8989
}
9090

9191
fn pubkeys(&self) -> &ChannelPublicKeys { self.inner.pubkeys() }
92-
fn key_derivation_params(&self) -> (u64, u64) { self.inner.key_derivation_params() }
92+
fn channel_keys_id(&self) -> [u8; 32] { self.inner.channel_keys_id() }
9393

9494
fn sign_counterparty_commitment<T: secp256k1::Signing + secp256k1::Verification>(&self, commitment_tx: &CommitmentTransaction, secp_ctx: &Secp256k1<T>) -> Result<(Signature, Vec<Signature>), ()> {
9595
self.verify_counterparty_commitment_tx(commitment_tx, secp_ctx);

lightning/src/util/test_utils.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -482,8 +482,8 @@ impl TestKeysInterface {
482482
revoked_commitments: Mutex::new(HashMap::new()),
483483
}
484484
}
485-
pub fn derive_channel_keys(&self, channel_value_satoshis: u64, user_id_1: u64, user_id_2: u64) -> EnforcingChannelKeys {
486-
let keys = self.backing.derive_channel_keys(channel_value_satoshis, user_id_1, user_id_2);
485+
pub fn derive_channel_keys(&self, channel_value_satoshis: u64, id: &[u8; 32]) -> EnforcingChannelKeys {
486+
let keys = self.backing.derive_channel_keys(channel_value_satoshis, id);
487487
let revoked_commitment = self.make_revoked_commitment_cell(keys.commitment_seed);
488488
EnforcingChannelKeys::new_with_revoked(keys, revoked_commitment, self.disable_revocation_policy_check)
489489
}

0 commit comments

Comments
 (0)