Difference between revisions of "Proof of Work"
AlexMackay (talk | contribs) |
|||
(20 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
− | A '''proof of work''' is a piece of data which is difficult (costly | + | A '''proof of work''' is a piece of data which is difficult (costly and/or time-consuming) to produce but easy for others to verify. Proof of work production usually involves a computational task that includes a random process with low probability of success, so that a lot of trial and error is required ''on average'' before a valid proof of work is generated. In Bitcoin the proof of work scheme is based on the [[SHA-256]] hashing algorithm. |
− | Proof of | + | == Proof of Work in Bitcoin == |
− | Bitcoin | + | Bitcoin uses a proof of work system in the process of [[mining]]. In order for a [[block]] to be accepted, the broadcasting node must demonstrate proof of valid work which covers all of the data in the block. The [[difficulty]] of discovering valid work outcomes is adjusted to limit the average growth rate of the [[blockchain]] to one block every 10 minutes. |
− | For a block to be valid | + | For a block to be valid, a nonce must be discovered that results in the double SHA-256 hash of the [[Block_hashing_algorithm#Block_Header|block header]], to a value less than the current [[target]]. This indicates that the node which discovered this block is an active participant in the network. Each block header contains the hash of the block being built upon, thus creating the chain of blocks that comprise the ledger. Changing a block can only be done by making a new block, containing the same predecessor, and requires regenerating all subsequent blocks by redoing the work they contain. This protects the blockchain from tampering. |
− | + | === Summary === | |
− | + | 1. Proof of work is part of the Bitcoin consensus mechanism. | |
− | + | 2. The Bitcoin proof of work algorithm attempts to solve a puzzle with a low probability of success per trial. | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | + | 3. A Miner uses a candidate block header as the input, hashes it to check whether the hash value is below a [[target]]. If not, the Miner changes the nonce in the block header and tries again. Once the hash value is below the target, the block has been successfully mined. | |
− | |||
− | |||
− | + | 4. In order for a block to be accepted by the Bitcoin network, Miners must complete a proof of work which covers all of the data in the block. The difficulty of this work is adjusted to limit the rate at which new blocks can be generated by the network to one every 10 minutes on average. Due to the very low probability of successful generation, it is impossible to predict which computer will generate the next block. | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | + | 5. The low probability of successfully finding valid proof of work solutions reduces the likelihood that two or more Miners generate a block around the same time. | |
− | |||
− | |||
− | == | + | ==Attribution== |
− | + | This content is based on content sourced from https://en.bitcoin.it/wiki/Proof_of_work 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. | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− |
Latest revision as of 01:51, 11 January 2022
A proof of work is a piece of data which is difficult (costly and/or time-consuming) to produce but easy for others to verify. Proof of work production usually involves a computational task that includes a random process with low probability of success, so that a lot of trial and error is required on average before a valid proof of work is generated. In Bitcoin the proof of work scheme is based on the SHA-256 hashing algorithm.
Proof of Work in Bitcoin
Bitcoin uses a proof of work system in the process of mining. In order for a block to be accepted, the broadcasting node must demonstrate proof of valid work which covers all of the data in the block. The difficulty of discovering valid work outcomes is adjusted to limit the average growth rate of the blockchain to one block every 10 minutes.
For a block to be valid, a nonce must be discovered that results in the double SHA-256 hash of the block header, to a value less than the current target. This indicates that the node which discovered this block is an active participant in the network. Each block header contains the hash of the block being built upon, thus creating the chain of blocks that comprise the ledger. Changing a block can only be done by making a new block, containing the same predecessor, and requires regenerating all subsequent blocks by redoing the work they contain. This protects the blockchain from tampering.
Summary
1. Proof of work is part of the Bitcoin consensus mechanism.
2. The Bitcoin proof of work algorithm attempts to solve a puzzle with a low probability of success per trial.
3. A Miner uses a candidate block header as the input, hashes it to check whether the hash value is below a target. If not, the Miner changes the nonce in the block header and tries again. Once the hash value is below the target, the block has been successfully mined.
4. In order for a block to be accepted by the Bitcoin network, Miners must complete a proof of work which covers all of the data in the block. The difficulty of this work is adjusted to limit the rate at which new blocks can be generated by the network to one every 10 minutes on average. Due to the very low probability of successful generation, it is impossible to predict which computer will generate the next block.
5. The low probability of successfully finding valid proof of work solutions reduces the likelihood that two or more Miners generate a block around the same time.
Attribution
This content is based on content sourced from https://en.bitcoin.it/wiki/Proof_of_work under Creative Commons Attribution 3.0. Although it may have been extensively revised and updated, we acknowledge the original authors.