pub struct InMemorySigner {
pub revocation_base_key: SecretKey,
pub delayed_payment_base_key: SecretKey,
pub htlc_base_key: SecretKey,
pub commitment_seed: [u8; 32],
/* private fields */
}Expand description
A simple implementation of EcdsaChannelSigner that just keeps the private keys in memory.
This implementation performs no policy checks and is insufficient by itself as a secure external signer.
Fields§
§revocation_base_key: SecretKeyHolder secret key for blinded revocation pubkey.
delayed_payment_base_key: SecretKeyHolder secret key used in an HTLC transaction.
htlc_base_key: SecretKeyHolder HTLC secret key used in commitment transaction HTLC outputs.
commitment_seed: [u8; 32]Commitment seed.
Implementations§
Source§impl InMemorySigner
impl InMemorySigner
Sourcepub fn funding_key(&self, splice_parent_funding_txid: Option<Txid>) -> SecretKey
pub fn funding_key(&self, splice_parent_funding_txid: Option<Txid>) -> SecretKey
Holder secret key in the 2-of-2 multisig script of a channel. This key also backs the holder’s anchor output in a commitment transaction, if one is present.
Sourcepub fn sign_counterparty_payment_input<C: Signing>(
&self,
spend_tx: &Transaction,
input_idx: usize,
descriptor: &StaticPaymentOutputDescriptor,
secp_ctx: &Secp256k1<C>,
) -> Result<Witness, ()>
pub fn sign_counterparty_payment_input<C: Signing>( &self, spend_tx: &Transaction, input_idx: usize, descriptor: &StaticPaymentOutputDescriptor, secp_ctx: &Secp256k1<C>, ) -> Result<Witness, ()>
Sign the single input of spend_tx at index input_idx, which spends the output described
by descriptor, returning the witness stack for the input.
Returns an error if the input at input_idx does not exist, has a non-empty script_sig,
is not spending the outpoint described by descriptor.outpoint,
or if an output descriptor script_pubkey does not match the one we can spend.
Sourcepub fn sign_dynamic_p2wsh_input<C: Signing>(
&self,
spend_tx: &Transaction,
input_idx: usize,
descriptor: &DelayedPaymentOutputDescriptor,
secp_ctx: &Secp256k1<C>,
) -> Result<Witness, ()>
pub fn sign_dynamic_p2wsh_input<C: Signing>( &self, spend_tx: &Transaction, input_idx: usize, descriptor: &DelayedPaymentOutputDescriptor, secp_ctx: &Secp256k1<C>, ) -> Result<Witness, ()>
Sign the single input of spend_tx at index input_idx which spends the output
described by descriptor, returning the witness stack for the input.
Returns an error if the input at input_idx does not exist, has a non-empty script_sig,
is not spending the outpoint described by descriptor.outpoint, does not have a
sequence set to descriptor.to_self_delay, or if an output descriptor
script_pubkey does not match the one we can spend.
Trait Implementations§
Source§impl ChannelSigner for InMemorySigner
impl ChannelSigner for InMemorySigner
Source§fn get_per_commitment_point(
&self,
idx: u64,
secp_ctx: &Secp256k1<All>,
) -> Result<PublicKey, ()>
fn get_per_commitment_point( &self, idx: u64, secp_ctx: &Secp256k1<All>, ) -> Result<PublicKey, ()>
Source§fn release_commitment_secret(&self, idx: u64) -> Result<[u8; 32], ()>
fn release_commitment_secret(&self, idx: u64) -> Result<[u8; 32], ()>
Source§fn validate_holder_commitment(
&self,
_holder_tx: &HolderCommitmentTransaction,
_outbound_htlc_preimages: Vec<PaymentPreimage>,
) -> Result<(), ()>
fn validate_holder_commitment( &self, _holder_tx: &HolderCommitmentTransaction, _outbound_htlc_preimages: Vec<PaymentPreimage>, ) -> Result<(), ()>
Source§fn validate_counterparty_revocation(
&self,
_idx: u64,
_secret: &SecretKey,
) -> Result<(), ()>
fn validate_counterparty_revocation( &self, _idx: u64, _secret: &SecretKey, ) -> Result<(), ()>
Source§fn new_pubkeys(
&self,
splice_parent_funding_txid: Option<Txid>,
secp_ctx: &Secp256k1<All>,
) -> ChannelPublicKeys
fn new_pubkeys( &self, splice_parent_funding_txid: Option<Txid>, secp_ctx: &Secp256k1<All>, ) -> ChannelPublicKeys
Source§fn channel_keys_id(&self) -> [u8; 32]
fn channel_keys_id(&self) -> [u8; 32]
SpendableOutputDescriptor types. This should be sufficient to identify this
EcdsaChannelSigner object uniquely and lookup or re-derive its keys. Read moreSource§impl Clone for InMemorySigner
impl Clone for InMemorySigner
Source§impl EcdsaChannelSigner for InMemorySigner
impl EcdsaChannelSigner for InMemorySigner
Source§fn sign_counterparty_commitment(
&self,
channel_parameters: &ChannelTransactionParameters,
commitment_tx: &CommitmentTransaction,
_inbound_htlc_preimages: Vec<PaymentPreimage>,
_outbound_htlc_preimages: Vec<PaymentPreimage>,
secp_ctx: &Secp256k1<All>,
) -> Result<(Signature, Vec<Signature>), ()>
fn sign_counterparty_commitment( &self, channel_parameters: &ChannelTransactionParameters, commitment_tx: &CommitmentTransaction, _inbound_htlc_preimages: Vec<PaymentPreimage>, _outbound_htlc_preimages: Vec<PaymentPreimage>, secp_ctx: &Secp256k1<All>, ) -> Result<(Signature, Vec<Signature>), ()>
Source§fn sign_holder_commitment(
&self,
channel_parameters: &ChannelTransactionParameters,
commitment_tx: &HolderCommitmentTransaction,
secp_ctx: &Secp256k1<All>,
) -> Result<Signature, ()>
fn sign_holder_commitment( &self, channel_parameters: &ChannelTransactionParameters, commitment_tx: &HolderCommitmentTransaction, secp_ctx: &Secp256k1<All>, ) -> Result<Signature, ()>
Source§fn sign_justice_revoked_output(
&self,
channel_parameters: &ChannelTransactionParameters,
justice_tx: &Transaction,
input: usize,
amount: u64,
per_commitment_key: &SecretKey,
secp_ctx: &Secp256k1<All>,
) -> Result<Signature, ()>
fn sign_justice_revoked_output( &self, channel_parameters: &ChannelTransactionParameters, justice_tx: &Transaction, input: usize, amount: u64, per_commitment_key: &SecretKey, secp_ctx: &Secp256k1<All>, ) -> Result<Signature, ()>
to_local output when our counterparty broadcasts an old state. Read moreSource§fn sign_justice_revoked_htlc(
&self,
channel_parameters: &ChannelTransactionParameters,
justice_tx: &Transaction,
input: usize,
amount: u64,
per_commitment_key: &SecretKey,
htlc: &HTLCOutputInCommitment,
secp_ctx: &Secp256k1<All>,
) -> Result<Signature, ()>
fn sign_justice_revoked_htlc( &self, channel_parameters: &ChannelTransactionParameters, justice_tx: &Transaction, input: usize, amount: u64, per_commitment_key: &SecretKey, htlc: &HTLCOutputInCommitment, secp_ctx: &Secp256k1<All>, ) -> Result<Signature, ()>
Source§fn sign_holder_htlc_transaction(
&self,
htlc_tx: &Transaction,
input: usize,
htlc_descriptor: &HTLCDescriptor,
secp_ctx: &Secp256k1<All>,
) -> Result<Signature, ()>
fn sign_holder_htlc_transaction( &self, htlc_tx: &Transaction, input: usize, htlc_descriptor: &HTLCDescriptor, secp_ctx: &Secp256k1<All>, ) -> Result<Signature, ()>
htlc_tx, which spends the commitment transaction at index input. The signature returned
must be be computed using EcdsaSighashType::All. Read moreSource§fn sign_counterparty_htlc_transaction(
&self,
channel_parameters: &ChannelTransactionParameters,
htlc_tx: &Transaction,
input: usize,
amount: u64,
per_commitment_point: &PublicKey,
htlc: &HTLCOutputInCommitment,
secp_ctx: &Secp256k1<All>,
) -> Result<Signature, ()>
fn sign_counterparty_htlc_transaction( &self, channel_parameters: &ChannelTransactionParameters, htlc_tx: &Transaction, input: usize, amount: u64, per_commitment_point: &PublicKey, htlc: &HTLCOutputInCommitment, secp_ctx: &Secp256k1<All>, ) -> Result<Signature, ()>
Source§fn sign_closing_transaction(
&self,
channel_parameters: &ChannelTransactionParameters,
closing_tx: &ClosingTransaction,
secp_ctx: &Secp256k1<All>,
) -> Result<Signature, ()>
fn sign_closing_transaction( &self, channel_parameters: &ChannelTransactionParameters, closing_tx: &ClosingTransaction, secp_ctx: &Secp256k1<All>, ) -> Result<Signature, ()>
Source§fn sign_holder_keyed_anchor_input(
&self,
chan_params: &ChannelTransactionParameters,
anchor_tx: &Transaction,
input: usize,
secp_ctx: &Secp256k1<All>,
) -> Result<Signature, ()>
fn sign_holder_keyed_anchor_input( &self, chan_params: &ChannelTransactionParameters, anchor_tx: &Transaction, input: usize, secp_ctx: &Secp256k1<All>, ) -> Result<Signature, ()>
anchor_tx, which spends the commitment transaction, at index input. Read more