loader image

What is a block? Introduction to function of a Block in Blockchain

What is Mainnet? Introduction to the Mainnet
What is Mainnet? Introduction to the Mainnet
ژانویه 19, 2024
Bitcoin dip still continues | Price Analysis
Bitcoin dip still continues | Price Analysis
ژانویه 19, 2024
What is a block? Introduction to function of a Block in Blockchain

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.

Block introduction Block task in blockchain

What is a Merkle Tree?

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.

Block structure in blockchain

Block structure in blockchain

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.

Block Body

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

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.

Program version (Version)

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.

Timestamp

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.

Hash of the previous block (Last Block)

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.

Merkle Root Hash

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.

Target

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.

Nonce number

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.

How to create a block in the blockchain

How to create a block in the blockchain

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.