Mining
Mining is the mechanism that powers "proof-of-work" based blockchains, including Bitcoin, Litecoin, Ethereum (for now), and many others.
Mining is the process of computers around the world competing to solve a complex mathematical puzzle. When a computer is the first to solve this puzzle, it wins the right to add the latest block to the blockchain, and earns a reward for doing so. For Bitcoin in 2020, that reward is 6.25 bitcoin ($50,000+). For Bitcoin a new contest occurs every ten minutes. For Litecoin, this occurs every 2.5 minutes.
The solution to this cryptographic puzzle involves four variables: the current time, the proposed transactions (approximately 3,500 of them), the identity of the previous block, and a variable called the nonce.
The nonce is very mathematically complex. In short, it's a random number that when combined with the other three variables results in an output that fits a difficult criteria. This criteria is adjusted each block to ensure that it takes approximately 10 minutes to solve the puzzle. Without the nonce, faster and faster computers would solve this puzzle in exponentially less time. For example, assuming Moore's Law (where computing power doubles every 1.5 years), computers in 2020 are 16 times faster than computers in 2008 (12 years / 1.5 years * 2), meaning without the nonce the puzzle could be solved every 0.625 minutes today.
The most important part of the mining process is the identity of the previous block as it links every block in the blockchain together. Meaning that if someones changes a block, they'd need to change every block that followed it. Because each block takes ten minutes to solve, and new blocks are being added every ten minutes, it becomes impossible to tamper with past blocks. Any such changes would be rejected by all other miners in the network immediately.
Mining ensures the following:
- Blocks can be added the blockchain, meaning transactions can occur. Without mining this would not happen.
- Transactions cannot be changed or tampered with. Because there is immense computing power around the world owned by thousands of individuals all competing and verifying transactions, it is nearly impossible to make changes.
- That people are economically incentivized to buy expensive computers to secure and power the network by rewarding them with bitcoin.
However, mining and the proof-of-work model have several problems, including:
- It's extremely energy intensive. Bitcoin alone uses 0.3% of the world's energy. Other cryptocurrencies that use other mechanisms, such as delegated proof of stake, use a lot less energy.
- It doesn't scale well. Because every computer in the world needs to reach consensus on the blockchain as quickly as possible, the size of each block is limited to 1mb. This comes to about 3,500 transactions. That means only ~6 transactions per second can be recorded. In comparison, VISA processes 300 times that. During periods of high transaction volume, it could take several blocks for your transaction to be added to the block and then verified. This could take upwards of hours. Whereas VISA processes your transaction in seconds. Other consensus models like delegated proof-of-stake do transactions every 0.5 seconds (EOS).
- The economics of mining gets messed up whenever there's a halving (when the reward for mining is halved) and whenever the price of the asset drops significantly, and whenever there's advancements in mining technology. For example, in 2020 when coronavirus economic slowdowns and the bitcoin halving occured, the reward for mining made it unprofitable for tens of millions of old bitcoin mining rigs being used. Only the newest technology being used in locations with cheap electricity remained profitable. And miners had to sell off their rewards immediately whenever they won, just to pay their bills. Which can cause the price of BTC to lower if every 10 minutes 6.25 bitcoin are guaranteed being sold.
- A group of the biggest miners could decide to work together to own 51% of the network, and could start falsifying transaction. This is incredibly unlikely however as that would cost billions of dollars and take a lot of collaboration amongst strangers.