What is Bitcoin Mining?
Bitcoin mining refers to the process of minting new bitcoins and ensuring that all transactions are verified. There is no central authority in bitcoin and miners form a decentralised network to choose transactions out of a backlog. The role of miners is to arrange these transactions into a block following the consensus rules, ensuring there are no “double spends”, and that these blocks are chained together.
The validity of transactions is checked by miners using the Unspent Transaction Output (UTXO) sets, and agree with each other on the new owners of any bitcoins that have changed hands in a given block. Miners are incentivised to choose and validate legitimate transactions since they earn fees for keeping the network secure, starting with the highest-fee transactions and going down to the lowest fee transactions.They also compete with each other using Proof of Work to add blocks to the blockchain by trying to find the solution to a cryptographic puzzle. Proof of Work refers to the fact that miners expend energy and resources to verify transactions and that anyone can easily verify that the miners have done this "work".
The potential profits from the block rewards (and fees earned from transactions) incentivise wide participation and encourages clever ways of increasing the efficiency of mining and improving the Bitcoin network’s security. If an entity wanted to change the blockchain, they would have to compete with the globally distributed network of miners and invest a large amount of resources required to perform the necessary Proof of Work.
To solve the required cryptographic puzzle to add a block to Bitcoin's blockchain, miners have to combine four variables;
- the time,
- a summary of transactions,
- the identity of the previous block, and
- a nonce (a random number).
Since the identity of the previous block is included in each block in Bitcoin, amending any information in the past requires an attacker to change every since block before it as well.
There are two useful ways to conceptualise Bitcoin mining; as a lottery and as mining a precious metal.
Bitcoin Mining as a Lottery
Bitcoin mining can be thought of as a frequent lottery. Miners commit resources to solving complicated mathematical problems to produce new bitcoins. By committing resources (electricity and hardware) and working to solve these problems, miners effectively gain an entry into the bitcoin mining lottery.
The lotteries we are familiar with run every week or fortnight. In Bitcoin, blocks are produced on average every ten minutes and the difficulty adjustment mechanism ensures that blocks are produced consistently no matter whether more miners join or leave the network.
As competitive game, miners compete with each other to find a 64-digit hexadecimal number that is equal or less than the target number to obtain the block reward. If a miner finds a valid block before any other miner, then they can reward themselves with the bitcoins from the block reward (which is currently 12.5 BTC for each block) and the transaction fees as well - equivalent to winning the lottery’s jackpot.
The freshly minted bitcoin that a miner receives is also known as a coinbase transaction. In another ten minutes, another miner will hit the jackpot (and so on). But if a miner tries to submit an invalid block with false transactions, they forfeit the block reward. The block reward started at 50 BTC and is cut by half every four years or so, until there are only 21 million bitcoins circulating. The block reward will eventually become negligible and Bitcoin miners will have to rely on transaction fees as a source of revenue.
Mining ‘Digital Gold’
Given Satoshi Nakamoto modelled the supply of bitcoin on the rate of discovery of new gold mines, it is not surprising that “mining” became the term for verifying transactions and minting new bitcoins. In Bitcoin’s early stages, anyone could have mined on the network using a laptop, like how getting the first bits of gold out of the ground is straightforward.
During this stage, mining bitcoin was like mining gold in the early 19th century in the Wild West of the US. Anyone could use a pickaxe, shovel, or pan to find gold nuggets and similarly, in the first 12 months or so in bitcoin, the digital currency could be mined with a decent computer. Bitcoin mining consisted of just CPUs (Computer Processing Units) which were widely available to consumers. A CPU miner at this time was the equivalent of sifting gold from a riverbed. But it wasn’t long until mining became commercialised and mainly an endeavour of big business.
As more miners joined the network and people figured out they could use GPUs to mine bitcoin, the profitability for CPU users deteriorated as they lacked enough hash power to compete. GPU farms dominated mining for around three years until early 2013. GPU miners at this time were the equivalent of small mining enterprises.
During early 2013, another advance in hashing power came in the form of Application Specific Integrated Circuits (ASICs) chips. ASICs started to circulate amongst mining enthusiasts and hobbyists, and eventually mining evolved into a professional endeavour with 16 nanometer ASICs appearing around January 2016. ASICs in Bitcoin are the equivalent of large-scale, professional gold mining businesses.
With around only 20 percent of bitcoins left remaining to be mined and the competition fierce, there are only a handful of companies and entities that are involved in large-scale mining operations that will potentially get their hands on the remaining bitcoins. Mining has become a very energy intensive process, and effectively prevents counterfeit bitcoin from existing. For instance, Bitcoin mining operations are mainly based in locations where electricity is relatively cheap (e.g., China) or an abundant source of energy (e.g., Iceland hosts a lot of bitcoin mining harnessing geothermal energy).
How Can I Mine Bitcoin?
To get started with mining bitcoin, purchasing the latest ASIC hardware is recommended. You also need to think about scale, as using one machine is unlikely to be as profitable as setting up a rig or a farm of your own. At this stage of Bitcoin's life, you will not be able to profitably mine bitcoin unless you have access to a lot of capital and cheap electricity.
If you plan on buying ASICs to mine bitcoin, you need to consider:
- The hash rate
- The efficiency of the ASIC miners
- The price of the ASIC miner
A high hash rate means you have a higher chance of earning bitcoins, but efficiency is also required so that each hash costs you less in electricity. The price is important because this is the cost which you should be able to recoup quickly. To compare different bitcoin miners, you can use a profitability calculator to enter your hash rate, power consumption, electricity costs and the price of bitcoin.
Two major manufacturers of bitcoin miners are Bitmain and Halong. Bitmain’s main product is the Antminer S9 while Halong’s is the Dragonmint T16. Along with the ASIC machines, you will also need mining software, a power supply and cooling fans. The Bitcoin mining software manages the ASICs and miners must run a Bitcoin client, which relays information between the client and the network.
Once you have setup the hardware and software, you can then join a mining pool and start hashing. Choose a pool with low fees and a relatively high hash rate so you have more chance of finding a block. You will have to specify a bitcoin address to send your payouts to and you’ll receive payments once your earnings reach a certain threshold.