Here is a slightly more technical description of how mining works. The network of miners, who are scattered across the globe and not bound to each other by personal or professional ties, receives the latest batch of transaction data. They run the data through a cryptographic algorithm that generates a “hash”—a string of numbers and letters that verifies the information’s validity but does not reveal the information itself. (In reality, this ideal vision of decentralized mining is no longer accurate, with industrial-scale mining farms and powerful mining pools forming an oligopoly. More on that below.)
Given the hash 000000000000000000c2c4d562265f272bd55d64f1a7c22ffeb66e15e826ca30, you cannot know what transactions the relevant block (#480504) contains. You can, however, take a bunch of data purporting to be block #480504 and make sure that it hasn’t been subject to any tampering. If one number were out of place, no matter how insignificant, the data would generate a totally different hash. For example, if you were to run the Declaration of Independence through a hash calculator, you might get 839f561caa4b466c84e2b4809afe116c76a465ce5da68c3370f5c36bd3f67350. Delete the period after the words “submitted to a candid world,” though, and you get 800790e4fd445ca4c5e3092f9884cdcd4cf536f735ca958b93f60f82f23f97c4. This is a completely different hash, although you’ve only changed one character in the original text.
A hash allows the Bitcoin network to instantly check the validity of a block. It would be incredibly time-consuming to comb through the entire ledger to make sure that the person mining the most recent batch of transactions hasn’t tried anything funny. Instead, the previous block’s hash appears within the new block. If the most minute detail had been altered in the previous block, that hash would change. Even if the alteration was 20,000 blocks back in the chain, that block’s hash would set off a cascade of new hashes and tip off the network.
Generating a hash is not really work, though. The process is so quick and easy that bad actors could still spam the network and perhaps, given enough computing power, pass off fraudulent transactions a few blocks back in the chain. So the Bitcoin protocol requires proof of work.
It does so by throwing miners a curveball: Their hash must be below a certain target. That’s why block #480504’s hash starts with a long string of zeroes. It’s tiny. Because every string of data will generate one and only one hash, the quest for a sufficiently small one involves adding nonces (“numbers used once”) to the end of the data. So, a miner will run [thedata]. If the hash is too big, she will try again. [thedata]1. Still too big. [thedata]2. Finally, [thedata]93452 yields her a hash beginning with the requisite number of zeroes.
The mined block will be broadcast to the network to receive confirmations, which take another hour or so, although occasionally much longer, to process. (Again, this description is simplified. Blocks are not hashed in their entirety but broken up into more efficient structures called Merkle trees.)
https://datawrapper.dwcdn.net/m7bjd/1/(Minutes, 7-day average)
Depending on the kind of traffic the network is receiving, Bitcoin’s protocol will require a longer or shorter string of zeroes, adjusting the difficulty to hit a rate of one new block every 10 minutes. As of November 2021, the current difficulty is around 22.465 trillion, up from 1 in 2009. As this suggests, it has become significantly more difficult to mine Bitcoin since the cryptocurrency launched a decade ago.
Mining is intensive, requiring big, expensive rigs and a lot of electricity to power them. And it’s competitive. There’s no telling what nonce will work, so the goal is to plow through them as quickly as possible.
Early on, miners recognized that they could improve their chances of success by combining into mining pools, sharing computing power, and divvying the rewards up among themselves. Even when multiple miners split these rewards, there is still ample incentive to pursue them. Every time a new block is mined, the successful miner receives a bunch of newly created bitcoins. At first, it was 50, but then it halved to 25, and then it became 12.5. The fourth halving in bitcoin’s history occurred on May 11, 2020, and now the reward is set at 6.25.
The reward will continue to halve every 210,000 blocks, or about every four years, until it hits zero. At that point, all 21 million bitcoins will have been mined, and miners will depend solely on fees to maintain the network. When Bitcoin was launched, it was planned that the total supply of the cryptocurrency would be 21 million tokens.5
The fact that miners have organized themselves into pools worries some. If a pool exceeds 50% of the network’s mining power, its members could potentially spend coins, reverse the transactions, and spend them again. They could also block others’ transactions. Simply put, this pool of miners would have the power to overwhelm the distributed nature of the system, verifying fraudulent transactions by virtue of the majority power it would hold.
That could spell the end of Bitcoin, but even a so-called 51% attack would probably not enable the bad actors to reverse old transactions because the proof of work requirement makes that process so labor-intensive. To go back and alter the blockchain, a pool would need to control such a large majority of the network that it would probably be pointless. When you control the whole currency, with whom can you trade?
A 51% attack is a financially suicidal proposition from the miners’ perspective. When GHash.io, a mining pool, reached 51% of the network’s computing power in 2014, it voluntarily promised to not exceed 39.99% of the Bitcoin hash rate in order to maintain confidence in the cryptocurrency’s value. Other actors, such as governments, might find the idea of such an attack interesting, though. But again, the sheer size of Bitcoin’s network would make this overwhelmingly expensive, even for a world power.
Another source of concern related to miners is the practical tendency to concentrate in parts of the world where electricity is cheap, such as China, or, following a Chinese crackdown in early 2018, Quebec. Bitcoin mining consumes massive amounts of electricity, and this has led some governments to curtail access to power or designate special rates for Bitcoin miners. This, coupled with the Chinese government’s repeated attempts to crack down on mining systems located in that country, has led to a dispersion of miners across the globe. As of October 2021, the United States had surpassed China to become the world’s biggest global hub for Bitcoin mining.