Как именно связать 2 блока, используя хэш предыдущего блока?

Вам нужно импортировать оператор map:

import 'rxjs/add/operator/map'
2
задан Neeraj Kumar 20 March 2019 в 13:08
поделиться

1 ответ

Блок содержит заголовок и некоторые данные (обычно транзакции). Единственная часть, которая используется для вычисления хеша, это заголовок блока.

Заголовок блока содержит следующее:

Заголовок блока

{версия 4B} {хеш предыдущего блока 32B} {корень хеша merkle 32B} {время 4B} {биты 4B} {одноразовый номер 4B}

version (4 Bytes) - Block format version.
previous block hash (32 Bytes) - The hash of the preceding block. This is important to include in the header because the hash of the block is calculated from the header, and thus depends on the value of the previous block, linking each new block to the last. This is the link in the chain of the blockchain.
merkle root hash (32 Bytes) - The hash of the merkle tree root of all transactions in the block. If any transaction is changed, removed, or reordered, it will change the merkle root hash. This is what locks all of the transactions in the block.
time (4 Bytes) - Timestamp in Unix Time (seconds). Since the clocks of each node around the world is not guaranteed to be synchronized, this is just required to be within of the rest of the network.
bits (4 Bytes) - Target hash value in Compact Format. The block hash must be equal to or less than this value in order to be considered valid.
nonce (4 Bytes) - Can be any 4 Byte value, and is continuously changed while mining until a valid block hash is found.
0
ответ дан JBaczuk 20 March 2019 в 13:08
поделиться
Другие вопросы по тегам:

Похожие вопросы: