Bitcoin mining

How Does Bitcoin Mining Work?

10 min read
Disclaimer

This article is for general information purposes only and isn’t intended to be financial product advice. You should always obtain your own independent advice before making any financial decisions. The Chainsaw and its contributors aren’t liable for any decisions based on this content.

Share

Follow

How does Bitcoin mining work? It’s one of the many questions beginners ask themselves when they first enter the Bitcoin space. 

For newbies, it can sound rather confusing as the term ‘mining’ is not something you typically think of in the digital realm. We mine for gold and other resources, but Bitcoin mining? 

For better or worse, Bitcoin mining is the term that is used and in this explainer, we provide an overview of what it is, how it works, why the Bitcoin network needs miners and everything in between.  

What is Bitcoin mining?

In basic terms, one can think of Bitcoin mining as the process that actually constructs the blockchain ledger, whereby new blocks are joined to the previous ones.

At its core, Bitcoin mining is the process used to generate new Bitcoins and verify new transactions through the decentralised ledger that forms the Bitcoin network. And it is Bitcoin mining and the verification of transactions that keeps the network secure. But who would choose to do that? Well, miners of course, but why? In a word: incentives.

In exchange for their efforts, Bitcoin miners are rewarded with newly-minted Bitcoins and transaction fees. 

How does Bitcoin mining work?

Bitcoin mining is the process of an international network of computers run Bitcoin code to confirm the legitimacy of transactions and add them to the ‘chains’ of the blockchain ledger. This is done through the use of specialised computers known as Application-Specific Integrated Circuits (ASICs) which confirm the transactions on Bitcoin’s blockchain.

These transactions are processed by Bitcoin miners through what is called a SHA-256 hashing algorithm, which is a military-grade cryptographic function invented by the US National Security Agency (NSA). SHA-256 lies at the core of Bitcoin mining.

At any given point, miners all over the world are running hundreds of thousands of ASICs generating hundreds of trillions of hashes (think guesses) to solve what can be conceived of as a complex mathematical problem. 

If you’re talking about how Bitcoin mining works, technically speaking, a ‘complex mathematical problem’ isn’t correct as it’s not as much about solving a mathematical problem as much as it is about using mathematical function to produce an output. Huh?

To keep things simple, let’s stick with the idea of “solving a mathematical problem” as the origins of that phrase are easy enough to understand. To compute a hash simply means plugging any random input into a mathematical function and producing an output. If the output is valid, a block is “found”.

Continuing with our explanation, Bitcoins transactions get confirmed as a Bitcoin miner is able to generate a valid hash that results in a new block being “found”.

When a miner finds a new block that is accepted by the entire Bitcoin network, it is rewarded with newly-created Bitcoin, and transactions waiting to be confirmed are placed into this new block and added to the blockchain. 

Below is a useful diagram that illustrates the process. 

Credit: @BitcoinWalkOrg

How Does Bitcoin Mining Work? More to Know

As outlined above, Bitcoin mining not only secures the network but results in the creation of new Bitcoin. 

When Bitcoin’s creator Satoshi Nakamoto first designed the protocol, it was programmed in a way to become more complex over time, and so for every 210,000 blocks the mining block reward would be halved. This works out to be roughly every four years. The is the so-called “halving event” and is scheduled next mid-2024, as the last was in 2020. 

Initially, miners were rewarded 50 Bitcoin for each successful block added to the blockchain. As this halved over the years to 25, 12.5 and now 6.25, it is scheduled to be reduced to 3.125 next year. This is the predictable monetary policy of Bitcoin in action that coupled with its fixed supply of 21 million, is what makes many believe it poses a credible alternative to gold or even fiat currencies. 

Credit: BitcoinWalkOrg

Based on Bitcoin’s monetary policy, the last Bitcoin is scheduled to be mined around 2140. As illustrated in the diagram below, it’s rate of issuance declines significantly every four years and by 2033, over 99% of total Bitcoin will ever be mined. 

bitcoin miner
Bitcoin supply issuance schedule. Credit: Nakamoto Institute 

Why Bitcoin needs miners

At a high-level, the miners are expending a lot of real-world resources (namely energy and time) to mine Bitcoin. In exchange, they compete with other miners for the chance to win a Bitcoin block reward.  

However now that we now know what Bitcoin mining is about, the question then becomes why the Bitcoin network needs the miners? Fundamentally, there are three main reasons why the network requires miners. 

Confirm transactions

As outlined above, the Bitcoin miners are responsible for solving the complex mathematical problem, and to do so, they expend energy.  

On a practical level, when Bitcoin is sent from one address to another, a transaction is created that is broadcast to the network and waits to be confirmed as it sits in what’s known as a ‘mempool’. Once a new block is found, as many transactions as possible are fit into the block and then it becomes accepted by all the nodes that verify it. In the process, the transactions become confirmed.

Secure the network

The second thing Bitcoin miners do is secure the network. That’s a vital part of the question when asking: “how does Bitcoin work?”

The energy that miners use to solve the complex mathematical problem (i.e. hashing) generates a metric used to determine how secure the network is – hashpower. The greater the hashpower, the more secure the network. But what does that actually mean? A secure network is less vulnerable to being exploited. 

Another way of saying that is that if someone secured 51% of the Bitcoin network’s hashpower, they could spend the same Bitcoin twice, which goes against the fundamental tenets of the protocol. 

Bitcoin solved the ‘double spend problem’ that plagued prior versions of digital cash and hashpower is what keeps it secure. In order to double spend a transaction, an attacker would need to obtain a majority of the hashpower of the network (51%), and proceed to roll back all blocks that were confirmed after the transaction which is trying to be double spent—a virtually impossible task.

Bitcoin expert Andreas Antonopoulos explains why even no government can attack Bitcoin.

 Mints new coins

The last and most important element of Bitcoin mining is that the process generates new Bitcoins, currently 6.25 per block, as a reward. Miners then sell those Bitcoins into the open market or hold them on their balance sheet. 

The miners play a critical role in the overall Bitcoin value proposition, which is its fixed monetary policy. We know exactly how many Bitcoin will be mined and how much will be mined, approximately every ten minutes. 

When Bitcoin mining becomes competitive, the ‘difficulty adjustment’ increases making it harder for miners to “find” the next block. 

And the opposite is true, such as when China banned Bitcoin mining and 50% of the network’s hashpower went offline, mining difficulty dropped.  Interestingly, Bitcoin mining continues to this day in China. 

Why mine Bitcoin?

The question of “how does Bitcoin mining work?” ought to be a little clearer by now, however why do it?

Bitcoin mining has evolved from something you could do on your laptop to numerous NASDAQ-listed companies with hundreds and thousands of ASICs.

It’s a competitive industry and for those who were earning 50 Bitcoin for each block mined, if they held, they’d be among some of the richest people on earth. Most didn’t, as few believed it would reach parity with the US dollar, let alone US$69,000. 

Needless to say, mining is hyper-competitive and is impacted by three variables

  • Finance — do I take on debt or do I dilute my equity with investors to pay for my machines and my expenses?
  • Power — where do I get my power from and how do I structure my agreement to pay for that power?
  • Cashflow — what do I do with the coins I generate?  Hold onto them or sell as I go?  Do I let others use my infrastructure and charge for hosting?

In the absence of ultra-low cost energy, we saw that in 2022 the average cost of producing a Bitcoin exceeded its market value. Of course this is can all change fast if the price shoots up. 

So while you can mine Bitcoin and make money, it’s not easy. At best, the main advantage for home miners is that they can receive KYC-free coins. Beyond that, the economics don’t really stack up in the vast majority of cases. If you’re goal is wealth, then buying Bitcoin is usually a better option. 

How much do Bitcoin miners make?

This depends entirely on how good an operator a particular miner is and whether it is able to employ the right strategies to optimise profits during both bear and bull markets. 

In 2022, we saw a lot of miners go down and end up needing rescue. Some miners are highly profitable, others are insolvent and may as well close up shop. 

The main variable that it comes down to is the cost of energy. The cheaper the energy and the less debt, the greater the prospects of success. 

How to mine Bitcoin

Mining hardware

The first thing you need to do is set up your Bitcoin mining hardware. This used to be a laptop, but over the past 13 years, the hardware requirements have ramped-up. 

You’ll need to get hold of an ASIC of which there are a number of options which you can order online. Like ordinary hardware, the higher the specs the more you can expect to pay. But also, the more hashpower you can expect to generate (i.e. more Bitcoin). 

Create Bitcoin wallet

Once your mining hardware is in place, you need to set up a Bitcoin wallet where any Bitcoin earned as a reward will be paid. 

Download a copy of the blockchain

You can start Bitcoin mining as soon as you download a local copy of the blockchain.

The mining process

Once you’ve followed the steps above, you are ready to get started. We’d strongly advise making sure that you get your set up right from the outset, as mistakes made early on can prove costly (such as consuming electricity without ensuring proper connectivity). 

It’s relatively simple, however it is probably best to work through a video such as one below which goes through everything step-by-step. 

Let’s assume you’re properly set up. Hit start and you’re off the races. Bitcoin mining can run 24/7 or be switched on/off at any point. There’s also plenty of software solutions out there that enable you to remotely monitor your rig to ensure that it remains optimally profitable at all times. 

What are mining pools?

If you are asking how to mine Bitcoin, you’ll first need to understand mining pools.

A mining pool is a joint group of Bitcoin miners who combine their computational resources (hashpower) to improve the probability of finding a block and receiving a block reward. 

It’s almost like pooling funds to buy lottery tickets. If you combine your cash with a bunch of other people’s, theoretically your chances of winning the lottery are improved.  

The reason this is done is pretty obvious – Bitcoin mining is a competitive industry and the chances of a solo miner finding a block is quite remote (0.000065% chance or a block every 29 years).

The disadvantages of Bitcoin mining 

There are various disadvantages, depending on why you’re mining. 

If you’re in it to make money, it’s a competitive industry and your hardware becomes outdated soon after you buy it. You’re also in constant search for cheap energy and of late, energy costs have been soaring around the world

It’s expensive, capital intensive and requires a degree of technical expertise – these can all be viewed as disadvantages for most people. 

Why does Bitcoin mining use so much electricity?

The next issue when discussing how to mine Bitcoin relates to energy.

Bitcoin uses a consensus mechanism (how the nodes in the network agree on the state of transactions) through Proof-of-Work (PoW). The ‘hashing’ process referred to earlier done by the ASICs consumes energy – a lot of it.

The more secure the network, the more hashpower it has and the more energy is needed to “find” the next block. In fact at present, Bitcoin’s hashrate is the highest its ever been despite it’s price languishing in the US$16,000 to US$24,000 range for the past six months. 

bitcoin mining
Bitcoin hashpower and price. Credit: Blockchain.com

But why energy?

Because miners provide an unforgeable real world physical cost to producing new bitcoins – a crucial factor which is why it is but one of the reasons it is considered valuable.  

Central bankers and most other cryptocurrencies are able to manifest new units of currency without any cost. Their cost to create new dollars, pounds or a token like Sam Bankman Fried’s FTT is essentially zero.

By contrast, the remaining unissued fixed supply of Bitcoins are released every 10 minutes or so via a competitive “Proof of Work” process done by miners – which establishes a gradually increasing cost to produce new units of the currency.

So how does Bitcoin mining work? Through an energy-intensive PoW algorithim that fundamentally ties the value of newly-minted Bitcoins with real-world resources.

Bitcoin mining is legal in most countries and even where it is not, it’s difficult to police and eliminate (as we’ve seen in China). 

Either way, there are some countries that specifically outlaw Bitcoin mining including Algeria, Bangladesh, China, Egypt, Iraq, Morocco, Nepal, Qatar, Russia and Tunisia. 

Sweden and a few other countries have been calling for a ban due to Bitcoin’s energy consumption, which they consider excessive and/or wasteful. 

That concludes The Chainsaw guide that seeks to address the question that many people ask themselves: how does Bitcoin mining work?