clementine_core::builder::address

Function create_taproot_address

Source
pub fn create_taproot_address(
    scripts: &[ScriptBuf],
    internal_key: Option<XOnlyPublicKey>,
    network: Network,
) -> (Address, TaprootSpendInfo)
Expand description

Creates a taproot address with given scripts and internal key.

§Arguments

  • scripts: If empty, it is most likely a key path spend address
  • internal_key: If not given, will be defaulted to an unspendable x-only public key
  • network: Bitcoin network
  • If both scripts and internal_key are given, it means one can spend using both script and key path.
  • If none given, it is an unspendable address.

§Returns

  • [Address]: Generated taproot address
  • [TaprootSpendInfo]: Taproot spending information

§Panics

Will panic if some of the operations have invalid parameters.