How Bitcoin Mining Works: Hashing, Difficulty, and Block Rewards
Bitcoin mining secures the network and processes transactions through a decentralized consensus mechanism called Proof-of-Work. Here is how miners use computational power to earn block rewards.
Key points
- Bitcoin mining uses Proof-of-Work to validate transactions and secure the network without a central authority.
- Miners use specialized ASIC hardware to repeatedly run the SHA-256 algorithm in a brute-force guessing game.
- The network adjusts the difficulty target every 2,016 blocks to maintain a 10-minute average block time.
- Successful miners receive a block reward consisting of a newly issued block subsidy and user transaction fees.
- Miners pool their hash rate together to generate predictable revenue rather than mining solo.
Bitcoin mining is the decentralized process of validating transactions and securing the network by expending computational power. Miners compete to generate a specific cryptographic output, and the winner earns the right to append the next batch of transactions to the blockchain. In exchange for this service, the protocol compensates the winning miner with newly created $BTC and transaction fees.
The Purpose of Mining
Traditional digital money requires a central bank or clearinghouse to deduct funds from one account and add them to another, solving the double-spend problem. Without a central authority, a digital currency network needs a decentralized mechanism to agree on the chronological order of transactions. According to the Bitcoin whitepaper, the network relies on a peer-to-peer timestamp server to establish a single, immutable history of transactions 1. Mining serves as this timestamp server.
When users broadcast transactions, network nodes collect them into a temporary holding area. Miners select transactions from this pool, verify that the sender has sufficient funds, and group them into a candidate block. For a deeper look at this process, see How a Bitcoin Transaction Works: UTXOs, Mempools, and Finality.
By requiring miners to expend real-world resources to propose a block, the protocol makes it economically unfeasible for a malicious actor to rewrite the transaction history. Reversing a past transaction would require redoing the computational work for that block and all subsequent blocks, demanding control of a majority of the network's total computing power.
If a single entity were to control more than 50% of the network's computing power, they could theoretically execute a 51% attack. This would allow the attacker to prevent new transactions from gaining confirmations and reverse transactions they completed while in control of the network, enabling double-spending. The massive energy and hardware costs required to achieve this majority serve as the primary deterrent against such attacks.
Proof-of-Work and Cryptographic Hashing
The core engine of Bitcoin mining is the Proof-of-Work algorithm, which relies on a cryptographic function called SHA-256. Developed by the National Security Agency and standardized by the National Institute of Standards and Technology, SHA-256 takes an input of any size and produces a fixed 256-bit output 4. This output is called a hash.
A cryptographic hash function operates in one direction. It is trivial to calculate the hash of a given input, but mathematically impossible to reverse-engineer the input from the hash. Even a microscopic change to the input data alters the resulting hash completely.
To mine a block, a miner constructs a block header. This header contains the hash of the previous block, a summary of the new transactions (the Merkle root), a timestamp, the current network difficulty, and a variable number called a nonce. The Merkle root is a single hash that represents all the transactions included in the candidate block. By hashing pairs of transactions together in a tree structure until only one hash remains, the protocol creates a compact fingerprint of the entire block's contents. If a single transaction is altered, the Merkle root changes, which in turn changes the block header and invalidates the miner's work.
The miner runs the block header through the SHA-256 algorithm. The goal is to produce a hash that is numerically smaller than the difficulty target set by the protocol. Because the hash output is unpredictable, the only way to find a winning hash is through brute force. Miners continuously change the nonce and re-hash the block header millions of times per second until a valid hash is discovered.
The Difficulty Adjustment
The Bitcoin protocol is programmed to add a new block to the chain approximately every 10 minutes. However, the total computational power on the network fluctuates as miners turn machines on and off. To maintain the 10-minute block interval, the protocol automatically adjusts the difficulty target every 2,016 blocks, which takes roughly two weeks 2.
If blocks are found faster than the 10-minute average during an epoch, the protocol lowers the difficulty target for the next epoch. A lower target means there are fewer valid hashes, making the guessing game harder. If blocks are found too slowly, the target increases, making it easier.
Worked Example: Assume the network requires a miner to generate a hash starting with 10 zeros. If the total network computing power is 500 exahashes per second, miners are generating 500 quintillion guesses every second. If 100 exahashes of computing power suddenly join the network, miners will find the required hash in eight minutes instead of 10. At the end of the 2,016-block epoch, the protocol will adjust the target, perhaps requiring a hash that starts with 11 zeros, thereby restoring the 10-minute average despite the increased computational power.
Block Rewards and Miner Revenue
When a miner discovers a valid hash, they immediately broadcast the solved block to the rest of the network. Other nodes verify that the hash meets the target and that all transactions within the block are valid according to consensus rules 3. Once verified, the block is added to the blockchain, and the miner receives compensation.
This compensation is known as the block reward, which consists of two distinct components: the block subsidy and transaction fees. The block subsidy is the mechanism by which new $BTC enters circulation. The winning miner includes a special transaction in the block, called the coinbase transaction, which pays the subsidy to their own address.
The protocol dictates that the block subsidy decreases by half every 210,000 blocks, a process that continues until the maximum supply of 21 million bitcoin is reached. For more details on this issuance schedule, see The Bitcoin Halving: How the Protocol Enforces Digital Scarcity.
The second component of miner revenue comes from transaction fees. Users attach fees to their transactions to incentivize miners to include them in the next block. As the block subsidy continues to halve over the coming decades, transaction fees are designed to gradually replace the subsidy as the primary financial incentive for miners to secure the network.
Hardware and Mining Pools
In the early days of the network, individuals could mine blocks using standard central processing units (CPUs) on personal computers. As the network grew and the difficulty target adjusted, miners transitioned to graphics processing units (GPUs) and eventually to specialized hardware.
Today, mining is dominated by the ASIC (Application-Specific Integrated Circuit). An ASIC is a microchip designed for a single, highly specific purpose. Bitcoin ASICs do nothing but compute SHA-256 hashes. They are exponentially faster and more energy-efficient than general-purpose computers, rendering older hardware entirely obsolete for Bitcoin mining.
Because the global network is so massive, the statistical probability of a single ASIC finding a valid block is near zero. To generate predictable revenue, individual miners combine their computational power, known as hash rate, into mining pools.
A mining pool acts as a coordinator, assigning different nonce ranges to participants to ensure no two machines duplicate work. When any machine in the pool finds a valid block, the pool operator collects the block reward and distributes it among the participants.
Mining pools typically use one of two payout methods. Pay-Per-Share (PPS) guarantees miners a fixed payout for every valid hash they contribute, transferring the variance risk to the pool operator. Pay-Per-Last-N-Shares (PPLNS) pays miners only when the pool successfully finds a block, distributing the reward based on recent contributions. PPS offers predictable income but charges higher fees, while PPLNS has higher variance but lower fees.
Common misconceptions
Miners solve complex mathematical equations: Miners do not solve equations, geometry, or calculus problems. The Proof-of-Work process is strictly a brute-force guessing game. Miners execute the same SHA-256 hashing algorithm repeatedly, changing a single variable each time, until they randomly generate an output that meets the protocol's criteria.
Mining is primarily about creating new bitcoin: While mining is the mechanism that issues new supply, its primary function is network security and transaction validation. The issuance of new $BTC is the financial incentive designed to encourage participation in the consensus process.
Anyone can mine profitably on a personal computer: CPU and GPU mining became obsolete years ago due to the difficulty adjustment. Modern mining requires industrial-scale ASIC deployments, specialized cooling infrastructure, and access to extremely cheap electricity to remain economically viable.
How this connects to the market
Miners are structural sellers in the cryptocurrency market. They operate businesses with fiat-denominated expenses, including electricity, hardware procurement, facility maintenance, and personnel. However, their primary revenue is denominated in $BTC. To cover their operating costs, miners must regularly sell a portion of their block rewards on the open market, creating constant sell pressure.
The profitability of mining is highly sensitive to the market price of the asset and the cost of energy. Because electricity is the largest ongoing expense, miners constantly seek the cheapest available power. This search often drives miners to utilize stranded energy—power generated in remote locations that cannot be easily transmitted to population centers. Additionally, miners increasingly integrate with renewable energy grids, acting as flexible load resources that can power down during peak demand and consume excess power during periods of overproduction.
When the price falls below the aggregate cost of production, inefficient miners operate at a loss. If the downturn is sustained, these miners are forced to power down their machines or liquidate their treasury holdings to cover debts. This process, known as miner capitulation, often removes the weakest operators from the network.
Conversely, high market prices drive mining profitability, incentivizing operators to expand their facilities and deploy new generation ASICs. This expansion increases the global hash rate, which subsequently triggers an upward difficulty adjustment. The self-correcting nature of the difficulty adjustment ensures that higher prices do not result in faster block issuance, but rather in a more secure network that requires more energy to attack. For a broader overview of the asset's design, see Understanding Bitcoin: The Architecture of Decentralized Digital Scarcity.
Questions this story raises
- What is a hash in Bitcoin mining?
- A hash is a fixed-length string of characters generated by running data through the SHA-256 cryptographic algorithm. Miners try to produce a hash that is numerically smaller than the network's current difficulty target.
- Why does Bitcoin mining use so much energy?
- The energy expenditure is intentional. Proof-of-Work requires miners to consume real-world resources, making it prohibitively expensive for an attacker to rewrite the blockchain's transaction history.
- What happens when all 21 million bitcoin are mined?
- Once the block subsidy reaches zero, miners will be compensated entirely by transaction fees paid by users to have their transactions included in blocks.
- Can I mine Bitcoin on my laptop?
- No. The network difficulty is so high that general-purpose computers cannot mine profitably. Mining requires specialized, industrial-grade hardware known as ASICs.
References
- [1] Bitcoin Core Developer Reference: Block Chain — Bitcoin Core
- [2] Bitcoin: A Peer-to-Peer Electronic Cash System — bitcoin.org
- [3] Secure Hash Standard (SHS) - FIPS 180-4 — National Institute of Standards and Technology
Evergreen explainer written by Basis Desk's system and checked by an independent model pass for factual errors and advice language. Figures, fees and rules change — the references above are where to verify current specifics. Market figures marked "at the time of writing" come from live exchange data. Report an error: hello@basisdesk.news.
Not financial advice. Basis Desk publishes information, not recommendations. Crypto assets are volatile and you can lose what you invest.