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§
- calculate_
taproot_ leaf_ depths - 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.
- create_
checksig_ address - Shorthand function for creating a checksig taproot address: A single checksig script with the given xonly PK and no internal key.
- create_
taproot_ address - Creates a taproot address with given scripts and internal key.
- generate_
deposit_ address - Generates a deposit address for the user. Funds can be spent by N-of-N or user can take after specified time should the deposit fail.
- generate_
replacement_ deposit_ address - 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.
- taproot_
builder_ with_ scripts - A helper to construct a
TaprootBuilderfrom 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.