Beginner Lesson 4 4 min read

Mining: how new bitcoins are created and why it costs energy

Miners do not solve difficult equations. They buy, with electricity, the right to propose the next block — and it is this cost that keeps the network standing.

Miners do not solve complex mathematical equations. This phrase appears in almost every report on the subject and does not describe what actually happens. There is no equation, no problem to decipher, nothing intelligent about the task. What exists is a lottery, and the ticket is intentionally expensive.

Here's how it works. The miner assembles a candidate block: selects transactions from the mempool, calculates the header, and adds a free field called nonce, which is just any number. Then the entire header is passed through the hash function from Lesson 3, and the result is checked. If the resulting number is less than a certain target, the block is valid, and the miner announces it to the world. If not — and it almost never is — the miner changes the nonce and tries again.

There is no shortcut. The hash function is designed so that the result is unpredictable from the input, so no one can calculate which nonce will work. The only option is to try. This is why the activity is called proof of work: the valid block carries, within itself, the evidence that someone attempted an absurd number of times.

There is no equation to solve. There is attempt after attempt until one falls below the target.

The number is indeed absurd. Combined, the machines worldwide currently make around one sextillion attempts per second — a 1 followed by twenty-one zeros. A home computer would contribute such a small fraction that, on average, it would take longer than the age of the universe to find a block on its own.

These machines are not ordinary computers. They are devices that only know how to do one thing, stacked by the thousands in warehouses, and what they consume, in practice, is electricity. A mining warehouse is a hot, noisy, and tedious place, much more like a factory than a tech office.

Combined, the machines worldwide make around one sextillion attempts per second.

The more people try, the faster someone would get it right — so the target moves. The network recalculates it periodically so that a block continues to be produced every ten minutes on average, no matter how many machines are running. Doubling the mining does not create more bitcoin; it tightens the target. The mechanism of this adjustment is covered in the intermediate track.

Who pays this bill? Whoever closes the block writes a transaction in it that creates new bitcoins for themselves and also pockets the fees from the transactions included. In 2009, the creation was fifty bitcoins per block; since April 2024, it is 3.125, and this number halves from time to time — this is the subject of the next lesson. There is no allowance from anyone: the reward is the only source, and it is what pays for the network's security.

Because that's what it's about. The energy spent is not the price of doing calculations; it is the price of rewriting the past. As the previous lesson showed, altering an old block requires redoing all the ones that came after — and now we can say how much that costs: more computing power than the rest of the planet combined, sustained for hours, paying for electricity the whole time, while everyone else continues stacking new blocks in front of you. It is not impossible by mathematics. It is expensive by physics.

Rewriting the past requires building faster than the entire world builds the future.

The attack has already happened on smaller networks. Ethereum Classic, with a fraction of Bitcoin's computing power, was attacked this way in January 2019 and again in August 2020. Where renting enough power is cheap, the attack is viable; where it is not, it is not.

The environmental criticism is legitimate and deserves honest numbers. Serious estimates place the network's annual consumption at around 150 to 180 terawatt-hours, close to what a country like Poland consumes. A significant portion of this energy still comes from fossil fuels. On the other hand, the miner is a buyer who can set up anywhere and shut down at any time, which pushes them towards energy that no one else is using: gas that would be burned at the wellhead, hydroelectric power too far from consumption, surplus at night. The debate is real and remains open.

The miner seeks energy that no one else is using: gas that would be burned right there.

What remains is the number that the reward pursues. In the next lesson, the 21 million and the halving every four years.