Data Structure of Bitcoin Block

This section describes the Data Structure of a Bitcoin Block.

The data structure of a Bitcoin block is described in the followting table:

Field        Size         Description

Magic #      4 bytes      Fixed value of 0xD9B4BEF9
Blocksize    4 bytes      Number of bytes of the block minus 4
Blockheader  80 bytes     6 header fields
Tx counter	 1 to 9 bytes Positive integer
Tx list                   List of transactions

The data structure of the blockheader fields:

Field         Size       Description

Version       4 bytes    The version of Bitcoin system
Previous hash 32 bytes   Hash of the previous block
Merkle root   32 bytes   The Merkle Root hash of transactions
Timestamp     4 bytes    Number of seconds since 1970-01-01 00:00
Bits          4 bytes    A representation of the networks current difficulty
Nonce         4 bytes    Generated by the miner to meet the hash requirement

Last update: 2018.

Table of Contents

 About This Book

 Introduction of Bitcoin

 Bitcoin Blockchain

 Bitcoin Wallet

 Bitcoin Core

 Bitcoin Transaction

 Bitcoin-Qt - Bitcoin Core GUI

Bitcoin Data Structure

 Data Fields of Bitcoin Block

 Merkle Root of Bitcoin Block

 Verify Merkle Root with Python

Data Structure of Bitcoin Block

 "getblock blockhash 0" - Serialized Hex Blcok Data

 Block Hash Calculation Algorithm

 Block Hash Calculation in Python

 References

 PDF Printing Version