Much like regular mining, in cryptocurrency mining a miner’s job is to unearth resources. The reward for extracting resources out of the ground is the cash value of the resource.
For blockchain miners however, things are a bit more complicated. A crypto-miner is rewarded by cracking a fiendishly difficult puzzle.
Before we get into that, let's explore how information is shared on the network.
Sharing Information 👐
On cryptocurrency networks there are traditionally two types of nodes:
Regular Nodes ☋
A node is a computer that shares information with other nodes on the network. When someone makes a transaction on the network - one person sends another person some currency for example - the nearest node documents the transaction and sends it to others, so every node is on the same page.
Mining Nodes ☊
These nodes take all the transactions passed around by the regular nodes and groups them together to form the blocks that make up the blockchain.
When you combine the two you have the fundamentals to a functioning cryptocurrency network.
The Puzzle 🤔
Mining computers or nodes are trying to guess a number. This is trickier than it sounds.
As part of any cryptocurrency’s design is something called a hash function. This is a specially designed algorithm that transforms all the transactions that have taken place in a block into one single number.
It doesn’t matter whether the information is a single letter, a word, a sentence, or an entire encyclopaedia, that number, called a digest number is always the same length.
But if you change just one bit of the information, the resulting number that comes out of the hash function will be completely different.
Information in ➕hash function ➡️ One long number out.
Miners have to guess that one long number to ‘solve’ the block. How?
Miners are trying to combine all of the transactions in the existing block, push it through a hash function and try to create a number that’s within a certain range in order to be right.
This takes a lot of work. 👔
Did you know?
The current amount of electricity required to mine and manage the Bitcoin network is on par with how much electricity Colombia uses in a year.
If they get it right, the network confirms that the number is accurate. The software the currency is built on closes the block, rewards the victor with some currency and all the miners in the network try again on the next block. ✅
But there’s more.
Proof of Work 📝
Remember those maths exams in school when they asked you to show your working out? Well, cryptocurrency networks are much the same.
Did you know?
For trivia lovers, the number miners are trying to guess is called a "nonce", which is a concatenation of "number used once." In Bitcoin, the nonce is a whole number somewhere between 0 and 4,294,967,296.
For miners, the proof-of-work is designed to ensure people aren’t sneakily changing transactions or details already in the blockchain. It’s a nifty tool that also helps protect the ledger from being hacked.
The proof-of-work is one of the main reasons everyone talks about how much electricity cryptocurrency networks like Bitcoin use.
How do you stop nodes mining blocks sent by the network that may be wrong or someone attempting to hack in? Difficulty.
The software that cryptocurrencies run on sets a difficulty level every time a new block is created. This does two things:
Allows crypto miners to tell whether the block they’ve been sent in order to work out the solution to the next block is difficult enough. If the block doesn’t meet the requirements established by the network, the miner can ignore it.
Allows the steady production of currency. In Bitcoin’s case, a new block is created every 10 minutes.
To stop someone buying the fastest and most powerful machines to allow them to solve the crypto puzzle at the heart of the network more quickly, the network automatically adjusts the difficulty by detecting how many machines are working to solve the block.
If the amount of miners on the network goes down, the difficulty drops.
The Future 🔮
Cryptocurrency mining is an energy intensive business. It also creates potential problems as more and more people start to use networks built on mining. But there are signs that the days of mining may be numbered.
If Bitcoin wants to be able to cater for more users, it will need to find a more energy efficient way of verifying transactions.