Payjoin

From claude-dev-suite/claude-dev-suite · View interactive version

Payjoin is an AI agent skill from the GitHub repository claude-dev-suite/claude-dev-suite. PayJoin (BIP78 + v2): receiver-augmented payment that breaks common-input-ownership heuristic. v2 adds async relay support. USE WHEN: implementing PayJoin sender/receiver, designing privacy- preserving payment flows, integrating with payjoin servers.

How to use this skill

Skill file

PayJoin (BIP78 + v2)

PayJoin = "P2EP" (pay-to-endpoint). The receiver adds **their own

input** to the sender's tx, defeating the common-input-ownership

heuristic.

Spec: BIP78 (sync) + BIP77 "Async Payjoin" (async via directory relay).

Mechanism

BIP78 sync flow

  1. Receiver gives sender a URL with ?pj=https://... (PayJoin

endpoint).

  1. Sender constructs an unsigned tx paying receiver.
  2. Sender POSTs the unsigned tx (or its PSBT) to PayJoin endpoint.
  3. Receiver:
  1. Sender signs and broadcasts.

Result: tx with inputs from BOTH sender and receiver. Heuristic

analyst now can't tell which inputs belong to whom.

v2 (async)

BIP78 v1 requires the receiver to be online during the payment.

BIP77 v2 introduces a directory relay so receiver can be offline:

Sender can then sign + broadcast. End-to-end encrypted (sender +

receiver have known pubkeys for the channel).

URI format

bitcoin:bc1q...?amount=0.001&pj=https://example.com/pj/endpoint&pjos=0

pj= for v1 and v2; in v2 it points at a directory mailbox endpoint.

pjos=0 disables output substitution (BIP77 requires it on the

BIP78-compatible path). BIP77 defines no new BIP21 parameters:

session data lives in the fragment of the pj URL (EX expiry,

OH OHTTP key config, RK receiver key) under a bech32-inspired

encoding — HRP as the parameter key, 1 separator, value in the

bech32 character set, uppercase, no checksum — with #

percent-encoded as %23 (BIP77 spec version 0.2.0, as of

September 2026).

Privacy properties

all inputs belong to same wallet.

the output value isn't necessarily the "payment amount" anymore.

Compared to CoinJoin

| Aspect | CoinJoin | PayJoin |

|--------|----------|---------|

| Multi-party | many participants | sender + receiver |

| Per-payment | dedicated round | seamless within payment |

| Fee | extra coordinator + on-chain | small overhead |

| Anonymity set | size of round | 2 |

| Frequency | periodic mixing | every payment can be PayJoin |

PayJoin is simpler to integrate (every payment can be a PayJoin)

but provides smaller anonymity set per-payment. Combined effect with

many users = chain-wide doubt.

Implementations

v1

v2

merged in the BIPs repo; status Draft, spec version 0.2.0 as of

September 2026. It is the recommended approach for new work.

on 12 August 2026 — one library covering both BIP78 and BIP77, with

typestate session workflows and event-log persistence. UniFFI

bindings: payjoin-python-0.2.0, payjoin-dart-0.2.2,

payjoin-csharp-0.1.0 and payjoin-javascript-0.2.0 (the JS and C#

releases landed 27 August 2026), all pinned to payjoin-1.0.0.

payjoin-cli was still at 1.0.0-rc.2 as of September 2026.

v1-fallback response rules (merged June 2026) — the receiver returns

the proposal PSBT un-encrypted as base64 ASCII via PUT to its own

mailbox, since a BIP78 sender supplies no reply key.

Use cases

dedicated rounds.

Common bugs

for simplicity).

privacy gain.

another tx → either tx fails.

PayJoin adds another → fees split unevenly.

See also

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.