Solving the Byzantine Generals Problem with Proof of Work
Proof of Work (PoW) is the original blockchain consensus algorithm, and is used in projects such as Bitcoin and Ethereum. It is the mechanism that enables users on a blockchain network to reach an agreed ‘truth’. A proof of work is essentially an answer to a complex mathematical problem. It takes a lot of work to create (hence the name) but is easy for others to validate.
Bitcoin was the first blockchain to implement PoW (known as Hashcash) as a consensus algorithm. Bitcoin miners run a computer program which gives each miner an equal chance proportional to their computing power to discover the solution to the next block. They compete to find the answer (known as hash) to the set PoW parameters for that block. This hash is a 64-character long answer, and is based upon the inputs to the block, such as the transactions it contains.
Miners search for this hash by combining this input with a random number known as a nonce,until someone finds the correct answer. This solution is then broadcast to, and verified by, other miners. Once confirmed, it is added to the blockchain by the other miners, which then use this new block as the input for the hash needed for the next correct block. This chain forms a canonical ledger of all of transactions from Bitcoin’s inception.
As a result, PoW solves the Byzantine Generals Problem as it achieves a majority agreement without any central authority, in spite of the presence of unknown/potentially untrustworthy parties and despite the network not being instantaneous. It empowers the distributed and un-coordinated Generals to come to an agreement:
- The Generals agree the first plan received by all Generals will be accepted as the plan
- A General solves the PoW problem, creating a block that is broadcast to the network so that all Generals receive it
- Following receipt of this block, each General verifies and works on solving the next PoW problem, incorporating the prior solution into it, so that their plan adds on to the previous resolution
- Each time a General solves a PoW problem, a block is generated and the chain begins to grow. In time, any General working on a different solution will switch over to the longest chain. This is the one most Generals are contributing to and therefore has the greatest chance of success
- As the Generals know roughly how long a PoW solution takes to solve, after a set amount of time they will know if enough of the other Generals are also working on the same chain
Through this process, the Generals can arrive at a consensus of when to attack, can estimate their chances of successfully doing so, and can prevent multiple different signals to attack being sent simultaneously.
PoW also prevents malicious actors, such as a traitorous General, from sabotaging the network by tampering with historic messages. Bitcoin, for example, stores the hash signature of the previous block in every new block. Any change to an earlier block would therefore require all successive blocks to also be changed. This would take an excessively large amount of computing power, and therefore the ledger is secure from alterations.
While PoW is an integral part of current blockchain technology, critics point to a number of problems with its implementation. The two most pressing issues concern the potential for centralisation and the waste it generates.
The rise in interest and price of Bitcoin has led to more users mining it, which in turn has led to an increase in processing power required. Mining Bitcoin is now a multi-billion dollar industry and, while all users still have an equal chance of mining a Bitcoin proportional to their computing power, the emergence of industrial scale mining operations means the ordinary individual has a very small chance of successfully mining one Bitcoin. As mining cartels continue to increase in size, the network becomes more centralized – the cartels control more of the hash power and so can mine more of the Bitcoin. This in turn means they can afford to expand operations and assume a greater proportion of computing power.
Furthermore, as a result of the growth of Bitcoin and other networks and the associated increase of processing power, PoW now demands huge energy consumption. Bitcoin alone currently absorbs close to the entire electricity demand of Switzerland. With blockchains such as Ethereum and Litecoin also utilizing PoW, energy needs have rapidly increased. This is of detriment to the environment, and is potentially unsustainable if mining difficulty continues to rise with no accompanying technological improvement.
Critics also point to the waste of the processing power which is essentially only used to secure the network – the calculations have no application to other fields. This energy and financial burden is the cost of securing the network.
This resource inefficiency is one of the issues proponents of other consensus algorithms such as Proof of Stake cite as a reason to switch over from PoW.