Mining has historically been a term usually reserved for those digging for gold and other metals deep underground, but today there is a new type of miner searching for very different treasure in a very different way.
Bitcoin miners, equipped with high tech computers rather than a spade, are crucial to the bitcoin ecosystem: dedicating the crucial computing power needed to maintain the blockchain and verify the thousands of transactions occurring every day while also providing the network’s immunity to hackers, ability to track trade and (the only) way to create new bitcoins.
Read more about bitcoin and how it works
The art of bitcoin mining is not even ten years old but the rewards on offer has already seen it evolve from a hobby-like operation that anyone could do at home into an industrialised, energy-intensive market.
Decentralisation is at the heart of bitcoin and, while the importance of the blockchain is well understood, how this public ledger operates is often overlooked considering it isn’t controlled by a single person or entity. So, what is bitcoin mining and how does it work?
What is bitcoin mining?
Bitcoin mining is the process that ensures that bitcoin functions as intended and is the only way of adding new supply into the market. Miners are individuals or companies that contribute computing power to help maintain and operate the blockchain network that underpins bitcoin as a digital currency. These computers are responsible for verifying all bitcoin transactions and in return they get the opportunity to ‘mine’ for bitcoin that has been newly created.
Although the Internet created a fast and universal communication channel around the world, the development of a truly decentralised system capable of operating on a global scale was still being held back by three big questions. Firstly, with no one in control, who will keep a record of (and incur the costs of recording) all the transactions? Secondly, who would hold these record keepers to account? And thirdly, how do you incentivise people to become record keepers in the first place?
Satoshi Nakamoto, the founder of bitcoin, came with up an answer for all three. People – known as miners – would use their own computers to power and maintain the blockchain, helping organise other people’s transactions. The computers of other miners would then check the work to ensure it is correct to provide a public consensus on which transactions to confirm – if the information from the original miner doesn’t match what everyone else has then it is clear something is amiss. In return for doing this, the miners are paid transaction fees and, so long as there is still new bitcoin to be made, an opportunity to win the new bitcoin that the protocol releases every ten minutes or so.
Using bitcoin miners to operate the blockchain addressed many of the problems that brought down previous systems. It is decentralised: the ledger is not under a single point of control and anyone can access and verify the transactions that have been recorded. It is incentivised: people have a reason to use their hardware and pay for the electricity needed to run the blockchain as they are rewarded with new bitcoins. Together, this makes it immune to hackers: the fact it is powered by a vast array of computers around the world rather than a single source means it is extremely unlikely (although not impossible) anyone could gain control of over 50% of the network to take control.
How does bitcoin mining actually work?
Today, bitcoin mining is predominantly done using powerful, purpose-built computer systems known as rigs that run bespoke software day and night. All the rigs have been set up for the same reason: to mine for new bitcoin. But to mine for this bitcoin they must assist in updating the public ledger and help validate the work done by other miners maintaining the blockchain. Every single bitcoin in existence has been created through mining, meaning every bitcoin is owned by a miner until (or if) they decide to sell it.
Every bitcoin transaction initially enters the network as ‘pending’, or ‘unconfirmed’, so there is a constant stream that need to be verified by the miners, in order for the transaction to be confirmed. This is the same principle as a bank clearing a payment using your debit card. These transactions contain all the important information needed for the transaction such as the wallet addresses of each party and the date, as well as other optional data such as transaction codes, reference numbers or messages.
Bitcoin mining and hashes
Miners (also referred to as mining nodes) then automatically begin to organise this data. Firstly, they reduce all the information within the transaction into a hash: an alphanumeric string of 64 characters. This not only condenses large amounts of information into a smaller file but also encrypts the information that the hash now represents. Once the hash has been created the underlying information it represents cannot be changed without messing up the hash, which would then alert the rest of the miners operating the blockchain.
Importantly, the blockchain is organised in chronological order and mining software automatically starts gathering the most recent transactions before moving on to the second most recent transaction, then the third and so on. Once one transaction has been hashed, it is combined with the information of another transaction to make a new hash. Transactions keep being added together and combined under a single hash until they form a block. It is these blocks that are added to grow the chain of transactions (hence the name blockchain).
Bitcoin mining and nonces
During this process miners are racing with one another to be the one to seal off the block so that it is ready to be inserted into the chain, as the miner to do this is the only one that is rewarded with new bitcoin. Sealing off complete blocks, however, is a guessing game rather than one based on skill. Miners compete to find the random block hash that the bitcoin protocol is looking for by rapidly submitting numerous guesses (known as nonces) in the hope of striking a match.
The random nature of this process means miners can’t find patterns to follow or gain a better insight into what next hash will be needed to seal off a block and earn new bitcoin: it all comes down to luck. They can, however, maximise their chances – the more computing power a miner has the more guesses it can make. It is the same principle as playing the lottery: you can purchase more tickets to increase your chances of winning but there is no guarantee of a prize regardless of how many you buy.
Once a miner seals off a new block it creates a block number that sequentially follows the last block that was added to the chain, mathematically tying the new block to the other blocks of transactions in the chain that have already been confirmed and verified by the consensus-based network.
Once the new block has been added to the blockchain it needs to be confirmed by other miners. The miner that has sealed off the block has to have their proof-of-work (PoW) checked by other miners to make sure all the information is correct. This is done by multiple other miners checking that the hash of the block matches that of the underlying information it represents, reaching a consensus as to whether the new block is legitimate or not. This consensus-based model is what prevents fraudsters from tampering with previous or new transactions and stops people from ‘double spending’ (when someone spends bitcoin they have already spent and no longer have), as the blockchain will recognise if any new transactions involve bitcoin that has already been spent.
In this capacity, miners are essentially acting as auditors of one another’s work to ensure everyone is playing by the rules.
Why do people mine bitcoin?
The miner that completes the PoW to add a new block to the blockchain – having helped verify a group of transactions over a certain timeframe – is rewarded twofold: they are given the new bitcoin that the protocol releases, and they are awarded the transaction fees attached. This is a way of acquiring bitcoin without having to purchase them.
The bitcoin protocol dictates the speed and volume at which new bitcoin supply is added to the market. New bitcoins are released to successful miners every ten minutes, but the algorithm controlling this is not technically dictated by time. Instead, it is designed to adjust how difficult it is for the miners to seal off a new block, to keep the flow of new supply steady at that speed. This means the rate at which bitcoin is released is unaffected when the number of miners in operation increases or more computing power is applied. The rewards on offer remain the same regardless how many miners are competing for it, and the new bitcoin on offer stays the same no matter how much computing power is thrown behind it. The only thing that does change is the odds of each miner winning the rewards on offer.
While new bitcoin will continue to be released over ten minute windows the volume of new bitcoins issued to successful miners does change, halving roughly every four years (technically, every 210,000 blocks). When bitcoin was first mined by Satoshi in 2009 the reward was 50 bitcoin before dropping to 12.5 bitcoin in 2012, and then down to the current level in 2016. The next cut, down to 6.25 bitcoin, is expected to happen in 2020, when miners will be hoping lower volumes will be offset by higher prices.
There will only ever be 21 million bitcoins in existence and the vast majority have already been mined – the 17 millionth bitcoin was released in April 2018. The constant rate of release of gradually smaller volumes of new bitcoin means the last bitcoin won’t be mined until sometime around 2140.
Miners are also paid transaction fees in addition to the new bitcoin that is released. The huge sums that payment processors and banks cream off the billions of transactions we all conduct each day is often cited as one of the reasons why bitcoin and other cryptocurrencies are necessary. But it is often misunderstood that using bitcoin is not free, albeit cheaper than what the traditional financial system currently offers. Miners do not have to charge transaction fees and not too long ago they often only applied them to certain types of transactions, such as particularly large or small ones, but income from transaction fees has rocketed and their reliance on this income stream is only set to grow.
Is bitcoin mining profitable?
In short, it is impossible to define whether bitcoin mining as a practice is profitable in general. There are too many variables: the cost of hardware and the energy needed to power it differs wildly across the globe and the return that each miner delivers depends on how able it is to compete with an increasing number of competitors all vying for the same prize.
In the same way a gold miner’s chances of finding a nugget would reduce as more people started digging in the same territory, a bitcoin miner’s chances of winning the new bitcoin and transaction fees declines the more competition there is in the market. There aren’t any other bitcoin deposits to dig up and bitcoin miners must compete for the same treasure or not at all.
While it is not known for sure whether bitcoin mining is profitable right now, we do know some things for sure. One, most bitcoin miners were making profit in the initial years. Two, some miners must be reaping rewards as otherwise there would be no incentive for them to continue mining. And three, while some could still be making money mining bitcoin it is certainly less profitable than it used to be and harder to compete than ever before.
That third point is demonstrated by how difficult it has become to seal off a new block and win the reward. According to blockchain.com, the difficulty level to find a new block (measured by the hashing power deployed by all miners) has risen exponentially in 2018, demonstrating the rise in competition.