Skip to content

Instantly share code, notes, and snippets.

DanGould /
Last active February 28, 2024 19:49
Quantifying Payjoin Privacy

Quantifying Payjoin Privacy


  • bolster the assumption that bitcoin is fungible
  • escape Unnecessary Input Heuristic (UIH) & pre-tracked TXOs
  • avoid introducing new heuristics


DanGould /
Last active March 5, 2024 22:06
Uneccesary Input Heuristic (UIH) in Payjoin

Unneccesary Input Heuristic

PayJoins help bitcoin users preserve their privacy because they bring ambiguity into blockchain analysis. Today's PayJoins are blockchain entries that are many-input and 2-output transactions. So the fact that multiple users can contribute inputs to one transaction breaks [the oldest assumption in blockchain analysis]. Still, lesser known "unecessary input heuristics" identify potential PayJoins:

UIH 1: One output is smaller than any input; Assume that output is change

Today's PayJoin clients avoid creating transactions that conform to UIH 1. This heuristic assumption is usually right. The heuristic assumes wrong if the change output is of much higher value than the payment, which is unusual. BTCPayServer code will not create these types of transactions.

UIH 2: The largest output is funded without the smallest

DanGould /
Created May 23, 2023 02:12

What is the Payjoin SDK and How does it work?

The Payjoin SDK/rust-payjoin is the most well-tested and flexible library for BIP 78 Payjoin and related privacy practices.

The primary crate, payjoin, is runtime-agnostic. Data persistence, chain interactions, and networking may be provided by custom implementations or copy the reference payjoin-client + bitcoind, nolooking + LND integration, or bitmask-core + BDK integrations.

The following is a breakdown of the existing documentation and its application to the payjoin-client reference implementation.

Send a Payjoin

DanGould / Serverless_Payjoin.mediawiki
Last active November 1, 2023 20:07
Serverless Payjoin - Receive surveillance-busting bitcoin transfers without hosting a secure endpoint

  BIP: ???
  Layer: Applications
  Title: Payjoin Version 2: Serverless Payjoin
  Author&#58; Dan Gould <>
  Status&#58; Draft
  Replaces&#58; 78
  Type&#58; Standards Track
  Created&#58; 2023&#45;08&#45;08
  License&#58; BSD&#45;2&#45;Clause

Keybase proof

I hereby claim:

  • I am dangould on github.
  • I am nart ( on keybase.
  • I have a public key ASAuyI7eufmiPGgeNuQ-e2h6jpXlvLAOPoAl9pyrNMXdvAo

To claim this, I am signing this object: