Bitcoin: In what order is the blockheader hashed?

Hash functions used in bitcoin

The Bitcoin consensus algorithm is based on a encryption system that ensures the integrity and safety of the block chain. Hash functions play a crucial role in maintaining the confidentiality of the network and uncomplicated properties. In this article, we explore the way the block was decentralized to produce the next Bitcoin block.

Hash functions

Bitcoin protocol uses two main decentrals:

  • Sha-256 (safe hash algorithm 256) : This is the function of primary encryption graphic used in most of the Bitcoin events.
  • Merkle Tree : This is a digital wooden data structure that allows us to check the correctness of the block chain.

Display of blocks

The following steps are performed to produce blockheader:

  • Calculate the previous block event Sha-256 Hash

Transactionhash in the previous block is used as an income for the SHA-256-Hash function.

  • Add the Merkle and Nonce root for departure

The output of the SHA-256-Hash function is added with a random (unique figure) and Merkle root and other relevant information.

Operations order

Here is a step -by -step specification how the block’s head is decentralized:

  • Sha-256 Hash from the previous event of the block

    Bitcoin: In what order is the blockheader hashed?

    : Calculate the SH-256 event in the previous block.

  • Add Merkleju and nonce : Combine the Merkle root of the previous block, nonce and sha -56 hash to produce a new value.
  • Hash : Apply the SHA -256 hash feature to this new value.

Calculation of the size hash

Let’s look at the following example to give a picture of what is happening behind the scene scenes:

Suppose we have three blocks: block A, block B and block C. The event in block A is as follows:

`

Event A (Txid = 1) - Value = 10

Here are the steps tied to the hash of block A:

  • Calculate Sha-256 Hash :Sha-256 (10)
  • Add the Merkle and nonce root : The Merkle root is created with a random selected Merkle tree, and to the result is added nonce (0x1234567890ABCDEF).
  • Hash : Apply the SHA -256 hash feature to this new value.

The event of the Hash block would be: 0 ... 012345678901234567890ABCDEF

Similarly, we can calculate the seals in blocks B and C:

  • Block B rod:

* Event in Block B

Event B (Txid = 2) - Value = 20

Hash:

* Sha-256 (20)

* Add Merkle Rock and Nonce:0 … 123456789012345678901234567890ABCDEF

* Hash:0 … 01234567890123456

  • Block C’s Hash:

* Event in block C

`

Event C (txid = 3) - value = 30

Hash:

* Sha-256 (30)

Add Merkle Root and Nonce:0 … Fedcba987654321098765432109876 *

* Hash: 0 ... 01234567890123456

The Hash of the Block C Result event would be:0 – 01234567890ABCDEF

Ethereum From

Laisser un commentaire

Votre adresse e-mail ne sera pas publiée. Les champs obligatoires sont indiqués avec *

chat ouvert
Bonjour et bienvenue chez BabyKinder ! Besoin d'aide ? Nous sommes là pour vous assister. N'hésitez pas à nous contacter pour toute question ou assistance. À votre service 🛍️"