How does bitcoin mining work?
Bitcoin’s rise to popularity has been meteoric. In less than 10 years it’s infiltrated nearly every aspect of our society. For better or worse it’s become virtually impossible to go a day without a coworker, news broadcaster, or relative mentioning cryptocurrencies.
But when most people talk about Bitcoin the conversation is largely focused on its price, or how to make money from it. The technology underpinning it and the technical process in place to guarantee new coins are released onto the network to be traded are largely ignored. So, how does bitcoin mining work?
In this article, we’ll unpack the technical process: the incredible ‘mining’ system in place to release new coins onto the Bitcoin network.
Before you go any further, you might want to read this quick summary of the key points:
Since its inception, the Bitcoin protocol has determined that only 21 million bitcoins will ever exist, which is unlike non-cryptocurrencies, like the US Dollar, which is infinite in its potential supply;
Mining is the only method for new coins to be released onto the Bitcoin network (new coins can’t be printed or minted at will like the US Dollar);
80% of coins have already been mined into existence, leaving just four million left unmined and currently non-existent on the network (What happens when all the bitcoins are mined?);
At the end of every 10 minutes, all of the transactions of bitcoins that took place during that 10-minute window are recorded in a new block, which is added to the infinite blockchain (thereby creating a neverending virtual record of transactions);
Before that block is added, however, computers (miners) from all over the world run software to verify and secure the transactions that took place;
The miners are, therefore, collectively adopting the role a central bank would play on its own (to verify and secure transactions between people and entities);
In exchange for their contribution to securing and running the network, the miners go into the running to ‘win’ (mine) new bitcoins (i.e., some of the four million coins yet to be mined) every time a new block of transactions is added to the blockchain;
To determine which mining operation should win each new kitty of new coins, the Bitcoin protocol sets a new mathematical challenge for the miners to solve with every new block, and the prize goes to the miner that solves the challenge first;
In essence, therefore, every miner on the planet is powering the Bitcoin network and trying to solve a puzzle simultaneously every 10 minutes; and,
That, in a nutshell, is Bitcoin mining: the process by which new bitcoins are released into the Bitcoin economy.
A Brief History of Bitcoin
Bitcoin was born from the cypherpunk movement, a group of Internet activists who promoted cryptography and privacy as a core idea in social and political change. From these ideas, a person or group of people under the name or pseudonym Satoshi Nakamoto created the world’s first blockchain-based digital currency: Bitcoin.
The original whitepaper (Bitcoin: A Peer-to-Peer Electronic Cash System) was published by Nakamoto in the wake of the 2008 financial crisis. Nakamoto’s goal is made clear within the very first line of the white paper:
"A purely peer-to-peer version of electronic cash would allow online payments to be sent directly from one party to another without going through a financial institution."
Nakamoto sought to create a system that would allow for individuals to digitally transact with one another without a necessarily trusted third party (namely, banks).
In order to do this, he/they created the first ever blockchain, a digital ledger wherein each block contains a chronological record of all transactions on that block, and a cryptographic hash of the previous block.
This prevented the double spending problem that Bitcoin’s predecessors struggled to tackle, and sought to ultimately replace the role banks play in maintaining, verifying, and securing our transactions on our behalves.
Rewards and Fees
Maintaining the blockchain ledger requires vast computing power, which is contributed to by miners or a pool of miners using special hardware to cryptographically secure each transaction onto the blockchain.
Currently, the size of one block in the Bitcoin blockchain is 1MB, and a new block of transactions is added to the chain approximately every 10 minutes. To maintain the 10 minute quota, the difficulty level of the mining process is increased or decreased based on the amount of hash power being used to mine.
When the network was created, the block reward was 50 bitcoins, but to preserve the scarcity of the coin the reward is halved every 210,000 blocks. Currently, the reward is 12.5 bitcoins for every block mined, and the next halving is expected to occur in May 2020. In total, only 21,000,000 bitcoins will ever be mined, and the last reward is expected to occur in the year 2140.
As the network grows, the mining process becomes more and more complex. This is ideally balanced out by increasingly affordable hardware and electricity over time.
Additionally, because of the scarcity of Bitcoin, the price of each coin is expected to continuously rise. Because of this, miners receive an appropriate incentive to maintain the ledger in order to collect their fair reward.
While this process currently works on an idealistic basis, where the price-per-coin remains justifiably high compared to the investment in hardware and electricity spent, miners are also incentivized by transaction fees. These fees encourage miners to include individual transactions on a block. The higher the fee paid, the more likely an individual’s transaction is to be processed quickly.
Fees have been a controversial topic in the Bitcoin community. Fees typically increase when the network is congested, soaring to the $30-range in December 2017.
This was the result of increased interest in Bitcoin, lack of hash power, and bad actors ‘spamming’ the network with small transactions, weighing down the blockchain. Fortunately, these attacks are uncommon as the spammer is essentially throwing away bitcoins in order to attack the system.
Because transactions are expected to increase over time, and the potential for fees to become unmanageable, developers have already set out to create ‘off-chain’ solutions such as the lightning network in order to deal with the inevitable scaling issues the network will face. This is a second-layer protocol which allows users to pool small transactions with small fees off chain and settle them in lump sums on the blockchain at a later time.
Security of the Network, Consensus, and Forks
The decentralized nature of the blockchain means that consensus rules. In order to alter or disrupt the Bitcoin blockchain, an individual or organization would need to control over 51 percent of the total hash power.
Because of this mechanism, it is practically impossible to falsify or corrupt transactions.
This same principle also applies to new rules being added to the protocol, or when the protocol is altered in any way. These changes can occur for a number of reasons, from underlying security risks or a simple upgrade in the way the protocol operates.
In order to make these changes in how the technology behaves, the blockchain must undergo a process called a ‘fork’. There are two types of forks: a soft fork and a hard fork.
A soft fork is a change in the protocol that can work retroactively on the blockchain and typically does not require a split in the chain.
Soft forks are usually cosmetic or functional changes that do not affect the structure of the blockchain in any way. After the new rules are implemented, the same chain will carry on, and miners not complying with the new rules will not be able to verify blocks, forcing them to upgrade to the new ruleset.
The other type of fork, the hard fork, almost always results in a chain split. This is because the changes made impact the structure of the blockchain in some way. With soft forks, newer blocks are still compatible with older blocks, but with hard forks, old blocks are rendered invalid.
When blockchains split, the history of the legacy chain still remains, meaning, any time there is a split, a person’s holdings are essentially replicated onto the new chain, as well (More on Bitcoin forks).
Hardware, Software and Mining Pools
Over time, Bitcoin mining has become a very competitive venture. In the early years of mining, all that was required to participate was a simple desktop computer and the associated software.
As Bitcoin gained popularity, however, miners began using linked GPUs in order to maximize their processing power. Now, in order to compete, miners must use the most up-to-date Application-Specific Integrated Circuit (ASIC) rigs.
Though the competition is stiff, there are several different options for ASIC hardware:
Halong Mining’s DragonMint– Clocking in at 16TWh, the DragonMint is one of the most powerful mining rigs available. It also proves to be a direct challenger to Bitmain’s mining dominance.
Bitmain’s Antminer S9 – Once the most powerful rig on the market, the Antminer S9’s sports a whopping 14TWh in hash power and moderate electricity costs.
Pangolin Miner’s WhatsMiner M3 – Although it falls short of Antminer S9’s hash power, it is not weak, boasting 12.5TWh.
ASICs became the standard for miners, and the difficulty to solve a block increased exponentially. Even with this specialized hardware, however, some miners may even look to join a mining pool so that they may get the most out of their efforts.
Mining pools are groups of miners who, in essence, share their computing power and the payout for solving a block. This allows miners to collect a smaller, but more consistent reward.
Four out of five of the top mining pools are located in China, but there are other options, including alternatives such as NiceHash wherein you can effectively rent your processing power to the highest bidder.
When you’re purchasing mining rigs or joining pools, due diligence is required as equipment is updated and regulations change frequently.
Electricity and Politics
Bitcoin’s popularity has led to surge in mining interest, and in turn, soaring electricity consumption (Read more: How to solve the Bitcoin energy consumption problem).
With energy usage so high, it has sparked a debate on sustainability, and even regulatory backlash.
Accounting for over 70 percent of the world’s Bitcoin processing power, China is a go-to for Bitcoin miners looking for cheap hydropower. The country’s affordable electricity and hardware created a gold rush in the Sichuan Mountains, but according to recent reports, new regulations could force miners to relocate.
Georgia is another one of the world’s top Bitcoin mining destinations. Unlike China, however, the small Eurasian nation enjoys supportive regulation, with the government even incentivizing new miners with low taxes and subsidized electricity costs. In fact, Georgia’s success has led other Eurasian nations to follow a similar path, with Armenia and Uzbekistan looking to create similar regulations.
When debating the best and worst places to mine bitcoins, miners take energy costs, regulation and even climate into account.
Iceland has emerged as one of the top countries in the world for Bitcoin mining, not only for its cheap renewable energy and favorable regulatory standards, but also because of its climate. The mining process essentially turns energy into bitcoins, and in doing so, creates a lot of heat. Iceland’s cool temperatures allow miners to cut back cooling costs and maximize their profits.
While Bitcoin is still years away from being able to compete with Visa or Mastercard, as it grows it is quickly addressing some of the biggest hurdles that could have held it back in the past.
As more miners participate, and new technologies such as the lightning network become available, even the biggest naysayers are changing their opinion on the cryptocurrency.
Despite increasing difficulty levels and stiffer competition, there is still plenty of room for miners to profit. Innovators in the industry are already looking at new ways to reduce electricity costs and improve the efficiency of their hardware, all while bitcoin prices are gradually increasing.
Though days of earning hundreds of bitcoins from a GPU rig may be over, if Bitcoin continues down its current path, "to the moon" may not be too far-fetched of an idea.