You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Receiver input selection ignores script type, so a type mismatch partitions the payjoin #1722
should the lib make input contribution script-type-aware? i.e. extend the existing privacy-preserving selection (which already covers amount) to also prefer a receiver UTXO whose script type matches the sender's inputs (match-when-available), and surface a mismatch when the receiver holds no matching type so the caller can decide?
this keeps convergence in the shared lib instead of each integration reimplementing it, and the lib already has both the sender's PSBT (its input types) and the receiver's candidates at this point.
open design questions
extend try_preserving_privacy, or a separate select variant / policy flag?
on no matching type: match-when-available only, flag, or abort? (leave the last call to the caller?)
structural limit: Single-type wallets can't always converge on this axis. Liana's wsh() descriptor reveals its timelock witnessScript on every spend, so it's always distinctive. Its tr() descriptor is better: under the Simple Inheritance template (single-sig primary as the taproot internal key), normal spends are key-path and thus indistinguishable from any single-sig P2TR keyspend, they already converge with taproot senders; only recovery (script-path) spends reveal the tapscript. (This is a general taproot property for any single-sig-primary wallet, not Liana-specific.) So the lib can match into the taproot set when the receiver spends key-path, and can only signal, not fix, the wsh() / script-path cases.
From a design perspective I'd like to align with the BIP, where script was intentionally removed as one of limitless fingerprints that can't really be spec enforced by counterparties. Rather the choice was to have the core state machine concerned just with network & agreement and leave wallet details / coin selection up to a higher layer. I think try_preserving_privacy and script selection like you describe make more sense in a higher level feature gated module or crate offered as part of payjoin dev kit, focusing on these type privacy-preserving heuristics beyond payjoin coordination itself but maintained to be ergonomic with the payjoin crate state machine
i'd shape it as a selection interface: the wallet implements a hook (receiver candidates + sender context in → selection + signals out, e.g. ScriptTypeMismatch), with try_preserving_privacy as the explicitly best-effort default, extended with match-when-available on script type (and output types as another signal). mismatches surface as signals, the integration decides.
i'd lean separate crate over feature-gated mod, so the interface can iterate at 0.x without touching payjoin 1.0 semver. the only pre-1.0 action becomes removing try_preserving_privacy from core. what do you think?
Activity
xstoicunicornx commentedon Jul 20, 2026
I don't have any answers for the open design questions, just have an additional question: should/could we also try to match on output types?
DanGould commentedon Jul 22, 2026
From a design perspective I'd like to align with the BIP, where script was intentionally removed as one of limitless fingerprints that can't really be spec enforced by counterparties. Rather the choice was to have the core state machine concerned just with network & agreement and leave wallet details / coin selection up to a higher layer. I think
try_preserving_privacyand script selection like you describe make more sense in a higher level feature gated module or crate offered as part of payjoin dev kit, focusing on these type privacy-preserving heuristics beyond payjoin coordination itself but maintained to be ergonomic with the payjoin crate state machinebc1cindy commentedon Jul 22, 2026
makes sense
i'd shape it as a selection interface: the wallet implements a hook (receiver candidates + sender context in → selection + signals out, e.g. ScriptTypeMismatch), with
try_preserving_privacyas the explicitly best-effort default, extended with match-when-available on script type (and output types as another signal). mismatches surface as signals, the integration decides.i'd lean separate crate over feature-gated mod, so the interface can iterate at 0.x without touching payjoin 1.0 semver. the only pre-1.0 action becomes removing
try_preserving_privacyfrom core. what do you think?DanGould commentedon Jul 23, 2026
concept ack of the shape & reason to be an independent crate for semver iteration