Difference between revisions of "Block hashing algorithm"
m |
|||
Line 1: | Line 1: | ||
Bitcoin mining uses a [[SHA-256]] hash based [[Proof of Work]] function. The algorithm requires the following parameters: a service string, a nonce, and a counter. In Bitcoin the service string is encoded in the block header data structure, and includes a version field, the hash of the previous block, the root hash of the [[wikipedia:Merkle tree|Merkle tree]] of all transactions in the block, the current time, and the [[target]] of the proof of work function. | Bitcoin mining uses a [[SHA-256]] hash based [[Proof of Work]] function. The algorithm requires the following parameters: a service string, a nonce, and a counter. In Bitcoin the service string is encoded in the block header data structure, and includes a version field, the hash of the previous block, the root hash of the [[wikipedia:Merkle tree|Merkle tree]] of all transactions in the block, the current time, and the [[target]] of the proof of work function. | ||
− | Bitcoin | + | Bitcoin Miners commonly make use of two nonce fields: |
# The Nonce field which is included in the block header | # The Nonce field which is included in the block header | ||
# The extraNonce field which is part of the [[Coinbase]] transaction | # The extraNonce field which is part of the [[Coinbase]] transaction | ||
Line 8: | Line 8: | ||
==Attribution== | ==Attribution== | ||
− | This content is based on content sourced from https://en.bitcoin.it/wiki/Block_hashing_algorithm under [https://creativecommons.org/licenses/by/3.0/ Creative Commons Attribution 3.0]. Although it may have been extensively revised and updated we acknowledge the original authors. | + | This content is based on content sourced from https://en.bitcoin.it/wiki/Block_hashing_algorithm under [https://creativecommons.org/licenses/by/3.0/ Creative Commons Attribution 3.0]. Although it may have been extensively revised and updated, we acknowledge the original authors. |
Revision as of 01:39, 27 October 2020
Bitcoin mining uses a SHA-256 hash based Proof of Work function. The algorithm requires the following parameters: a service string, a nonce, and a counter. In Bitcoin the service string is encoded in the block header data structure, and includes a version field, the hash of the previous block, the root hash of the Merkle tree of all transactions in the block, the current time, and the target of the proof of work function.
Bitcoin Miners commonly make use of two nonce fields:
- The Nonce field which is included in the block header
- The extraNonce field which is part of the Coinbase transaction
Each field includes a counter parameter that is relatively small (32-bits). The hash function cycles through all values of the Nonce field, testing each outcome of the hash function against the difficulty setting, then increments (or otherwise changes) the extraNonce field before going through all permutations of the Nonce again. Incrementing the extraNonce field entails recomputing the merkle tree root as it modifies the hash of the Coinbase transaction.
Attribution
This content is based on content sourced from https://en.bitcoin.it/wiki/Block_hashing_algorithm under Creative Commons Attribution 3.0. Although it may have been extensively revised and updated, we acknowledge the original authors.