Blocks are the fundamental part of blockchain technology and can be thought of as the pages of the blockchain’s distributed ledger. Each block contains information including the transactions performed on the blockchain platform, the information of these transactions includes the time of execution, the address of the sender and receiver, a specific hash, and the hash of the previous block.
Merkel tree is one of the terms related to digital currencies. This tree, which is a part of every block in the blockchain, is named after the famous mathematician Ralf Merkel. This technology is used to provide information using a hash. The data is first hashed, and then the hash values are merged together and become a single hash, which is called the root of the Merkel tree. The leaves of this tree represent the transactions made in the network and the branches of the tree are the hashes of the leaves.
By guaranteeing indices and leaves, building the hash root is quick and easy. But due to the characteristics of hash functions, which are one-way transformations, if the hash of the root of the tree is known but the leaves and branches are unknown, it is difficult to guess the transactions.
The structure of the block in the blockchain. In general, the block can be interpreted as a permanent data storage file. Each block consists of two parts: block header and block body. The block header contains various information that perform various tasks, and the block body is where the history of confirmed transactions is stored.
The body of the block is where the history of confirmed transactions is stored. Miners select and confirm transactions when creating a block, and these transactions are stored in the body of the block for easier verification.
Block header plays an important role in blockchain network processes.
Blocks are connected to each other through headers and identified in the network through hash headers. The header is divided into six sections, which include the program version, timestamp, previous block hash, Merkel tree root hash, target, and nance number. Each of these parts performs specific tasks in the operation of the whole block.
The program version number is used to describe the data structure inside the block, and through this number, computers can easily interpret the content of the block, and miners can determine the protocol used in the network through this program version number.
This time tag shows the chronological order of the blocks in the blockchain and specifies the creation time of each block. In addition to playing an essential role in the order of blocks, the time stamp also plays a role in hash rate changes and blockchain protection.
The hash of the previous block is placed as one of the hash values in the header block and ensures the prevention of censorship and fraud on the blockchain platform. This hash helps make the information in the blockchain immutable and undeletable. If someone wants to change the data of a block, he must also change all the hashes of the previous blocks, which is impossible, and the information in the blockchain remains unchanged.
By using hashing, all information in a block (transaction information, proprietary hash, and hash of the previous block) is collected into a single hash or the root of the Merkel tree. This root Merkel tree can be constructed quickly and easily and is used as a proxy of all block information.
The hash size in the blockchain is measured in bits, and the hash of the current block must be smaller than or equal to the target hash. The target specifies how small the hash value is and determines how small the hash must be for miners to verify it.
The Nance number is used only once and is added to the hash block through the proof-of-work algorithm. Miners try to get this number by solving complex math problem.
Blocks are created by miners. Transactions are first stored in the memory pool and wait for nodes to confirm. Miners select and verify transactions and create block candidates. To add a block to the blockchain network, miners hash the block and add it to the chain of blocks based on the difficulty goal of the network to be built.