clementine_core::builder::address

Function generate_deposit_address

Source
pub fn generate_deposit_address(
    nofn_xonly_pk: XOnlyPublicKey,
    recovery_taproot_address: &Address<NetworkUnchecked>,
    user_evm_address: EVMAddress,
    network: Network,
    user_takes_after: u16,
) -> Result<(Address, TaprootSpendInfo), BridgeError>
Expand description

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.

§Parameters

  • nofn_xonly_pk: N-of-N x-only public key of the depositor
  • recovery_taproot_address: User’s x-only public key that can be used to take funds after some time
  • user_evm_address: User’s EVM address.
  • amount: Amount to deposit
  • network: Bitcoin network to work on
  • user_takes_after: User can take the funds back, after this amounts of blocks have passed

§Returns

  • [Address]: Deposit taproot Bitcoin address
  • [TaprootSpendInfo]: Deposit address’s taproot spending information

§Panics

Panics if given parameters are malformed.