Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,16 @@

The Payjoin Dev Kit `payjoin` library implements both [BIP 78 Payjoin V1](https://github.com/bitcoin/bips/blob/master/bip-0078.mediawiki) and [BIP 77 Payjoin V2](https://github.com/bitcoin/bips/blob/master/bip-0077.md).

### Feature Flags

The `payjoin` crate supports the following features:
- `v1`: Enables BIP 78 Payjoin V1 support.
- `v2`: Enables BIP 77 Payjoin V2 support (enabled by default).
- `directory`: Enables Payjoin Directory support.

**Note:**
The crate will now build with no features enabled (e.g., `cargo build --no-default-features`), but in this configuration, no functionality is available. This is intended to support comprehensive CI and linting. To use the library, enable at least one of the features above.

### `payjoin-cli`

The [`payjoin-cli`](https://github.com/payjoin/rust-payjoin/tree/master/payjoin-cli) crate performs no-frills Payjoin as a reference implementation using Bitcoin Core wallet.
Expand Down
2 changes: 2 additions & 0 deletions payjoin/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ exclude = ["tests"]
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[features]
# The crate will build with no features enabled, but will provide no functionality.
# Enable at least one of: 'v1', 'v2', or 'directory' to use the library.
default = ["v2"]
#[doc = "Core features for payjoin state machines"]
_core = ["bitcoin/rand-std", "serde_json", "url", "bitcoin_uri", "serde", "bitcoin/serde"]
Expand Down
6 changes: 5 additions & 1 deletion payjoin/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,11 @@
//! **Use at your own risk. This crate has not yet been reviewed by independent Rust and Bitcoin security professionals.**

#[cfg(not(any(feature = "directory", feature = "v1", feature = "v2")))]
compile_error!("At least one of the features ['directory', 'v1', 'v2'] must be enabled");
#[doc(hidden)]
pub mod no_features_enabled {
//! This crate was built with no features enabled. No functionality is available.
//! Enable at least one of the features: `directory`, `v1`, or `v2`.
}

#[cfg(any(feature = "v2", feature = "directory"))]
pub(crate) mod bech32;
Expand Down