[][src]Enum lightning::chain::keysinterface::SpendableOutputDescriptor

pub enum SpendableOutputDescriptor {
    StaticOutput {
        outpoint: OutPoint,
        output: TxOut,
    },
    DynamicOutputP2WSH {
        outpoint: OutPoint,
        key: SecretKey,
        witness_script: Script,
        to_self_delay: u16,
        output: TxOut,
    },
    DynamicOutputP2WPKH {
        outpoint: OutPoint,
        key: SecretKey,
        output: TxOut,
    },
}

When on-chain outputs are created by rust-lightning (which our counterparty is not able to claim at any point in the future) an event is generated which you must track and be able to spend on-chain. The information needed to do this is provided in this enum, including the outpoint describing which txid and output index is available, the full output which exists at that txid/index, and any keys or other information required to sign.

Variants

StaticOutput

An output to a script which was provided via KeysInterface, thus you should already know how to spend it. No keys are provided as rust-lightning was never given any keys - only the script_pubkey as it appears in the output. These may include outputs from a transaction punishing our counterparty or claiming an HTLC on-chain using the payment preimage or after it has timed out.

Fields of StaticOutput

outpoint: OutPoint

The outpoint which is spendable

output: TxOut

The output which is referenced by the given outpoint.

DynamicOutputP2WSH

An output to a P2WSH script which can be spent with a single signature after a CSV delay. The private key which should be used to sign the transaction is provided, as well as the full witness redeemScript which is hashed in the output script_pubkey. The witness in the spending input should be: <BIP 143 signature generated with the given key> (MINIMALIF standard rule) <witness_script as provided> Note that the nSequence field in the input must be set to_self_delay (which corresponds to the transaction not being broadcastable until at least to_self_delay blocks after the input confirms). These are generally the result of a "revocable" output to us, spendable only by us unless it is an output from us having broadcast an old state (which should never happen).

Fields of DynamicOutputP2WSH

outpoint: OutPoint

The outpoint which is spendable

key: SecretKey

The secret key which must be used to sign the spending transaction

witness_script: Script

The witness redeemScript which is hashed to create the script_pubkey in the given output

to_self_delay: u16

The nSequence value which must be set in the spending input to satisfy the OP_CSV in the witness_script.

output: TxOut

The output which is referenced by the given outpoint

DynamicOutputP2WPKH

An output to a P2WPKH, spendable exclusively by the given private key. The witness in the spending input, is, thus, simply: <BIP 143 signature generated with the given key> These are generally the result of our counterparty having broadcast the current state, allowing us to claim the non-HTLC-encumbered outputs immediately.

Fields of DynamicOutputP2WPKH

outpoint: OutPoint

The outpoint which is spendable

key: SecretKey

The secret key which must be used to sign the spending transaction

output: TxOut

The output which is reference by the given outpoint

Trait Implementations

impl Clone for SpendableOutputDescriptor[src]

impl PartialEq<SpendableOutputDescriptor> for SpendableOutputDescriptor[src]

impl Readable for SpendableOutputDescriptor[src]

impl StructuralPartialEq for SpendableOutputDescriptor[src]

impl Writeable for SpendableOutputDescriptor[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.