Class SpendableOutputDescriptor.DelayedPaymentOutput

  • Enclosing class:
    SpendableOutputDescriptor

    public static final class SpendableOutputDescriptor.DelayedPaymentOutput
    extends SpendableOutputDescriptor
    An output to a P2WSH script which can be spent with a single signature after an `OP_CSV` delay. The witness in the spending input should be: ```bitcoin (MINIMALIF standard rule) ``` Note that the `nSequence` field in the spending input must be set to [`DelayedPaymentOutputDescriptor::to_self_delay`] (which means the transaction is not broadcastable until at least [`DelayedPaymentOutputDescriptor::to_self_delay`] blocks after the outpoint confirms, see [BIP 68](https://github.com/bitcoin/bips/blob/master/bip-0068.mediawiki)). Also note that LDK won't generate a [`SpendableOutputDescriptor`] until the corresponding block height is reached. These are generally the result of a \"revocable\" output to us, spendable only by us unless it is an output from an old state which we broadcast (which should never happen). To derive the delayed payment key which is used to sign this input, you must pass the holder [`InMemorySigner::delayed_payment_base_key`] (i.e., the private key which corresponds to the [`ChannelPublicKeys::delayed_payment_basepoint`] in [`ChannelSigner::pubkeys`]) and the provided [`DelayedPaymentOutputDescriptor::per_commitment_point`] to [`chan_utils::derive_private_key`]. The public key can be generated without the secret key using [`chan_utils::derive_public_key`] and only the [`ChannelPublicKeys::delayed_payment_basepoint`] which appears in [`ChannelSigner::pubkeys`]. To derive the [`DelayedPaymentOutputDescriptor::revocation_pubkey`] provided here (which is used in the witness script generation), you must pass the counterparty [`ChannelPublicKeys::revocation_basepoint`] (which appears in the call to [`ChannelSigner::provide_channel_parameters`]) and the provided [`DelayedPaymentOutputDescriptor::per_commitment_point`] to [`chan_utils::derive_public_revocation_key`]. The witness script which is hashed and included in the output `script_pubkey` may be regenerated by passing the [`DelayedPaymentOutputDescriptor::revocation_pubkey`] (derived as explained above), our delayed payment pubkey (derived as explained above), and the [`DelayedPaymentOutputDescriptor::to_self_delay`] contained here to [`chan_utils::get_revokeable_redeemscript`].