Skip to content
Merged
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
2 changes: 1 addition & 1 deletion Cargo-minimal.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2247,7 +2247,7 @@ checksum = "df94ce210e5bc13cb6651479fa48d14f601d9858cfe0467f43ae157023b938d3"

[[package]]
name = "payjoin"
version = "1.2.0"
version = "1.3.0"
dependencies = [
"arbitrary",
"bhttp",
Expand Down
2 changes: 1 addition & 1 deletion Cargo-recent.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2453,7 +2453,7 @@ checksum = "df94ce210e5bc13cb6651479fa48d14f601d9858cfe0467f43ae157023b938d3"

[[package]]
name = "payjoin"
version = "1.2.0"
version = "1.3.0"
dependencies = [
"arbitrary",
"bhttp",
Expand Down
2 changes: 1 addition & 1 deletion payjoin-cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ dirs = "6.0.0"
http-body-util = { version = "0.1.3", optional = true }
hyper = { version = "1.8.0", features = ["http1", "server"], optional = true }
hyper-util = { version = "0.1.18", optional = true }
payjoin = { version = "1.2.0", default-features = false }
payjoin = { version = "1.3.0", default-features = false }
pest_derive = "2.7.0"
psm = "=0.1.24"
r2d2 = "0.8.10"
Expand Down
2 changes: 1 addition & 1 deletion payjoin-ffi/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ path = "uniffi-bindgen.rs"
async-trait = "0.1.89"
getrandom = "0.2.10"
lazy_static = "1.5.0"
payjoin = { version = "1.2.0", features = ["v1", "v2"] }
payjoin = { version = "1.3.0", features = ["v1", "v2"] }
payjoin-test-utils = { path = "../payjoin-test-utils", optional = true }
serde = { version = "1.0.228", features = ["derive"] }
serde_json = "1.0.149"
Expand Down
2 changes: 1 addition & 1 deletion payjoin-mailroom/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ opentelemetry-otlp = { version = "0.32", optional = true, default-features = fal
"http-proto",
] }
opentelemetry_sdk = "0.32"
payjoin = { version = "1.2.0", features = [
payjoin = { version = "1.3.0", features = [
"directory",
], default-features = false }
psm = "=0.1.24"
Expand Down
2 changes: 1 addition & 1 deletion payjoin-test-utils/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ futures = { version = "0.3.21", default-features = false, features = ["std"] }
http = { version = "1.3.1", optional = true }
ohttp = { package = "bitcoin-ohttp", version = "0.7.0", optional = true }
once_cell = "1.21.3"
payjoin = { version = "1.2.0", default-features = false }
payjoin = { version = "1.3.0", default-features = false }
payjoin-mailroom = { version = "0.1.3", features = ["_manual-tls"] }
rcgen = { version = "0.14.7", optional = true }
reqwest = { version = "0.12.23", default-features = false, features = [
Expand Down
58 changes: 58 additions & 0 deletions payjoin/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,63 @@
# Payjoin Changelog

## 1.3.0

This release changes how a receiver learns which transaction resolved its
session. Instead of polling for a predicted txid, the wallet passes each
transaction it receives to `classify_tx`, which says whether it is the
Payjoin proposal, the fallback, or neither, and then closes the session with
`close` once that transaction has enough confirmations. The old polling
methods are deprecated rather than removed.

Selected Improvements:

### Deprecations

- Deprecate `Receiver<Monitor>::check_for_transaction`. It closes the
session on first sight of a predicted txid, never sees a spend that is
neither the proposal nor the fallback, and closes a session with
non-SegWit sender inputs without checking. Use `classify_tx` and `close`
instead. For a session with a legacy or P2SH-wrapped receiver input it
now probes a txid that includes that input's script_sig, where it used
to probe one that never appears on chain (#1971)
- Deprecate `Receiver::proposal_txid_is_stable`. It checks only the
sender's inputs, so a legacy or P2SH-wrapped receiver input can change
the txid even when it returns true. Use `classify_tx` instead (#1971)
- Deprecate `Receiver<MaybeInputsOwned>::extract_tx_to_schedule_broadcast`.
Schedule the fallback broadcast by cancelling the session when the payjoin
fails: `cancel` yields a `Receiver<PendingFallback>` whose `fallback_tx`
is the transaction to broadcast (#1994)

### API Additions

- Add `classify_tx` to every `receive::v2::Receiver` state that holds a
fallback transaction and is advancing the Payjoin protocol, from
`MaybeInputsOwned` through `Monitor`. For a transaction spending the
sender's original inputs it returns a `Resolution`, whose `resolved_by` is a
`ResolvedBy` saying whether that transaction is the Payjoin proposal, the
fallback, or neither. `ReceiveSession::classify_tx` does the same for a
session in any state. Wallets should pass every transaction they receive to
`classify_tx` on each open session. It recognizes the proposal even after a
non-SegWit sender's signature changes its txid, and never reports `Payjoin`
before `PayjoinProposal` (#1971)
- Add `close` to the same states and to `ReceiveSession`. It takes a
`Resolution` and ends the session once the wallet decides the transaction
has enough confirmations, without broadcasting the fallback. Only
`classify_tx` makes a `Resolution`, and `close` rejects one classified from
another session. `ReceiveSession::close` also rejects a session state
that cannot be closed via resolution. `close` classifies the transaction
again against the session's current state, and records
`PayjoinProposalSent` from `Monitor`, and from `PayjoinProposal` when the
Payjoin resolved it, and `Aborted` otherwise (#1971, #2043)

### Bug Fixes

- Close a leak in the `HasFallbackTx` seal. Generic code bounded on the trait
could call the sealed `fallback_tx` method, which was never part of the
documented API; such code no longer compiles. Read the fallback transaction
from `Receiver<PendingFallback>::fallback_tx` after `cancel`, or from
`SessionHistory::fallback_tx` (#1994)

## 1.2.0

This release adds a non-blocking interface to the receiver state machine.
Expand Down
2 changes: 1 addition & 1 deletion payjoin/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "payjoin"
version = "1.2.0"
version = "1.3.0"
authors = ["Dan Gould <d@ngould.dev>"]
description = "Payjoin Library implementing BIP 78 and BIP 77 batching protocols."
repository = "https://github.com/payjoin/rust-payjoin"
Expand Down
32 changes: 0 additions & 32 deletions payjoin/changelog.d/classify-tx.md

This file was deleted.

This file was deleted.

5 changes: 0 additions & 5 deletions payjoin/changelog.d/seal-fallback-tx.md

This file was deleted.

6 changes: 3 additions & 3 deletions payjoin/src/core/receive/v2/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -740,7 +740,7 @@ impl<S: HasFallbackTx> Receiver<S> {
/// Only sender inputs are checked. A legacy or P2SH-wrapped receiver input still changes the
/// txid of the unsigned proposal.
#[deprecated(
since = "0.0.0-unreleased",
since = "1.3.0",
note = "checks only the sender's inputs; use `Receiver::classify_tx`"
)]
pub fn proposal_txid_is_stable(&self) -> bool { self.sender_script_sigs_are_empty() }
Expand Down Expand Up @@ -1167,7 +1167,7 @@ impl Receiver<MaybeInputsOwned> {
///
/// Returns the extracted [`bitcoin::Transaction`].
#[deprecated(
since = "0.0.0-unreleased",
since = "1.3.0",
note = "cancel the session when the payjoin fails and broadcast `Receiver<PendingFallback>::fallback_tx` instead"
)]
pub fn extract_tx_to_schedule_broadcast(&self) -> bitcoin::Transaction {
Expand Down Expand Up @@ -2080,7 +2080,7 @@ impl Receiver<Monitor> {
/// Returns a [`MaybeFatalOrSuccessTransition`] that, once successfully persisted, either
/// concludes the session if a transaction is found, or yields a [`Receiver<Monitor>`] to
/// remain in stasis if no transaction is found yet.
#[deprecated(since = "0.0.0-unreleased", note = "use `classify_tx` and `close`")]
#[deprecated(since = "1.3.0", note = "use `classify_tx` and `close`")]
pub fn check_for_transaction(
self,
find_transaction: impl Fn(Txid) -> Result<Option<bitcoin::Transaction>, ImplementationError>,
Expand Down
Loading