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: ChannelDerivationParametersThe parameters required to derive the signer for the HTLC input.
commitment_txid: TxidThe txid of the commitment transaction in which the HTLC output lives.
per_commitment_number: u64The number of the commitment transaction in which the HTLC output lives.
per_commitment_point: PublicKeyThe 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: u32The 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: HTLCOutputInCommitmentThe 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: SignatureThe 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: EcdsaChannelSigner, SP: Deref>(
&self,
signer_provider: &SP,
) -> Swhere
SP::Target: SignerProvider<EcdsaSigner = S>,
pub fn derive_channel_signer<S: EcdsaChannelSigner, 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 more