clementine_core::builder::transaction

Function create_optimistic_payout_txhandler

Source
pub fn create_optimistic_payout_txhandler(
    deposit_data: &mut DepositData,
    input_utxo: UTXO,
    output_txout: TxOut,
    user_sig: Signature,
    paramset: &'static ProtocolParamset,
) -> Result<TxHandler, BridgeError>
Expand description

Creates a TxHandler for the optimistic_payout_tx.

This transaction is signed by all verifiers that participated in the corresponding deposit give the deposited funds directly to the user withdrawing from Citrea. This way no kickoff/BitVM process is needed.

§Inputs

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

§Outputs

  1. User payout output (to the user withdrawing from Citrea)
  2. Anchor output for CPFP

§Arguments

  • deposit_data - Mutable reference to deposit data.
  • 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.
  • user_sig - The user’s signature for the payout, given to operators off-chain.
  • paramset - Protocol parameter set.

§Returns

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