Skip to content

Instantly share code, notes, and snippets.

@DanGould
Last active February 28, 2024 19:49
Show Gist options
  • Save DanGould/cb477b0bbd6591b0d4b015a3abc2797f to your computer and use it in GitHub Desktop.
Save DanGould/cb477b0bbd6591b0d4b015a3abc2797f to your computer and use it in GitHub Desktop.
Quantifying Payjoin Privacy

Quantifying Payjoin Privacy

Goals

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

Key

CIH: Common Input Heuristic UIH: Unnecessary Input Heuristic

UIH_1

Change is not usually much larger than the transfer

UIH_2: ~30% of all TXs as of 2022

  • Smallest input may be excluded to create the largest (subset of) output(s)
  • Created when consolidating funds from internal address reuse
  • Occasionally created by Bitcoin Core in low fee environments to consolidate TXOs (Multiple input set candidates are possible when the feerate is less than 10sats/vB and the heighest weight candidate is chosen)

*

EITHER change OR another identity paid via sender batching

EITHER transfer payjoin consolidation OR another identity via transaction cut-through

Transaction Interpretations from Payjoin Candidate

amounts represented in sats

        6930 sats fee
           |
 48126917  |  30363810
  Input 0  |  Output 0
           >----+
 41483318  |  59244995
  Input 1  |  Output 1
           >----+

PJ_1 Fallback Candidate

        6930 sats fee
            |
 48126917   |  30363810
  A's Input |  A's output
            >----+
            |  17761677
            |  B's output
            >----+

PJ_2 Fallback Candidate

        6930 sats fee
            |
 41483318   |  30363810
  A's Input |  A's output
            >----+
            |  11118578
            |  B's output
            >----+

CIH Legacy Interpretation

  • A sends B 59,244,295 sats
        6930 sats fee
           |
  A's      |  A's*
  Input 0  |  Output 0
           >----+
  A's      |  B's†
  Input 1  |  Output 1
           >----+

CIH, UIH1 Legacy Interpretation

  • A sends B 30,363,810 sats
        6930 sats fee
           |
  A's      |  B's†
  Input 0  |  Output 0
           >----+
  A's      |  A's*
  Input 1  |  Output 1
           >----+

Payjoin Interpretation 1

  • A sends B 17,761,677 sats
  • B consolidates Input 1
        6930 sats fee
           |
  A's      |  A's*
  Input 0  |  Output 0
           >----+
  B's      |  B's†
  Input 1  |  Output 1
           >----+

Payjoin Interpretation 2

  • A sends B 11,118,578 sats
  • B consolidates Input 0
        6930 sats fee
           |
  B's      |  A's*
  Input 0  |  Output 0
           >----+
  A's      |  B's†
  Input 1  |  Output 1
           >----+

Internal CIH Interpretation

A self spend. Possibly

  • A channel open
  • Movement between storage modes (e.g. hot to cold, ln node)
        6930 sats fee
           |
  B's      |  A's*
  Input 0  |  Output 0
           >----+
  A's      |  A's*
  Input 1  |  Output 1
           >----+
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment