I am building analytics starting from blockchain raw data (blk**.dat files).

I have read in the bitcoin wiki that once the inputs have been chosen for a transaction, they must be all used: so a change is generated back to the original sender (via the same address or a different change one, depending on the client configuration).

While building analytics, I would like to exclude these outputs from any kind of metric, since they let the coin work but do not represent any intelligence at all.

Is there a way to looking at the outputs of a transaction and split them into meaningful sent amounts and change?

  • The whole point of having change explicit in the first place is making sure people can't (trivially) do this kind of analysis! Commented Nov 27, 2017 at 22:46

1 Answer 1


There is no way to know with certainty which output is the actual spend, and which is the change, without being involved in the transaction yourself. It is possible to infer this though, consider the following:

Transaction 'X' has 2 inputs (0.5, 0.5), and 2 outputs (0.7, 0.3). Logically, we can infer that the larger output (0.7) is the spend, because if the spend was the 0.3 output, the user could have saved costs by just using one of the 0.5 inputs to send the transaction.

However, it is possible for users to purposefully transact in a less efficient way, in order to obfuscate their spending habits, so you can never be absolutely certain.

  • Thank you very much, that is was I was looking for - a definite clause. Do you happen to have any external resource for that? This constraint will be included in a paper or similar, and I could use that. Or does it happen to be on the wiki and I totally missed it? Commented Nov 29, 2017 at 8:33
  • I don't have an external resource, sorry. The system is designed to obfuscate this sort of data though, so if you're looking for a hard reference on how to elucidate this info, I'm not sure one exists. At any rate, even the best inference would not be absolutely conclusive in just about every case, you'll be playing a guessing game within some self-defined confidence bounds.
    – chytrik
    Commented Nov 29, 2017 at 22:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.