Mining


Mining is the process of validating cryptocurrency transactions. Mining is people using their computing power to secure a blockchain network. It is a decentralized consensus process that uses nodes in the network to maintain the shared ledger. It is the means by which transactions are processed on a blockchain network.

Mining produces blocks of transactions. Each block contains a timestamp, a nonce, a hash of the previous block and a list of the transactions in the block. The hash of the previous block acts as a reference to the previous block that links the last block to the new block. This produces a chain of blocks, or “blockchain.” The transactions in the block comprise all of the transactions that have taken place since the previous block.

New blocks are broadcast to the nodes in the network and the nodes then verify that the new block is valid. In this way, miners provide a service of updating the state of the blockchain for the network.

Miners solve an encryption problem to ensure that the proposed transaction is valid in reference to the existing status of the public blockchain. If the owner of wallet A wants to transfer value to the owner of wallet B, then it must be confirmed that the proposed amount of value truly exists in wallet A. This is called “solving the double spend problem.” A public blockchain’s mining network is a way of internalizing the validation of transactions to the network itself. For instance, Bitcoin miners are compensated with new Bitcoin.

Bitcoin and Ethereum use a proof-of-work consensus mechanism. This is the process of mining on these public blockchains. Anyone who wants to add a block to the chain must solve a difficult puzzle that requires a lot of computing power. It is called proof of work, because solving the puzzle “proves” the use of computational resources. Mining is a process of brute force trial and error. It is basically guess then hash, guess then hash, … until the miner solves the puzzle.

The miners are attempting to guess a number called a nonce. Miners use trial and error to guess a number and then run the hashing algorithm. The number is the nonce. Nonce is a cryptographic term that is an abbreviation of “number only used once.” The miner is adding a random number (the nonce) in the hashing of a block that results in a block hash with a certain number of leading zeros. The leading zeros are just an arbitrary feature that is agreed upon as the “proof of work.” The nonce is a random number added to a hashed block that, when rehashed, meets this difficulty level requirement.  

Check out this demo to get a hands-on feel for mining. It illustrates how the hashing of blocks in a blockchain works. In particular, it shows how a block references all the previous blocks.

Mining revenue consists of two components: transaction fees and block rewards. When a block is successfully added to the chain, the miner gets paid the transaction fee and an additional reward of newly minted cryptocurrency. Bitcoin miners get paid in BTC and Ethereum miners get paid in ETH. Monthly mining revenue on the Ethereum blockchain reached $2.35 billion in May 2021.

A transaction fee is a cut of the transaction amount. This is the network fee in a cryptocurrency transaction.

A block reward is payment in newly issued cryptocurrency. When a miner mines a block of transactions and adds it to the blockchain, they receive a set number of newly created tokens. 

In this mining process, transaction fees are applied and new tokens are created.

One of the major concerns around mining is environmental impact. The Cambridge Center for Alternative Finance produces the Cambridge Bitcoin Electricity Consumption Index. Here is an academic study that attempts to measure “The Carbon Footprint of Bitcoin.”