A Simple Proof of Work Example in C# - Bitcoin Seinfeld Part 3 of 3
Channel: Ryan McBeth
Date: 19/02/2022

The code for this example can be found here:

ryanmcbeth.com 
https://github.com/mcbethr/BlockChainExample

Proof of work is essential to reward miners for hashing a block.

When the transaction pool is almost complete, the mine adds themselves and the block reward as the last transaction.  In bitcoin, this reward is decremented every 210000 blocks or roughly every four years.  Then the miner attempts to "solve" the hash.

Solving the hash involves repeatedly hashing the block data, the previous block's hash and a "Nonce" or "number only used once."

In Bitcoin, the Nonce is the variable that allows randomness to enter the hashing algorithm.

The hasher is aiming for a certain number of zeros at the beginning of the hash.  In bitcoin, the difficulty is tied to the chance that a hasher will discover a block every ten minutes.

Difficulty can go up or down.  The current bitcoin difficulty as of 2/19/2022 is a hash with 19 zeros.