// TODO: We should remove Clone by instead requesting a new ChannelKeys copy when we create
// ChannelMonitors instead of expecting to clone the one out of the Channel into the monitors.
pub trait ChannelKeys : Send+Clone {
- /// Gets the local secret key for blinded revocation pubkey
- fn revocation_base_key<'a>(&'a self) -> &'a SecretKey;
- /// Gets the local secret key used in HTLC-Success/HTLC-Timeout txn and to_local output
- fn delayed_payment_base_key<'a>(&'a self) -> &'a SecretKey;
- /// Gets the local htlc secret key used in commitment tx htlc outputs
- fn htlc_base_key<'a>(&'a self) -> &'a SecretKey;
/// Gets the commitment seed
fn commitment_seed<'a>(&'a self) -> &'a [u8; 32];
/// Gets the local channel public keys and basepoints
}
impl ChannelKeys for InMemoryChannelKeys {
- fn revocation_base_key(&self) -> &SecretKey { &self.revocation_base_key }
- fn delayed_payment_base_key(&self) -> &SecretKey { &self.delayed_payment_base_key }
- fn htlc_base_key(&self) -> &SecretKey { &self.htlc_base_key }
fn commitment_seed(&self) -> &[u8; 32] { &self.commitment_seed }
fn pubkeys<'a>(&'a self) -> &'a ChannelPublicKeys { &self.local_channel_pubkeys }
fn key_derivation_params(&self) -> (u64, u64) { self.key_derivation_params }