FORENSIAWeb3 forensicsOpen workspace

Which output is the change

How Forensia guesses which output of a payment went back to the sender, why it needs agreement between rules, and when it stays silent.

2 min read · Bitcoin analysis

#Plain languageIn plain terms

Bitcoin coins cannot be split in place. To pay 0.3 from a coin worth 1, you spend the whole coin and create two new ones: 0.3 for the recipient and the rest back to yourself. That second one is called change.

From outside, both outputs look the same. Working out which is the payment and which is the change is the single most useful guess in Bitcoin tracing, and it is only ever a guess. Forensia runs several independent rules and speaks up only when at least two agree.

#How it worksHow it works

  1. Check the transaction has exactly two outputs. Otherwise stop.
  2. Run four rules. Each may vote for one output.
  3. Count the votes.
  4. Report a candidate only if one output leads and has at least two votes.

#Technical detailThe exact rules

RuleVotes for an output when
Script-type matchAll inputs share one script type and exactly one output has that same type.
Round payment amountExactly one output is a round amount. The vote goes to the other one.
Self-transferThe output's address is also one of the input addresses.
Dominant remainderThe output holds at least 90% of the total output value.

An amount is round when it is a whole multiple of 1, 0.1, 0.01 or 0.001 BTC. The idea is that people choose round numbers to pay and the leftover is whatever it happens to be.

Votes for the leading outputOutcome
0 or 1Nothing is reported.
2Reported, confidence low.
3 or 4Reported, confidence medium.
A tie between outputsNothing is reported.

The finding is finding:bitcoin-change-output, class lead. It lists every rule that voted, so you can weigh them yourself.

#LimitsWhat it does not tell you

  • Transactions with any number of outputs other than two are not assessed.
  • Wallets can pay round amounts, reuse script types on purpose, or produce change that looks like a payment.
  • The dominant-remainder rule points at the larger output. When someone spends most of a coin, the larger output is the payment, and the rule points the wrong way.
  • Round amounts below 0.001 BTC, and amounts that are round in a fiat currency, are not recognised.
  • Address reuse is checked only within the one transaction, not across the address's history.
  • The change output is not used to group addresses together.