How Does Mining Work?

Bitcoin is powered by an incredible amount of sophisticated technology, namely the blockchain. Blockchain is a digital record of all the verified transactions made on a particular cryptocurrency, consisting of a series of "blocks". Each block consists of a series of transactions of bitcoins between users, represented by an alphanumeric string called an address. Each of these transactions are shared with a network resource called the memory pool (also known as the mempool.) Transactions aren't recognized by the network until they are added from the mempool to the blockchain.

In order to send bitcoin to someone's address, the sending user needs to include fees to incentivize miners picking their transaction out of all the ones available in the mempool. Because blocks have a size capacity, miners select the transactions that deliver the most revenue, and therefore the ones with the highest fees. They then create a block made of these transactions and push it across the network to be validated by nodes.

Proof of work is at the center of the bitcoin network. Without it, users would attempt to modify the blockchain to benefit themselves, taking advantage of the network's decentralized nature. Miners must show literal proof that they have done work to create a valid block in the form of computation. Proofs are chained together between blocks, which makes it difficult for anyone to reverse a previous transaction. This is how proof of work mining keeps the network secure.

Proof of Work ensures that network participants share the same copy of the blockchain and safeguards against funds being spent more than once. This is a common issue for payment networks without a centralized authority.

The algorithm is created by the repeated running of hash functions, a mathematical operation that takes a string of data and transforms it into a fixed-length number. That number is then considered a "hash." Each hash is unique to an input and can't be calculated in reverse, which maintains the input's privacy.

Bitcoin relies on Secure Hash Algorithm 256 (SHA-256) to output a value that is 256 bits long. These values are usually displayed in digits that range from 0-9 and characters a-f, referred to as base-16. They typically look like a combination of numbers and letters shuffled together. The National Security Agency created SHA-256 in 2001 and is regarded as extremely secure.

One of Bitcoin's goals is to produce on average a block every ten minutes. This time reduces chain splits, where the appearance of two valid but competing blocks occur due to the time it takes for new blocks to reach miners globally.

To maintain this ten minute interval in the midst of network hash rate changes, Bitcoin adjusts the difficulty for miners to find valid proofs of work. This "difficulty adjustment" occurs roughly every two weeks, at every 2,016 blocks.

Difficulty can be lowered to help make it easier for miners to identify blocks if they require longer than ten minutes to be produced. It can also be raised to make it harder. Difficulty is adjusted to maintain that interval average and keep the issuance of bitcoin at a consistent pace, unaffected by changes in hash rate.

The number of bitcoinsavailable to be created and used is capped at 21 million. In order to maintain this restriction, "halvings" occur every 210,000 blocks, or roughly every four years. Halvings are when the Bitcoin network halves the block subsidy that miners are paid for creating new blocks.

In 2009, when the network launched, miners were paid 50 bitcoin for every block. Three halvings have occurred by then, leaving miners earning 6.25 bitcoin per block until the next halving in 2024. The idea is that repeated halvings will reduce the block subsidy to 0 in the year 2140. When that occurs, no new bitcoin will enter circulation.