Mining, Math, and Waste: A Simple Look at Blockchain Hashing
What a hash actually is, why mining depends on guessing, and where all that electricity goes.
To mine a block in a traditional blockchain, you need to calculate a hash. But what exactly is a hash, and why are so many of them wasted?
To understand hashes, let’s start with the concept of functions. Take a simple example: a function that adds the inputs, such as two and three add up to five. We can write this as F(2, 3) = 5. If we apply the same function to 2, 3, and 4, the result is 9. If I told you that F(X) = 9, you could try to solve for X. One possible answer would be X = 2, 3, and 4; another would be X = 1 and 8. For simple functions like this, it’s relatively easy to solve them in either direction—using addition forward and subtraction in reverse.
However, functions become more difficult to reverse as they grow more complex. Functions involving prime factorization or squaring inputs, for instance, may be easy to compute in one direction but extremely hard to solve backward. Even powerful computers can struggle to reverse them efficiently.
Hashing algorithms are a type of complex function with a special twist: their outputs are formatted to a fixed size. That means no matter what data you input—whether it’s a single number or a dataset with a million digits—the output hash will always be the same size. Since these algorithms are mathematical at their core, everything can be reduced to numbers: think ASCII codes or binary. In the digital world, it all comes down to bits.
To mine a new block on a blockchain, you start by organizing your inputs. These include metadata such as the block number, the previous block’s hash, your reward address, and any other required details. Then you add a group of validated transactions that need to be permanently recorded. Finally, you include a counter known as a nonce. You feed all of this into the blockchain’s hashing algorithm to generate a single hash representing that block.
The catch? While the hash output is always the same size, only certain hashes are acceptable. In Bitcoin, for instance, there’s a difficulty rating that defines an upper limit for valid hashes—essentially requiring that the hash begin with a specific number of zeros. To find such a hash, miners must try countless combinations of metadata, transaction sets, and nonces.
If a miner does find a hash that meets the criteria, they broadcast it to the network. Other nodes can quickly verify that the block is valid, as it is easy to prove an answer is correct, whereas it is very hard to find a new correct answer. It is kind of like a jigsaw puzzle where every piece is numbered at random: if somebody tells you the right order you can put it together quite quickly, but if you are guessing randomly you may not live long enough to find the solution. If accepted, the community begins mining the next block using the new one as a reference.
But what happens to all the hashes that didn’t make the cut? They’re discarded. The time, effort, and electricity used to generate them are essentially wasted.
As we move toward a more sustainable digital economy, we must look for greener alternatives that don’t depend on burning massive amounts of energy just to validate transactions. The future of digital currency should prioritize efficiency and environmental responsibility.
Want the full picture? Read how the three-ledger system avoids these problems.