From bd4aaa010d78f6915c1b450e4f461e8ad9c9cf5a Mon Sep 17 00:00:00 2001 From: spacebear Date: Tue, 10 Nov 2026 08:26:32 -0700 Subject: [PATCH] Bump payjoin version to 1.3.0 --- Cargo-minimal.lock | 2 +- Cargo-recent.lock | 2 +- payjoin-cli/Cargo.toml | 2 +- payjoin-ffi/Cargo.toml | 2 +- payjoin-mailroom/Cargo.toml | 2 +- payjoin-test-utils/Cargo.toml | 2 +- payjoin/CHANGELOG.md | 58 +++++++++++++++++++ payjoin/Cargo.toml | 2 +- payjoin/changelog.d/classify-tx.md | 32 ---------- ...recate-extract-tx-to-schedule-broadcast.md | 4 -- payjoin/changelog.d/seal-fallback-tx.md | 5 -- payjoin/src/core/receive/v2/mod.rs | 6 +- 12 files changed, 68 insertions(+), 51 deletions(-) delete mode 100644 payjoin/changelog.d/classify-tx.md delete mode 100644 payjoin/changelog.d/deprecate-extract-tx-to-schedule-broadcast.md delete mode 100644 payjoin/changelog.d/seal-fallback-tx.md diff --git a/Cargo-minimal.lock b/Cargo-minimal.lock index e1a6a3ce6..ecdc8b2fa 100644 --- a/Cargo-minimal.lock +++ b/Cargo-minimal.lock @@ -2247,7 +2247,7 @@ checksum = "df94ce210e5bc13cb6651479fa48d14f601d9858cfe0467f43ae157023b938d3" [[package]] name = "payjoin" -version = "1.2.0" +version = "1.3.0" dependencies = [ "arbitrary", "bhttp", diff --git a/Cargo-recent.lock b/Cargo-recent.lock index a63f267b7..6e37bd733 100644 --- a/Cargo-recent.lock +++ b/Cargo-recent.lock @@ -2453,7 +2453,7 @@ checksum = "df94ce210e5bc13cb6651479fa48d14f601d9858cfe0467f43ae157023b938d3" [[package]] name = "payjoin" -version = "1.2.0" +version = "1.3.0" dependencies = [ "arbitrary", "bhttp", diff --git a/payjoin-cli/Cargo.toml b/payjoin-cli/Cargo.toml index 65ddb54a1..96144340d 100644 --- a/payjoin-cli/Cargo.toml +++ b/payjoin-cli/Cargo.toml @@ -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" diff --git a/payjoin-ffi/Cargo.toml b/payjoin-ffi/Cargo.toml index 0fb4197f7..f25b1e85a 100644 --- a/payjoin-ffi/Cargo.toml +++ b/payjoin-ffi/Cargo.toml @@ -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" diff --git a/payjoin-mailroom/Cargo.toml b/payjoin-mailroom/Cargo.toml index 330560c9d..1538800e5 100644 --- a/payjoin-mailroom/Cargo.toml +++ b/payjoin-mailroom/Cargo.toml @@ -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" diff --git a/payjoin-test-utils/Cargo.toml b/payjoin-test-utils/Cargo.toml index e75bad171..d046c5737 100644 --- a/payjoin-test-utils/Cargo.toml +++ b/payjoin-test-utils/Cargo.toml @@ -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 = [ diff --git a/payjoin/CHANGELOG.md b/payjoin/CHANGELOG.md index d4e484a19..817f0b19b 100644 --- a/payjoin/CHANGELOG.md +++ b/payjoin/CHANGELOG.md @@ -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::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::extract_tx_to_schedule_broadcast`. + Schedule the fallback broadcast by cancelling the session when the payjoin + fails: `cancel` yields a `Receiver` 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::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. diff --git a/payjoin/Cargo.toml b/payjoin/Cargo.toml index b060c869b..c788d16a1 100644 --- a/payjoin/Cargo.toml +++ b/payjoin/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "payjoin" -version = "1.2.0" +version = "1.3.0" authors = ["Dan Gould "] description = "Payjoin Library implementing BIP 78 and BIP 77 batching protocols." repository = "https://github.com/payjoin/rust-payjoin" diff --git a/payjoin/changelog.d/classify-tx.md b/payjoin/changelog.d/classify-tx.md deleted file mode 100644 index b319f1132..000000000 --- a/payjoin/changelog.d/classify-tx.md +++ /dev/null @@ -1,32 +0,0 @@ -- Deprecate `Receiver::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. It now probes a txid that includes the script_sig of a legacy or - P2SH-wrapped receiver input. It used to probe a txid that never appears - on chain for such a session. -- 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. - -### 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` -- 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 diff --git a/payjoin/changelog.d/deprecate-extract-tx-to-schedule-broadcast.md b/payjoin/changelog.d/deprecate-extract-tx-to-schedule-broadcast.md deleted file mode 100644 index d0b9f95e6..000000000 --- a/payjoin/changelog.d/deprecate-extract-tx-to-schedule-broadcast.md +++ /dev/null @@ -1,4 +0,0 @@ -- Deprecate `Receiver::extract_tx_to_schedule_broadcast`. - Schedule the fallback broadcast by cancelling the session when the payjoin - fails: `cancel` yields a `Receiver` whose `fallback_tx` - is the transaction to broadcast. diff --git a/payjoin/changelog.d/seal-fallback-tx.md b/payjoin/changelog.d/seal-fallback-tx.md deleted file mode 100644 index 5c85bd1b8..000000000 --- a/payjoin/changelog.d/seal-fallback-tx.md +++ /dev/null @@ -1,5 +0,0 @@ -- 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::fallback_tx` after `cancel`, or from - `SessionHistory::fallback_tx`. diff --git a/payjoin/src/core/receive/v2/mod.rs b/payjoin/src/core/receive/v2/mod.rs index 9103be3e4..f593b0a37 100644 --- a/payjoin/src/core/receive/v2/mod.rs +++ b/payjoin/src/core/receive/v2/mod.rs @@ -740,7 +740,7 @@ impl Receiver { /// 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() } @@ -1167,7 +1167,7 @@ impl Receiver { /// /// 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::fallback_tx` instead" )] pub fn extract_tx_to_schedule_broadcast(&self) -> bitcoin::Transaction { @@ -2080,7 +2080,7 @@ impl Receiver { /// Returns a [`MaybeFatalOrSuccessTransition`] that, once successfully persisted, either /// concludes the session if a transaction is found, or yields a [`Receiver`] 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, ImplementationError>,