Bitcoin mining is based on a mechanism known as Proof-of-Work (PoW). Miners compete to solve complex mathematical problems that involve cryptographic computation. The main task of miners is to find a numerical value, called a “nonce,” which, when combined with the data in a block, produces a cryptographic hash that meets specific difficulty criteria. If the generated hash is below a certain threshold, the block is considered valid and is added to the blockchain.
Miners are responsible for validating and recording transactions on the Bitcoin blockchain. When a user makes a transaction, it is transmitted to the network and grouped with other transactions into a block. Miners compete to solve the mathematical problem associated with that block. The first miner to solve the problem earns the right to add the block to the blockchain and is rewarded with new Bitcoins, known as the “block reward,” along with fees paid by users for the transactions included in the block. The transaction that rewards miners for their work is known as the coinbase.
The Proof-of-Work system ensures that the Bitcoin blockchain is secure and resistant to attacks. The difficulty of the problem to be solved is automatically adjusted (through a process called difficulty adjustment) every 2,016 blocks, approximately every two weeks, to maintain an average time of about 10 minutes between blocks. This difficulty adjustment process ensures that the network remains stable and prevents block generation from becoming too fast or too slow.
As time has passed, the mining industry has generated a demand for increasingly efficient and specialized hardware. Today, it is no longer feasible to mine with a home PC; instead, one must rely on ASICs, specialized hardware designed to execute the SHA256 hashing function used extensively in the Bitcoin protocol and essential in the block validation process by miners.