How is a block from the blockchain constructed?

Did you know that a block from the blockchain consists of multiple elements?

Of course, we all know that "blocks" are created on the blockchain.
Duhhh..

But do we also know how these blocks are put together?

Let's dive into that.

BlockHeader

The block header is divided into six components:

  1. the version number of the software

  2. the hash of the previous block

  3. the root hash of the merkle tree

  4. the time in seconds since 1970-01-01 T00: 00 UTC

  5. the difficulty

  6. the nonce

The version number

The version number of the software does not matter in most cases. However, a miner with a given version number can indicate which protocol decisions it supports.

The hash of the previous bock

Namely, this guarantees the chain part of the blockchain. The hash of the previous block is incorporated into the hash of the new block, thus the blocks of the blockchain all build on each other. Without this component, there would be no connection and chronology between the blocks.

The root hash of the merkle tree

All transactions in a block can be merged into a hash. This is the root hash of the Merkle tree (I will write more explanation of this in the future).

The time in seconds

Also called a time stamp.
It is added the moment a miner begins searching for a block.

The difficulty (DIFFICULTY ADJUSTMENT)

The difficulty level indicates a certain goal that must be achieved to "win" with mines. This goal in turn indicates how small or large the hash that miners must find must be. Again, I will explain more about this in the future

The nonce

The nonce is a number that miners use to search for the correct hash. The miner guesses a valid hash, by entering the correct nonce into an algorithm.

Block Body

"The body" can be compared to a large index in which all transactions are listed and also the transactions dei confirmed by the block.

By the way, the first transaction in a block is the coinbase transaction. This is the transaction that records how much the miner receives in rewards and fees.

Basically, this is what a block from the bitcoin blockchain looks like.