How Bitcoin Mining Works – The Newbie Guide to Bitcoin
In today’s article, I will have a look at how bitcoin mining works and how coins get into circulation. If you missed our previous newbie article on What is Bitcoin, you can view it over here.
The short definition is: Bitcoins are “mined” into existence by miners using specialized hardware.
Bitcoin mining serves two purposes; first, it adds new transaction blocks to the blockchain. Second, it introduces Bitcoins into circulation.
During the mining process, miners compile recent transactions into blocks; next, they try to solve a computationally complex puzzle. The first miner in the Bitcoin network to solve the puzzle is by consensus allowed to add the next block to the blockchain, and to claim the mining reward.
The reward, which includes Bitcoins and sometimes transaction fees, gives miners a reason to keep mining.
Bitcoin Network Integrity
The mining can be done by anyone who has a fast internet connection as well as proper hardware.
The decentralized concept also secures the network because mining nodes approve transactions by consensus. When there is a disagreement on which miner’s block should be added to the blockchain, the dispute is settled by the majority. Therefore, the winning block is determined by a 50% + 1 vote of the Bitcoin mining power.
If there is a single person or group of people with a control greater than 50% of the network’s mining power, they can corrupt the blockchain. That attack is referred to as “51% attack.”
Bitcoin’s network is extremely secure due to the enormously high hash rate it operates with and it’s virtually impossible to hack it. At the moment of writing, Bitcoin’s hash power is 6.5 exahashes per second (18 zeros).
It’s safe to claim that the blockchain would get away with 1/10 of its existing hash rate and still be unhackable. That’s thanks to the proof-of-work concept.
To put it simply: anyone who wants to hack the network in order to, let’s say, steal your bitcoins, would have to rewrite the whole blockchain and it would have to happen quicker than new blocks are mined. Nobody is able to do it as of today due to the insufficient computing power.
The block reward is the number of Bitcoins released into the network after a new block is mined.
After every 21,000 blocks, the block rewards is halved, which happens roughly every four years.
At the start of the Bitcoin blockchain, the first block reward was 50 BTC, which the Bitcoin founder awarded himself in 2009.
Currently, the block reward is 12.5 BTC. There’s 1.8 million Bitcoins to be mined until next blockhalf which is estimated to take place in June 2020.
As the block reward diminishes, the number of Bitcoins also approaches the maximum number, which is 21 million. Once that number is attained, the current Bitcoin protocol will stop the release of new coins.
As of today, block rewards still act as the main incentive for mining. On the other hand, transaction fees currently represent about 20% of the total reward for mining a new block.
As the block reward dwindles, mining will become a less attractive investment in years to come. Unless of course, there is an increase in the number transactions that include mining fees. That will give miners a reason to continue their mining.
Transaction fees are a fixed minimum number of bitcoins included in a transaction. They are added as an incentive for miners to include a transaction in the block they are mining.
While the transaction fees are optional, miners also have an option not to include transactions without fees in the block they are mining. This means that if a Bitcoin user wants their transaction to be processed faster, they need to include the fees as an incentive.
The more in fees you’re willing pay, the quicker your Bitcoins reach their destination. However, this is being worked on and could be sped up by the Lightening Network concept.
The average amount of tx fee per transaction within a block is just over $35.
If the blocks on the bitcoin chain are to be solved correctly (each every 10 minutes), the very last Bitcoin will be mined in July 2140 and it’s hoped the transaction fees will sustain the chain from then on.
However, we’ve witnessed evolution of new blockchain algorithms that are being successfully deployed in other networks on a regular basis. For example, proof-of-work morphed into proof-of-stake, proof-of-activity, proof-of-burn, proof-of-capacity, proof-of-elapsed-time etc. You can read more about blockchain algorithms and how they work over here.
This indicates that there’s a good chance that Bitcoin’s PoW will be replaced by one of the above or not-yet-developed algorithm before the magical year 2140.
One thing is certain though — we’re living in exciting times when the blockchain technology is in its infancy stage and nothing is certain yet!
Why Are There Only 21 Million Bitcoins?
21 million BTC isn’t a random number that Satoshi Nakamoto came out with.
- Initial block reward was 50 BTC
- 1 block is made every 10 minutes
- Block reward halves every 4 years
Those three variables lead to 21 million coins.
That’s because after so many halvings the block reward eventually hits 0 and at that time the number of coins generated happens to be just under 21 million.
The difficulty of mining Bitcoins is determined by the combined effort of the whole network.
The Bitcoin network uses the protocol described in the software to adjust the mining difficulty after every 2,016 new blocks, which happens automatically about every two weeks.
All adjustments are calculated to keep the rate of mining constant. When the network’s computation power increases, the mining difficulty is adjusted upwards to make mining harder.
The opposite happens when the mining power drops; mining difficulty is adjusted downwards to make mining easier. This is what we had observed with Bitcoin Cash (BCC/BCH) in its very first days. BCH had struggled to get a decent amount of miners behind it and its difficulty adjusted after several days to make it more profitable to mine it and attract more supporters.
Simply put: the more difficult it is to mine, the less the profit miners make because it takes more computing power (more electricity) to solve a math problem. Furthermore, as the number of mining participants increases, the mining profit for each participant drops.
The prevailing Bitcoin price, size of transaction fees, the block reward, and the number of people mining determine the overall payout per block.
Bitcoin Mining Hardware
During the early days of Bitcoin mining, miners used regular CPUs found in desktop computers. As the mining difficulty increased, Graphics Processing Units or GPUs were found to be more efficient mining tools than CPUs.
As mining became even more competitive, Application Specific Integrated Circuits or ASICs made for Bitcoin mining were introduced.
They were faster and more efficient than GPUs. Today the design of the ASICs has been improved further to make them efficient and faster.
Using CPUs, GPUs, and even older ASICs will cost the miner more than the revenue they get for mining.
The mining difficulty has gone up exponentially as more miners join the network and efficiency of the ASICs improves. Furthermore, the large increase in the price of Bitcoin has made mining rewards an attractive investment for those who can find cheap power.
Political power within the Bitcoin mining network is also at play; more mining power means a person or persons get a vote on whether to adopt new protocols or not.
Companies such as CloudHashing, CEX.io, and MegaBigPower allow miners to lease their mining hardware to cut down on the initial investment costs.
If you wish to invest in the Bitcoin mining ecosystem, the leading mining hardware companies to consider are KnCMiner, HashFast, Bitfury, and Butterfly Labs.
Bitcoin Mining Pools
As mining difficulty increased, miners had to mine for longer periods before they were able to solve the puzzle before other miners.
What that meant is a miner could invest in an ASIC card that costs a few thousand dollars, mine for months, and still not earn any reward. That was possible because even the best ASIC card represents less than 0.001% of the network’s mining power.
The situation is aggravated by the increasing mining difficulty as more miners join the network. It’s possible that one could mine for years and not recoup their initial investment.
The solution to that problem is to join a mining pool. Third parties manage mining pools and coordinate the efforts of large groups of miners.
When one miner is paid, the payout is shared among the pool members. Miners can, therefore, start earning the day they activate their miner. While mining pools increase the chances of “51% attack,” they provide a more sustainable mining strategy.
The cost of hardware and the cost to operate the hardware form the largest portion of the investment in Bitcoin mining.
While the hardware is a one—time cost, the electricity needed to power the hardware, cool it, and ventilate the mining ecosystem is a continuous cost.
Some mining operations have chosen to locate their mining equipment where the cost of electricity is lowest, such as in Columbia River, Washington State. Others have chosen to locate their mining equipment in cold places such as Iceland, where the cold environment provides free cooling, and the geothermal power provides cheap electric energy.
- Bitcoin Mining is the process that is used to process Bitcoin transactions and bring Bitcoin into circulation
- The total number of Bitcoins is capped at 21 million, and the miners compete to offer mining services in exchange for Bitcoin rewards and transaction fees
- As miners use more computing power, the network’s mining difficulty automatically increases to control mining profitability
- The network is extremely secure due to its overwhelmingly exaggerated hash rate which makes it virtually unhackable