We will continue to explore mining concepts on blockchain technology. If you haven’t read the part one of the series, here is the link to read it first.
In this post, you’ll learn the important concepts for bitcoin mining – hashcash or proof-of-work, and proof-of-work difficulty. These concepts are the key in making the whole system works.
Hashcash is the mining function of bitcoin which is also required for proof-of-work. A proof of work is a piece of data which is costly and time-consuming to produce. Bitcoin miners spend a lot of their efforts creating hashcash or proofs-of-work which serve as a vote in the blockchain evolution and verify the blockchain transaction log.
Some history lesson! The first modern application, presented as “Hashcash” by Adam Back in 1996, uses a SHA256-based proof of work as an anti-spam measure. SHA256 is a cryptography algorithm used by bitcoin to serve as the core of security in the form of “mining”.
In practice, bitcoin miners spend their resources such as hardware, electricity, and time to solve the proof-of-work function, hashcash. Producing a proof of work can be a random process with low probability so that a lot of trial and error is required on average before a valid proof of work is generated. The following figure should make it easier to understand Proof-of-Work.
Did you know that solving the proof-of-work is so difficult that computers with normal CPU alone is not enough. It’s because the SHA-256 hash of a block’s header must be lower than or equal to the target in order for the block to be accepted by the network.
To put it simply, the hash of a block must start with a certain number of zeroes. The probability of calculating a hash that starts with many zeroes is very low, therefore many attempts must be made. In order to generate a new hash each round, a nonce is incremented. That’s why many computers join together to solve the mathematical problems and share the rewards.
We will explore more concepts on later post series.