What is Bitcoin Mining and How Does it Work?
By: Ofir Beigel | Last updated: 11/21/22
If you’ve heard about Bitcoin then you’ve probably heard about Bitcoin mining as well – the concept of “creating” Bitcoins from your computer. The following post will give you a complete overview of what Bitcoin mining is and how it actually works.
Don’t like to read? Watch our video guide instead
What is Bitcoin Mining Summary
Bitcoin mining is the process of updating the ledger of Bitcoin transactions known as the blockchain. Mining is done by running extremely powerful computers called ASICs that race against other miners in an attempt to guess a specific number.
The first miner to guess the number gets to update the ledger of transactions and also receives a reward of newly minted Bitcoins (currently the reward is 6.25 Bitcoins).
Today, in order to be profitable with Bitcoin mining you need to invest heavily in equipment, cooling, and storage. It’s not possible to mine Bitcoin profitably with a PC or a GPU at home. You can calculate your profitability using a Bitcoin mining calculator.
Here’s what you’ll need to do to get started with Bitcoin mining:
- Calculate mining profitability
- Get a Bitcoin miner
- Get a Bitcoin wallet
- Find a mining pool
- Download a mining program
- Start Mining!
That’s Bitcoin mining in a nutshell. If you want a more detailed explanation about mining keep reading this post. Here’s what I’ll cover:
- What is Bitcoin Mining?
- Mining Difficulty
- The Evolution of Bitcoin Miners
- Bitcoin Mining Pools
- Is Bitcoin Mining Profitable?
- Step-by-Step Guide for Mining at Home
- Additional Types of Mining
- Frequently Asked Questions
- Conclusion – Is Bitcoin Mining Worth It?
Bitcoin is a decentralized alternative to the banking system. This means that the system can operate and transfer funds from one account to the other without any central authority.
With a trusted central authority, transferring money is easy. Just tell the bank you want to remove $50 from your account and add it to someone else’s account. In this example, the bank has all the power because the bank is the only one that is allowed to update the ledger that holds the balances of everyone in the system.
Bitcoin, on the other hand, creates a system that has a decentralized ledger. It gives independent miners the ability to update the ledger without giving them too much power.
How Mining Works
Anyone who wants to participate in updating the ledger of Bitcoin transactions, known as the blockchain, can do so. All you need is to guess a random number that solves an equation generated by the system.
Sounds simple, right?
Of course, this guessing is all done by your computer. The more powerful your computer is, the more guesses you can make in a second, increasing your chances of winning this game. If you manage to guess right, you earn bitcoins and get to write the “next page” of Bitcoin transactions on the blockchain.
The solution to the equation is very hard to achieve but very easy to validate. You can think of a Rubik’s cube as a good example for this (very hard to solve, but easy to see you’ve solved it).
Rubik’s cube – hard to solve, easy to prove you’ve solved it
The Mining Process in a Nutshell
Once your mining computer comes up with the right guess, your computer determines which pending transactions will be inserted in the next block of transactions on the blockchain.
Compiling this block represents your moment of glory, as you’ve now become a temporary banker of Bitcoin who gets to update the Bitcoin transaction ledger.
The block of transactions you’ve created, along with your solution, is sent to the whole network so other computers can validate it.
Each computer that validates your solution updates its copy of the Bitcoin transaction ledger with the transactions that you chose to include in the block.
The system generates a fixed amount of Bitcoins (currently 6.25 ) and rewards them to you as compensation for the time and energy you spent solving the math problem.
Additionally, you get paid any transaction fees that were attached to the transactions you inserted into the next block.
All the transactions in the block you’ve just entered are now confirmed by the Bitcoin network and are virtually irreversible.
Here’s a two-minute video showing the process of blocks and confirmations.
So that’s Bitcoin mining in a nutshell.
It’s called mining because of the fact that this process helps “mine” new Bitcoins from the system. But if you think about it, the mining part is just a by-product of the transaction confirmation process. So the name is a bit misleading, since the main goal of mining is to maintain the ledger in a decentralized manner.
Since mining is based on a form of guessing, each time a different miner will guess the number and be granted the right to update the blockchain. Of course, the miners with more computing power will succeed more often, but due to the law of statistical probability, it’s highly unlikely that the same miner will succeed every time.
Now that you know what Bitcoin mining is, you might be thinking, “Cool! Free money! Where do I sign up?” Well, not so fast…
Satoshi Nakamoto, Bitcoin’s inventor, crafted the rules for mining in a way that the more mining power the network has, the harder it is to guess the answer to the mining math problem. So the difficulty of the mining process is actually self-adjusting to the accumulated mining power the network possesses.
If more miners join, it will get harder to solve the problem; if many of them drop off, it will get easier. This is known as mining difficulty.
Mining difficulty adjusts every 2016 blocks
Difficulty is self-adjusting in order to create a steady flow of new Bitcoins into the system. In a sense, this was done to keep inflation in check. Mining difficulty is set so that, on average, a new block will be added every ten minutes (i.e., the number will be guessed every ten minutes on average).
Now, remember, this is on average. We can have two blocks being added minute after minute and then wait an hour for the next block. In the long run, this will even out to ten minutes on average.
The difficulty adjustment is done every 2016 blocks (every 2 weeks on average) retroactively. Meaning, every 2016 blocks the system looks back on the past 2016 blocks and calculates the average block time. If it’s under 10 minutes it will increase the difficulty, if it’s over 10 minutes it will lower it.
When Bitcoin first started out, there weren’t a lot of miners out there. In fact, Satoshi, the inventor of Bitcoin, and his friend Hal Finney were a couple of the only people mining Bitcoin back at the time with their own personal computers.
Using your CPU (central processing unit—your computer’s brain) was enough for mining Bitcoin back in 2009, since mining difficulty was very low. As Bitcoin started to catch on, people looked for more powerful mining solutions.
A GPU (graphics processing unit) is a special component added to computers to carry out more complex calculations. GPUs were originally intended to allow gamers to run computer games with intense graphics requirements.
Because of their architecture, GPUs became popular in the field of cryptography, and around 2011, people also started using them to mine Bitcoins. For reference, the mining power of one GPU equals that of around 30 CPUs.
GPUs were used for mining Bitcoin in the past
FPGA is a piece of hardware that can be connected to a computer in order to run a set of calculations. They are just like GPUs but 3–100 times faster. The downside is that they’re harder to configure, which is why they weren’t as commonly used in mining as GPUs.
FPGAs are more efficient than GPUs for mining purposes
Around 2013, a new breed of miner was introduced: the ASIC miner. ASIC stands for Application Specific Integrated Circuit.
ASICs are pieces of hardware manufactured solely for the purpose of mining Bitcoin. Unlike GPUs, CPUs, and FPGAs, they couldn’t be used to do anything else. Their function was hardcoded into the machine.
Today, ASIC miners are the current mining standard. Some early ASIC miners even appeared in the form of a USB, but they became obsolete rather quickly. Even though they started out in 2013, the technology quickly evolved, and new, more powerful miners were coming out every six months.
An ASIC USB mining rig with a fan on top
After about three years of this crazy technological race, we finally reached a technological barrier, and things started to cool down a bit. Since 2016, the pace at which new miners are released has slowed considerably.
A Bitcoin ASIC miner used for mining Bitcoin
Mining is an extremely competitive game. Even if you buy the best possible miner out there, you’re still at a huge disadvantage compared to professional Bitcoin mining farms. That’s why mining pools came into existence.
The idea is simple – miners group together to form a “pool” so they can combine their mining power and compete more effectively. Once the pool manages to win the competition, the reward is spread out between the pool members depending on how much mining power each of them contributed.
This way, even small miners can join the mining game and have a chance of earning Bitcoin (though they get only a part of the reward).
The market share of the most popular Bitcoin mining pools in 2020
Today there are over a dozen large pools that compete for the chance to mine Bitcoin and update the ledger. According to certain reports, 65% of all Bitcoin mining worldwide is done in China due to cheap electricity, manufacturing costs and weather conditions.
The short answer is “probably not”; the correct answer is “it depends on a lot of factors.”
When calculating Bitcoin mining profitability, there are a lot of things you need to take into account. Let’s break them down.
Hashrate (how powerful is your miner)
A Hash is the mathematical problem the miner’s computer needs to solve. The hashrate refers to your miner’s performance (i.e., how many guesses your computer can make per second).
Hashrate can be measured in MH/s (mega hash = 1m hashes per second), GH/s (giga hash = 1b per hashes second), TH/s (terra hash = 1t hashes per second), and even PH/s (peta hash = 1000t hashes per second).
The number of Bitcoins generated when a miner finds a solution (in other words “solves a block”). This number started at 50 bitcoins back in 2009, and it’s halved every 210,000 blocks (about four years). The current number of Bitcoins awarded per block is 6.25.
The last block-halving occurred in May 2020, and the next one will be on 2024. Once the halving occurs the reward will decrease to 3.125 Bitcoin.
A number that represents how hard it is to mine bitcoins at any given moment considering the amount of mining power currently active in the system.
Also known as “how many dollars are you paying per kilowatt to get electricity?”
You’ll need to find out your electricity rate in order to calculate profitability. This can usually be found on your monthly electricity bill. The reason this is important is that miners consume electricity, whether for powering up the miner or for cooling it down (these machines can get really hot and noisy).
Each miner consumes a different amount of energy. You’ll need to find out the exact power consumption of your miner before calculating profitability. This can be found easily with a quick search online. Power consumption is measured in watts.
If you’re mining through a mining pool, then the pool will take a certain percentage of your earnings for rendering their service. Generally, this would be somewhere around 2%.
Since no one knows what Bitcoin’s price will be in the future, it’s hard to predict whether Bitcoin mining will be profitable. If you are planning to convert your mined bitcoins to any other currency in the future, this variable will have a significant impact on profitability.
Difficulty increase per year
This is probably the most important and elusive variable of them all. The idea is that since no one can actually predict the rate of miners joining the network, neither can anyone predict how difficult it will be to mine in six weeks, six months, or six years from now.
In fact, in all the time Bitcoin has existed, its profitability has dropped only a handful of times—even at times when the price was relatively low.
The last two factors (price and difficulty increase) are the reason no one will ever be able to give a 100% accurate answer to the question “is Bitcoin mining profitable?”
Once you have all of these variables at hand you can insert them into a Bitcoin mining calculator (as can be seen below) and get an estimate of how many Bitcoins you will earn each month. If you can’t get a positive result on the calculator, it probably means you don’t have the right conditions for mining to be profitable.
|BTC/USD Exchange Rate|
|Pool Fees %|
|Hardware Cost (USD)|
|Power Cost (USD/kWh)|
|Duration||Calculation||Estimated Profit in USD|
Pure Earnings in BTC:
Pool Fee in BTC:
Earnings After Fee in BTC:
Earnings in USD:
Power Cost in USD:
Earnings After Power Cost in USD:
Earnings After Hardware Cost in USD:
Step 1 – Calculate profitability
Before even starting out with Bitcoin mining, you need to do some research. The best way to do this, as we’ve discussed, is through the use of a Bitcoin mining calculator.
Bear in mind that mining costs money! If you don’t have a few thousand dollars to spare on the right miner, and if you don’t have access to cheap electricity, mining Bitcoin might not be for you.
Step 2 – Get a miner
Once you’re done with your calculations, it’s time to get your miner! Make sure to go over our Bitcoin mining hardware reviews to understand which miner is best for you, if you haven’t done it already in step 1. Here’s a list of the most popular miners around today:
You can purchase mining hardware directly from the manufacturers or buy them on second-hand markets such as eBay or Amazon.
Step 3 – Get a Bitcoin wallet
You’ll need a Bitcoin wallet for your newly mined Bitcoin. Once you have a wallet, make sure to get your wallet address, it will be a long sequence of letters and numbers.
Each wallet has a different way of getting to the Bitcoin address, but most wallets are pretty straightforward about it. Notice that you’ll need your Bitcoin address and NOT your private key (which is like the secret password for your wallet).
Step 4 – Find a mining pool
When you join a mining pool, you’ll be given only part of the math problem to solve. The combined work of all of the miners in the pool will make the pool more likely to solve the original problem and earn the bitcoin reward and transaction fees. The profits will be spread out throughout the pool based on contribution.
Basically, you’ll make a more consistent amount of Bitcoins and will be more likely to receive a return on your investment.
When choosing which mining pool to join, make sure to ask the following questions:
- What is the reward method? (Proportional/Pay Per Share/Score Based/PPLNS—more on that here)
- What fee does the pool charge for mining and the withdrawal of funds?
- How frequently does the pool find a block (i.e., how frequently do I get rewarded)?
- How easy is it to withdraw funds?
- What kind of stats does the pool provide?
- How stable is the pool?
Once you are signed up with a pool, you’ll get a username and password for that specific pool, which you will use later on.
Step 5 – Get a mining program (also knowns as a client)
Controlling and monitoring your mining hardware requires dedicated software. Depending on what mining rig you have, you’ll need to find the right software.
Many mining pools have their own software, but some don’t. In case you’re not sure which mining software you need, you can find a list of Bitcoin mining software here. Also, if you want to compare different mining software, you can do it here.
Step 6 – Start mining!
Connect your miner to a power outlet and fire it up. Make sure to connect it to your computer as well (usually via USB), and open up your mining software. The first thing you’ll need to do is to enter your mining pool’s address, username, and password.
Once this is configured, you will start collections shares, which represent your part of the work in finding the next block. According to the pool you’ve chosen, you’ll be paid for your share of coins—just make sure that you enter your address in the required fields when signing up to the pool.
Here’s a full video of me mining in action:
Cloud mining means that you do not buy a physical mining rig but rather rent computing power from a mining company and get paid according to how much mining power you own.
At first, this sounds like a really good idea, since you don’t have to go through all of the hassle of buying expensive equipment, storing it, cooling it, and monitoring it.
However, when you do the math it seems that none of these cloud mining sites are profitable. Those that do seem profitable are usually scams that don’t even own any mining equipment; they’re just elaborate Ponzi schemes that will end up running away with your money.
As a general rule of thumb, I’d suggest avoiding cloud mining altogether. If you still want to pursue this path, make sure to make the right calculations before handing over any funds.
Mining on a Mobile Phone
Some mobile apps claim to mine Bitcoin on your phone. While in theory, this is possible, due to the low processing power phones have compared to ASIC miners, you’ll probably end up draining your phone’s battery much faster and make a very small fraction of Bitcoin in return.
The apps that allow this act as mining pools for mobile phones and distribute earnings according to how much work was done by each phone.
Remember, mining is possible with any old computer—it’s just not worth the electricity wasted on it because the slower the computer, the smaller the chances are of actually getting some kind of reward.
For reference, mining was demonstrated in theory on a 55-year-old computer some time ago by IBM—and the result was of course, that it’s not worth it.
Somewhere around 2017, the concept of web mining or ‘cryptojacking’ was introduced. Simply put, web mining allows website owners to “hijack” visitors’ CPU power and use them to mine Bitcoin.
This means that a website owner can make use of thousands of “innocent” CPUs in order to gain profits. However, since mining Bitcoins isn’t really profitable with a CPU, most of the sites that utilize web mining mine Monero instead. Up until today, over 20,000 sites have been known to utilize web mining.
The concept of web mining is very controversial. From the site’s visitor perspective, someone is using their computer without consent to mine Bitcoins. In extreme cases, this can even harm the CPU due to overheating.
From the site owner’s perspective, web mining has become a new way to monetize websites without the need for the placement of annoying ads. Also, the site owner can control how much of the visitor’s CPU he wants to control in order to make sure he’s not abusing his hardware.
For more information about web mining, you can read this post.
How Much Does it Cost to Mine 1 Bitcoin?
Using the Antminer S17 Pro it costs around $7,474 to mine 1 Bitcoin around April 2020. Here’s a breakdown of the calculations:
The Antminer S17 Pro costs around $1900 and generates a hashrate of 56 TH/s. The power consumption of this model is 2212 Watts. I used a standard 2% mining pool fee and $0.1/KwH for electricity cost.
Entering all of these numbers into a Bitcoin mining calculator I receive an answer that it will take me 3 years until I manage to mine 1 Bitcoin. In those 3 years I would have spent the following:
Hardware cost – $1,900
Electricity cost – $5,574
Total cost – $7,474
This does not include the cost for shipping, storing or cooling the miner.
How Many Bitcoins Can you Mine in a Day?
Using the data from the previous question I can calculate that in one day I will be able to mine 0.0008 Bitcoins.
What Will Happen When All Bitcoins Are Mined?
Some people are concerned about what will happen when all of 21 million Bitcoins are mined and no more mining reward will be available to incentivize mining. This is set to happen somewhere around 2140 and the answer to this question lies in Bitcoin mining fees.
Miners get paid in newly minted Bitcoins but also with mining fees that are attached to transactions. Once all Bitcoins are mined, it is presumed that mining fees will continue to incentivize the action of Bitcoin mining. As Bitcoin becomes more popular and the mining reward decreases, Bitcoin mining fees will become more lucrative.
Is it Legal to Mine Bitcoin?
While it depends on the laws of the country you’re in, by large Bitcoin mining is a perfectly legal activity. Even in a few countries that do regulate the use of Bitcoin, such as Iceland, mining Bitcoin is still legal.
Many countries, including most African countries, have not passed any legislation for or against Bitcoin, and have generally remained silent on the issue. It’s important to keep a close eye on the friendliness of countries towards mining, because the regulatory environment could change at the drop of a hat.
Isn’t mining a waste of electricity?
There’s been a lot of criticism regarding the energy consumption that Bitcoin mining employs worldwide. I believe this video from Andreas Antonopoulos give a different view of how Bitcoin mining is actually optimizing energy consumption around the world:
Can’t Google start mining Bitcoin and blow out the competition?
Yes it can—but it won’t do it much good. The reason is that Google’s servers aren’t fit for solving the Bitcoin mining problem in the same way that ASICs are.
For reference, if Google harnesses all of its servers for the sole purpose of mining Bitcoin (and abandons all other business operations), it will account for a very small percent (less than 0.001%) of the total mining power the Bitcoin network currently has.
Isn’t Bitcoin mining centralized by the hands of a few Chinese companies?
At the moment, the answer is “yes.” But due to the fact we’ve reached a technological barrier in miner development (which originally led to the centralization of mining), it’s now possible for new companies outside of China to take more of the market share.
Here’s another great explanation by Andreas on this matter:
Now that you’ve finished this extensive read, you should be able to answer this question yourself.
Keep in mind that sometimes there might be better alternatives to Bitcoin mining in order to produce a higher return on your investment.
For example, depending on Bitcoin’s price, it might be more profitable to just buy Bitcoins instead of mining them. Another option would be to mine cryptocurrencies that can still be mined with GPUs, such as Ethereum, Monero, or Zcash.
If you still have any questions, feel free to leave them in the comment section below. Happy mining!