server_htlc_receive_taproot

Function server_htlc_receive_taproot 

Source
pub fn server_htlc_receive_taproot(
    payment_hash: PaymentHash,
    server_pubkey: PublicKey,
    user_pubkey: PublicKey,
    exit_delta: BlockDelta,
    htlc_expiry_delta: BlockDelta,
    htlc_expiry: BlockHeight,
) -> TaprootSpendInfo
Expand description

Construct taproot spending information for a VTXO that enables incoming Lightning payments. This relates to the crate::VtxoPolicy::ServerHtlcRecv policy.

This will build a taproot with 3 clauses:

  1. The keyspend path allows Alice and Server to collaborate to spend the HTLC. This is the expected path to be used. Server should only accept to collaborate if Alice reveals the preimage.

  2. One leaf of the tree allows Server to spend the HTLC after the expiry, with an exit delta delay. Server can use this path if Alice tries to spend the HTLC using the 3rd path after the HTLC expiry

  3. The other leaf of the tree allows Alice to spend the HTLC if she knows the preimage, but with a greater exit delta delay than Server. Alice must use this path if she revealed the preimage but Server refused to collaborate using the 1rst path.