Module payjoin::send

source ·
Expand description

Send a Payjoin

This module contains types and methods used to implement sending via BIP 78 Payjoin.

Usage is pretty simple:

  1. Parse BIP21 as payjoin::Uri
  2. Construct URI request parameters, a finalized “Original PSBT” paying .amount to .address
  3. (optional) Spawn a thread or async task that will broadcast the original PSBT fallback after delay (e.g. 1 minute) unless canceled
  4. Construct the request using RequestBuilder with the PSBT and payjoin uri
  5. Send the request and receive response
  6. Process the response with Context::process_response()
  7. Sign and finalize the Payjoin Proposal PSBT
  8. Broadcast the Payjoin Transaction (and cancel the optional fallback broadcast)

This crate is runtime-agnostic. Data persistence, chain interactions, and networking may be provided by custom implementations or copy the reference payjoin-cli for bitcoind, nolooking for LND, or bitmask-core BDK integration. Bring your own wallet and http client.

Structs§

Enums§