“What’s inside a block on the blockchain?”

--

As a blockchain node operator, I often get into conversations with people who are exploring blockchain and cryptocurrencies, but struggle with the plethora of concepts and terms used in the scene.

The questions that pop up in these conversations tend to be an interesting mix of legitimate concerns, false comparisons, and twists of thought. Therefore, I thought it would be fun to share some of them here, along with their answers.

First one up: “What’s inside a block on the blockchain?”

Genesis Block

A blockchain is a trustless peer-to-peer database: a shared, immutable ledger where participants (called nodes) add, communicate and validate records of transactions and assets (called blocks).

The first block in a blockchain is called the Genesis block. This block is often unlike the others in that it is hardcoded and doesn’t refer to previous blocks. All other blocks follow a structure as described below.

Block Header

The header of the block consists of six components.

Block Number

The Block Number states the version of the blockchain network protocol. Just like how smartphones and computers have different versions, blockchains do too. The blockchain uses the Block Number to see what features or protocols the block supports.

Previous Block Hash

In order for the blocks in a blockchain to form a chain, the blocks need to be connected. This Hash lets the new block know which block came before it. Except for the Genesis Block, all blocks have this information stored in their block header.

Merkle Root Hash

On the blockchain each transaction has a hash associated with it. The Merkle Tree groups these transactions into pairs until just one hash remains. That last hash is called the Merkle Root Hash.

So, if we were to have 1000 transactions, the Merkle Tree would group them into pairs of 500, then 250, 125 and so on. Or on a smaller scale, if we were to have 4 transactions (A, B, C and D), the Merkle Tree would group first group them in 2 pairs (AB and CD) and then pair AB and CD to form the root hash (ABCD).

In short, the Merkle root is the hash of all the hashes of all the transactions in the block. This scheme makes it possible to determine if the network has accepted a transaction or not without having to download the full blockchain.

Timestamp

Each block contains a Unix timestamp. This timestamp states when the block was added to the blockchain in seconds.

Nonce

A Nonce is a 32-Bit number found in the block headers of blockchains such as Bitcoin and Ethereum. It is a unique number that can be just used once on the entire blockchain and is used for block - and transaction - authentication.

In Proof of Work blockchains, miners (computers) are assigned mathematical problems to solve. Once a miner solves the problem it will get a hash value. If the hash value is verified the block is added to the chain and the miner gets a block reward in the form of cryptocurrency.

The Nonce is often used to prevent malicious behavior on a blockchain, such as double spend attacks (attempting to spend the same funds twice in rapid succession) and replay attacks (an exploit that copies transaction details on forked crypto-currencies to allow transactions to be valid across both chains).

Block Body

The Block Body is the second part of a block. It contains the data of all the transactions that are added in this block and are confirmed on the blockchain.

Was this post fun or helpful? Great! Please consider giving it a thumbs up and sharing it with others. Did it leave some questions unanswered? Let me know which ones and I will answer them as soon as I can.

Cheers,
Olivier Wouters

Operator of the IDEAL Stake Pool

--

--