How I converted the entire Bitcoin Core Blockchain into images. #NFT

Opinions are that of my own. Do your own research and verify all aspects. I am not responsible or accountable for any aspects if you decide to buy images on the internet.

Sneak peak before we get started!

Video below of a sample BLK file.

The idea — Convert the entire Bitcoin Blockchain into images.

I’ve been into crypto / blockchain for a while now and actually had this idea well before the current NFT trend. Unfortunately technical limits (compute +bandwidth) and personal time constraints left me only a couple hours a week to work on this. I wanted to share this a few months ago.

I went through a number of iterations before landing where we are now.

I wanted a way to display not just a heatmap but actual data of some sorts.

So here we are with my attempt to put the entire life of the Bitcoin Core chain from the genesis block to today into pictures..

I hope least a couple people out there will enjoy this collection.

I’d also like to preface the below with the fact that I’m not a programmer and I’m certain there are better ways to loop my scripts but the end result looks decent to me. I also want to be as transparent as possible with my methods and outcomes. Should anyone decide to buy one of the NFTs , please read this. This was initially a curiosity project but I think its turned out pretty cool.

Getting the data.

Before I could even get started the first step was getting my hands on the Data so I could start digging into it.

This was fairly straightforward and involved setting up a Bitcoin Core node.

Naturally it took a while and a few hundred GB of storage space to actually “complete”. Given blocks constantly generate I regularly updated my node to the latest block.

Eventually It completed and looking at the file system it’s around 2500.dat files. Each 130MB~ in Size.

Opening them with a txt editor basically gave us nothing.

Converting binary “.dat” raw data to HEX.

After a bit of research I found these database.dat files are basically just binary. I won’t bore you with everything I tried (a lot) but I eventually settled and hacked this little python script.

https://docs.python.org/3/library/binascii.html

You can Read more about this module here:

Now we are getting somewhere. This gave me a 500MB+ .txt file in hex. EG below.

Reading it — Satoshis hidden message.

If you dump this into a HEX to string tool the first few lines are showing the Genesis block and Satoshis Secret message!

http://string-functions.com/hex-string.aspx

Read more about this here:

https://en.bitcoin.it/wiki/File:Jonny1000thetimes.png

At this point I should just add that the BLK files contain hundreds of blocks.

690000 / 2500 = 276Blocks per image / .Dat file.~

Converting hex to Images.

Once again I actually turned to Python and used the below docs/ modules:

Bam! We have images!

At this point hopefully you can start to understand the data sizes x 2500.

  • Raw.dat — 130MB~
  • .txt HEX — 500MB~
  • PNG — 200MB ~

Somewhere around 2TB of disk was needed. I was lucky enough to have a high speed 1TB nvme.m2 I used for processing before migrating.

The images.

I must say I love looking at the images, They are very high def and huge but you can zoom around them and see some really cool patterns.

Picking a file at random here and zooming.

  • @{name=blk00012.dat}.png

You can start to see some cool data after some significant magnification.

Hopefully at this point there is a little acknowledgement for the pure scope of data as well as compute power. These images are unique and full of massive numbers of pixels.

  • 13376 x 13376 px = 178917376 px per file.
  • 178,917,376
  • By comparison, 4k TV resolution is around 3840 x 2160

I love the unique images even though they look like grey blobs until you zoom like crazy.

Bringing it all together.

I won’t bore you with too many details. Once I got a working process I setup a bit of a loop that pulled names ftom csv and It it go in batches of 100~.

I’ve got a decent gaming machine and this just took forever to process. I’d kick off the jobs that ran for about 6 hours each batch smashing my Cpu, memory and disk.

Image resizing.

Opensea has a maximum size limit of 40mb per file so I needed to cut down the resolution a bit.

If you want to view the file on opensea be sure to open the full file then save it local, not just the thumbnail. Click > Click > save.

Launching the collection.

The initial NFT collection can be found below if you want to have a look at some files. As mentioned , save them to a PC first . It helps to have a good contrast screen too.

I will be limiting this to 100.

https://opensea.io/collection/bitcoin-blocks

You can follow me on twitter to keep updated: @xenzor1

Conclusions.

For the most part I’m fairly happy with the outcome given some challenges.

File size, bandwidth and straight up compute power / time became my biggest obstacles but I really enjoy browsing the images and zooming in and out to look at the data patterns. I hope that others may too enjoy a visual representation of the raw data.

Twitter - @xenzor1 All views and opinions expressed are that of my own.