In brief

  • Bitcoin mining is the process of adding and verifying blocks of transactions to Bitcoin’s public blockchain.
  • Bitcoin uses the “proof of work” consensus mechanism, which demands commitment from miners in the form of expensive mining hardware and electricity.
  • Miners compete to solve a complex cryptographic puzzle, and are rewarded with newly-minted Bitcoin.

Bitcoin mining is the process by which blocks of transactions are added to the public blockchain and verified. It’s also the process by which new Bitcoin is created—a mechanism that both secures the integrity of the blockchain and incentivizes participation in the network.

Miners compete to add new blocks to the blockchain. Mining Bitcoin demands a substantial commitment on the part of miners; it’s a costly, time-consuming task, and one that’s necessary for the cryptocurrency to work and for people to have faith in its legitimacy.

Over a decade since Bitcoin was created by Satoshi Nakamoto, most people have heard of mining. But what does it really mean—and how do you go about mining Bitcoin?

What is Bitcoin mining?

Mining Bitcoin isn’t like digging for gold or coal deep underground. It refers to verifying the transactions made using Bitcoin. Miners are those individuals or companies that sustain and audit the blockchain network that supports the cryptocurrency.

They do so by completing "blocks" of verified transactions, which are added to the blockchain; when a miner completes a block, they are rewarded with Bitcoin.

Did you know?

Approximately every four years, the reward for mining Bitcoin is halved, an event known (unsurprisingly) as the “halving”. In May 2020, the block reward dropped from 12.5 BTC per block to 6.25 BTC.

Mining for Bitcoin isn’t as cheap as it once was, but this still doesn’t prevent investors from carrying out this activity. The block reward of Bitcoin is the incentive that powers cryptocurrency transactions through legitimizing and monitoring the network. Because this responsibility is carried out by many users throughout the world, Bitcoin is a decentralized cryptocurrency, meaning that it relies on no central authority such as a government or bank for its trustworthiness.

Why does Bitcoin need miners?

Mining is, in effect, a process of auditing and verifying Bitcoin transactions to prevent the problem of “double spending”. Double spending is where someone with cryptocurrency tries to spend the same coin twice. With physical currency, you can’t buy a drink in a pub with a £20 note and then pop to the shops to buy some groceries with the same £20 note.

With cryptocurrency, there is a risk that someone with Bitcoin could make a copy of that Bitcoin and send that to a merchant instead of the real thing. In the real world, the cashier looks at a £20 note to ensure it is not fake—and this is what Bitcoin miners are trying to do with cryptocurrency; they are checking to ensure that a transaction has not been made twice.

What is the process of Bitcoin mining and what can you do with it?

Bitcoin uses a consensus mechanism called proof of work.

The process of mining Bitcoin works as follows:

  • 🖥️ A miner’s computer, called a node, collects and packages individual Bitcoin transactions from the last ten minutes into a block.
  • 🖧 This node competes with other nodes in the network to solve a complicated cryptographic problem to be the first to validate the new block for the blockchain.
  • 📡 The first miner to solve the problem broadcasts their success to the entire network.
  • 🧮 Other nodes then check if their solution is correct. If correct, the new block is added to the blockchain and the whole process starts again.
  • 💰 As the miner was first to solve the problem, it gets rewarded with Bitcoin.

Bitcoin mining hardware runs a cryptographic hashing function on a block header.

What that means is that each miner creates a “candidate block” with unconfirmed transactions from the node’s memory pool, or mempool. This block includes a block header that summarizes the data inside the block, along with a reference to an existing block in the blockchain and a nonce (“number only used once”). In Bitcoin, the nonce is a whole number somewhere between 0 and 4,294,967,296.

This block header is then put through the SHA256 hash function; if the resulting number is higher than the current target hash, the miner adjusts the nonce and tries again. Miners do this many thousands of times per second. The difficulty target is a 256-bit number; it is adjusted every 2016 blocks (roughly every two weeks), to ensure that a block is mined on average once every 10 minutes.

When a lucky miner’s hash function spits out a result that’s lower than the current target hash, the block is broadcast to the network. Each node checks that the block header hashes to meet the target, and if confirmed the newly mined block is added to the blockchain. The miner receives a reward of Bitcoin; this transaction, which creates new Bitcoin out of thin air, is known as the “coinbase transaction” and is included in the candidate block.

These rewards serve to incentivize participation and keep things running smoothly.

The rate at which coins are issued is set by the mining code, ensuring that the time it takes for a miner to win a block is always approximately 10 minutes. This is to protect the system and prevent miners from creating their own Bitcoin.

Every time Bitcoin is mined, the cryptographic problem becomes harder to solve, meaning that miners will require a higher hash rate to succeed in earning block rewards. This means that more computing power is needed to earn the same amount of cryptocurrency.

The first Bitcoin miners used their computers’ CPUs to complete the cryptographic problems. Soon, miners discovered that graphics processing units (GPUs) were more effective than CPUs, sparking an arms race in mining hardware. Now, miners use dedicated hardware known as ASIC (application-specific integrated circuit) miners.

Solving cryptographic problems is necessary to protect the Bitcoin network from attacks. To reverse transactions in the blockchain would require 51% of the whole network’s computing power. This ensures that any attack is difficult and pointless as an attacker would have to own more mining hardware than anyone else.

The future of Bitcoin (and other cryptocurrency) mining

As Bitcoin mining has matured, the barrier to entry for individual miners has been raised. Now, most mining is carried out by “pools” of miners who combine their resources and attempt to use their cumulative computing power to earn Bitcoin rewards.

In 2020, the majority of mining pools are based in China, although the country’s dominance of the industry has slipped somewhat over the course of the year. Miners are heavily influenced by electricity prices, since proof-of-work mining uses large quantities of electricity; many miners relocate their operations to make the most of cheap electricity.

Did you know?

The supply of Bitcoin is capped at 21 million. When all 21 million BTC are mined, in around 2140, miners will be rewarded with transaction fees.

Bitcoin mining has come in for criticism over its high energy consumption, which in 2020 was around 8.4 GW or 65.74 terawatt-hours—more than the output of seven nuclear power plants. Some advocates of the cryptocurrency argue that it functions as an “energy currency” that incentivizes the use of surplus energy. Indeed, several power plants in the USA and Iran are now using surplus natural gas to operate large-scale Bitcoin mining operations.

Nevertheless, renewable energy only makes up 39% of the total energy consumption of the world’s cryptocurrency miners; Bitcoin miners generate a carbon footprint equivalent to that of Denmark.

Stung by this criticism, some cryptocurrencies are switching from a proof of work consensus mechanism to a system known as proof of stake (PoS).

Instead of miners, proof of stake cryptocurrencies have validators. These validators stake their cryptocurrency on betting which blocks will be added next to a chain. If successful, the validators get a block reward in proportion to what they have staked. Ethereum, the second-biggest cryptocurrency by market capitalization after Bitcoin, is switching to a proof of stake model with its Ethereum 2.0 upgrade.

Bitcoin, however, is sticking with the tried-and-true proof of work consensus model espoused by Satoshi Nakamoto in the original Bitcoin whitepaper, over a decade ago.