Expand description
Receive Payjoin
This module contains types and methods used to receive payjoin via BIP78. Usage is pretty simple:
- Generate a pj_uri BIP 21
using
payjoin::Uri
::from_str - Listen for a sender’s request on the
pj
endpoint - Parse the request using
UncheckedProposal::from_request()
- Validate the proposal using the
check
methods to guide you. - Assuming the proposal is valid, augment it into a payjoin with the available
try_preserving_privacy
andcontribute
methods - Extract the payjoin PSBT and sign it
- Respond to the sender’s http request with the signed PSBT as payload.
The receive
feature provides all of the check methods, PSBT data manipulation, coin
selection, and transport structures to receive payjoin and handle errors in a privacy
preserving way.
Receiving payjoin entails listening to a secure http endpoint for inbound requests. The
endpoint is displayed in the pj
parameter of a bip
21 request URI.
Modules§
Structs§
- Typestate to validate that the Original PSBT has no receiver-owned inputs.
- Typestate to validate that the Original PSBT has no inputs that have been seen before.
- Typestate to validate that the Original PSBT has no mixed input types.
- The receiver has not yet identified which outputs belong to the receiver.
- A mutable checked proposal that the receiver may contribute inputs to to make a payjoin.
- A mutable checked proposal that the receiver may contribute inputs to to make a payjoin.
- Error that may occur when the request from sender is malformed.
- Error that may occur when coin selection fails.
- The sender’s original PSBT and optional parameters