clementine_core::builder::address

Function generate_replacement_deposit_address

Source
pub fn generate_replacement_deposit_address(
    old_move_txid: Txid,
    nofn_xonly_pk: XOnlyPublicKey,
    network: Network,
    security_council: SecurityCouncil,
) -> Result<(Address, TaprootSpendInfo), BridgeError>
Expand description

Builds a Taproot address specifically for replacement deposits. Replacement deposits are to replace old move_to_vault transactions in case any issue is found on the bridge. This address incorporates a script committing to an old move transaction ID and a multisig script for the security council. This replacement deposit address will be used to create a new deposit transaction, which will then be used to sign the new related bridge deposit tx’s.

§Parameters

  • old_move_txid: The Txid of the old move_to_vault transaction that is being replaced.
  • nofn_xonly_pk: The N-of-N XOnlyPublicKey for the deposit.
  • network: The Bitcoin network on which the address will be used.
  • security_council: The SecurityCouncil configuration for the multisig script.

§Returns

  • Ok((Address, TaprootSpendInfo)) containing the new replacement deposit address and its associated TaprootSpendInfo if successful.
  • Err(BridgeError) if any error occurs during address generation.