What is bitcoin mining?
The process of minting new bitcoins is in some ways similar to the process of extracting precious metals from the earth. For this reason, it has come to be known as 'bitcoin mining.'
As stated in the Bitcoin white paper:
The steady addition of a constant amount of new coins is analogous to gold miners expending resources to add gold to circulation. In our case, it is CPU time and electricity that is expended.
A simplified overview of bitcoin mining is as follows:
1. People compete to earn bitcoin rewards by applying computing power in a process known as 'Proof of Work' (PoW). The process is named such because only participants (miners) who have proven they've dedicated sufficient resources (work) will have a chance at winning the rewards.
2.Approximately every 10 minutes, rewards are distributed to a single winning 'miner.'
3. Rewards are twofold: (1) the 'block reward,' which is newly minted bitcoin. The block reward is currently set at 6.25 bitcoins (but will be cut in half from early May 2024, then cut in half again four years later and so on). (2) the fees associated with all transactions in the current block. End users wishing to make a transaction must attach a fee to the proposed transaction as incentive for miners to include it in the next block.
Why is bitcoin mining needed?
Bitcoin mining is an essential component of the network's system for arriving at consensus as to the current state of the ledger. It is central to enabling people to securely make Bitcoin transactions.
The Bitcoin network is a globally distributed public ledger consisting of a giant list of timestamped transactions. For example, one ledger entry might indicate that Person A sent 1 bitcoin to Person B at 10am on Monday. The ledger is updated approximately every 10 minutes by adding 'blocks' that contain a list of new transactions. The existence of the ledger, which is voluntarily stored by thousands of participants known as 'nodes,' allows anyone to see both the current state and complete history of bitcoin ownership.
By design, there is no centralized authority deciding which transactions should be added to new blocks. Instead, the state of the ledger (ie. the 'truth') is arrived at collectively and through coordination by nodes in accordance with the Bitcoin protocol. This decentralization is what gives Bitcoin some of it's most interesting properties - namely, censorship-resistance and permissionless-ness.
Most nodes simply validate the authenticity of transactions, store the ledger, and pass on updates to other nodes (again, updates take the form of new blocks added to the chain). However, a smaller group of nodes, called miners, compete to create new blocks. When miners create new blocks, they are effectively updating the state of ledger, or the 'truth' about who owns what.
What is the purpose of bitcoin mining?
Bitcoin mining serves several functions:
1.It is a method for distributing new coins.
2.It is part of a more complete system for ensuring only valid transactions are added to the blockchain.
3. It is a method for prioritizing transactions given limited throughput (it creates a fair market for limited block space).
4. It provides financial incentive for participants (miners) to dedicate resources to the network, and the resources dedicated help secure the network from attackers. Note that attackers here primarily refers to miners themselves. In other words, by making it expensive to mine, Bitcoin ensures miners follow the rules.
How does bitcoin mining secure the network?
Proof-of-Work mining helps to secure the Bitcoin network by requiring potential attackers to commit more resources to an attack than they could hope to gain from the attack itself. In other words, it ensures that attacking Bitcoin is a money-losing (and very costly) prospect, making it exceedingly unlikely to occur.
How does bitcoin mining work?
The process is summarized in the Bitcoin white paper:
1.New transactions are broadcast to all nodes.
2.Each node collects new transactions into a block.
3.Each node works on finding a difficult proof-of-work for its block.
4. When a node finds a proof-of-work, it broadcasts the block to all nodes.
5.Nodes accept the block only if all transactions in it are valid and not already spent.
6. Nodes express their acceptance of the block by working on creating the next block in the chain, using the hash of the accepted block as the previous hash.
Let's break that down into a little more detail.
To begin, miners are the ones who propose updates to the ledger and only miners who have successfully completed the Proof of Work are permitted to add a new block. This is coded into the Bitcoin protocol.
Miners are free to select valid transactions from a pool of potential transactions that are broadcast to the network by nodes. Such transactions are collected into the 'mempool.' Rational and honest miners select transactions from the mempool based on the fees attached to them, optimizing for higher fees. This gives rise to the fee market, which helps to ensure the limited block space is used fairly and efficiently.
The first miner to complete the Proof of Work broadcasts her proposed new block to the wider network of nodes who then check to ensure that the block follows the rules of the protocol. The key rules here are (1) all transactions in the block are valid (ie. there are no double spends), and (2) the new block appropriately references the previous block and is numbered as the next in the chain (ie. the new block constitutes the latest block in the longest chain). If it does, nodes send it on to other nodes who complete the same process. In this way, the new block propagates across the network until it is widely accepted as the 'truth.'
However, it can (and regularly does) happen that more than one miner completes the Proof of Work at almost the same time and simultaneously broadcasts his new block out to the network. Moreover, due to network delays and geographic separation, nodes may receive new proposed blocks at slightly different times. Read More...