github payjoin/rust-payjoin payjoin-1.3.0
Release payjoin-1.3.0

2 hours ago

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)

What's Changed

New Contributors

Full Changelog: payjoin-javascript-0.3.0+payjoin-1.2.0...payjoin-1.3.0

Don't miss a new rust-payjoin release

NewReleases is sending notifications on new releases.