clementine_core::builder

Module address

Source
Expand description

§Bitcoin Address Construction

Contains helper functions to create taproot addresses with given scripts and internal key. Contains helper functions to create correct deposit addresses. Addresses need to be of a specific format to be valid deposit addresses.

Functions§

  • Calculates the depth of each leaf in a balanced Taproot tree structure. The returned Vec contains the depth for each script at the corresponding index.
  • Shorthand function for creating a checksig taproot address: A single checksig script with the given xonly PK and no internal key.
  • Creates a taproot address with given scripts and internal key.
  • Generates a deposit address for the user. Funds can be spend by N-of-N or user can take after specified time should the deposit fail.
  • 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.
  • A helper to construct a TaprootBuilder from a slice of script buffers, forming the script tree. Finds the needed depth the script tree needs to be to fit all the scripts and inserts the scripts.