The proof-of-work mechanism is a form of the so-called consensus mechanisms in order to reach a consensus in the network and to jointly agree on an identical version of the blockchain.
Why do I need proof-of-work?
The basic principle of proof-of-work is based on the idea that miners in the network have to prove that they have made a certain effort. Previously, proof-of-work mechanisms were also used for sending e-mails to prevent spam. To send an e-mail, the sender simply had to perform additional calculations. Since the machines were limited in their computing capacity, it was necessary to make high investments in order to carry out the calculations and ultimately send e-mails. As a result, the cost of sending emails should be high enough for spammers to find it no longer worthwhile. The recipient of an e-mail could easily check whether the calculations were carried out correctly, while the calculations for the sender involved a certain amount of effort.
The idea behind the blockchain is to store a decentralized transaction book. This results in a trust problem, since many network participants usually have to rely on a central “trusted party”. To avoid this undesirable side effect, consensus algorithms are used that allow each participant to check whether their blockchain complies with the rules.
How does Proof-of-Work work with a blockchain?
The execution of a proof-of-work mechanism or the calculation of the results is called “mining” in the context of block chains. The miners try to find a result with certain properties by performing billions of arithmetical operations. If you have made such a result, you will be remunerated.
The process of a transaction that is pushed into the network looks like this until it is confirmed:
- Transactions are combined in a block
- Miners verify that these transactions are legitimate by performing the proof-of-work calculations
- The first miner to find the solution receives the block compensation
- The validated transactions are appended to the block chain in the form of a block.
How exactly do the proof-of-work calculations work?
The miners use hash functions, i.e. mathematical functions that generate a fixed-length character string from a character string of any length. The difficulty is that a result with certain properties must be found, which result from the hash function.