Cryptocurrency Mining For Dummies
Book image
Explore Book Buy On Amazon
Cryptocurrency mining involves the addition of transactions to a blockchain by a crypto miner. But, it’s a bit more complicated than that. Take a look at decentralization and discover the role of the crypto miner.

Understanding decentralized currencies

Cryptocurrencies are decentralized — that is, no central bank, no central database, and no single, central authority manages the currency network. The United States, for example, has the Federal Reserve in Washington, the organization that manages the U.S. dollar, and European Central Bank in Frankfurt manages the euro, and all other flat currencies also have centralized oversight bodies.

However, cryptocurrencies don’t have a central authority; rather, the cryptocurrency community and, in particular, cryptocurrency miners and network nodes manage them. For this reason, cryptocurrencies are often referred to as trustless. Because no single party or entity controls how a cryptocurrency is issued, spent, or balanced; you don’t have to put your trust in a single authority.

Trustless is a bit of a misnomer. Trust is baked into the system. You don’t have to trust a single authority, but your trust in the system and fully auditable codebase is still essential. In fact, no form of currency can work without some form of trust or belief. (If nobody trusts the currency, then nobody will accept it or work to maintain it!)

In the trustless cryptocurrency world, you can still trust the cryptocurrency community and its mechanisms to ensure that the blockchain contains an accurate and immutable — unchangeable — record of cryptocurrency transactions. Cryptocurrencies are established using a set of software rules that ensure that the system can be trusted, and the mining process is part of this system that allows everyone to trust the blockchain.

Cryptocurrencies have no central bank printing new money. Instead, miners dig up new currency according to a preset coin-issue schedule and release it into circulation in a process called mining.

So why is the process called cryptocurrency mining?

When you compare cryptocurrency mining to gold mining, the name becomes clear. In both forms of mining, the miners put in work and are rewarded with an uncirculated asset. In gold mining, naturally occurring gold that was outside the economy is dug up and becomes part of the gold circulating within the economy.

In cryptocurrency mining, work is performed, and the process ends with new cryptocurrency being created and added to the blockchain ledger. In both cases, miners, after receiving their reward — the mined gold or the newly created cryptocurrency — usually sell it to the public to recoup their operating costs and get their profit, placing the new currency into circulation.

The cryptocurrency miner’s work is different from that of a gold miner, of course, but the result is much the same: both make money. For cryptocurrency mining, all of the work happens on a mining computer or rig connected to the cryptocurrency network — no burro riding or gap-toothed gold panners required!

The role of the crypto miner

Cryptocurrency miners add transactions to the blockchain, but different cryptocurrencies use different mining methods, if the cryptocurrency uses mining at all. (Most cryptocurrencies don’t use mining.) Different mining and consensus methods are used to determine who creates new blocks of data and how exactly the blocks are added to the blockchain.

How you mine a particular cryptocurrency varies slightly depending on the type of cryptocurrency being mined, but the basics are still the same: mining creates a system to build trust between parties without needing a single authority and ensures that everyone’s cryptocurrency balances are up-to-date and correct in the blockchain ledger.

The work performed by miners consists of a few main actions:
  • Verifying and validating new transactions
  • Collecting those transactions and ordering them into a new block
  • Adding the block to the ledger’s chain of blocks (the blockchain)
  • Broadcasting the new block to the cryptocurrency node network
The preceding cryptocurrency mining process is essential work, needed for the continued propagation of the blockchain and its associated transactions. Without it, the blockchain won’t function. But why would someone do this work? What are the incentives for the miner?

The bitcoin miner actually has a couple of incentives (other cryptocurrencies may work in a different manner):

  • Transaction fees: A small fee is paid by each person spending the cryptocurrency to have the transaction added to the new block; the miner adding the block gets the transaction fees.
  • Block subsidy: Newly created cryptocurrency, known as the block subsidy, is paid to the miner who successfully adds a block to the ledger.
Combined, the fees and subsidy are known as the block reward. In Bitcoin, the block subsidy began at 50 BTC. (BTC is the ticker symbol for bitcoin.) The block subsidy at the time of writing was 12.5 BTC. The block subsidy is halved every 210,000 blocks, or roughly every four years; around May 2020 it halved again to 6.25 BTC per block.

The image below, from the BlockChain.com blockchain explorer, shows a block subsidy being paid to an address that is owned by the miner who added the block to the blockchain. Near the top you can see that 12.5 BTC is being paid as the subsidy; the actual sum received by the miner (the full reward, 13.24251028 BTC) is larger, because it also includes the transaction fees for all the transactions in the block.

cryptocurrency mining transactions A transaction showing the block subsidy and transaction fees being paid to a miner, from the BlockChain.com blockchain explorer.

Making cryptocurrency trustworthy

For a cryptocurrency to function, several conditions must be met by the protocol. Jan Lanksy’s 6-factor list is particularly helpful. (Jan is a cryptocurrency academic and PhD of Computer Science and Mathematics at The University of Finance and Administration in Prague). As can be seen, below, mining (in the mineable cryptocurrencies, non-mineable currencies have different mechanisms) is an integral part of making sure these conditions are met.
  • The system doesn’t require a central authority and is maintained through distributed consensus. That is, everyone agrees on the balances associated with addresses in the blockchain ledger. Mining is an integral part of adding transactions to the blockchain and maintaining consensus.
  • The system keeps track of cryptocurrency units and their ownership. Balances can be proven at any point in time. Mining adds transactions to the blockchain in a way that becomes immutable — the blockchain can’t be changed. If the blockchain shows your balance is five bitcoin, then you absolutely do own five bitcoin!
  • The system defines whether new cryptocurrency units can be created, and, if so, the system defines the circumstances of their origin and how to determine the ownership of these new units. A fixed issuance or inflation rate is predefined. Mining provides a way to release new cryptocurrency into circulation at a predetermined, controlled rate, with ownership being assigned to the miner.
  • Ownership of cryptocurrency units is proved through cryptography. The three conditions of authenticity, nonrepudiation, and immutability are met, through the use of cryptography. Miners, using cryptography, verify that transaction requests are valid before adding them to a new block. The miner verifies that the transaction request is for a sum that is available to the owner of the crypto, that the owner has correctly signed the request with his or her private key to prove ownership, and that the receiving address is valid and able to accept the transfer.
  • The system allows transactions to be performed in which ownership of the cryptographic units is changed. Transactions can be submitted only by senders who can prove ownership of the cryptocurrency being transferred. Cryptocurrency owners prove ownership by signing transactions using the addresses associated private key. Mining is the process through which transactions are accomplished, and miners verify ownership before adding the transaction to the blockchain.
  • If two different instructions for changing the ownership of the same cryptographic units are simultaneously entered, the system performs at most one of them. There is no ability for someone to double-spend the same unit. The problem of double-spending was one that weakened earlier digital currencies. But with modern cryptocurrencies, miners vet transactions, searching the blockchain record of transactions to determine whether the owner actually has sufficient balance at that moment. If a sufficient balance isn’t accounted for within the spend address (the Input address) in the transaction request, the transaction will be rejected by the node software and never mined onto the blockchain. Also, if the same sender has two or more pending transaction requests, but doesn’t own enough cryptocurrency to cover them all, miners can decide which of the requests is valid. Additional transactions will be discarded to avoid double-spending the same currency.

If even one of these six conditions aren’t met, a cryptocurrency will fail because it can’t build enough trust for people to reliably use it. The process of mining solidifies and satisfies every single one of these conditions.

The Byzantine Generals

There’s a mind exercise known as the Byzantine Generals Problem (or the Byzantine Fault, the error avalanche, and various other things) that illustrates the problem that cryptocurrency consensus algorithms seek to solve.

The overall problem? You’re trying to reach consensus; in cryptocurrency, you’re trying to reach agreement over the history of currency transactions. But in a cryptocurrency network, a distributed computer system of equals, you have thousands, maybe tens of thousands of computers (nodes); in the Bitcoin network you currently have 80,000 to 100,000 nodes.

But out of those tens of thousands of systems, some are going to have technical problems; hardware faults, misconfiguration, out-of-date software, misfunctioning routers, and so on. Others are going to be untrustworthy; they’re going to be seeking to exploit weaknesses for the financial gain of the people running the node (they are run by “traitors”). The problem is that for various reasons, some nodes may send conflicting and faulty information.

So someone came up with a sort of parable or metaphor, the Byzantine Generals Problem. (A guy named Leslie Lamport Shostak first told this story back in 1980, in a paper related to general issues of reliability in distributed computer systems.)

Originally named the Albanian Generals Problem, it was renamed after a long-defunct empire so not to offend any Albanians! Apparently distributed-computing academics like to sit around and devise these little metaphors; there’s the dining philosopher’s problem, the readers/writers problem, and so on. In fact the Byzantine Generals Problem was derived from the Chinese Generals Problem.

Anyway, the idea is this, as described in the original paper:

“We imagine that several divisions of the Byzantine army are camped outside an enemy city, each division commanded by its own general. The generals can communicate with one another only by messenger. After observing the enemy, they must decide upon a common plan of action. However, some of the generals may be traitors, trying to prevent the loyal generals from reaching agreement. The generals must have an algorithm to guarantee that A. All loyal generals decide upon the same plan of action….[and] B. A small number of traitors cannot cause the loyal generals to adopt a bad plan.”

That’s the problem that cryptocurrency consensus algorithms, as they’re known, are trying to solve. How do the generals (the computer nodes) come up with consensus (all agree on the same plan of action—or transaction ledger), and avoid being led astray by a small number of traitors (faulty equipment and hackers)?

Looking at the cryptocurrency miner

To have a chance at the mining reward, crypto miners must set up their mining rigs (the computer equipment) and run that cryptocurrency’s associated mining software.

Depending on how many resources the crypto miner is committing, he or she will have a proportional chance to be the lucky miner who gets to create and chain the latest block; the more resources employed, the higher the chance of winning the reward. Each block has a predetermined amount of payment, which is rewarded to the victorious miner for their hard work to spend as they wish.

So how is the winning miner chosen? That depends. In most cases, one of two basic two methods are used:

  • Proof of work: Under the proof of work method, the miner has to carry out a task, and the first miner to complete the task adds the latest block to the blockchain and wins the block reward, the block subsidy and transaction fees. Bitcoin and other cryptocurrencies, such as Ether (for now, it may switch to Proof of Stake at some point), Bitcoin Cash, Litecoin, and Dogecoin, use proof of work.
  • Proof of stake: In the proof of stake system, the software is going to choose one of the cryptocurrency nodes to add the latest block, but in order to be in the running, nodes must have a stake, generally meaning that they must own a certain amount of the cryptocurrency. The cryptocurrency network chooses the miner who will add the next block to the chain based on a combination of random choice and amount of stake — for example, with some cryptocurrencies, the more cryptocurrency owned and the longer it has been owned, the more likely the miner is to be chosen. (It’s like owning lottery tickets; the more you own, the more likely you are to win.) With other cryptocurrencies, the choice is made sequentially, one by one, from a queue of preselected miners.
When Bitcoin first started, anyone with a simple desktop computer was able to mine. The would-be miner simply downloaded the Bitcoin mining software, installed it, and let the BTC roll in! As time went on, though, competition increased.

Faster and more powerful computers were built and used for mining. Eventually, specialized processing chips called Application Specific Integrated Circuits (ASICs) were developed. An ASIC, as the name implies, is a computer chip designed for a specific purpose, such as displaying high-resolution graphics quickly, running a smartphone, or carrying out a particular form of computation.

Specific ASICs have been designed to be highly efficient at the forms of computation required for cryptocurrency mining — for example, for Bitcoin mining. Such a chip can be 1,000 times more efficient at Bitcoin mining than the chip in your PC, so in today’s Bitcoin mining environment, it’s go ASIC or go home!

For high-difficulty cryptocurrencies, such as Bitcoin, the ideal mining environment is one with:

  • Low hardware costs: Those mining rigs aren’t free.
  • Low temperatures: Lower temperatures make cooling your mining rigs easier.
  • Low electricity costs: Mining rigs can use a lot of power.
  • Fast, reliable Internet connections: You need to be communicating with the cryptocurrency network rapidly with minimal downtime because you’re in competition with other miners.
Fear not, though! With many different copies and mimicry of Bitcoin running rampant, Bitcoin is no longer the only game in town, and you can find lots of alternative mining choices, with varying levels of required computing power. Today, some of the most profitable cryptocurrencies to mine are lesser known and can be mined using off-the-shelf computer hardware due to less stringent difficulty levels that are associated with lower popularity and adoption.

Currently, a large portion of the global cryptocurrency mining takes place in China, at perhaps three times the rate of the next closest nation (the United States). A combination of cheap electricity and easy access to cheap computer components for building mining rigs gives China an edge that Chinese miners have leveraged and so far, maintained, even with their government’s apparent disapproval of cryptocurrencies.

This is a testament to how resilient and difficult to shut down distributed cryptocurrency systems such as Bitcoin are.

Making the crypto world go ’round

A cryptocurrency has value because a large number of people collectively believe that it does. But why do they believe cryptocurrency has value? The answer is trust.

A holder of Bitcoin can trust that their Bitcoin will be in their wallet a day from now or 10 years from now. If they want to research how the system works, they can audit the code base to understand the system on a deeper level to see how trust is maintained.

However, if they do not have the skillset or the computer science knowledge to audit code, they can choose to trust that other people, more knowledgeable than them, understand and monitor the system; they can trust the overall blockchain community that is managing the particular cryptocurrency.

Without the mining functionality underpinning the distributed peer-to-peer cryptocurrency system, this collective trust (based on the proof of collective work towards the chain) would not exist.

Cryptocurrency mining makes sure that your balances won’t change without your authorization. It incentivizes everyone to behave correctly and punishes those who don’t. It creates a digital form of value transfer that can be trusted by each individual user as an equal peer in the network because every part of the system is aligned for one purpose: providing a secure way to create, verify, and transfer ownership of digitally scarce cryptographic units.

About This Article

This article is from the book:

About the book authors:

This article can be found in the category: