16 breaking releases

new 0.19.0 Jul 18, 2024
0.17.0 Jun 17, 2024
0.15.0 Mar 19, 2024
0.12.0 Dec 14, 2023
0.5.0-alpha Dec 29, 2022

#554 in Magic Beans

Download history 695/week @ 2024-04-02 225/week @ 2024-04-09 130/week @ 2024-04-16 110/week @ 2024-04-23 59/week @ 2024-04-30 165/week @ 2024-05-07 499/week @ 2024-05-14 1046/week @ 2024-05-21 655/week @ 2024-05-28 397/week @ 2024-06-04 978/week @ 2024-06-11 213/week @ 2024-06-18 201/week @ 2024-06-25 274/week @ 2024-07-02 472/week @ 2024-07-09 302/week @ 2024-07-16

1,349 downloads per month
Used in 4 crates (3 directly)

MITNFA license

210KB
4K SLoC

Rust-Payjoin

Supercharged payment batching to save you fees and preserve your privacy.

About

payjoin

The Payjoin Dev Kit payjoin library implements both BIP 78 Payjoin V1 and BIP 77 Payjoin V2.

The payjoin crate is compatible with many wallets lilke LND in nolooking and Bitcoin Dev Kit in Mutiny Wallet and in BitMask

payjoin-cli

The payjoin-cli crate performs no-frills Payjoin as a reference implementation using Bitcoin Core wallet.

payjoin-directory

The payjoin-directory crate implements the Payjoin Directory store-and-forward server required for Payjoin V2's asynchronous operation.

Disclaimer ⚠️ WIP

Use at your own risk. This crate has not yet been reviewed by independent Rust and Bitcoin security professionals.

While I don't think there is a huge risk running it, be careful relying on its security for now!

Seeking review of the code that verifies there is no overpayment. Contributions are welcome!

Development status

Sender (V1 beta, V2 alpha)

  • Basic logic
  • Most checks implemented
  • Documentation
  • Unit test with official test vectors passes
  • Many unit tests
  • Fee contribution support
  • Example client using bitcoind
  • Tested and works with BTCPayServer
  • Tested and works with JoinMarket
  • Minimum fee rate enforcement
  • Independent review
  • Independent testing

Receiver (V1 beta, V2 alpha)

  • Basic logic
  • Most checks implemented
  • Documentation
  • Unit test with official test vectors passes
  • Many unit tests
  • Fee contribution support
  • Example server using bitcoind
  • Tested and works with BTCPayServer
  • Tested and works with WasabiWallet
  • Tested and works with Blue Wallet
  • Tested and works with Sparrow
  • Tested and works with JoinMarket
  • Minimum fee rate enforcement
  • Discount support
  • Independent review
  • Independent testing

Code quality

  • Idiomatic Rust code
  • Newtypes
  • Panic-free error handling
  • No unsafe code or well-tested/analyzed/proven/... unsafe code
  • Warning-free
  • CI
  • Integration tests
  • Fuzzing
  • Coverage measurement

Minimum Supported Rust Version (MSRV)

The payjoin library and payjoin-cli should always compile with any combination of features on Rust 1.63.0.

To build and test with the MSRV you will need to pin the below dependency versions:

payjoin

cargo update -p cc --precise 1.0.105
cargo update -p regex --precise 1.9.6
cargo update -p url --precise 2.5.0
cargo update -p which --precise 4.4.0
cargo update -p reqwest --precise 0.12.4

payjoin-cli

cargo update -p cc --precise 1.0.105
cargo update -p clap_lex --precise 0.3.0
cargo update -p regex --precise 1.9.6
cargo update -p url --precise 2.5.0
cargo update -p which --precise 4.4.0
cargo update -p time@0.3.36 --precise 0.3.20
cargo update -p reqwest --precise 0.12.4

Code Formatting

We use the nightly Rust formatter for this project. Please run rustfmt using the nightly toolchain before submitting any changes.

License

MIT

Dependencies

~8–21MB
~288K SLoC