Bitcoin Mining

We'll cover the following

Mining

In Bitcoin implementation there is an extra field added in each block, called nonce.

Mining peers continuously receive new transactions submitted on the chain. In order for a transaction to be confirmed, it should be put in a block, that needs to be created.

Simply adding transactions to a block is simple - you get the hash or prev block, increment the block number, add the list of transactions, and take its hash. Pretty fast! But in order to incentivize to run a node, Bitcoin awards miners for creating new blocks by giving them newly generated Bitcoins.

Since it would be very simple to mine a block and devalue the generated coin, Bitcoin has made the block creation process challenging. This difficulty self-adjusts to ensure the global pool of miners are able to mine around one block every 10 minutes. This ensures that the supply of new coins is not too fast, making bitcoin a valuable asset.

Nonce Mining

So Bitcoin adds this extra requirement for a block to have a nonce value, such that the block hash of the new block with the nonce has X number of leading zeros. This X is adjusted by the protocol to control the speed of coin generation. The higher the value of X, the harder it is to calculate a nonce.

Create a free account to view this lesson.

By signing up, you agree to Educative's Terms of Service and Privacy Policy