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 Satoshi Nakamoto, most people have heard of mining. But what does it really mean—and how do you go about mining Bitcoin?was created by
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.
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.
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, Bitcoin miners use dedicated hardware known as ASIC (application-specific integrated circuit) miners—though miners of Ethereum and other cryptocurrencies still typically use GPUs, which has led to shortages of graphics cards.
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.
China’s Bitcoin mining crackdown, and beyond
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.
Up until mid-2021, the majority of mining pools were based in China. That changed in May 2021, when China’s State Council included Bitcoin mining in a list of financial risks that required monitoring. It marked the start of a sweeping crackdown on crypto mining across China, prompted by the country’s commitments to carbon neutrality and the imminent launch of its digital yuan, a central bank digital currency and Bitcoin rival.
A succession of mining bans imposed by provincial governments including Inner Mongolia, Xinjiang, Qinghai, Yunnan and Sichuan followed, causing a collapse in the Bitcoin mining hash rate. Since then, Chinese miners have relocated to countries including Kazakhstan, while miners in other countries have picked up the slack, with the result that by October 2021, the U.S. had overtaken China as the world’s largest market for Bitcoin mining.
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.
Bitcoin mining has come in for criticism over its high energy consumption, which in 2021 was around 11.8 GW or 103.31 terawatt-hours—more than the output of twelve 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. Other miners are looking to nuclear power. The government of El Salvador, which made Bitcoin legal tender in 2021, has even started mining Bitcoin using geothermal energy from volcanoes.
Figures for how much of Bitcoin’s total energy consumption comes from renewables vary, with estimates ranging from 39% to as much as 75% (though the higher estimates typically come from firms involved in the crypto industry). Bitcoin miners currently generate a carbon footprint equivalent to that of Bangladesh.
Stung by this criticism, some cryptocurrencies are switching from a proof of work consensus mechanism to a system known as(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 upgrade.
This post first appeared on: Decrypt