Proof of Work Consensus Algorithm: How It Works
Proof of Work Consensus Algorithm: How It Works
The concept and principle of the Proof of Work algorithm
Various algorithms are used for cryptocurrency mining, however, one of the oldest and most common is Proof of Work (PoW, proof of work, proof of work) – it is based on Bitcoin. At the same time, the PoW algorithm performs several important functions for the existence of digital assets at once, some of which are not entirely obvious.
The concept of “complexity” in mining
Mining – selection (search) of a hash (key) to a block, for its creation.
In other words, before you is an electronic combination lock, having found the key to which the miner will receive a reward and the block will be included in the general blockchain.
To solve the problem, the system issues a hash to which the miner must hash the block.
The miner makes the first attempt, during it calculates a hash that does not match the specified one, which means that the system does not confirm it, and the further search for the key continues.
The complexity of block mining (finding a matching hash) depends on the number of miners and their capacities. Complexity is expressed, for example, in the bitcoin blockchain, in the number of zeros in the hash.
When you connect to the search block a large number of miners – the complexity increases. If in the previous scenario 1 billion combinations were tried to find the key, then with a larger number of miners there is a growing need to sort out 2 billion combinations. The miner picked up the hash, the block is included in the blockchain, transactions are considered confirmed, the miner received a reward.
Features of Proof of Work
Each block contains a hash of the previous block, forming a chain. The block cannot be changed – it is only possible to create a block at the same “height”, which will contain the hash of the previous block. To carry out such a process, work needs to be done to find all the previous blocks. The high complexity (a practical impossibility) of this process protects the blockchain.
The proof of work algorithm protects against double-spending attacks (Double spending or Double-spending is called the successful use of the same funds twice) by verifying each transaction that is added to the blockchain to ensure that the funds contained in Transactions have not been spent before.
You had 1.2 BTC in your account, you made a spend on the entire amount, the transaction is confirmed, which means that information about your spending was recorded on the blockchain and you will not be able to spend the amount a second time because according to the data in the blockchain, you have already spent the amount.
Proof of Work Benefits
An important factor is the inability to launch a DDoS attack.
During a DDoS attack, thousands of users connect to the server and due to the inability of the server to process the operations of all users, the site begins to freeze, at this time new users cannot perform any operations.
To arrange a DDoS attack, you need a colossal amount of money that can’t pay off in any way.
In the case of the blockchain, a DDoS attack can be arranged in a unique way: you need to create a huge number of small transactions. Bitcoin block is limited to 1MB, which means that miners will spend a lot of time on processing a large number of small transactions and “real” transactions will not fall into blocks, because of this a large number of unconfirmed transactions will form, which means that every transaction can expect confirmation by days.
Meaningless energy costs – a large number of nodes make calculations, but in reality, only one (first) carries out successful work and receives a reward.
The main disadvantage of the proof of the work is its vulnerability to attack-51.
If a miner or a pool of miners controls more than half of the hash rate, then it becomes possible to completely control the network: they can add new blocks, manipulate two-way operations and not confirm new transactions. Also, “Attack 51%” can lead to the fact that unscrupulous miners will be able to use the same coin several times, recalling transactions made with it, which is double-spending or “double waste”. At the same time, the attacker can not change the information in already added blocks and generate new cryptocurrencies.
However, this is possible only with “new” cryptocurrencies, in which there are few miners.
It is interesting
Below we presented the percentage of the largest mining pools in the bitcoin network.
According to the diagram, each of them is far from 51% ownership of all capacities, but this is a subject picture: the same company Bitmain, which is engaged in the production of ASIC mining equipment, owns the BTC.com and AntPool pools.