Table of contents
Lesson 5
What is mining?
What is mining?

8 min reading time

Updated

What is mining?

Mining is a crucial process that comprises solving complex cryptographic puzzles, in order to validate transactions and add them to the blockchain. Mining is therefore a crucial security process in the blockchain. New coins are distributed to reward the validation.

Technically speaking, mining is not an official term. It is the name given to the verification process of transactions in blockchains that use the Proof of Work consensus mechanism. The most famous example of a blockchain that uses Proof of Work is Bitcoin.

The verification process to confirm transactions needs miners to solve a complex cryptographic puzzle. Miners (machines that are mining) are competing with each other to do so. The first one to solve the cryptographic puzzle, receives a reward. Every successful verification therefore means that new crypto coins come into circulation.

What is mining?

Mining is more than simply a way to create new crypto coins. Mining cryptocurrencies is mainly about validating transactions and adding new blocks to the blockchain. Verifying transactions with mining helps avoid double spending and therefore incorrect balance sheets. As reward for this work, miners receive new coins that will then come into circulation.

Recording transactions

Like with physical currency, the digital ledger, the so-called blockchain, must be updated when someone spends cryptocurrency. An amount is deducted from one account, and is then added to another. With physical currency, the bank is the central party checking the transactions. However, cryptocurrency is decentralized. This means that no specific institute does all the checking. Instead, transactions are checked by a network of computers spread across the world: the miners. Every transaction is checked by miners and recorded in a block. All blocks together form the blockchain.

Miners collect all valid transactions carried out in the network, and record these transactions in a block. To add blocks to the blockchain, a miner needs to solve a complex cryptographic puzzle. This complex cryptographic puzzle is the “Proof of Work” (PoW) hash function. The solution to the Proof of Work function is added to the block.

The greater the miner’s arithmetic power, the faster the miner can find a Proof of Work hash function and add a block to the blockchain. The miner’s arithmetic power is important, because only the first miner to succeed in adding a certain block to the blockchain is rewarded.

A miner’s arithmetic power is therefore an important factor. A miner’s arithmetic power depends on the hardware used. It is not the processor, but rather the video cards that do the heavy math. However, the price of a powerful video card is high,  meaning it can take a lot of money and energy to start an own miner.

Preventing double-spending

A double spend is when a cryptocurrency’s owner spends the same cryptocoin twice. This is impossible to achieve with physical currency. Once a conl or bill is spent, the money will actually be in the possession of the new owner. It is therefore impossible to spend that same coin or bill again. It is however possible for the money to be faked.

The same risk exists with crypto coins. A crypto coin owner can make digital copies of the coin. The owner then spends the copy, while the original crypto coin remains in the owner’s wallet.

When spending physical currency, this can be discovered by looking at the serial number on both bills. When these are the same, it means one of the bills is fake. A miner does something similar. Every transaction is checked and recorded to guarantee that the same coin cannot be spent twice. In this way, miners are jointly responsible for the network’s security and together form the decentralized network.

Creating new crypto coins

Miners must have sufficient arithmetic power to successfully find a valid Proof of Work hash function (see below). They also need electricity to work. To reward miners for their work in checking the network, new crypto coins are created. With the exception of the coins that were created through the “genesis block”, the first block created by Bitcoin inventor Satoshi Nakamoto, every existing coin was created by a miner as reward for his work, also called the block reward.

The reward for adding a new transaction block to the blockchain is currently 6.25 Bitcoin. The rate at which new coins are created is halved after every 210,000 blocks, the so-called Bitcoin halving. Halving takes place approximately every four years. Because of the halving process, the final Bitcoin will be created in the year 2140.

What does the cryptographic puzzle look like?

Miners solve complex cryptographic puzzles, the so-called Proof of Work hash function. They don’t do this by mathematically solving the puzzle, but by guessing the solution. The solution consists of a 64-digi hexadecimal number (a “hash”), that is smaller or equal to the target hash (the correct answer). Finding a valid Proof of Work hash function is therefore guesswork, and subject to luck. The total number of guesses for every Proof of Work hash function, however, is several billions. One billion is a million times a million. A valid Proof of Work hash function must be numerically lower than the difficulty factor.

What is the hash rate and difficulty factor?

The difficulty rate is measured in hashes per second, also abbreviated with H/s, and called the hash rate. A hash is a collection of digits and letters. The hash rate (or difficulty rate) is a benchmark to measure how many times guesses are made for the right hash. The higher a computer’s arithmetic power, the more it can guess, and the higher the hash rate.

The difficulty rate depends on the difficulty factor. The difficulty factor is automatically adjusted depending on how many miners are connected to the network. The difficulty rate was created to guarantee that a new block is added to the blockchain approximately every 10 minutes. This guarantees that the final Bitcoin will only be mined in 2140.

If more miners connect to the network, it is possible that a correct hash (solution to the cryptographic puzzle) is found within 10 minutes. To prevent this, the difficulty rate for finding a correct hash is increased as more miners connect to the network. The difficulty rate is lowered when miners leave the network.

The difficulty factor is adjusted every 2,016 blocks. The difficulty factor is a number of 256 bits, whereby a bit is either 0 or 1. Specifically, the difficulty factor determines the level of the difficulty rate at which the arithmetic power of all miners in the network are able to find a correct solution to a complex cryptographic puzzle.

How can you mine?

Mining is done by miners. A miner is a computer with strong graphic cards. The graphic cards are crucial, since the miner is constantly solving complex cryptographic puzzles.

The difficulty rate of the cryptographic puzzle increases when new miners join the network. The more miners, the higher the difficulty rate and the more difficult it becomes for an individual miner to add a block to the Blockchain. The arithmetic power of miners must therefore continue to improve, meaning more expensive equipment needs to be purchased.

Mining equipment

The required mining equipment depends on the coin being mined. For Bitcoin and Litecoin, an ASIC (application-specific integrated circuits) is necessary to efficiently mine, but for Ethereum a powerful GPU (graphics processing unit) is essential. An ASIC is a special type of hardware designed to perform one specific task, for example solving a cryptographic puzzle. A GPU is a processor that performs video (graphic) tasks. Differences in hardware also occur between brands.

Mining pools

An alternative solution for the increasingly expensive equipment is the creation of mining pools. A mining pool consists of various miners joining forces. This combines the arithmetic power of multiple miners. The income from mining is then divided among the various participants. The participants are obliged to pay a certain fee towards the owner of the mininpool.

Cloud mining

It is also possible to mine without buying equipment. This is done via so-called cloud mining. In cloud mining, equipment is rented. A cloud mining company operates a data center with all hardware somewhere in the world, often in a place where electricity is cheap and where it’s cold. It is possible to rent part of this hardware for mining. In this way, you don’t need to buy your own equipment. However, it is important to be careful with potential frauds claiming to have a large data center and promising returns that are just too good to be true.

Summary

Mining is the process where all transactions carried out in the network are checked and validated. Upon validation, the block with transactions is added to the blockchain. As reward for securing the network, miners receive crypto coins. In the case of a Proof of Work blockchain, such as Bitcoin, this is the only way in which new crypto coins can come into circulation.

Mining is done by powerful computers. These computers aim to solve complex cryptographic puzzles, the so-called Proof of Work hash function. The first miner to find a Proof of Work hash function is allowed to add a block to the blockchain. The miner is rewarded with new crypto coins and the transaction costs of all transactions recorded in the block. Additionally, new coins come into circulation through the reward given to the miners for adding a block to the blockchain. The reward halves every 4 years, the so-called Bitcoin halving. As a result, the very last Bitcoin will only come into circulation in the year 2140.

Finding a valid Proof of Work hash function has nothing to do with the mathematical solving of a complex puzzle. It is pure guesswork that is subject to luck and the available arithmetic power of the miner or the mining pool. The probability of finding a valid Proof of Work hash function depends on the difficulty rate and the associated difficulty factor. A valid Proof of Work hash function must be numerically lower than the difficulty factor. The lower the difficulty factor, the fewer valid solutions and the more difficult it becomes for a miner to guess a valid solution.

You can become a miner yourself in one of two ways: by purchasing hardware or by joining a cloud mining company and renting equipment. Mining with your own equipment can also be done in two ways: individually or by joining a mining pool. An individual miner, however, rarely has sufficient arithmetic power to be the first to find a valid Proof of Work hash function. Joining a mining pool and joining forces (more arithmetic power) increases the chances that the pool is the first to find a valid Proof of Work hash function and receives a reward. The reward is then divided among all pool participants.