What are blocks in blockchain technology?

Overview

Block is a place in a blockchain where data is stored. In the case of cryptocurrency blockchains, the data stored in a block are transactions. These blocks are chained together by adding the previous block's hash to the next block's header. It keeps the order of the blocks intact and makes the data in the blocks immutable.

Structure of blocks

The structure of a block is different for every blockchain. However, a general structure of a block is as follows:

Block's structure

A block consists of the following two main parts:

  • Header
  • Body

Header

A block's header contains information about the block and the miner. It is further divided into subparts which are as follows:

Previous block's hash

This is the hash of the previous block. It chains the blocks together and makes the data in the previous blocks immutable. If data in the previous blocks is changed, then the hash of that block will change causing the unchaining of the blockchain.

Other block header fields

These fields can vary depending on the different requirements of different blockchains. Some of the common fields are as follows:

Nonce: This is an integer that a miner changes to change the hash of the block to achieve the network's difficulty.

Timestamp: This is the time at which the block was mined. It is usually in the Unix timeNumber of seconds elapsed since 1st January 1970.

Difficulty: It is the current difficulty level of the network. It is stored in different formats in every blockchain.

Merkel root hash: Hashes pair off transactions until only one hash remains, called a root hash or a Merkel root hash.

Block height: The number of blocks mined between the genesis block and the current block.

Structure of a Bitcoin blockchain's block header

Body

It includes all the data stored in the block, such as transactions. Every blockchain has a different format for storing transactions. An array of transactions is stored in the body of the block.

Copyright ©2024 Educative, Inc. All rights reserved