From f3edac50844cf00b472f3150d5791153d1720edd Mon Sep 17 00:00:00 2001 From: 1HXb9KMAtwNJqz4egi6hJx08EQgJajiBTH <1HXb9KMAtwNJqz4egi6hJx08EQgJajiBTH@reference.cash> Date: Thu, 2 Jan 2020 15:54:47 -0500 Subject: [PATCH] wiki commit --- protocol/blockchain/block/block-header.md | 5 ++--- protocol/blockchain/proof-of-work.md | 5 ++++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/protocol/blockchain/block/block-header.md b/protocol/blockchain/block/block-header.md index d3c6d93..1e41802 100644 --- a/protocol/blockchain/block/block-header.md +++ b/protocol/blockchain/block/block-header.md @@ -7,7 +7,6 @@ With a block header, you can: 1. Calculate the hash of the block. - The double SHA-256 hash of the block header. 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. - 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)[(LE)](/protocol/misc/endian/little) | The hash of the block immediately preceding this block in the blockchain. | | merkle root | 32 bytes | [merkle root](/protocol/blockchain/merkle-tree)[(LE)](/protocol/misc/endian/little) | The merkle tree root of the transactions in the block. | | timestamp | 4 bytes | unix timestamp[(LE)](/protocol/misc/endian/little) | The epoch timestamp of the block in seconds. | -| difficulty target | 4 bytes | [difficulty target](#difficulty-target-encoding)[(LE)](/protocol/misc/endian/little) | 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)[(LE)](/protocol/misc/endian/little) | 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[(LE)](/protocol/misc/endian/little) | A random value that is repeatedly changes during block mining in order to achieve the block hash requirements. | ### 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. -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 | |--|--|--|--| diff --git a/protocol/blockchain/proof-of-work.md b/protocol/blockchain/proof-of-work.md index 36a5da1..fe0997f 100644 --- a/protocol/blockchain/proof-of-work.md +++ b/protocol/blockchain/proof-of-work.md @@ -16,7 +16,10 @@ This is only quasi-random because the likelihood of building a block with an app ## 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