Bitcoin Forum

Bitcoin => Development & Technical Discussion => Topic started by: jacko27 on December 02, 2017, 10:33:12 AM



Title: New Bitcoin Block Format
Post by: jacko27 on December 02, 2017, 10:33:12 AM
What’s the best resource to see the actual bitcoin block in it’s raw readable format?

For example, if I want to see the actual bitcoin block data?


Title: Re: New Bitcoin Block Format
Post by: cr1776 on December 02, 2017, 12:09:26 PM
What’s the best resource to see the actual bitcoin block in it’s raw readable format?

For example, if I want to see the actual bitcoin block data?

Download the block chain with Bitcoin Core and use a hex editor to look in the files. Or is that too low a level?


Title: Re: New Bitcoin Block Format
Post by: hopeAo on December 02, 2017, 01:30:02 PM
What’s the best resource to see the actual bitcoin block in it’s raw readable format?

For example, if I want to see the actual bitcoin block data?

The best resource to see the actual bitcoin block in its raw readable format is the hex Editor.

After you have gotten the block hex (the raw data for the block itself), you can then make it a file by putting the hex into a hex editor or better still you can save the hex as a string in a text file.


Title: Re: New Bitcoin Block Format
Post by: achow101 on December 02, 2017, 06:12:26 PM
Download the block chain with Bitcoin Core and use a hex editor to look in the files. Or is that too low a level?
Or you could use the getblock command to get the block as a hex string or decoded in JSON.


Title: Re: New Bitcoin Block Format
Post by: haltingprobability on December 02, 2017, 07:51:37 PM
What’s the best resource to see the actual bitcoin block in it’s raw readable format?

For example, if I want to see the actual bitcoin block data?

As long as you're not doing anything that requires trust (in which case, you should use Core), you can just go to:

Code:
https://blockexplorer.com/api/rawblock/<block_hash>


Title: Re: New Bitcoin Block Format
Post by: jacko27 on December 03, 2017, 04:43:51 PM
What’s the best resource to see the actual bitcoin block in it’s raw readable format?

For example, if I want to see the actual bitcoin block data?

As long as you're not doing anything that requires trust (in which case, you should use Core), you can just go to:

Code:
https://blockexplorer.com/api/rawblock/<block_hash>

Now when I do this

https://blockexplorer.com/api/rawblock/000000000000000000a7b4999c723ed9f308425708577c76827ade51062e135a

I get this

{"rawblock":"00000020a15e218f5f158a31053ea101b917a6113c807f6bcdc85a000000000000000000cc7cf9e ab23c2eae050377375666cd7862c1dfeb81abd3198c3a3f8e045d91484a39225af6d00018659e5e 8a0101000000010000000000000000000000000000000000000000000000000000000000000000f fffffff64030096072cfabe6d6d08d1c2f6d904f4e1cd10c6558f8e5aed5d6a89c43bb22862464e bb819dd8813404000000f09f909f104d696e6564206279206a6f73656d737200000000000000000 0000000000000000000000000000000000000000000000000007f06000001807c814a0000000019 76a914c825a1ecf2a6830c4401620c3a16f1995057c2ab88acefebcf38"}

But trying to decode that yields gibberish.

Suggestions?



Title: Re: New Bitcoin Block Format
Post by: Coding Enthusiast on December 03, 2017, 05:31:26 PM
=======Block Header=======
00000020 version
a15e218f5f158a31053ea101b917a6113c807f6bcdc85a000000000000000000 previous block header hash
cc7cf9eab23c2eae050377375666cd7862c1dfeb81abd3198c3a3f8e045d9148 merkle root hash
4a39225a time = 1512192330 = Saturday, December 2, 2017 5:25:30 AM
f6d00018 nBits = 402706678
659e5e8a nonce = 2321456741
=====================

01 tx count = 1 (aka Coinbase transaction)

=======Transactions in the block=======
01000000 version
01 tx_in count
0000000000000000000000000000000000000000000000000000000000000000 previous_output
ffffffff index for coinbase tx is 0xffffffff
64 script bytes = 100
03009607 op_3 (bytes in height) + height 497152
2cfabe6d6d08d1c2f6d904f4e1cd10c6558f8e5aed5d6a89c43bb22862464ebb819dd8813404000 000f09f909f104d696e6564206279206a6f73656d73720000000000000000000000000000000000 0000000000000000000000000000000000 arbitrary coinbase script
7f060000 sequence = 1663
01 tx_out count
807c814a00000000 amount = 1250000000
19 76 a9 14 c825a1ecf2a6830c4401620c3a16f1995057c2ab 88 ac P2PKH script
efebcf38 Lock time = 953150447 = Wednesday, March 15, 2000 8:00:47 PM

Note: The hashes are in internal byte order; the other values are all in little-endian order.
Read more: https://bitcoin.org/en/developer-reference#block-chain