How to mine Bitcoin: Everything you need to know
What is mining?
Mining is the process of creating valid blocks that add transaction records to Bitcoin’s (BTC) public ledger, called a blockchain. It is a crucial component of the Bitcoin network, as it solves the so-called “double-spend problem.”
The double-spend problem refers to the issue of needing to find consensus on a history of transactions. Ownership of Bitcoin can be proven mathematically through public key cryptography, which cannot be broken with today’s technology. However, cryptography alone cannot guarantee that one particular coin hadn’t previously been sent to someone else. In order to form a shared history of transactions, one needs to have an agreed-upon ordering that is based on, for example, the time of creation of each transaction. But any external input can be manipulated by whoever provides it, requiring participants to trust that third party.
Mining (and blockchain in general) leverages economic incentives to provide a reliable and trustless way of ordering data. The third parties ordering transactions are decentralized, and they receive monetary rewards for correct behavior. On the contrary, any misbehavior results in loss of economic resources, at least as long as the majority remains honest.
In the case of Bitcoin mining, this result is achieved by creating a succession of blocks that can be mathematically proven to have been stacked in the correct order with a certain commitment of resources. The process hinges on the mathematical properties of a cryptographic hash — a way to encode data in a standardized manner.
Hashes are a one-way encryption tool, meaning that decrypting them to their input data is near-impossible, unless every possible combination is tested until the result matches the given hash.
This is what Bitcoin miners do: they cycle through trillions of hashes every second until they find one that satisfies a condition called “difficulty.” Both the difficulty and the hash are very large numbers expressed in bits, so the condition simply requires the hash to be lower than the difficulty. Difficulty readjusts every 2016 Bitcoin blocks — or approximately two weeks — to maintain a constant block time, which refers to how long it takes to find each new block while mining.
The hash generated by miners is used as an identifier for any particular block, and is composed of the data found in the block header. The most important components of the hash are the Merkle root — another aggregated hash that encapsulates the signatures of all transactions in that block — and the previous block’s unique hash.
This means that altering even the tiniest component of a block would noticeably change its expected hash — and that of every following block, too. Nodes would instantly reject this incorrect version of the blockchain, protecting the network from tampering.
Through the difficulty requirement, the system guarantees that Bitcoin miners put in real work — the time and electricity spent in hashing through the possible combinations. This is why Bitcoin’s consensus protocol is called “proof-of-work,” to distinguish it from other types of block-creation mechanisms. In order to attack the network, malicious entities have no method other than recreating the entirety of its mining power. For Bitcoin, that would cost billions of dollars.
How Bitcoin miners are paid
The network recognizes the work conducted by Bitcoin miners in the form of providing rewards for generating new blocks. There are two types of rewards: new Bitcoin created with each block, and fees paid by users to transact on the network. The block reward of newly minted Bitcoin, amounting to 6.25 BTC as of May 2020, is the majority of miners’ revenue. This value is programmed to halve at fixed intervals of approximately four years, so that eventually, no more Bitcoin is mined and only transaction fees guarantee the security of the network.
By 2040, the block reward will have reduced to less than 0.2 BTC and only 80,000 Bitcoin out of 21 million will be left up for grabs. Only after 2140 will mining effectively end as the final BTC is slowly mined.
Even though the block reward decreases over time, past halvings have been amply compensated by increases in the Bitcoin price. While this is no guarantee of future results, Bitcoin miners enjoy a relative degree of certainty about their prospects. The community is very supportive of the current mining arrangement, and has no plans to phase it out like Ethereum, another major mineable coin. With the right conditions, individual Bitcoin miners can be confident that the venture will turn a profit.
Though mining is a competitive business, starting out is still relatively easy. In the early years of Bitcoin, hobbyists could simply boot up some software on their computer and get started right away. Those days are long gone, but setting up a dedicated Bitcoin miner is not as hard as it may seem at first.
How to choose hardware for mining
The first thing to note is that for mining Bitcoin, your only option is to buy an Application-Specific Integrated Circuit device, commonly referred to as an ASIC.
These devices can only mine Bitcoin, but they are highly efficient in doing so. In fact, they are so efficient, that their introduction around 2013 made all other types of calculating mining devices obsolete almost overnight.
If you are looking to mine with common CPUs, GPUs or more advanced FPGAs, you will need to look into other coins. Though these devices can mine Bitcoin, they do so at such a slow pace that it’s just a waste of time and electricity. For reference, the best graphics card available just before the rise of ASICs, the AMD 7970, produced 800 million hashes per second. An average ASIC today produces 100 trillion hashes per second — a 125,000-fold difference.
The number of hashes produced in a second is commonly referred to as the “hash rate” and it is an important performance measurement for mining devices.
There are two other main factors that should be considered when purchasing a Bitcoin mining device. One is the electricity consumption, measured in watts. Between two devices that produce the same number of hashes, the one that uses the least electricity will be more profitable.
The third measure is unit cost for each device. It is pointless to have the most energy-efficient ASIC in the world if it takes 10 years to pay itself back through mining.
Bitcoin has a fairly vibrant ecosystem of ASIC manufacturers, which often differ on these three parameters. Some may produce more efficient but also more expensive ASICs, while others make lower-performing hardware that comes at a cheaper price. Before analyzing which device is best suited for your needs, it is important to understand the other factors influencing profits from Bitcoin mining.
The economics of mining Bitcoin
Like the real estate business, Bitcoin mining is all about location, location, location.
Different places in the world will have a different average price of electricity. Residential electricity in many developed countries is often far too expensive for mining to be financially viable. With the price of electricity often ranging between $0.15 and $0.25 per kilowatt hour, Bitcoin mining in residential areas runs too high a bill to remain consistently profitable.
Professional Bitcoin miners will often place their operations in regions where electricity is very cheap. Some of these include the Sichuan region in China, Iceland, the Irkutsk region in Russia, as well as some areas in the United States and Canada. These regions will usually have some form of cheap local electricity generation such as hydroelectric dams.
The prices enjoyed by these Bitcoin miners will often be below $0.06 per KWh, which is usually low enough to turn a profit even during market downturns.
In general, prices below $0.10 are recommended to maintain a resilient operation. Finding the right location for mining is largely dictated by one’s circumstances. People living in developing countries may not need to go further than their own home, while those in developed countries are likely to have higher barriers to entry.
Aside from the choice of hardware, an individual miner’s profit and revenue depend strongly on market conditions and the presence of other miners. During bull markets, the price of Bitcoin may skyrocket higher, which results in the BTC they mine being worth more on a dollar basis.
However, positive inflows from bull markets are counterbalanced by other Bitcoin miners seeing the increased profits and purchasing more devices to tap into the revenue stream. The result is that each individual miner now generates less BTC than before. Eventually, the revenue generated trends toward an equilibrium point where less efficient miners begin to earn less than they spend on electricity, thus shutting devices off and allowing others to earn more Bitcoin.
Usually, this does not happen instantaneously. There is a certain lag, as ASICs can sometimes not be produced quickly enough to make up for the increase in Bitcoin price.
In a bear market, the opposite principle holds: Revenue is depressed until miners begin to turn off their devices en masse.
To avoid being outcompeted, existing Bitcoin miners must find a winning combination of location and hardware that would allow them to maintain their edge. They must also constantly maintain and reinvest their capital, as more efficient hardware can throttle older miners’ profits completely.
Comparison of mining hardware profitability
There are several calculators online on websites such as AsicMinerValue, CryptoCompare and Nicehash, where the profitability of a mining device can be quickly checked. It’s also possible to estimate profit manually with the following formula:
This is the formula that many of these calculators use, and it simply represents your share of the overall hashrate divided by the network’s total issuance in dollars. The input values required are either fixed parameters (the block time for Bitcoin is 10 minutes, so there are six blocks mined in an hour and 144 in a day), or they can be found on data websites like Blockchain.com or Coinmetrics.
To find the profit, one also needs to subtract the cost of electricity. Thanks to the equivalence between kilowatts and kilowatt hours, this can be as simple as multiplying the device’s power usage by 24 hours in a day and the electricity price per kilowatt hour.
Below is a table illustrating major ASICs on the market today and their payback period — that is, how long it would take for the investment to break even on current revenues. It’s worth noting that a Bitcoin miner’s profit fluctuates wildly over time, and extrapolating a single day into the future can lead to inaccurate results. Nonetheless, it’s a useful metric to understand the relative effectiveness of each device.
As can be seen in the table, none of the ASICs turn a profit at prices of $0.20 per KWh. The relative performance is mostly the same for each of the new-generation ASICs, while older models can be an attractive proposition if electricity is cheap.
For example, the Canaan AvalonMiner 1066 has low energy efficiency but also a very low price, making it fairly competitive at the low electricity price bracket despite being a fairly old model. The Bitmain S17 Pro, a previous-generation ASIC, still holds its ground due to its lower cost, but quickly becomes unattractive when the reference electricity price rate is raised. MicroBT’s devices appear to have the most balanced performance overall for mining.
One final issue to consider is that this table was compiled in a bull market. Profits may be higher than average, though the halving of 2020 is still fresh and may counterbalance the effect with lower Bitcoin issuance.
Buying and setting up the hardware
There are several shops that sell ASICs to retail customers, while some manufacturers also allow direct purchases. Though they are more difficult to source than common graphics cards, it is still possible for anyone to buy an ASIC at an acceptable price. It is worth noting that buying mining equipment from shops or manufacturers shipping from foreign countries may result in hefty import dues.
Depending on the manufacturer or the shop, ASICs may be offered without a power supply unit, which will then need to be purchased separately. Some ASIC manufacturers sell their own units, but it is also possible to use PSUs built for servers or gaming computers, though they are likely to require special modifications.
ASICs need to be connected to the internet via an ethernet cable, and they can only be configured through a web browser by connecting to the local IP address, similar to a home router.
Before carrying on, it is necessary to set up an account with a mining pool of choice, which will then provide detailed information on how to connect to its servers. From the ASIC’s web panel, you need to insert the pool’s connection endpoints and account information. The miner will then begin working and generating Bitcoin.
Mining through an established pool is strongly advised, as you will be able to generate constant returns by pooling your hardware with others. While your device may not always find the correct hash to create a block, your mining contribution will still be rewarded.
Considerations and risks of Bitcoin mining
In addition to the financial risk of not turning a profit, there are technical risks involved in managing high-power devices such as ASICs.
Proper ventilation is required to avoid the mining equipment burning out components due to overheating. The entirety of the miner’s electricity consumption is dissipated into its environment as heat, and one ASIC is likely to be the single-most powerful appliance in your home or office.
That also means you need to carefully consider the limits of your electrical grid when Bitcoin mining. Your home’s electricity network is rated up to a maximum level of power, and each socket has its own rating too. Exceeding those limits could easily result in either frequent outages or electrical fires. Consult an expert to determine whether your electrical setup is safe for mining.
Regular maintenance against dust and other environmental factors is also required to keep the mining devices healthy. While failures are relatively rare, ASICs can go out of commission earlier than expected without proper maintenance.
While single ASICs may fail, the largest threat to their profitability is them becoming obsolete. More efficient miners will eventually crowd out older devices.
Historic generations of miners like the Bitmain S9, released around 2016, lasted approximately four years before becoming unprofitable under any electricity price configuration (except zero). However, the speed of advances in computing technology is largely unpredictable.
Bitcoin mining is no exception to any other venture. There is potential for rewards as well as risks. Hopefully, this guide provided a decent starting point to further evaluate both.