Expand description
§Rust Payjoin Library
The main Payjoin Dev Kit (PDK) library which implements Async Payjoin. The library implements Payjoin session persistence support and IO utilities for interacting with OHTTP relays to make integration plug-and-play.
Both sender and receiver construct design follow The Typestate Pattern in Rust,
where higher-level Sender and Receiver structs are transitioned through
consecutive states which represent a specific step they can be on over the course of a Payjoin
session. See the documentation of state implementations for more information.
§Cargo Features
v2: all constructs for BIP 77: Async Payjoin send and receive operations. Note that IO for fetching OHTTP keys from the Payjoin directory is not enabled here, and requires you to bring your own implementation and HTTP client unless you choose to use ours with theiofeature.v1: all constructs for BIP 78: Simple Payjoin send and receive operations.io: helper functions for fetching and parsing OHTTP keys.directory: type for identifying Payjoin Directory entries as defined in BIP 77.
Only the v2 feature is enabled by default.
Re-exports§
pub extern crate bitcoin;
Modules§
- directory
directory - Types relevant to the Payjoin Directory as defined in BIP 77.
- error
_core - io
io - IO-related types and functions. Specifically, fetching OHTTP keys from a payjoin directory.
- persist
_coreandv2 - receive
_core - Receive Payjoin
- send
_core - Send Payjoin
- time
_coreandv2 - uri
_core - Payjoin URI parsing and validation
- version
_core
Structs§
- Hpke
KeyPair v2 - Hpke
Public Key v2 - Implementation
Error - Ohttp
Keys v2 - PjParse
Error - Request
- Represents data that needs to be transmitted to the receiver or payjoin directory.
Ensure the
Content-Lengthis set to the length ofbody. (most libraries do this automatically)
Enums§
- Into
UrlError - Output
Substitution v1 - Whether the receiver is allowed to substitute original outputs or not.
- PjParam
- Version
- The Payjoin version
Constants§
- MAX_
CONTENT_ LENGTH _core - 4M block size limit with base64 encoding overhead => maximum reasonable size of content-length 4_000_000 * 4 / 3 fits in u32