What Is Proof of Work?
Proof-of-work is Bitcoin’s way of verifying that a computer or a node has performed a computation faster than the time it takes to execute the computation itself. A complete proof-of-work process requires the node to concatenate a challenge and a response data through a hash by performing a complex computation for a specific output. When solved, the result can be hashed again with the challenge string to get the desired output. The only way a node can get the target output connected to the challenge set by the network is through random guessing or brute force and the guessing process until the final output can reach millions of attempts, all without success.
If a computer is left to do proof-of-work, it will take a long time for a block to be mined, but with every computer on the network incrementing nonces (number used once) to solve a block, the time is reduced significantly. Proof-of-work forms the basis for decentralized systems such as the blockchain that enables participants to work together without trust. If anyone can add records to a network without proof, attackers can take over the network and defeat the essence of decentralization. In Bitcoin’s case, the process of solving the puzzle is known as mining, and the amount of computation required to solve the puzzle is a hash rate. Proof-of-work is what miners do when they mine cryptocurrencies like Bitcoin. We will explain that process in a bit. Today, proof-of-work is one of the most popular consensus algorithms in all of crypto.
Summary of Important Points
- Proof-of-work is a computational process required of computers to verify a process faster than the time and effort needed to repeat that process.
- It enables participants on a peer-to-peer network to agree on a transaction without the need to trust any central entity.
- Proof-of-work is a consensus algorithm, just like proof-of-stake and proof-of-history.
- As a consensus algorithm, proof-of-work forms the basis for participants on a decentralized network to agree on the state of transactions by setting the rules for the network.
- Proof-of-work requires passing data from a block, the previous block hash, and a nonce (number used once), which is then incremented several times to get a value less than the target.
- The value gotten from the process is the new block's hash and must be connected through the same proof-of-work process or mining to the next block to generate the hash and form the blockchain.
- The hash rate defines the amount of computation required to solve a block, and it is fixed at a set difficulty to make the block time predictable.
How Does Proof-Of-Work Function?
Proof-of-work is a consensus algorithm that protects distributed decentralized public networks from attacks such as Sybil attacks or counterfeiting of multiple pairs of identities, double-spend attacks, and single point of failure attacks. The basic concept starts with a challenge and a response to that challenge—or proof—guessing until you arrive at an output below a certain number or containing a certain number of zeros in the target hash. Reaching this output creates a hash for the current block. With proof-of-work, altering the data of previous transactions invalidates the block, protecting the network from dishonest users. It enables data sharing without trust, and it requires time and computational resources to resolve.
Transactions on the Bitcoin network go to a memory pool (mem-pool) for verification before they are added to the network. Proof-of-work done in this case is known as PoW mining, and it is a requirement for adding a block to the Bitcoin network. In a typical example of proof-of-work, a miner gets transactions from the mem-pool of the latest transactions on the network. The miner then constructs a block header for the block. The block header is a random string of data in the block that is hashed or passed through a hash function such as SHA256. For a hash digest below target hash, a nonce (number used once) is quickly incremented several million times until the desired value is reached. When that value is reached, the block is mined and published on the network.
The difficulty rate on the Bitcoin network is adjusted every 2016 block or two weeks so that it takes an average of 10 minutes for a block to be solved. Nodes or miners compete to solve a block, and the first node to reach the required hash digest or output announces the block to the network and receives the reward for doing the work and proving that. The reward is also halved every four years to progressively reduce the supply, making Bitcoin more predictable while mining becomes less profitable on smaller scales. Other alternative cryptocurrencies to Bitcoin, such as Dogecoin, Ethereum, Litecoin, Monero, and a host of others use the PoW mining consensus algorithm.
How Do Proof-Of-Work and Proof-Of-Stake Differ?
Proof-of-work requires a lot of computational resources, which makes it energy inefficient. With proof-of-stake, miners only need to stake a certain amount of the native tokens to qualify to be selected as a node. Once selected, nodes can start checking the validity of block transactions before adding them to the blockchain. Nodes receive transaction fees for adding the blocks to the network. The sum of transaction fees is always less than the amount staked so that validators remain committed to adding verified blocks to the network.
Proof-of-stake is a more decentralized consensus algorithm for decentralized networks because mining pools in the proof-of-work-based networks can be so large that they have unfair chances of solving blocks. It is also less expensive to set up a proof-of-stake node since you do not need to buy expensive mining equipment required to become a validator in a proof-of-work-based network. Proof-of-work is also less scalable as the difficulty with solving blocks can make transactions quite expensive, as was the case with Ethereum in 2021.
Advantages Proof of Work
Security
Proof-of-work is more secure and less prone to a 51% attack than proof-of-stake because the cost of computational resources isn't the only criteria. Miners must solve the blocks, and it will be more profitable to use the unfair power to earn more mining rewards.
Decentralization
Miners in proof-of-work-based networks must compete with other miners to solve a block. The only requirement for becoming a miner is the right hardware resources, making it easy for everyone to participate. People with low hardware resources also form mining pools to increase their chances of solving blocks.
Trustless Cooperation
Proof-of-work allows people who may never know each other to collaborate and agree on a network without the need for trust. The only requirement is proof that the work needed to update the state of the network was done.
Rewards
Miners are rewarded for solving blocks in a proof-of-work-based network with cryptocurrency.
Disadvantages of proof-of-work
Environmental Concerns
Estimates of the amount of energy consumed by Bitcoin miners alone is about 54TWH, enough to power cities. That alone has led to many Bitcoin critics who feel that cryptocurrency has a negative impact on the environment.
Scalability
Proving that work has been done to create a block is difficult and can take a long time in some cases. The period taken during proof-of-work can reduce network speed, and competition for space can lead to arbitrary fees.
Resource Requirements
The cost of setting up Bitcoin mining equipment is high and discouraging. Today, miners spend millions of dollars on graphic cards and electricity just to mine bitcoin.