Struct breez_sdk_core::lightning::sign::HTLCDescriptor

pub struct HTLCDescriptor {
    pub channel_derivation_parameters: ChannelDerivationParameters,
    pub commitment_txid: Txid,
    pub per_commitment_number: u64,
    pub per_commitment_point: PublicKey,
    pub feerate_per_kw: u32,
    pub htlc: HTLCOutputInCommitment,
    pub preimage: Option<PaymentPreimage>,
    pub counterparty_sig: Signature,
}
Expand description

A descriptor used to sign for a commitment transaction’s HTLC output.

Fields§

§channel_derivation_parameters: ChannelDerivationParameters

The parameters required to derive the signer for the HTLC input.

§commitment_txid: Txid

The txid of the commitment transaction in which the HTLC output lives.

§per_commitment_number: u64

The number of the commitment transaction in which the HTLC output lives.

§per_commitment_point: PublicKey

The key tweak corresponding to the number of the commitment transaction in which the HTLC output lives. This tweak is applied to all the basepoints for both parties in the channel to arrive at unique keys per commitment.

See https://github.com/lightning/bolts/blob/master/03-transactions.md#keys for more info.

§feerate_per_kw: u32

The feerate to use on the HTLC claiming transaction. This is always 0 for HTLCs originating from a channel supporting anchor outputs, otherwise it is the channel’s negotiated feerate at the time the commitment transaction was built.

§htlc: HTLCOutputInCommitment

The details of the HTLC as it appears in the commitment transaction.

§preimage: Option<PaymentPreimage>

The preimage, if Some, to claim the HTLC output with. If None, the timeout path must be taken.

§counterparty_sig: Signature

The counterparty’s signature required to spend the HTLC output.

Implementations§

§

impl HTLCDescriptor

pub fn outpoint(&self) -> OutPoint

Returns the outpoint of the HTLC output in the commitment transaction. This is the outpoint being spent by the HTLC input in the HTLC transaction.

pub fn previous_utxo<C>(&self, secp: &Secp256k1<C>) -> TxOut
where C: Signing + Verification,

Returns the UTXO to be spent by the HTLC input, which can be obtained via Self::unsigned_tx_input.

pub fn unsigned_tx_input(&self) -> TxIn

Returns the unsigned transaction input spending the HTLC output in the commitment transaction.

pub fn tx_output<C>(&self, secp: &Secp256k1<C>) -> TxOut
where C: Signing + Verification,

Returns the delayed output created as a result of spending the HTLC output in the commitment transaction.

pub fn witness_script<C>(&self, secp: &Secp256k1<C>) -> Script
where C: Signing + Verification,

Returns the witness script of the HTLC output in the commitment transaction.

pub fn tx_input_witness( &self, signature: &Signature, witness_script: &Script, ) -> Witness

Returns the fully signed witness required to spend the HTLC output in the commitment transaction.

pub fn derive_channel_signer<S, SP>(&self, signer_provider: &SP) -> S
where S: WriteableEcdsaChannelSigner, SP: Deref, <SP as Deref>::Target: SignerProvider<Signer = S>,

Derives the channel signer required to sign the HTLC input.

Trait Implementations§

§

impl Clone for HTLCDescriptor

§

fn clone(&self) -> HTLCDescriptor

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
§

impl Debug for HTLCDescriptor

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl PartialEq for HTLCDescriptor

§

fn eq(&self, other: &HTLCDescriptor) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
§

impl Readable for HTLCDescriptor

§

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

Reads a Self in from the given Read.
§

impl Writeable for HTLCDescriptor

§

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

Writes self out to the given Writer.
§

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

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

Writes self out to a Vec<u8>.
§

impl Eq for HTLCDescriptor

§

impl StructuralPartialEq for HTLCDescriptor

Auto Trait Implementations§

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Any for T
where T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

§

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

§

impl<T> AnySync for T
where T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync>

§

impl<T> AsAny for T
where 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
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where T: 'a,

§

fn implicit( self, class: Class, constructed: bool, tag: u32, ) -> TaggedParser<'a, Implicit, Self, E>

source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

source§

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

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

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

§

fn is<T>(&self) -> bool
where 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<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> FromRef<T> for T
where T: Clone,

§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where 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.

source§

impl<T> IntoRequest<T> for T

source§

fn into_request(self) -> Request<T>

Wrap the input message T in a tonic::Request
§

impl<T> MaybeReadable for T
where 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> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where 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 T
where 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 T
where 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 T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

impl<T> DartSafe for T