wiki commit

This commit is contained in:
1HXb9KMAtwNJqz4egi6hJx08EQgJajiBTH
2020-01-02 15:54:47 -05:00
committed by buwiki
parent 8294c17c71
commit f3edac5084
2 changed files with 6 additions and 4 deletions
+2 -3
View File
@@ -7,7 +7,6 @@ With a block header, you can:
1. Calculate the hash of the block. 1. Calculate the hash of the block.
- The double SHA-256 hash of the block header. - The double SHA-256 hash of the block header.
2. Confirm the [proof of work](/protocol/blockchain/proof-of-work) was executed correctly. 2. Confirm the [proof of work](/protocol/blockchain/proof-of-work) was executed correctly.
- See [Difficulty Adjustment Algorithm](/protocol/blockchain/proof-of-work/difficulty-adjustment-algorithm) for more details.
3. Determine the relative location of the block in the blockchain. 3. Determine the relative location of the block in the blockchain.
- Using the previous block hash contained in the header - Using the previous block hash contained in the header
@@ -21,13 +20,13 @@ Since validation of all the transactions in the block can be expensive, the abil
| previous block hash | 32 bytes | [block hash](/protocol/blockchain/hash)<sup>[(LE)](/protocol/misc/endian/little)</sup> | The hash of the block immediately preceding this block in the blockchain. | | previous block hash | 32 bytes | [block hash](/protocol/blockchain/hash)<sup>[(LE)](/protocol/misc/endian/little)</sup> | The hash of the block immediately preceding this block in the blockchain. |
| merkle root | 32 bytes | [merkle root](/protocol/blockchain/merkle-tree)<sup>[(LE)](/protocol/misc/endian/little)</sup> | The merkle tree root of the transactions in the block. | | merkle root | 32 bytes | [merkle root](/protocol/blockchain/merkle-tree)<sup>[(LE)](/protocol/misc/endian/little)</sup> | The merkle tree root of the transactions in the block. |
| timestamp | 4 bytes | unix timestamp<sup>[(LE)](/protocol/misc/endian/little)</sup> | The epoch timestamp of the block in seconds. | | timestamp | 4 bytes | unix timestamp<sup>[(LE)](/protocol/misc/endian/little)</sup> | The epoch timestamp of the block in seconds. |
| difficulty target | 4 bytes | [difficulty target](#difficulty-target-encoding)<sup>[(LE)](/protocol/misc/endian/little)</sup> | The difficulty that the block must achieve to be valid. This value is determined by the timestamps of previously mined blocks. | | difficulty target | 4 bytes | [difficulty target](#difficulty-target-encoding)<sup>[(LE)](/protocol/misc/endian/little)</sup> | The difficulty that the block must achieve to be valid. This value is determined by the timestamps of previously mined blocks. See [Target Difficulty](/protocol/blockchain/proof-of-work#target-difficulty) for more information. |
| nonce | 4 bytes | bytes<sup>[(LE)](/protocol/misc/endian/little)</sup> | A random value that is repeatedly changes during block mining in order to achieve the block hash requirements. | | nonce | 4 bytes | bytes<sup>[(LE)](/protocol/misc/endian/little)</sup> | A random value that is repeatedly changes during block mining in order to achieve the block hash requirements. |
### Difficulty Target Encoding ### Difficulty Target Encoding
Within the block header, the difficulty target uses a special floating-point representation that helps keep the size of the block header small. Within the block header, the difficulty target uses a special floating-point representation that helps keep the size of the block header small.
While the difficulty adjustment algorithm attempts to calculate the ideal target (i.e. the value the block hash must be "less than"), it undergoes a lossy conversion when put in the block header: While the [difficulty adjustment algorithm](/protocol/blockchain/proof-of-work/difficulty-adjustment-algorithm) attempts to calculate the ideal target (i.e. the value the block hash must be "less than"), it undergoes a lossy conversion when put in the block header:
| Field | Length | Format | Description | | Field | Length | Format | Description |
|--|--|--|--| |--|--|--|--|
+4 -1
View File
@@ -16,7 +16,10 @@ This is only quasi-random because the likelihood of building a block with an app
## Target Difficulty ## Target Difficulty
As the network's hashing power changes, the proof-of-work algorithm adjusts to compensate.
With a stated goal of averaging 10 minutes per block mined, the work required to successfully mine a block is periodically adjusted to match the actual rate at which blocks were mined over a given period of time.
At any given point, the next block to be mined must hash to a value that, when interpreted as an integer, must be below a target value, called the difficulty, that is deterministically calculated using the difficulties and timestamps of prior blocks.
See [Difficulty Adjustment Algorithm](/protocol/blockchain/proof-of-work/difficulty-adjustment-algorithm) for more details.
## Extra Nonce ## Extra Nonce