Skip to main content

Crate payjoin

Crate payjoin 

Source
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 the io feature.
  • 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§

directorydirectory
Types relevant to the Payjoin Directory as defined in BIP 77.
error_core
ioio
IO-related types and functions. Specifically, fetching OHTTP keys from a payjoin directory.
persist_core and v2
receive_core
Receive Payjoin
send_core
Send Payjoin
time_core and v2
uri_core
Payjoin URI parsing and validation
version_core

Structs§

HpkeKeyPairv2
HpkePublicKeyv2
ImplementationError
OhttpKeysv2
PjParseError
Request
Represents data that needs to be transmitted to the receiver or payjoin directory. Ensure the Content-Length is set to the length of body. (most libraries do this automatically)

Enums§

IntoUrlError
OutputSubstitutionv1
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

Traits§

IntoUrl
Try to convert some type into a Url.
UriExt

Type Aliases§

PjUri
Uri