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 - State machine persistence for payjoin sessions.
- receive
_core - Receive Payjoin
- send
_core - Send Payjoin
- time
_coreandv2 - uri
_core - Payjoin URI parsing and validation
- version
_core
Structs§
- Hpke
KeyPair _coreandv2 - Hpke
Public Key _coreandv2 - Implementation
Error _core - Ohttp
Keys _coreandv2 - Ohttp
Response _coreandv2 - An opaque OHTTP client context.
- PjParse
Error _core - PjUri
_core - A BIP21 URI that is known to request payjoin, with validated payjoin parameters.
- Request
_core - 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) - Uri
_core - A BIP21 URI that may or may not request payjoin.
- UriParse
Error _core - Error parsing a BIP21 URI into a payjoin
Uri. - Url
_core - A parsed URL.
Enums§
- Into
UrlError _core - Ohttp
Keys Error _coreandv2 - Error encoding or decoding
OhttpKeys. - Output
Substitution _core - Whether the receiver is allowed to substitute original outputs or not.
- PjParam
_core - UrlParse
Error _core - Errors produced by
Url::parse. - Version
_core - 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