Skip to content

Block Header Specifications


Block header format

Decred block headers occupy 180 bytes when serialized. The serialization format for a block header is displayed below:

Field type Description
ChainId uint32 Chain ID for unique identification
Version int32 Block version
PreviousHash crypto.Hash The previous block hash
GasLimit big.Int The gas upper limit of current block
GasUsed big.Int The amount of gas consumed in transactions of current block
Height uint64 Block height
Timestamp uint64 Block timestamp
StateRoot []byte State tree root after current block processing
TxRoot []byte The root generated after applying merkle tree to transaction data
ReceiptRoot crypto.Hash Merklet tree root of receipt generated after the transaction pocessing
Bloom [256]byte Used to check the information of EVM event quickly.
## Example encoded block header
  0x0 ,                                                                                                                                         //ChainId
  0x2 ,                                                                                                                                         //Version
  0xcf ,0x77 ,0xd3 ,0x47 ,0xff ,0x7b ,0xdc ,0xd3 ,0x36 ,0xc0 ,0xb2 ,0x37 ,0x5b ,0x1b ,0x2e ,0x3c ,0x8a ,0x56 ,0xa3 ,0xa8 ,0xc9 ,0xc1 ,0x8a ,0xfa ,0xab ,0x42 ,0x7c ,0x4e ,0xe3 ,0x4d ,0xa0 ,0x9 , //PreviousHash
  0x4 ,0xa ,0xba ,0x95 ,0x0 ,                                                                                                                   //GasLimit
  0x0 ,                                                                                                                                         //GasUsed                  
  0x8c ,0x78 ,                                                                                                                                  //Height
  0xce ,0xfb ,0xfe ,0xea ,0x5 ,                                                                                                                 //Timestamp
  0x20 ,0x1f ,0x54 ,0xa9 ,0x40 ,0xa2 ,0xc2 ,0xeb ,0x36 ,0xe4 ,0xfb ,0xb6 ,0x16 ,0x8e ,0x9f ,0x26 ,0x27 ,0xe3 ,0x2 ,0x18 ,0xb5 ,0xd8 ,0xa3 ,0x17 ,0xfe ,0x4b ,0xca ,0x34 ,0x91 ,0xd5 ,0xf3 ,0xc6 ,0x59 , //StateRoot
  0x0 ,                                                                                                                                         //TxRoot
  0x0 ,0x0 ,0x0 ,0x0 ,0x0 ,0x0 ,0x0 ,0x0 ,0x0 ,0x0 ,0x0 ,0x0 ,0x0 ,0x0 ,0x0 ,0x0 ,0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,0x0 ,0x0 ,0x0 ,0x0 ,0x0 ,0x0 ,0x0 ,0x0 ,0x0 ,0x0 ,0x0 ,0x0 ,0x0 ,0x0 ,0x0 ,0x0 ,0x0 ,0x0 ,0x0 ,0x0 ,0x0 ,0x0 ,0x0 ,0x0 ,0x0 ,0x0 ,0x0 ,0x0 ,0x0 ,0x0 ,0x0 ,0x0 ,0x0 ,0x0 ,0x0 ,0x0 ,0x0 ,0x0 ,0x0 ,0x0 ,0x0 ,0x0 ,0x0 ,0x0 ,0x0 ,0x0 ,0x0 ,0x0 ,0x0 ,0x0 ,0x0 ,0x0 ,0x0 ,0x0 ,0x0 ,0x0 ,0x0 ,0x0 ,0x0 ,0x0 ,0x0 ,0x0 ,0x0 ,0x0 ,0x0 ,0x0 ,0x0 ,0x0 ,0x0 ,0x0 ,0x0 ,0x0 ,0x0 ,0x0 ,0x0 ,0x0 ,0x0 ,0x0 ,0x0 ,0x0 ,0x0 ,0x0 ,0x0 ,0x0 ,0x0 ,0x0 ,0x0 ,0x0 ,0x0 ,0x0 ,0x0 ,0x0 ,0x0 ,0x0 ,0x0 ,0x0 ,0x0 ,0x0 ,0x0 ,0x0 ,0x0 ,0x0 ,0x0 ,   //Bloom


Example encoded block header as raw bytes

        0002cf77d347ff7bdcd336c0b2375b1b2e3c8a56a3a8c9c18afaab427c4ee34da009040aba9500008c78cefbfeea05201f54a940a2c2eb36e4fbb6168e9f2627e30218b5d8a317fe4bca3491d5f3c65900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000