10 years of Bitcoin

Valerio Vaccaro
3 min readJan 2, 2019

--

Soon bitcoin will turn 10 years, a lot of data is available in the blockchain, I decided to start an analysis about some data we get from this firsts 10 years. Software needed:

Dataset

The first step is to extract a dataset for all blocks between 0 and actual heigh, we can use bitcoin iterate (plus a full-node) using the following command.

./bitcoin-iterate --block='%bN %bs %bc %bl %bn' > blocks.csv

Or you can download the result file on http://bitcoin.vaccaro.tech/blocks.csv update daily.

We can analyze this dataset with a simple R script, first step is import the dataset in R, we can do it with the following script.

library(readr)
library(ggplot2)
dataset <- read_table2("blocks.csv", col_names = FALSE)
names(dataset) <- c("block_id", "timestamp", "transactions", "size", "nonce")
dataset$timestamp <- as.POSIXct(dataset$timestamp, origin = "1970-1-1")
dataset$transactions <- as.numeric(dataset$transactions)
dataset$size <- as.numeric(dataset$size)
dataset$nonce <- as.numeric(dataset$nonce)
dataset$delta <- c(0,tail(dataset$timestamp, -1) - head(dataset$timestamp, -1)) / 60

Block delay

We want plot the delay between two blocks (in minutes), in our dataset this is in the delta column, due to the hight variability we will use a logarithmic chart. We can use the following code.

delta <- ggplot(dataset, aes(x=timestamp, y=delta, color=transactions)) +
geom_point(alpha=0.01, size=1) +
geom_hline(yintercept = 10) +
geom_smooth() +
scale_y_log10() +
scale_color_gradientn(colours = rainbow(50)) +
ggtitle("Time between blocks - 10 years") +
labs(y="Time [m]", x="Date")
ggsave(filename="delta.png", plot=delta, width = 15, height = 10)

Nice! Around 1 block every 10 minutes without big differences(except first year). Remember that you are watching a logarithmic chart! The black line identify 10 minutes.

Block size

Using the same dataset we can plot the size of all available blocks in the chain. We can use the following code.

size <- ggplot(dataset, aes(x=timestamp, y=size, color=transactions)) +
geom_point(alpha=0.01, size=1) +
geom_hline(yintercept = 1000*1000) +
scale_color_gradientn(colours = rainbow(50)) +
ggtitle("Block sizes - 10 years") +
labs(y="Size [B]", x="Date")
ggsave(filename="size.png", plot=size, width = 15, height = 10)

You can easily identify when blocks are full, when SegWit was activated and you can identify some kind of “standard block sizes” in form of horizontal lines in the chart. The black line identify the size of 1.000.000 bytes.

Nonce

Let’s check nonce distribution in the dataset, we can use the following code.

size <- ggplot(dataset, aes(x=timestamp, y=nonce, color=transactions)) +
geom_point(alpha=0.05, size=1) +
geom_hline(yintercept = 1000*1000) +
scale_color_gradientn(colours = rainbow(50)) +
ggtitle("Block nonce - 10 years") +
labs(y="nonce", x="Date")
ggsave(filename="nonce.png", plot=size, width = 15, height = 10)

This is just an introduction, I will add new charts soon.

--

--

Valerio Vaccaro

Engineer, Bitcoiner, Data Scientist, IoT Expert and Tech Enthusiast. Co-founder of @scamcoinbot. Dad of @otsproofbot.