Function create_watchtower_challenge_txhandler

Source
pub fn create_watchtower_challenge_txhandler(
    kickoff_txhandler: &TxHandler,
    watchtower_idx: usize,
    commit_data: &[u8],
    paramset: &'static ProtocolParamset,
) -> Result<TxHandler, BridgeError>
Expand description

Creates a TxHandler for the watchtower_challenge_tx.

This transaction is sent by a watchtower to submit a challenge proof (e.g., a Groth16 proof with public inputs). The proof data is encoded in a single OP_RETURN output.

§Inputs

  1. KickoffTx: WatchtowerChallenge utxo (for the given watchtower)

§Outputs

  1. OP_RETURN output containing the challenge data.
  2. Anchor output for CPFP.

§Arguments

  • kickoff_txhandler - The kickoff transaction handler the watchtower challenge belongs to.
  • watchtower_idx - The index of the watchtower in the deposit submitting the challenge.
  • commit_data - The challenge proof data to be included in the transaction.
  • paramset - Protocol parameter set.

§Returns

A TxHandler for the watchtower challenge transaction, or a [BridgeError] if construction fails.