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§

source§

impl DynSigner

source

pub fn new<S: InnerSign + 'static>(inner: S) -> Self

Trait Implementations§

source§

impl ChannelSigner for DynSigner

source§

fn get_per_commitment_point( &self, idx: u64, secp_ctx: &Secp256k1<All> ) -> PublicKey

Gets the per-commitment point for a specific commitment number Read more
source§

fn release_commitment_secret(&self, idx: u64) -> [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, preimages: Vec<PaymentPreimage> ) -> Result<(), ()>

Validate the counterparty’s signatures on the holder commitment transaction and HTLCs. Read more
source§

fn pubkeys(&self) -> &ChannelPublicKeys

Returns the holder’s channel public keys and basepoints.
source§

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.
source§

fn provide_channel_parameters( &mut self, channel_parameters: &ChannelTransactionParameters )

Set the counterparty static channel data, including basepoints, counterparty_selected/holder_selected_contest_delay and funding outpoint. Read more
source§

impl Clone for DynSigner

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl EcdsaChannelSigner for DynSigner

source§

fn sign_counterparty_commitment( &self, commitment_tx: &CommitmentTransaction, 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 validate_counterparty_revocation( &self, idx: u64, secret: &SecretKey ) -> Result<(), ()>

Validate the counterparty’s revocation. Read more
source§

fn sign_holder_commitment_and_htlcs( &self, commitment_tx: &HolderCommitmentTransaction, secp_ctx: &Secp256k1<All> ) -> Result<(Signature, Vec<Signature>), ()>

Creates a signature for a holder’s commitment transaction and its claiming HTLC transactions. Read more
source§

fn unsafe_sign_holder_commitment_and_htlcs( &self, commitment_tx: &HolderCommitmentTransaction, secp_ctx: &Secp256k1<All> ) -> Result<(Signature, Vec<Signature>), ()>

Same as [sign_holder_commitment_and_htlcs], 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_and_htlcs] may enforce that we only ever get called once.
source§

fn sign_justice_revoked_output( &self, 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 more
source§

fn sign_justice_revoked_htlc( &self, 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, 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, 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, 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_anchor_input( &self, anchor_tx: &Transaction, input: usize, secp_ctx: &Secp256k1<All> ) -> Result<Signature, ()>

Computes the signature for a commitment transaction’s anchor output used as an input within anchor_tx, which spends the commitment transaction, at index input.
source§

impl Readable for DynSigner

source§

fn read<R: Read>(_reader: &mut R) -> Result<Self, DecodeError>

Reads a Self in from the given Read.
source§

impl Writeable for DynSigner

source§

fn write<W: Writer>(&self, writer: &mut W) -> Result<(), Error>

Writes self out to the given [Writer].
§

fn encode(&self) -> Vec<u8, Global>

Writes self out to a Vec<u8>.
§

fn serialized_length(&self) -> usize

Gets the length of this object after it has been serialized. This can be overridden to optimize cases where we prepend an object with its length.
source§

impl WriteableEcdsaChannelSigner for DynSigner

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> AsAny for Twhere T: Any,

§

fn as_any(&self) -> &(dyn Any + 'static)

§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

§

fn type_name(&self) -> &'static str

Gets the type name of self
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> Downcast for Twhere T: AsAny + ?Sized,

§

fn is<T>(&self) -> boolwhere T: AsAny,

Returns true if the boxed type is the same as T. Read more
§

fn downcast_ref<T>(&self) -> Option<&T>where T: AsAny,

Forward to the method defined on the type Any.
§

fn downcast_mut<T>(&mut self) -> Option<&mut T>where T: AsAny,

Forward to the method defined on the type Any.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> MaybeReadable for Twhere T: Readable,

§

fn read<R>(reader: &mut R) -> Result<Option<T>, DecodeError>where R: Read,

Reads a Self in from the given Read.
source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere V: MultiLane<T>,

§

fn vzip(self) -> V