Struct lightning::sign::HTLCDescriptor
source · 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§
source§impl HTLCDescriptor
impl HTLCDescriptor
sourcepub fn outpoint(&self) -> OutPoint
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.
sourcepub fn previous_utxo<C: Signing + Verification>(
&self,
secp: &Secp256k1<C>
) -> TxOut
pub fn previous_utxo<C: Signing + Verification>( &self, secp: &Secp256k1<C> ) -> TxOut
Returns the UTXO to be spent by the HTLC input, which can be obtained via
Self::unsigned_tx_input
.
sourcepub fn unsigned_tx_input(&self) -> TxIn
pub fn unsigned_tx_input(&self) -> TxIn
Returns the unsigned transaction input spending the HTLC output in the commitment transaction.
sourcepub fn tx_output<C: Signing + Verification>(&self, secp: &Secp256k1<C>) -> TxOut
pub fn tx_output<C: Signing + Verification>(&self, secp: &Secp256k1<C>) -> TxOut
Returns the delayed output created as a result of spending the HTLC output in the commitment transaction.
sourcepub fn witness_script<C: Signing + Verification>(
&self,
secp: &Secp256k1<C>
) -> ScriptBuf
pub fn witness_script<C: Signing + Verification>( &self, secp: &Secp256k1<C> ) -> ScriptBuf
Returns the witness script of the HTLC output in the commitment transaction.
sourcepub fn tx_input_witness(
&self,
signature: &Signature,
witness_script: &Script
) -> Witness
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.
sourcepub fn derive_channel_signer<S: WriteableEcdsaChannelSigner, SP: Deref>(
&self,
signer_provider: &SP
) -> Swhere
SP::Target: SignerProvider<EcdsaSigner = S>,
pub fn derive_channel_signer<S: WriteableEcdsaChannelSigner, SP: Deref>(
&self,
signer_provider: &SP
) -> Swhere
SP::Target: SignerProvider<EcdsaSigner = S>,
Derives the channel signer required to sign the HTLC input.
Trait Implementations§
source§impl Clone for HTLCDescriptor
impl Clone for HTLCDescriptor
source§fn clone(&self) -> HTLCDescriptor
fn clone(&self) -> HTLCDescriptor
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for HTLCDescriptor
impl Debug for HTLCDescriptor
source§impl PartialEq for HTLCDescriptor
impl PartialEq for HTLCDescriptor
source§fn eq(&self, other: &HTLCDescriptor) -> bool
fn eq(&self, other: &HTLCDescriptor) -> bool
self
and other
values to be equal, and is used
by ==
.