Skip to content

Proof of Work

What Is PoW?

PoW (Proof of Work) is a consensus mechanism used in blockchain systems. It can be simply understood as a proof that confirms you have done a certain amount of work.

In blockchain, Proof of Work involves: trying a large number of random nonces in hash computations. Specifically, it means finding a nonce to include in the block header, computing the hash of the block header, and ensuring the computed hash result is less than or equal to the target value in the block header. If the target condition is not met, a new nonce is selected and the operation is repeated until the target condition is satisfied. The hash function used in Bitcoin is the SHA-256 algorithm, which is a cryptographic hash function family member that outputs 256-bit hash values.

Formula: H(block header + nonce) <= target

Due to the properties of hash functions, the resulting hash value is unpredictable. For a given input x, there is no shortcut to getting H(x) within a certain range -- you can only try each x one by one (hence the need for substantial work). The reason only the block header hash is computed (not including the block body) is that the Merkle root hash in the block header guarantees that the contents of the block body have not been tampered with.

PoW Main Process

The main process of PoW is as follows:

  1. Generate Merkle Root Hash: The node generates a coinbase transaction and combines it with all other transactions to be packaged, using the Merkle tree algorithm to generate the Merkle root hash.

  2. Assemble Block Header: The block header includes the parent block (i.e., the previous block) hash, version, timestamp, Merkle root hash, difficulty, and the nonce required for Proof of Work.

  3. Compute Proof of Work Output: The block header is run through the hash function to produce an output. This is compared against the target value -- if it is less than the target, the work is complete; otherwise, the nonce is modified and the above steps are repeated until the target condition is met.

Bitcoin Block

PoW Defense Against Malicious Nodes

  • The PoW consensus mechanism competes for block-producing rights based on computing power, so malicious nodes gain no advantage by creating more accounts. (Against Sybil attacks)
  • PoW requires finding the correct nonce value before broadcasting to the entire network. Continuously packaging illegal transactions clearly brings no benefit, as it incurs significant economic costs including hardware, electricity, and maintenance.

PoW Reward Mechanism in Bitcoin

The Bitcoin system stipulates that once a Proof of Work reaches consensus across the network and is added to the blockchain, Bitcoin can be earned -- this is the block reward. The source of new Bitcoin is through block rewards, which is the only way new Bitcoin is created.

Reward Rules: The Bitcoin system maintains an average of one successful Proof of Work (successful mining) every 10 minutes. The initial mining reward in Bitcoin was 50 BTC. After every 210,000 blocks in the blockchain, the reward is halved to 25 BTC, then 12.5 BTC, and so on.

  • Calculating BTC Reward Halving Time

Based on 2 conditions:

  1. An average of one block every 10 minutes (successful mining)

  2. The reward halves every 210,000 blocks

The time needed to mine 210,000 blocks:

210,000 * 10 / 60 / 24 / 365 = 3.995 years

The calculated time is 3.995 years, approximately 4 years. This means the Bitcoin reward halves approximately every 4 years.

Around the year 2140, Bitcoin will stop growing and reach saturation. Miners will no longer receive block rewards.

  • PoS
  • DPoS
  • PoH