June 24, 2023
Each block contains a block header and a block body.
The block header is an 80-byte segment at the beginning of each block. It contains essential information about the block, including: (We'll take block number 795,633 as our reference)
The Merkle root is derived from the hashes of all transactions included in this block, ensuring that none of those transactions can be modified without modifying the header. I won't go in depth here because I already have published two detailed articles on it. I'll provide the link for your reference.
In a blockchain context, a Merkle tree is constructed for the transactions within a block. Let's take an example to illustrate this process. Consider a block containing four transactions:
A Merkle Tree is a binary tree of hash values, where each leaf node represents a single piece of data or a hash of a piece of data. It is used to verify the integrity of large amounts of data efficiently. It was invented by Ralph Merkle in 1979 and is widely used in cryptocurrencies like Bitcoin and Ethereum.
Merkle root for (795,633): 8ac3cfc68465375943e1c625e3a1c6c02d4f7d2fd66cd91b68165fcc152d9f6f
The timestamp of when the block was mined. Block 795,633 was mined on Jun 24, 2023 12:02 AM UTC.
A value representing the mining difficulty level at which the block was mined. It was 52,350,439,455,487.47 for Block 785,633.
A random value that miners change in order to find a valid block hash. It was 3,492,054,801 for our Block in reference.
The block body is the part of the block that has all the transactions. Transactions are the records of who sent and received bitcoins. In other words, transactions represent the movement of Bitcoins from one address to another. Each transaction contains the following elements:
Let's take an example from our reference block 795,633. You can view all the transactions present in this block by going to any bitcoin blockchain explorer and pasting the transaction hash. Let's take an example of a transaction with hash:76060e5f6947dd875ab84f41a8ee87d9b9344f25a6737b9502d42bc9c90fba20
There are some additional information such as, the position, which gives us the information regarding the index of the transaction in the block.
The block body also has a special transaction that gives bitcoins to the miner who found the block. It is called the Coinbase transaction, which is the first transaction (position: 1) in the block. It has no inputs, but has one or more outputs, which specify the reward for the miner who found the block solution.
The miner gets some bitcoins as a reward for finding the block and some bitcoins as fees for including the transactions in the block. In case of our reference block, the transaction id for that special transaction is:a2acdd6473c049a7cf1ca38ce91e6cb0a9e6099a90e0749f2a183e320478fe6f
You can copy this transaction id and search it in any bitcoin explorer to get additional details.
Bitcoin blocks are created by miners, who are responsible for verifying transactions and adding them to the blockchain. Miners use powerful computers to solve complex mathematical problems, and the first miner to solve the problem and validate the transactions in a block is rewarded with newly created bitcoins. Once a block is created, it is broadcast to the network, and other nodes on the network validate the block before adding it to their own copy of the blockchain. I have written a detailed article on explaining how this works. Please refer to the following article.
Proof-of-Work (PoW) is a consensus algorithm vital in securing and validating transactions in blockchain networks.
In summary, Bitcoin blocks are a fundamental building block of the blockchain and are responsible for ensuring the security and immutability of the Bitcoin network. Without blocks, the blockchain would not exist, and the entire Bitcoin ecosystem would be compromised. Understanding how blocks work is essential for anyone looking to learn more about Bitcoin and the wider world of cryptocurrencies.
Subscribe to the newsletter to learn more about the decentralized web, AI and technology.