0

I have obtained bitcoin data from block explorer and created the transaction graph. The graph consists of millions of nodes and edges.

i wrote a query that creates a relationship from source address to destination address and visualized a portion of the network; approx. 4500 nodes along with 50000 edges. What this means is that I omit the nodes depicting the blocks txs belong to, nodes depicting txs etc.

The nodes in the graph illustrate addresses connected by a relationship " sent_money_to "

There are many self-loops. In several instances a node u has n out-links to node w, while the same node u has n self-loops.

By no means I am an expert on the graph properties or protocol of the bitcoin network.

Any possible explanations? Trivial or non-trivial.

Thanks.

Andreas
  • 89
  • 7

1 Answers1

4

You are looking at transactions the wrong way. Bitcoin does not actually use addresses and their balances. The protocol has no concept of what an address is, nor does it need to. It also has no idea of an address or an account balance.

Rather how Bitcoin works is with transaction outputs. Transaction outputs are spent as the inputs to other transactions, and created as the outputs of transactions. Addresses are merely a human abstraction to quickly specify the locking conditions (the conditions that need to be met in order to spend) of a transaction output. They are not an identifier, just shorthand for an output script.

Since addresses are just shorthand for an output script rather than identifiers, nodes do not care about the contents of the scripts except when verifying that an input has met the conditions to spend the output it specifies. Other than that, a transaction output can contain whatever the user wants in the script, including invalid scripts. Outputs with such scripts just cannot be spent.

So these self loops exist because people can create a transaction which spends an output with a particular script, and then they create a new output which has the same script. Because nodes don't check the scripts, this is perfectly fine and valid.

Ava Chow
  • 70,382
  • 5
  • 81
  • 161
  • So, correct if I am wrong, but the protocol can be used to send anything in a anonymized (or pseudo-anonymized) way. That may include pictures, videos, etc.?

    However, I don't understand the last paragraph. Could you elaborate more? If not, can you recommend sources to study the bitcoin protocol/blockchain?

    – Andreas Oct 08 '19 at 13:25
  • 1
    Arbitrary data can be sent only by abusing the fact that output scripts aren't checked for any form of validity in the transaction that creates the output. There isn't anything that explicitly allows or disallows arbitrary data, just that people have realized they can abuse the laxness in order to embed aribitrary data in the blockchain. The point of the last paragraph is just that because you can have anything as a script, having the same script as the output that is being spent is allowed and that causes your "self-loops". – Ava Chow Oct 08 '19 at 19:58