If you want to know how proof-of-work operates on the Bitcoin network, first you need to understand more about blockchain technology because—especially if you’re new to the topic—a lack of background information will get in the way of your ability to grasp this multi-layered subject matter.
A Brief Primer on Blockchain Technology
Blockchain technology consists of two fundamental parts:
- The actual blockchain; and
- The blockchain technology that runs it.
1. What Is a Blockchain?
A cryptocurrency blockchain is simply a spreadsheet or ledger. Cryptocurrencies, like Bitcoin (BTC) and Litecoin (LTC), use blockchain ledgers to store the following information:
- The history of all transactions for each account
- How much currency each account holds
*Other cryptocurrencies like Ethereum (ETH) and Tron (TRX) can store additional information like executable computer applications on their blockchains, but that’s a different story.
Visualizing a Blockchain: One way to visualize a blockchain is to imagine an Excel spreadsheet with rows and columns. The rows represent a snapshot of the entire ledger at any point in time. The columns represent an individual account on the blockchain with all its transaction information.
Understanding Hashes: As you move down the column of a particular account, each cell has information pertaining to a specific transaction. This transaction information is stored within a cryptographic fingerprint (called a hash). Hashes contain the following:
- How much currency was received/sent by the account
- The account ID of the sender/receiver
- All the information contained in the previous hash
Understanding Chains: Emphasis must be added to number (3) above, because that’s what makes the ledger a blockchain. Each hash contains all the information of the previous hash with the new transaction information chained to it. In this way, every hash contains the entire transaction history for that account on the ledger up to that point. The hashes build upon each other – “chaining” together to create a hash chain.
Understanding Blocks: The final row of hashes on the spreadsheet represents the most recent “block” of transactions and the blockchain in its entirety. Through the hash chains, each new block of transactions is chained to the block that preceded it—thus forming the blockchain. In this way, each new block contains the complete history of the ledger up to that point. Thus, the blockchain builds upon itself as new transaction blocks are added to the chain.
2. What Is “Blockchain Technology?”
In the case of Bitcoin, a decentralized, global network of computer users stores duplicate copies of the Bitcoin blockchain. This computer network continuously and synchronously appends each user’s copy of the blockchain to reflect new transactions. To preserve the accuracy of the ledger during updates—and to reach consensus on the correct version of the ledger—the Bitcoin network uses “blockchain technology.”
Blockchain technology, or Bitcoin technology, is the cryptographic protocol that allows hundreds of thousands of untrusted computer operators—who know nothing about each other—to synchronously update their counterpart copies of the blockchain without fear of fraudulent entries, double-spending attacks or nefarious hacks. It allows two untrusted Bitcoin network operators on different sides of the world to agree that Jason owns 3 bitcoins and he sent 3 bitcoins to Chris (and only Chris).
Because of the cryptographic hash IDs found within the blockchain, network operators can prove with certainty how Jason obtained his bitcoins, so they know he owns the bitcoins he intends to send. Moreover, through the proof-of-work concept explained in the next section, blockchain technology prevents Jason from sending the same bitcoins to both Chris and third party, Ryan. Therefore, proof-of-work prevents double-spending attacks, ensuring that only one party receives the 3 bitcoins.
How Proof-of-Work Operates
The crown jewel of Bitcoin’s blockchain ecosystem is the proof-of-work concept. Without proof-of-work, someone could easily attack the Bitcoin network with conflicting orders pertaining to the same bitcoins. Imagine, for example that Jason told Operator A to send 3 bitcoins to Chris. Simultaneously, he told Operator B to send the same bitcoins to Ryan. The conflicting orders would confuse the network, producing two different versions of the blockchain ledger. No one would know which version to trust, and the blockchain would be useless.
Since a decentralized ledger is vulnerable to these kinds of double-spending attacks, special protocols need to be in place to prevent them. Proof-of-work is the protocol that prevents double-spending attacks from corrupting the Bitcoin network. Proof-of-work requires network operators to verify transactions by solving energy-expensive mathematical puzzles before the blockchain ledger can be updated. This process of verifying through energy-expensive puzzle-solving is called “mining.”
Here’s what proof-of-work miners do when verifying transactions:
- Bitcoin network operators—a.k.a., miners—bundle Jason’s transaction into a block with other transactions.
- Miners compute a series of energy-expensive mathematical puzzles to validate the transactions in the block, and to ensure that double spending has not occurred. These mathematical puzzles are called “proof-of-work problems.”
- The first miner who correctly solves the proof-of-work problem for a block receives a payment of Bitcoin. This pays for the energy costs and provides an income to the miner.
- The entire network accepts the newly validated addendum to the blockchain.
- Since solving the proof-of-work problems like this involves computers submitting random guesses, the winning miner can win only by chance. This prevents anyone from predicting which miner will win. In this fashion, a double-spender cannot know which of the double-spent transactions will be confirmed and recorded to the blockchain before it happens.
- After verifying that the winning miner’s work matches the previous blockchain, the public ledger is appended to include the newly validated block of transactions. In other words, Jim’s account shows 3 less bitcoins, and Chris’s account shows 3 more bitcoins. All network operators append their copies of the public blockchain ledger synchronously.
An essential element of the proof-of-work protocol makes it easy to check if the winning miner performed the work correctly. Each hash must link up with the hash before it. The process works kind of like a lock and key. It takes a long time for a locksmith to build a new key to fit the lock and open it. However, once the key is built, its effectiveness is easily proved. Because the proof-of-work puzzle solution is quickly and easily tested for accuracy, it’s impossible for miners to submit a version of the ledger that doesn’t match the previous one. A fraudulent version would be identified and rejected immediately.
What are “Energy-expensive Mathematical Puzzles?”
The Bitcoin blockchain ledger shows the transactional history of every Bitcoin that exists. To update this ledger to reflect new transactions, one must perform a series of complicated computer problems that are expensive from an energy perspective. As mentioned before, this work, although difficult to perform, is exceedingly easy for the network to check and validate.
Because each blockchain replicates and chains itself to the previous one, if a hacker wished to fraudulently manipulate any information on the chain, the hacker would need to re-mine and re-calculate each block that preceded it. Successfully mining and adding a single block of transactions to the Bitcoin network requires thousands of computers and a great deal of time and electricity. On the other hand, the amount of time and electricity required to cryptographically recalculate the entire blockchain from the beginning to the end would be so astronomical that it isn’t even possible. Thus, we can understand how proof-of-work establishes the imperviable and unalterable nature of blockchain accounts.
What Happens to Double-spent Bitcoins?
What happens to double-spent bitcoins? Imagine Jason double-spent his bitcoins by creating two orders to send the same bitcoins to both Chris and Ryan. Since only one miner’s work will be accepted, only one of these transactions will be retained for the record. The other transaction will be lost forever. Furthermore, since randomness determines the first miner who solves the proof-of-work puzzle, Jason has no way of predicting which of the recipients will actually receive the double-spent bitcoins. As long as Chris and Ryan wait for miners to confirm they have indeed received the bitcoins in question, they won’t get cheated out of any payments.
Are Energy-Expensive Bitcoin Puzzles Bad for the Environment?
The carbon-based energy costs required to maintain the Bitcoin ledger has concerned environmentalists around the world for years. To make matters worse, the lion’s share of Bitcoin mining is carried out in areas of China where cheap electricity is sourced from coal. As Bitcoin becomes more popular and more miners jump on board, environmentalists predict that mining will have an increasingly-negative effect on the environment.
Projects like GEAR Token, however, are attempting to solve this problem by harnessing renewable energy for Bitcoin mining purposes. GEAR Token plans to use biomass, hydroelectric, tidal, wind farm, solar energy, and other green energy resources, to mine cryptocurrencies in a way that doesn’t hurt the environment. Moreover, GEAR Token wants to use the cryptocurrency it earns through environmentally-friendly mining practices to finance green energy endeavors that benefit the world.
Jeremy Hillpot is an investment fraud litigation consultant. Fascinated by emerging technologies like blockchain and associated laws and market trends, Jeremy’s background in consumer fraud litigation provides a unique perspective on a vast array of topics including investments, startups, cryptocurrencies and the law.