What is Bitcoin Mining?

Written by Sean GraytokUpdated: 19th Sep 2021
Share this article

Disclaimer: This post contains references to products from one or more of our advertisers. We may receive compensation (at no cost to you) when you click on links to those products. Read our Disclaimer Policy for more information.

Bitcoin mining is analogous to mining for gold — it’s just the digital version. Oh, and there’s some cryptography. But what exactly does that mean?

What is Bitcoin Mining?

Bitcoin mining is the process of new bitcoin entering the circulating supply in the form of a “block reward” to miners who verify transactions on the Bitcoin Blockchain.

Mining is the industrial infrastructure that allows Bitcoin to function without intermediaries. It requires expensive hardware called application-specific integrated circuits (ASICs) and software specifically designed to mine bitcoin.

Miners maintain the blockchain ledger that records the history of all transactions made on the blockchain, ensuring that no one spends bitcoin that they do not have — also known as “double spend.”

Miners must verify a certain amount of transactions per block (about 1MB worth), then race amongst each other to solve a cryptographic problem that requires massive amounts of computational power from specialized hardware and software.

The first miner to solve the problem shows “Proof of Work” and receives the block reward, and their block is added to the chain.

Then, the race to confirm the next block starts again.

The Bitcoin Protocol designed this process to happen every ten minutes, on average.

The difficulty of these mathematical problems varies to ensure the 10 minute pace is kept, and the rate of new bitcoin entering circulation follows its programmatic supply schedule.

Understanding Bitcoin Mining

Miners must meet two conditions to earn the block reward — verify the block’s transactions and find the “nonce” (number only used once) that is less than or equal to the “target hash.” So, how exactly does this work?

Bitcoin uses cryptography to secure its network, specifically SHA-256.

Each confirmed block has a “block header” that uniquely describes the contents of that block. The block header is an 80-byte long string that includes data such as a timestamp, Merkle root, version number, mining difficulty target, and nonce.

The golden nonce is the value the bitcoin miners are solving for — the other information is broadcasted to the network.

Once a miner finds the nonce that is less than or equal to the target hash, the block is complete, and the miner receives the block reward.

All of this data is combined and is the “input” for the cryptographic hash function that creates a digital fingerprint of the mined block to be uniquely distinguished from every other block on the chain.

The output is deterministic, meaning that the resulting hash of the block will always be the same for the given input.

Additionally, the hash function’s output will always be 256 bits regardless of the input size. An “Avalanche Effect” ensures that a minor change in the input results in a vastly different output.

This is one reason why Bitcoin is so secure — cryptography ensures that this communication is a one-way street. It is computationally infeasible to calculate the input if the only information available is the output, thus securing the data in the network.

The smaller the target hash, the more difficult it is to mine a block. Since the nonce could be any string of numbers from 1 to 50 trillion and beyond, there is less probability that a miners guessed nonce is less than the target hash if the target hash is smaller compared to being larger.

It’s like closing your eyes and jumping out of a plane. There’s a better chance you land in the Pacific Ocean than Lake Tahoe.

A smaller target hash means that it will have more leading zeros. All target hashes begin with at least eight zeros and have at most 63 leading zeros. There is no minimum target, but there is a maximum target set by Satoshi and the Bitcoin Protocol.

Mining difficulty is essentially controlled by the number of leading zeros in the target hash.

The Bitcoin protocol updates this mining difficulty every 2,016 blocks, which typically happens every two weeks.

If more blocks are mined over this period than intended by Satoshi, the protocol increases the difficulty of mining.

This reduces the miner’s probability of earning the block reward to the degree that it is not economically worth their time to try.

It works the other way, too. If less blocks are mined over this period, mining becomes easier, and the likelihood of receiving block rewards increases, which attracts additional miners to provide sufficient computing power.

Additionally, the block reward is halved after every 210,000 blocks or approximately every four years.

When Bitcoin first launched, the reward for each mined block was 50 bitcoin. After the first halving, it was 25, and then reduced to 12.5, and on May 11, 2020, it was halved to 6.25 bitcoin.

Example of Bitcoin Mining

Let’s say you’re trying to mine block #10 and add it to the bitcoin blockchain. Here’s a crude summary of events:

  • You must verify block #9 before starting on block #10 to ensure you’re not adding to a bad fork in the chain
  • Your software takes the previous block’s header and begins guessing for the golden hash that is less than or equal to the target hash
  • Your software will make billions and trillions of guesses to find the right nonce, thus doing proof of work
  • While your rigs are searching for the nonce, they are also verifying 1MB worth of transactions that are waiting to be verified in a “mempool” and adding the transactional data to block #10 (your software can start guessing nonces before verifying transactions, even if it’s just microseconds before, because every microsecond counts)
  • If you’re first to find the nonce that is less than the target hash, congratulations, your block is added to the chain, and the information is broadcasted to the network
  • You receive the block reward plus a commission on the transaction you processed for maintaining the legitimacy of the ledger
  • The other miners verify block #10, and the race to confirm block #11 begins

Keep in mind that all of these processes are done by specialized computers and software — there is no human involvement in the computations.

Humans purchase the equipment and set the initial conditions for the mining systems to do the heavy lifting, making sure everything is plugged in where it’s supposed to be, and the electricity is on.

Economics of Bitcoin Mining

Miners typically sell the majority of their block reward to cover the costs of the specialty mining hardware and software, electricity, and energy required to power and cool the mining equipment, thus providing liquidity to the market.

The amount they sell largely depends on the price of bitcoin because they’re selling it for goods and services priced in bitcoin’s USD exchange rate.

It’s been a golden year for bitcoin miners in 2021. For many, their mining equipment was purchased and well established before the bitcoin price surged to new all-time highs, resulting in unprecedented margins and holding a larger percentage of the block reward.

However, the economics work the other way too. As the price of bitcoin goes up, so does the cost of the mining equipment because its demand increases, and there’s only so much hardware.

Say a company purchased miners for double what they would have paid prior to a given bull run. They now have to mine 2x the amount of bitcoin to make back their initial investment.

To make matters worse, say they happened to purchase it at a local top, and they watch BTC fall 50%, which is a rather common thing for bitcoin to do.

The value of the bitcoin they mine is now worthless in USD, and they must mine 4x the amount of bitcoin just to break even.

Miners don’t control the price of bitcoin, the cost of miners, the block reward, or the network’s hash rate at any given time. They assume substantial risks to get those block rewards.

Bitcoin Mining FAQs

What will bitcoin miners do after 2140?

There won’t be new bitcoin entering supply after 2140 — all 21 million will have been issued from inception. Therefore, miners will not receive block rewards for maintaining the ledger. But transactions will still occur on the Bitcoin Blockchain, and they will need to be verified by miners. The miners that stay around will receive transaction fees for maintaining the legitimacy of the blockchain.

Is bitcoin mining bad for the environment?

Bitcoin mining does require large amounts of energy, but isn’t energy expenditure justified to properly secure a global asset class worth over $1 trillion? Also, many mining operations are harnessing energy from sources that would otherwise be wasted in the atmosphere. Miners are economically incentivized to find the cheapest forms of energy, which is often renewable energy. Arguing that “bitcoin uses a lot of energy and therefore bitcoin is bad” is a narrow viewpoint. The potential net benefits will certainly outweigh concerns over using too much energy.

Bottom Line: Bitcoin Mining Definition

Bitcoin miners are essentially auditors of the public ledger. But since Bitcoin is decentralized, there is no central authority that can financially incentivize them to maintain the ledger.

Therefore, the Bitcoin Protocol mandates that new bitcoin enter circulation in the form of payments to the miners.

Bitcoin mining is a beautiful process driven by pure but variable market incentives while being cryptographically secured by the mathematical laws of the universe.

Sean Graytok
Sean Graytok

Sean Graytok is our Co-Founder and is a recognized expert in investing, financial management, and Bitcoin. His work has been cited in leading industry publications, such as InvestorPlace and Business Insider. Sean is interested in the people and companies who are driving technological innovation.