Bitcoin Forum

Bitcoin => Development & Technical Discussion => Topic started by: Zetler on April 21, 2014, 08:26:08 AM



Title: Open Bootstrap.dat with VB.NET
Post by: Zetler on April 21, 2014, 08:26:08 AM
I downloaded the torrent with the entire blockchain and tried to open bootstrap.dat.

With its 17GB it is obviously too large for most text editors, so I programmed a VB.NET app to do this.

Assuming encoding ISO-8859-1, I get this rather confusing line:
""                                     ;z{z,>gvaÈQ2:K^J)_I +|                                   M EThe Times 03/Jan/2009 Chancellor on brink of second bailout for banks *   CAgUH'gq0\֨(9   yba޶I?L8U\8M WLp+k_          o""

Assuming UTF8 does not make much more sense either:
"����                                     ;���z{�z�,>gv�a��Q2:���K^J)�_I�� �+|                                   ����M�� EThe Times 03/Jan/2009 Chancellor on brink of second bailout for banks���� �*   CAg����UH'g�q0�\֨(�9   �yb��a޶I��?L�8��U���\8M�� �W�Lp+k�_�    �����      o�"

Will it work if I change the encoding on this VB.NET code?
System.Text.Encoding.UTF8



Title: Re: Open Bootstrap.dat with VB.NET
Post by: Sukrim on April 22, 2014, 12:19:26 AM
...the file is in a binary format. The small piece of text you see is the genesis block by Satoshi, he embedded it on purpose to make sure he did not "premine" a chain in secret, since it would have been impossible to predict the headline of The Times in advance.


Title: Re: Open Bootstrap.dat with VB.NET
Post by: danneu on April 22, 2014, 12:24:45 AM
View it in hexadecimal for a better representation of the data.

If bootstrap.dat is a concatenation of what you find in block.dat files, then the data is a repeating sequence of:

  • Magic bytes: uint32 little endian
  • Byte-count of the block: uint32 little endian
  • Block: BlockCodec (https://en.bitcoin.it/wiki/Protocol_specification#block)