pub struct DynSigner {
pub inner: Box<dyn InnerSign>,
}Expand description
A ChannelSigner derived struct allowing run-time selection of a signer
Fields§
§inner: Box<dyn InnerSign>Implementations§
Trait Implementations§
Source§impl ChannelSigner for DynSigner
impl ChannelSigner for DynSigner
Source§fn validate_counterparty_revocation(
&self,
idx: u64,
sk: &SecretKey,
) -> Result<(), ()>
fn validate_counterparty_revocation( &self, idx: u64, sk: &SecretKey, ) -> Result<(), ()>
Validate the counterparty’s revocation. Read more
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, ()>
Gets the per-commitment point for a specific commitment number Read more
Source§fn release_commitment_secret(&self, idx: u64) -> Result<[u8; 32], ()>
fn release_commitment_secret(&self, idx: u64) -> Result<[u8; 32], ()>
Gets the commitment secret for a specific commitment number as part of the revocation process Read more
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<(), ()>
Validate the counterparty’s signatures on the holder commitment transaction and HTLCs. Read more
Source§fn pubkeys(&self, secp_ctx: &Secp256k1<All>) -> ChannelPublicKeys
fn pubkeys(&self, secp_ctx: &Secp256k1<All>) -> ChannelPublicKeys
Returns the holder channel public keys and basepoints. This should only be called once
during channel creation and as such implementations are allowed undefined behavior if
called more than once. Read more
Source§fn new_funding_pubkey(
&self,
splice_parent_funding_txid: Txid,
secp_ctx: &Secp256k1<All>,
) -> PublicKey
fn new_funding_pubkey( &self, splice_parent_funding_txid: Txid, secp_ctx: &Secp256k1<All>, ) -> PublicKey
Returns a new funding pubkey (i.e. our public which is used in a 2-of-2 with the
counterparty’s key to to lock the funds on-chain) for a spliced channel. Read more
Source§fn channel_keys_id(&self) -> [u8; 32]
fn channel_keys_id(&self) -> [u8; 32]
Returns an arbitrary identifier describing the set of keys which are provided back to you in
some
SpendableOutputDescriptor types. This should be sufficient to identify this
EcdsaChannelSigner object uniquely and lookup or re-derive its keys. Read moreSource§impl EcdsaChannelSigner for DynSigner
impl EcdsaChannelSigner for DynSigner
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>), ()>
Create a signature for a counterparty’s commitment transaction and associated HTLC transactions. Read more
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, ()>
Creates a signature for a holder’s commitment transaction. Read more
Source§fn unsafe_sign_holder_commitment(
&self,
channel_parameters: &ChannelTransactionParameters,
commitment_tx: &HolderCommitmentTransaction,
secp_ctx: &Secp256k1<All>,
) -> Result<Signature, ()>
fn unsafe_sign_holder_commitment( &self, channel_parameters: &ChannelTransactionParameters, commitment_tx: &HolderCommitmentTransaction, secp_ctx: &Secp256k1<All>, ) -> Result<Signature, ()>
Same as [
sign_holder_commitment], but exists only for tests to get access to holder
commitment transactions which will be broadcasted later, after the channel has moved on to a
newer state. Thus, needs its own method as [sign_holder_commitment] may enforce that we
only ever get called once. Read moreSource§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, ()>
Create a signature for the given input in a transaction spending an HTLC transaction output
or a commitment transaction
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, ()>
Create a signature for the given input in a transaction spending a commitment transaction
HTLC output when our counterparty broadcasts an old state. Read more
Source§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, ()>
Create a signature for a claiming transaction for a HTLC output on a counterparty’s commitment
transaction, either offered or received. Read more
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, ()>
Create a signature for a (proposed) closing transaction. Read more
Source§fn sign_channel_announcement_with_funding_key(
&self,
channel_parameters: &ChannelTransactionParameters,
msg: &UnsignedChannelAnnouncement,
secp_ctx: &Secp256k1<All>,
) -> Result<Signature, ()>
fn sign_channel_announcement_with_funding_key( &self, channel_parameters: &ChannelTransactionParameters, msg: &UnsignedChannelAnnouncement, secp_ctx: &Secp256k1<All>, ) -> Result<Signature, ()>
Signs a channel announcement message with our funding key proving it comes from one of the
channel participants. Read more
Source§fn sign_holder_keyed_anchor_input(
&self,
channel_parameters: &ChannelTransactionParameters,
anchor_tx: &Transaction,
input: usize,
secp_ctx: &Secp256k1<All>,
) -> Result<Signature, ()>
fn sign_holder_keyed_anchor_input( &self, channel_parameters: &ChannelTransactionParameters, anchor_tx: &Transaction, input: usize, secp_ctx: &Secp256k1<All>, ) -> Result<Signature, ()>
Computes the signature for a commitment transaction’s keyed anchor output used as an
input within
anchor_tx, which spends the commitment transaction, at index input. Read moreSource§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, ()>
Computes the signature for a commitment transaction’s HTLC output used as an input within
htlc_tx, which spends the commitment transaction at index input. The signature returned
must be be computed using EcdsaSighashType::All. Read moreSigns the shared input of a splice transaction with our funding key. Read more
Source§impl Writeable for DynSigner
impl Writeable for DynSigner
Auto Trait Implementations§
impl !RefUnwindSafe for DynSigner
impl !UnwindSafe for DynSigner
impl Freeze for DynSigner
impl Send for DynSigner
impl Sync for DynSigner
impl Unpin for DynSigner
impl UnsafeUnpin for DynSigner
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for T
impl<T> Downcast for T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> LengthReadable for Twhere
T: Readable,
impl<T> LengthReadable for Twhere
T: Readable,
Source§fn read_from_fixed_length_buffer<R>(reader: &mut R) -> Result<T, DecodeError>where
R: LengthLimitedRead,
fn read_from_fixed_length_buffer<R>(reader: &mut R) -> Result<T, DecodeError>where
R: LengthLimitedRead,
Reads a
Self in from the given LengthLimitedRead.