Skip to main content

8.8 Blocks

The block header is divided into two parts, the block header and the block body. The block header is the blockchain part of Xiden. This is the structure that contains the hash of its predecessor block (also known as parent block), building a cryptographically guaranteed chain.

The block body contains a list of transactions that have been included in this block, and a list of uncle (ommer) block headers.

block header

The block header contains the following fields:

  • parentHash - Hash of the block header from the previous block. Each block contains a hash of the previous block, all the way to the first block in the chain. This is how all the data is protected against modifications (any modification in a previous block would change the hash of all blocks after the modified block)

  • ommersHash - Hash of the uncle blocks headers part of the block body

  • beneficiary - Xiden account that will get fees for mining this block

  • stateRoot - Hash of the root node of the world state trie (after all transactions are executed)

  • transactionsRoot - Hash of the root node of the transactions trie. This trie contains all transactions in the block body

  • receiptsRoot - Every time a transaction is executed, Xiden generates a transaction receipt that contains information about the transaction execution. This field is the hash of the root node of the transactions receipt trie

  • logsBloom - Bloom filter that can be used to find out if logs were generated on transactions in this block (if you want more details check this Stack Overflow answer). This avoids storing logs in the block and facilitates storage saving.

  • difficulty - Difficulty level of this block. This is a measure of how hard it was to mine this block.

  • number - Number of ancestor blocks. This represents the height of the chain (how many blocks are in the chain). The genesis block has number zero

  • gasLimit - Each transaction consumes gas. The gas limit specifies the maximum gas that can be used by the transactions included in the block. It is a way to limit the number of transactions in a block

  • gasUsed - Sum of the gas cost of each transaction in the block

  • timestamp - Unix timestamp when the block was created.

  • extraData - Arbitrary byte array that can contain anything. When a miner is creating the block, it can choose to add anything in this field

  • mixHash - Hash used to verify that a block has been mined properly

  • nonce - Same as the mixHash, this value is used to verify that a block has been mined properly.

block diagram