clementine_core::builder::transaction::sign

Function get_kickoff_utxos_to_sign

Source
pub fn get_kickoff_utxos_to_sign(
    paramset: &'static ProtocolParamset,
    op_xonly_pk: XOnlyPublicKey,
    deposit_blockhash: BlockHash,
    deposit_outpoint: OutPoint,
) -> Vec<usize>
Expand description

Deterministically (given same seed) generates a set of kickoff indices for an operator to sign, using the operator’s public key, deposit block hash, and deposit outpoint as the seed.

This function creates a deterministic seed from the operator’s public key, deposit block hash, and deposit outpoint, then uses it to select a subset of kickoff indices. deposit_blockhash is also included in the seed to ensure the randomness of the selected kickoff indices, otherwise deposit_outpoint can be selected in a way to create hash collisions by the user depositing.

§Arguments

  • paramset - Protocol parameter set.
  • op_xonly_pk - Operator’s x-only public key.
  • deposit_blockhash - Block hash of the block containing the deposit.
  • deposit_outpoint - Outpoint of the deposit.

§Returns

A vector of indices that the operator should sign, with the count determined by the protocol parameter num_signed_kickoffs.