Mining

Beginner
Mining is the process through which cryptocurrency transactions are gathered, verified and recorded into a digital ledger known as blockchain. The work done by miners is essential for maintaining the integrity of the network and is also responsible for introducing new coins into the system.
Within the traditional banking system, fiat currency is printed and distributed by financial institutions and governmental authorities - but for most cryptocurrencies, the issuance of new coins is not in the hands of centralized entities. Instead, new cryptocurrency units are generated through the process of mining, which follows a predefined set of rules established by the underlying protocol. While the protocol defines what the primary rules are, the so-called consensus algorithms outline how these rules will be followed (for instance, during the validation of transactions).
Taking Bitcoin as an example, the participants involved in the process of mining are called mining nodes (or just miners), and they play a key role in the security of the blockchain network. The job of a miner is to gather unconfirmed transactions from the memory pool and organize them into a candidate block that they will try to validate.
When creating a candidate block, a miner includes a transaction where they send the block reward to themselves. This transaction is known as a coinbase transaction and is often the first to be recorded in a block.
After the list of unconfirmed transactions is formed, each transaction is hashed, and their outputs are organized into pairs. These pairs are then hashed, producing new outputs that are also organized into pairs and hashed once again. The process is repeated until a single hash is produced, which is referred to as the root hash or Merkle tree root.
The root hash is then combined with the hash of the previously confirmed block, along with a pseudo-random number called nonce (plus some other parameters). These elements are then hashed, producing the block hash for that candidate block.

However, the miner will only be successful if the resulting output (block hash) for their candidate block is below a predetermined value (target). Consequently, the process is based on trial and error and they need to perform numerous hashing functions with different nonces in order to find a valid result. The first miner to find a valid hash validates their candidate block and get the block reward. The whole process takes ten minutes, on average.

Once a block gets validated, it is added to the blockchain and miners start to work on the next block. The valid hash produced by miners functions as the proof for their work and this is why the Bitcoin consensus algorithm is called Proof of Work. Each confirmed block has a unique block hash that acts as an identifier.
The block reward is defined by the Bitcoin protocol and decreases every 210,000 blocks (around four years). Initially, the block reward was 50 BTC and is now 6.25 BTC.
Glosario

A decentralized, digitized ledger that records transaction information about a cryptocurrency in a chronolo...

Glosario

A digital currency that is secured by cryptography to work as a medium of exchange within a peer-to-peer (P...

Glosario

The science of using mathematical theories and computation in order to encrypt and decrypt information.

Glosario

A collection of functions and procedures that allow users to interact/communicate with the data of an appli...

Glosario

A temporary block created by a mining node (miner) to add to the blockchain to receive the block rewards.

Glosario

The first ever block recorded on its respective blockchain network, also referred to as Block 0 or Block 1.

Glosario

The sum of coins awarded by the blockchain protocol to cryptocurrency miners for each successfully mined an...

Glosario

A computer file that stores transaction data. These can then be arranged in a linear sequence, which will f...