clementine_core::builder::transaction

Function create_payout_txhandler

Source
pub fn create_payout_txhandler(
    input_utxo: UTXO,
    output_txout: TxOut,
    operator_xonly_pk: XOnlyPublicKey,
    user_sig: Signature,
    _network: Network,
) -> Result<TxHandler<Signed>, BridgeError>
Expand description

Creates a TxHandler for the payout_tx.

This transaction is sent by the operator to front a peg-out, after which operator will send a kickoff transaction to get reimbursed.

§Inputs

  1. UTXO: User’s withdrawal input (committed in Citrea side, with the signature given to operators off-chain)

§Outputs

  1. User payout output
  2. OP_RETURN output (with operators x-only pubkey that fronts the peg-out)

§Arguments

  • input_utxo - The input UTXO for the payout, committed in Citrea side, with the signature given to operators off-chain.
  • output_txout - The output TxOut for the user payout.
  • operator_xonly_pk - The operator’s x-only public key that fronts the peg-out.
  • user_sig - The user’s signature for the payout, given to operators off-chain.
  • network - The Bitcoin network.

§Returns

A TxHandler for the payout transaction, or a BridgeError if construction fails.