21Relay
Intermediate curriculum
Lesson 1819 minReviewed July 2026

CoinJoin, PayJoin and Chain Analysis

Learn how analysts infer relationships from public transactions, how collaborative transactions weaken some heuristics and why no privacy tool creates automatic anonymity.

Learning outcomes

By the end of this lesson, you should be able to

  • Chain-analysis heuristics are useful guesses, not consensus facts.
  • CoinJoin combines inputs and outputs from independent participants.
  • PayJoin is a collaborative payment that can break the common-input heuristic.
  • Post-transaction coin control matters because later spending can recreate links.
1

Chain analysis works with evidence and heuristics

Bitcoin exposes transaction inputs, outputs, amounts and timing on a public ledger. Analysts combine that data with outside information and heuristics—useful assumptions that may be wrong—to estimate which activity belongs together.

For example, the common-input-ownership heuristic often assumes one entity controlled all inputs to a transaction. It can be useful for ordinary wallet transactions, but collaborative transactions deliberately make that assumption unreliable.

2

CoinJoin combines independent participants

A CoinJoin is a transaction built by multiple participants who contribute inputs and receive outputs. When output values and transaction structure avoid obvious links, an observer has more possible mappings between the inputs and outputs.

CoinJoin does not erase transaction history, hide network activity or prove that every output belongs to a different person. The coordinator design, participant set, liquidity and wallet implementation all affect the result.

3

PayJoin makes a payment collaborative

PayJoin is a two-party CoinJoin used during a payment. The receiver contributes an input to the transaction, which breaks the simple assumption that every input came from the sender while preserving the intended payment.

The sender must validate the receiver's proposal carefully: the payment must still go to the intended destination, the fee must remain acceptable and no unexpected output may substitute for the payment. BIP78 specifies these checks and known attack considerations.

4

Later spending can undo earlier privacy

Recombining separated outputs, reusing addresses or spending several outputs together can recreate links that a collaborative transaction made uncertain. Wallet labels and coin control therefore remain important after the transaction completes.

Amounts, timing and contact with a KYC service may also narrow the possible owners. Privacy is an ongoing process rather than a one-time transaction type.

5

Use bounded claims and understand trade-offs

Collaborative transactions can improve privacy against particular heuristics, but they do not promise complete anonymity. Software bugs, malicious coordinators, participant probing, network observation and poor follow-up spending can reduce the benefit.

Some services may delay or reject deposits associated with privacy tools, and laws or policies differ by jurisdiction. Research the implementation, test with small values and never surrender keys or seed words to participate.

Visual recap

From a strong guess to several possibilities

Collaborative construction can weaken ownership heuristics, but later activity may reveal new links.

01

Public inputs

02

Ownership heuristic

03

Collaborative build

04

Multiple mappings

05

Separate outputs

06

Careful future spends

Key takeaways

  • Chain-analysis heuristics are useful guesses, not consensus facts.
  • CoinJoin combines inputs and outputs from independent participants.
  • PayJoin is a collaborative payment that can break the common-input heuristic.
  • Post-transaction coin control matters because later spending can recreate links.
  • Neither CoinJoin nor PayJoin guarantees anonymity.

Lesson recap

Check what you learned

Reveal each model answer, then honestly mark whether you understood it or need another review.

1 of 3

Recall

Why can combining two previously separated outputs in a later payment reduce privacy?

References

Further reading

Lesson progress

Loading progress...

Rate this lesson

Was this lesson helpful?

No name or financial information is collected.

Found inaccurate or outdated information? Report a correction