Is Bitcoin mining profitable?
Shelly Henry
CEO, MooresLabAI | Ex-Microsoft | HoloLens | Quantum Computing | Server/AI Chips | Ex-ARM
Who are bitcoin miners? What do they do and how do they profit from mining? Before we answer these questions, we need to take a deeper look into how Bitcoin mining works.
What is Bitcoin mining?
The bitcoin network consists of hundreds of thousands of nodes or computers. Each node keeps a copy of every single transaction that has happened since the beginning of bitcoin! It’s stored in a “file” called blockchain. If we need to change any transaction that happened in the past, we need to hack every single node on the network, which is impossible.
Now, how does a new transaction get added to blockchain?
To explain that, we need to understand a mathematical function called SHA-256 (Secure Hash Algorithm). It’s a special computer program that takes in a message of any length and outputs a 256-digit number.
This process is called hashing. Mathematically, this is considered a one-way function, which means, if you are given the 256-digit output, you can never recreate the original message.
Now, I can create a mathematical puzzle by giving you a message and ask you to add a 5 digit magic number at the end of the message so that the final SHA256 output will have 2 zeroes in the beginning.
The only way I can solve this puzzle is by trying out different 5-digit numbers until I find a SHA256 output that starts with 2 zeros. Of course, you can use a computer to try out different numbers for you until it finds the right answer. You have 1 in 10 chance of finding a SHA256 output with one leading zero. For two leading zeros, your chance drops down to 1 in 100. But I can easily increase the difficulty of the puzzle exponentially by requiring a SHA256 output that starts with 4 or 5 or even 10 zeros, instead of just 2 zeros.
Now, let’s get back to our Blockchain world. Consider this example where the bitcoin blockchain has only 4 transactions. All computers on the bitcoin network has the same copy.
From this Blockchain, we can easily calculate the current assets of John, Steve, Trevor, Bella and Alice
Now Alice bought a cake from Steve and wants to give 2 bitcoins to Steve. So, she publishes that transaction on the bitcoin network.
Every node in the network see that transaction. Bitcoin nodes are setup such that it can add a new transaction, only if the following two conditions are met.
a) Alice has at least 2 bitcoins in her assets
b) the message “Alice gave 2 bitcoins to Steve +magic number” has a SHA256 output that starts with say 7 zeros. The magic number is called “nonce” in bitcoin terminology.
When that magic number is found, the person who finds it will publish it on the network and the new transaction gets added to Blockchain on every node-computer.
Now, who is going to volunteer to find this “magic number” for every transaction that needs to be added to the blockchain? And what is their incentive to find the magic number? That’s where miners come in. Say, Martin is a miner. He’s not going to find a magic number for the message “Alice gave 2 bitcoins to Steve”. He will modify the message to “Alice gave 2 bitcoins to Steve + Martin gets 12.5 bitcoins out of thin air+ magic number”.
If Martin is the first one in the bitcoin network to find the magic number, then his message will get added to the Blockchain. And he will become the proud owner of 12.5 bitcoins which he is free to spend.
So, the race is to be the first one to find the “magic number”. Since, the only way to do that is by trial and error, the more powerful your computer is, the more likely you will be to be the first to find the magic number. That’s how miners make money.
The number of leading zeros, the SHA256 output should start with, is not always a constant. It keeps increasing as the number of miners increases. For example, if the “magic number” for a transaction message was set to require 7 leading zeros and someone found the number in 10 minutes, the next transaction message will require 8 leading zeros. The algorithm is setup so that a new magic number will be discovered for the next transaction message (or set of transactions known as a “block”) approximately every 15 minutes.
Now, how do you get access to a powerful computer to do as many SHA256 operations as possible and increase your chances?
There are 3 main approaches to achieve that:
- Solo mining
- Mining Pools
- Cloud mining
Type 1: Solo mining
Currently, in mid-2019, bitcoin blockchain requires 19 leading zeros for the SHA output of the transaction message or transaction block.
If you own a regular desktop computer, you can do about 20 million SHA256 operations per second which means it will take you more than 140,000 years to find the “magic number” and collect your mined bitcoin!
The other option is to use a graphical processing unit (GPU), which is a chip that sits inside your desktop computer that communicates with the monitor. It can do SH256 calculations much faster. Even if you use 100 of these GPUs it would take approximately 170 years to mine a block.
So, what is a viable option?
Mining today is essentially dominated by Application Specific Integrated Circuits (ASIC). These are chips that are designed and built from scratch to do nothing except compute SHA256 and mine bitcoins.
At the time of writing, in 2019, the most powerful Bitcoin ASIC device is the Bitmain Antminer S17 , which can generate 53 x 1012 (53 million million) SHA256 calculations per second or 53TH(TerraHashes) per second. This equates to finding the “magic number” once every 2 months!
Just for comparison, here is a list of few ASIC hardware you can currently buy and the corresponding profitability:
Assumptions (as of mid-2019):
1 BTC = $9830
1kwh = 12 cents (average US rate)
Most of these devices can be hooked on to your desktop computer using a USB cable. You will need to install the supplied software on to your computer and follow the on-screen instructions. You can now sit back and let your mining device do all the hard work!
The drawback with solo mining is that there is no guarantee that you will make a regular income. The estimated monthly income is calculated using the probability that your ASIC hardware will discover the “magic number” for a block of transactions every 2 months.
So, if you are looking for a more predictable income, mining pools are a better option for you.
Type 2: Mining Pools
A mining pool is usually controlled by a pool manager. The manager picks up the transaction messages and creates a block which looks something like this: “Alice gives Steve 2 bitcoins + Pool manager gets 12.5 bitcoins out of thin air+ magic_number”. Then he sends this new block to all the participants in the pool to find the “magic number” so that the SHA256 output of the block has, say, 19 leading zeros. Since everyone in the pool is working on finding the magic number for the same block, the pool has a very high probability of success!
When one of the members of the pool finds the “magic number” and sends it back to the pool manager, the member doesn’t get the reward! Instead, the pool manager gets the reward since the message said, 12.5 Bitcoins go to the pool manager.
Now, how does the pool manager distribute the reward fairly to the members of the pool? Some members might have had very expensive machines and worked harder than others. The pool manager employs a clever solution for that! He instructs all members to send in the “magic number” even if they got 14 or more leading zeros for their SHA output, even though 19 leading zeros are required for receiving the rewards. These magic numbers are called “pool shares”. So, the pool members with more powerful machines will be sending in more “pool shares” than the members with modest machines. Irrespective of who finds the “magic number”, the reward will be distributed proportional to the shares they send in.
Here is an interesting situation:
Say, two people, Joe and Mary joined a mining pool at the same time. Joe has a regular desktop computer while Mary has a powerful ASIC. They both receive a new block from the pool manager. Mary, using her ASIC sends in 1000 pool shares and Joe could manage only 2 during the same time period. But, lucky for Joe, one of his two shares turned out to be the “magic number” that solved the block. Since all the reward money goes to the pool manager, he will distribute a big reward to Mary and a tiny one to Joe, even though Joe was the one who found the real “magic number”!
Currently, over 81% of the mining pools are in China. And their website and support are in Mandarin.
However, Slush Pool (with website/support in English) was the first Bitcoin mining pool and remains one of the most reliable and trusted pools, especially for beginners.
This pie chart displays the global share of the biggest mining pools operational today:
Type 3: Cloud mining
There is yet another way of mining that is popular. It’s called “cloud mining”.
This involves a host company that owns both the hardware and the mining pool. You just rent machine and infrastructure from them. Your payout will be based on the power of the machines you rent to calculate SHA256.
This is the most hassle-free process of Bitcoin mining, from a user perspective.
Your profits are going to be lower since the operators must cover their costs after all.
A word of caution - the risk of fraud and mismanagement is all too common in the cloud mining space.
Conclusion
Bitcoin mining is still a profitable business! Buying your own equipment and joining a mining pool seems like the best option currently available. The profitability from a small-scale operation seems quite modest. But there is nothing that is preventing you from scaling your business, choosing a geographic location that provides low cost cooling and utilities, and maximizing your profits.
This article was written by Shelly Henry, Microsoft
Special thanks to the editor, Adv. T.H Lawrence
For a better understanding of Bitcoin basics, please check out my previous articles:
?
Data Architect at Philips Wellcentive
5 年man, I still don't get a thing about Bitcoin :)?