How cryptocurrency mining works
Last Updated: 17 February 2025
One of the most popular and well-known examples is Bitcoin mining. By examining this cryptocurrency, one can better understand how coin extraction occurs, how network security is ensured, and why mining is an integral part of the entire cryptocurrency system.
Why is cryptocurrency mining needed at all?
Mining plays a key role in achieving consensus in the blockchain and ensuring its security by validating transactions and protecting the system from attacks. This is a crucial process for the secure operation of the Bitcoin network or any other cryptocurrency mined in a similar way. To understand why mining is so necessary, let’s take a look at how the blockchain itself works.
The Bitcoin network is a public decentralized ledger that includes information about hundreds of millions of timestamped transactions. For example, one entry in the blockchain may contain information that Participant 1 sent Participant 2 5 BTC on Wednesday at 9 PM. This ledger is not stored in one single location. It is loaded onto computers known as nodes. This approach allows every participant in the network to access the complete history of BTC ownership and its current state, ensuring total transparency.
Blockchain is structured in such a way that there is no centralized authority making decisions about which transactions should be added to new blocks. Instead, all nodes collectively decide which transaction information is correct, following established rules. All nodes store the transaction history, verify their authenticity, and broadcast updates to other network participants. When all nodes receive the same information, a common understanding of how many bitcoins each participant has emerges.
Additionally, there is a group of nodes called miners who compete for the right to create a new block of transactions. They obtain this right through a process called Proof of Work, in which miners solve complex computational tasks to win the right to create a new block, outpacing their 'rivals' and receiving a reward in the form of new BTC.
What is "Proof of Work" and why is it needed?
Mining using the Proof of Work (PoW) protection system is a way to prove that blockchain participants are actively involved in maintaining its operation. To do this, they must perform complex calculations that require significant resources, including energy.
Why is this proof necessary? The point is that such computations cost money, and to participate in mining, real resources must be spent. This makes attacks on the network very expensive and unprofitable for attackers, as they require huge computational power. In other words, PoW protects Bitcoin from attempts to hack or manipulate it, as the attack would be too costly for those who would want to carry it out.
Principle of cryptocurrency mining
Although PoW is a technically complex process, it will be easier to understand by examining its execution step by step. We will look at how Bitcoin mining works, although this principle is also applicable to other blockchains based on the Proof of Work algorithm.
Stage 1: The emergence of a new transaction
Each transaction in the Bitcoin network is initially assigned an unconfirmed status. A new unconfirmed transaction appears in the blockchain the moment two users make a deal between themselves, for example, one sends cryptocurrency to the other. This transaction contains detailed information about the deal, namely: the addresses of the sender and the recipient, the number of coins sent, the time, etc. As a result, this transaction is broadcast throughout the blockchain network.
Stage 2: Adding a new transaction to the "waiting area"
Each miner participating in the maintenance of the network constantly monitors for new activities within it. On the computer that manages the mining process, there is a specific time zone — mempool. Here, after appearing in the network, an unconfirmed transaction is added. Each miner has their own mempool, so it is not some unified 'storage' for everyone. Despite the fact that the base size of the mempool cannot exceed 300 MB, it will differ among various miners. This is all due to the fact that nodes are built differently from each other and unconfirmed transactions are added to them not simultaneously, but at different times.
Stage 3: Transitioning unconfirmed transactions into the candidate block
Miner takes unconfirmed transactions from the mempool and adds them to a candidate block — a new block that is not yet confirmed by the network and is vying to become the block in the blockchain for which a reward is given. The size of the candidate block in the Bitcoin network is about 2 MB: this memory volume includes approximately 2000 transactions.
Stage 4: Solving Cryptographic Challenges
From here, the mining process essentially begins, which is based on PoW. With the help of special equipment, the miner adds a special random number (nonce) to the candidate block. After that, all the information (including the block data and nonce) goes through the SHA-256 algorithm, which generates a hash (a unique code-combination obtained as a result of the calculations).
The miner's goal is to find a hash that meets certain conditions (for example, starting with a specific number of zeros). This is a complex task that requires high computational power, as if the hash does not meet the network's conditions, the miner changes the number and tries again, repeating the process millions of times.
Whoever finds the appropriate hash first adds a block to the blockchain. In this case, the candidate block is considered 'solved' and receives the status of being fully verified by the network. Only after that, the block is added to the blockchain and becomes a full link in the chain, containing the next entry in the ledger. The miner who outpaces other network participants and solves a new block receives a reward in the form of a fixed amount of cryptocurrency. Currently, it is 3.125 BTC.
Based on this, we can conclude that the greater the computing power of the equipment (hashrate — the number of hashes calculated per second), the higher the probability of being the first in the race to add a new block. In the Bitcoin blockchain, this process repeats approximately every 10 minutes. After the winner block appears, miners stop trying to solve their current candidate block, remove transaction information from the mempool, and begin forming a new candidate block — it all starts over and continues indefinitely.
Difficulty Adjustment in Mining
After every 2016 blocks are added, which takes about 2 weeks on average, an automatic adjustment of the PoW algorithm's difficulty level occurs. This is necessary to maintain a constant rate at which new blocks are mined — 10 minutes.
In the course of adjusting the difficulty, the total amount of computational power currently applied to the hashing algorithm—so-called hash power—is taken into account. When the power increases, the mining process becomes harder for all participants. If the power decreases, then it becomes easier to mine cryptocurrency since the difficulty decreases.
Unlike gold mining, where an increase in the number of miners leads to a greater volume of gold mined, the process of Bitcoin mining operates on a different principle. In the case of gold mines, when more people participate in mining, the supply of gold in the market increases. As supply increases, the price of the precious metal decreases.
With Bitcoin, the situation is quite different: the network protocol sets the exact amount of BTC that can be issued — 21 million. And this number does not change regardless of how many people are mining or how powerful their devices are. To maintain mining stability, its difficulty is adjusted automatically. This means that no matter how many miners connect to the blockchain, the total volume of new BTC that enters the market remains constant. This keeps the network stable and helps avoid the 'inflation' of the digital asset, as is the case with physical resources.