Visualizing individual transactions with the Bitcoin API

23rd September, 2019

Part 2: Visualizing individual transactions

This is the second of two posts exploring the uses of graph visualization to understand cryptocurrency. We’ll use Bitcoin data throughout, but the concepts could also be applied to other cryptocurrencies.

In part one, we introduced the topic of cryptocurrency and Bitcoin, and visualized some Bitcoin blocks, to identify different kinds of transactions. While visualizing an entire block can be interesting, and useful for understanding transaction patterns and anomalies, it can also be restrictive.

A different approach is to explore individual transactions and how they link to other transactions in other blocks. That’s what we’ll do in this post, with the help of our sequential layout.

Visualizing individual Bitcoin transactions

The first-ever Bitcoin transaction happened at block height 170 on 12th January 2009. Before this point, Bitcoin blocks contained no transactions beyond the miner reward.

visualizing the first Bitcoin transaction
The first bitcoin transaction in 2009. Grey nodes represent transactions, inputs are orange and outputs are teal, grouped by address

It was between Bitcoin founder Satoshi Nakamoto and programmer Hal Finney, and follows a typical transaction structure. Here, Nakamoto sent Finney a total of 10 Bitcoins, using a 50 Bitcoin input and a 40 Bitcoin output as change.

Exploring these data in the transaction-centric view reveals some interesting details.

visualizing bitcoin transactions as a network
Visualizing the first Bitcoin transaction in KeyLines, using bands and the sequential layout to help show activity over time

In this visualization, grey nodes with the double arrow icon represent transactions, orange links are inputs and teal links are outputs as before. Filled nodes represent unspent outputs, and empty nodes represent spent outputs.

We can see Nakamoto’s 50 Bitcoin input on the left, and Finney’s output and Nakamoto’s change are on the right.

Double-clicking on a spent output will fetch data about that output from the Bitcoin API. This data is then parsed and loaded into the chart, expanding it in place.

This user interaction allows the user to explore transaction data through time, both forward and backward, in a controllable, logical way. It’s a powerful technique for investigating specific transactions of incidents, without suffering data overload.

visualizing data from the bitcoin API
Using the Bitcoin API, we can pull in data about more transactions on-demand

Expanding Nakamoto’s input node, we can see the origins of the Bitcoins he transferred to Finney. They originated from the miner rewards for the block at height 9, meaning Nakamoto successfully mined the ninth block in the Bitcoin blockchain.

visualizing data from the bigcoin API
Understanding the provenance of the coins used in the first-ever Bitcoin transaction: What happened to Finney’s 10 Bitcoins?

Exploring in the other direction, we can find out how the outputs from this historic transaction were later spent.

First looking at Finney’s output, we can see that this remained unspent until block 92,240, almost 3 years after he received the funds.

After this point, the outputs were spent in a series of transactions over a short time period. Some of these transactions feature unspent outputs totaling 1.69 Bitcoins, the private keys for which could potentially be lost.

Exploring Nakamoto’s output branch
Exploring Nakamoto’s output branch

Alternatively, we can expand Nakamoto’s side of the transaction. Shortly after the initial transaction, he made a 10 Bitcoin payment to another address, which has not yet been spent.

This left Nakamoto with 30 Bitcoins on his address, and he immediately went on to pay 1 Bitcoin to yet another address. Following this, Nakamoto made a series of further transactions, leaving him with 18 Bitcoins on this address of his, which remains unspent to this day.

Nakamoto’s unspent output
Zooming in to Nakamoto’s unspent output, worth $170,000 today. Hopefully they kept a record of the key to these funds!

It is worth noting that the reason we are able to gain this level of insight is because this transaction was announced and the participants were known (The cryptographic addresses involved could be associated with the users behind them).

Let’s look at another notable transaction from Bitcoin’s history.

The $100,000,000 pizza

On 17 May 2010, Laszlo Hanyecz posted a request on a Bitcoin forum. He was offering to pay 10,000 Bitcoins, then worth about $41, for two pizzas.

On 22 May 2010, fellow forum user ‘jercos’ took him up on the offer and ordered the two Papa John’s pizzas. Laszlo couldn’t know at the time that, had he kept the Bitcoins instead of buying two pizzas, he would have been $100,000,000 richer today. Proof of this historic purchase can be found in block 00000000152340ca42227603908689183edc47355204e7aca59383b0aaac1fd8.

In this block, there are two transactions. The first one is the pizza payment transaction from Laszlo to jercos. The second is the generation transaction: the reward for the Bitcoin user who successfully mined the block.

Let’s visualize this block with KeyLines:

Visualizing a single Bitcoin block containing two transactions
Visualizing a single Bitcoin block containing two transactions

Grouping nodes that share an address gives a clearer picture:

The same transaction block, with input and output nodes grouped by address
The same transaction block, with input and output nodes grouped by address

The structure is immediately clear. Laszlo used multiple unspent outputs from previous transactions to one of his addresses as inputs to the pizza transaction.

At the time of writing, if Laszlo had saved the original Bitcoins, he would have been able to order 6 million Papa John’s extra-large pepperoni pizzas, leaving a sizeable tip for the delivery driver. He should probably have kept hold of them.

Try it for yourself

The great thing about Bitcoin is all the data is publicly available, meaning anyone can visualize it and explore it for themselves. Our graph visualization toolkits make it quick and easy to build powerful visualization tools that can be deployed to unlimited end-users, anywhere in the world.

Want to try them for yourself? Request a free trial

More from our blog

Visit our blog