Analyze Blockchain Data Statistically

Bitcoin blocks are limited to roughly 1,000,000 bytes, depending on the software adopted by the nodes. However, there is no a priori limit on the number of transactions.

This example uses BlockchainBlockData to analyze whether there is a relationship between block size and the number of transactions in a block.

Get the "ByteCount" and "TransactionList" of the last 100 Bitcoin blocks.

For each block, get the byte count, compute the number of transactions and pair the numbers.

Compute the minimum and maximum block sizes.

Construct a linear model of the data.

Plot the data and the fit, focusing on the inner 90 percent of data points.

The plot shows a positive but relatively weak correlation between the size and transaction count, which is confirmed by the R-squared coefficient of the fit.

Plotting how the two properties change over blocks also suggests changes are independent.

A 3D histogram of the data shows a strong peak around roughly 3000 transactions and 1.2 MB, but with variations in all directions.

Related Examples

de es fr ja ko pt-br zh