Proof of work
Proof of work is a form of cryptographic using a zero-knowledge proof in which one party proves to others that a certain amount of computational effort has been expended for some purpose. Verifiers can subsequently confirm this expenditure with minimal effort on their part. Bitcoin and Ethereum together account for almost 90% of all proof-of-work coins' annual electricity use, so the rest have a small share.
Proof of Work (PoW) is the original consensus algorithm in a blockchain network. The algorithm is used to confirm the transaction and creates a new block to the chain. Producing proof of work can be a random process with low probability.
PoW requires nodes on a network to provide evidence that they have expended computational power (i.e., work) to achieve consensus in a decentralized manner and to prevent bad actors from overtaking the network.
Proof of work (PoW) is necessary for security, which prevents fraud, which enables trust. This security ensures that independent data processors (miners) cannot lie about a transaction. Proof of work is used to securely sequence Bitcoin's transaction history while increasing the difficulty of altering data over time.
The Proof of Work is just one aspect of the blockchain. For a transaction to be considered final, it must be in the blockchain. If such another transaction exists in the blockchain, then the block will be invalid. It is this process of including transactions in blocks which avoids double spends.
A proof of work is a piece of data which is difficult (costly, time-consuming) to produce but easy for others to verify and which satisfies certain requirements. In order for a block to be accepted by network participants, miners must complete a proof of work which covers all of the data in the block.
Proof-of-work is the algorithm that secures many cryptocurrencies, including Bitcoin and Ethereum. Most digital currencies have a central entity or leader keeping track of every user and how much money they have. But there’s no such leader in charge of cryptocurrencies like Bitcoin. Proof-of-work is needed to make the online currency work without a company or government running the show.
More specifically proof-of-work solves the “double-spending problem,” which is trickier to solve without a leader in charge.
If users can double-spend their coins, this inflates the overall supply, debasing everyone else’s coins and making the currency unpredictable and worthless. Double spending is an issue for online transactions because digital actions are very easy to replicate, which is what makes it trivial to copy and paste a file or send an email to more than one person.
Proof-of-work makes doubling digital money extremely hard. It is much what it sounds like: “proof” that someone has done a significant number of computations.
How proof-of-work works
Bitcoin is a blockchain, which is a shared ledger that contains a history of every Bitcoin transaction that ever took place. This blockchain, as the name suggests, is composed of blocks. Each block has the most recent transactions stored in it.
Proof-of-work is a necessary part of adding new blocks to the Bitcoin blockchain. Blocks are summoned to life by miners, the players in the ecosystem who execute proof-of-work. A new block is accepted by the network each time a miner comes up with a new winning proof-of-work, which happens roughly every 10 minutes.
Finding the winning proof-of-work is so difficult the only way to provide the work miners need to win bitcoin is with expensive, specialized computers. Miners will earn bitcoin if they guess a matching computation. The more computations they churn out, the more bitcoin they are likely to earn.
What computations are the miners making exactly? In Bitcoin, miners spit out so-called “hash,” which turns an input into a random-looking string of letters and numbers.
The goal of the miners is to create a hash matching Bitcoin’s current “target.” They must create a hash with enough zeroes in front. The probability of getting several zeros in a row is exceptionally low. But miners across the world are making trillions of such computations a second, so it takes them about 10 minutes on average to hit this target.
Whoever reaches the goal first wins a batch of bitcoin cryptocurrency. Then the Bitcoin protocol creates a new value that miners must hash, and miners start the race for finding the winning proof-of-work all over again.
Why is proof-of-work needed.
The goal of proof-of-work is to prevent users from printing extra coins they did not earn, or double-spending. If users were able to spend their coins more than once, it would effectively make the currency worthless.
Most digital currencies, this problem is easy to solve. The bank that oversees the system keeps track of how much money each person has. If Robert sends Victor $1, then the bank deducts $1 from Robert and gives $1 to Victor. But in cryptocurrency there is not such an entity. Proof-of-work provides a solution.
There are at least a few problems with proof-of-work.
High energy use: Bitcoin uses as much energy as all of Switzerland because of proof-of-work. And its energy use is increasing as more miners join the hunt for bitcoins, though some of this is powered by renewable energy.
51% attacks: If one mining entity is able to accumulate 51% of Bitcoin’s mining hashrate, it can then flout the rules temporarily, double-spending coins and blocking transactions.
Mining centralization: Proof-of-work is all about creating a currency without one single entity in charge. That said, in practice the system is somewhat centralized, with just three mining pools controlling almost 50% of Bitcoin’s computational power. Developers are attempting to at least alleviate this issue, however.
Why does more mining power mean more security.
The more computational power being poured into securing Bitcoin, the more resources a potential attacker needs to amass in order to successfully attack Bitcoin.
Example of Proof of Work Proof of work requires a computer to randomly engage in hashing functions until it arrives at an output with the correct minimum number of leading zeroes.
For example, the hash for block # 686798, mined on June 8th, 2021,
PoW requires nodes on a network to provide evidence that they have expended computational power (i.e. work) in order to achieve consensus in a decentralized manner and to prevent bad actors from overtaking the network.
The work itself is arbitrary. For Bitcoin, it involves iterations of SHA-256 hashing algorithms. The "winner" of a round of hashing, however, aggregates and records transactions from the mempool into the next block. Because the "winner" is randomly-chosen proportional to the work done, it incentivizes everybody on the network to act honestly and record only true transactions.
Source: Coinbase, Investopedia