pub struct InMemorySigner {
pub funding_key: Privkey,
pub tlc_base_key: Privkey,
pub musig2_base_nonce: Privkey,
pub commitment_seed: [u8; 32],
}Expand description
A simple implementation of a channel signer that keeps the private keys in memory.
This implementation performs no policy checks and is insufficient by itself as a secure external signer.
Fields§
§funding_key: PrivkeyHolder secret key in the 2-of-2 multisig script of a channel.
tlc_base_key: PrivkeyHolder HTLC secret key used in commitment transaction HTLC outputs.
musig2_base_nonce: PrivkeySecNonce used to generate valid signature in musig.
commitment_seed: [u8; 32]Seed to derive above keys (per commitment).
Implementations§
Source§impl InMemorySigner
impl InMemorySigner
Sourcepub fn generate_from_seed(params: &[u8]) -> InMemorySigner
pub fn generate_from_seed(params: &[u8]) -> InMemorySigner
Generate an InMemorySigner from a seed.
Sourcepub fn get_base_public_keys(&self) -> ChannelBasePublicKeys
pub fn get_base_public_keys(&self) -> ChannelBasePublicKeys
Get the base public keys for this signer.
Sourcepub fn get_commitment_point(&self, commitment_number: u64) -> Pubkey
pub fn get_commitment_point(&self, commitment_number: u64) -> Pubkey
Returns the commitment point for the given commitment number.
The commitment point is the public key derived from the commitment seed and the commitment number. It is used to derive the pubkeys used in TLC (htlc and revocation outputs).
Sourcepub fn get_commitment_secret(&self, commitment_number: u64) -> [u8; 32]
pub fn get_commitment_secret(&self, commitment_number: u64) -> [u8; 32]
Returns the commitment secret for the given commitment number.
Sourcepub fn derive_tlc_key(&self, new_commitment_number: u64) -> Privkey
pub fn derive_tlc_key(&self, new_commitment_number: u64) -> Privkey
Derive the TLC key for the given commitment number.
Sourcepub fn derive_musig2_nonce(
&self,
commitment_number: u64,
context: Musig2Context,
) -> SecNonce
pub fn derive_musig2_nonce( &self, commitment_number: u64, context: Musig2Context, ) -> SecNonce
Derive a musig2 nonce for the given commitment number and context.
Trait Implementations§
Source§impl Clone for InMemorySigner
impl Clone for InMemorySigner
Source§fn clone(&self) -> InMemorySigner
fn clone(&self) -> InMemorySigner
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more