If you are a PC gamer looking to upgrade your gaming hardware or you are planning to build a gaming PC from scratch, you may have noticed that graphics processing units (GPUs) have been in very short supply lately. Even if you are fortunate to have found one, chances are its price has nearly doubled. The reason? Cryptocurrency miners have been snatching them up in bulk as soon as they hit the market.
Why do crypto miners need GPUs? Crypto mining has become an escalating computer arms race as miners compete to be the first to validate data transactions in blockchains by solving complex math problems, with crypto coins awaiting them as a reward if they succeed. Because it is a winner takes all proposition, miners are turning to GPUs to provide the raw processing power they need.
In this article, we will do a deep dive into crypto mining, where the worlds of cryptocurrency, high-level encryption, and sophisticated computer processing collide. These are complicated subjects, but we will break them down so that you can better understand the unique challenges that face crypto miners today and how GPUs became their most valuable tool.
What is Cryptocurrency Mining, and Why do You Need a GPU to Mine Crypto?
The cryptocurrency that started the mining craze was Bitcoin in 2009. As the gold standard of crypto, thus far in 2020, Bitcoin is trading at around $6,000 per coin and currently rewards its miners 12.5 bitcoin, which equals a $75,000.00 payday. So why isn’t everybody mining? To put it simply, because it is very, very difficult – and it was designed to be this way.
As the name suggests, successful mining results in the creation of new crypto coins that are awarded to successful miners. Mining is the only way that certain crypto tokens (e.g., Bitcoin) enter circulation. Not all cryptocurrencies can be mined, such as ones that pre-release all their coins as part of an initial coin offering (ICO). These are known as proof of stake crypto.
Cryptocurrencies that can be mined, such as Bitcoin, Litecoin, and Ethereum Classic, are known as proof of work cryptos. It can be argued that miners perform a function that is the very backbone of proof of work cryptocurrency – peer to peer validation of transactions. Without the efforts of miners, cryptocurrency transactions such as buying crypto or paying someone with crypto, could not be verified and recorded.
Understanding the Crypto in Cryptocurrency
Regardless of the cryptocurrency or the operating model, all crypto relies on cryptography (the art of encoding and decoding data) to record transactions and secure the network. It is like a secret code that requires complex math to both write the encrypted data and also to decode or decrypt the same data.
Each time a transaction occurs on a crypto network – for instance, when someone purchases or transfers crypto, or pays for something with crypto – the transaction must be validated and then recorded. What is so unique about proof of work crypto is that the responsibility of verifying and entering these transactions falls on the shoulders of miners. This is done through a system called a blockchain.
A blockchain is a system of organizing data that, in the case of crypto, serves as a community ledger of all transactions that occur on the network. Hundreds of transactions are grouped into a block, which, when validated, is added to the end of a string of already verified blocks. Anyone with a computer can access this ledger, and millions of people can have possession of the ledger and its contents at the same time.
This means that it would be incredibly challenging, if not impossible, to hide a fraudulent transaction in this ledger because it is always out in the open. Furthermore, it would be equally difficult for a hacker to attempt to change or modify an existing transaction because of the way that a blockchain works. To change one block’s data, all previous blocks must be changed as well because they are all linked.
One of the unique and ingenious features of the blockchain system is that the purpose of the blocks is not just to store transaction data but also to provide a directory of its contents to make searching easier. Also, each block contains unique codes that are necessary to create additional blocks. What makes a blockchain so effective as a recordkeeping technology is the use of encrypted hashes.
What is a Hash?
A hash is a mathematical operation that takes an input and produces an encrypted output. The hash is a vital part of the blockchain because it enables one data block to be linked to the next data block in such a way that the link cannot be broken, changed, or manipulated. Hashes are so complex that they require computers to generate and solve them.
Here is how a hash works:
- The input can consist of virtually any amount of alphanumeric characters. In the case of crypto, this usually includes the transaction timestamp, the transaction details (e.g., parties’ keys and amounts), a unique block identifier, a directory, and an encrypted hash for the previous block.
What is important (and you are about to see why in a moment) is that the size of the input does not affect the size of the output. In other words, an input of 10 characters will generate the same length output as an input of one million characters.
- A hash is a function, meaning a process (always performed on a computer) that takes the input data and runs specific mathematical equations on the data. Once this operation is completed, the hash will generate the output, which is an encrypted string of letters and numbers of fixed length.
This is not a random process. In other words, the purpose of the hash is not to convert each input into a random string of characters. The hash generates an output that is unique and specific to each input. If you enter the same input five times, you will get the same output every time. Also, if you ran the unencrypted output back into the hash, you would see the input.
- The output is a string of letters and numbers that are generated when input is hashed. Crypto hashes produce outputs of fixed length. Whether the input was one word or the entire text of the U.S. Constitution, the output will always be the same number of characters (albeit different characters).
What is also interesting is that even the slightest change to the input will result in a completely different output. This feature plays a significant role in discouraging would-be hackers from attempting to alter blockchain data in a crypto network.
To illustrate, here are several actual inputs and the outputs that result when they are hashed using an online hash calculator:
|Hashing is so fun.||d0801ffb2e878d1f5c792b9ecf67fcce|
|I could do this all day every day.||1d172c49d739d52fc58f0297978d9402|
(This particular hash is known as “md2” and is one of the simpler ones. As you can see, regardless of the length of the input, the output always consists of 32 characters. In the first two examples, merely adding the exclamation mark to the end of “Hello” completely changed the hashed output.)
This illustrates how difficult it would be to alter or manipulate the contents of a block because even the slightest change would result in a completely different output, which would certainly catch the attention of someone on the crypto network who has a copy of the communal ledger.
SHA-256 – This may be the most famous hash ever created, as it is the one that is used by Bitcoin in its blockchain. It was developed by the U.S. National Security Agency in 2002 and later published. It stands for Secure Hash Algorithm, and it is 256 bits, which means that it produces an output of 64 characters (versus 32 in our example).
What is a Nonce?
You have now seen how encrypted hashes can be so useful in securing sensitive data in a cryptocurrency network. There are additional security measures to protect vital information in each block further. In addition to encrypted hashes, each block also contains a nonce which stands for “number only used once.”
Unlike an encrypted hash that produces a particular result that corresponds to a specific input (i.e., NOT random), a nonce is a randomly generated string of numbers that are added to the hashed contents of a block.
The nonce, together with the already hashed block data, is then hashed again. This added layer of encryption further strengthens the security of not only the sensitive information stored in the data, but since every block is constructed the same way and they are linked to each other, it is like a chain of impenetrable fortresses.
Putting it all Together – The Vital Role of GPUs in Crypto Mining
So, where do GPUs fit into all of this? Think of crypto mining as a series of extremely tough challenges consisting of extraordinarily complex math problems. The only tool that the miner has at their disposal is a computer.
The faster and more powerful the computer, the better the miner’s chances of overcoming the challenges and being the first to solve the problems and claim the block and its crypto coin reward.
Each block contains a target hash, which includes the requirements for “solving” the block. Ultimately, the miner can solve the problems and produce a hash that, when compared to the target hash, satisfies all the conditions.
The Challenges Facing Crypto Miners
Remember the nonce? The first challenge facing the crypto miner is to guess the nonce correctly. Since it is a random string of numbers, there is no way to calculate the nonce. It must be guessed, which means that it will be a repeating process of trial and error until the correct one is found.
Guessing the correct nonce is only the first step of validating a block. The nonce must be added to the hash of the block and then together re-hashed. It is this result that is compared to the target hash to see if all the conditions are met. If not, then the process starts all over again.
Now imagine that there are thousands, perhaps upwards of a million, crypto miners worldwide all trying to solve the same problems to earn the same crypto coin rewards. The competition is extremely stiff, and it all boils down to how quickly nonces can be guessed, added to hashes, then re-hashed and compared to the target hash, then repeating this process until the matching hash is produced.
The Key to Crypto Mining Success? Computing Speed and Power
Whether for work or leisure, we all rely on computers to get things done. At the heart of every computer is its CPU or central processing unit. The CPU performs tasks very rapidly. It follows instructions, performs calculations, or responds to input. For example, the CPU of the computer on which this article was written laid out each character on this page as it was typed on the keyboard.
CPUs are fast and efficient. In most cases, tasks or calculations are performed within microseconds. For everyday purposes, CPUs are more than capable of handling most computing needs. But crypto mining is a different animal, and CPUs are simply not up to the task.
What is the Difference Between a GPU and a CPU?
Whereas CPUs are best suited for straightforward, everyday tasks like word processing, surfing the web, and other types of standard computing, GPUs are ideal for scenarios calling for more complex tasks. A GPU can be thought of as a highly specialized version of a CPU. The way that CPUs and GPUs differ can be best analyzed by examining the way that they perform their jobs.
Serial Processing vs. Parallel Processing
A typical CPU has one to four processors, which are the actual processing units that perform the CPU’s work. Modern CPU processors are speedy and versatile. Their only limitation is the fact that they perform serial processing, which is to say that each processor performs one task at a time, in the order that the task was given. In other words, CPUs perform work sequentially (one after the other).
In contrast, a GPU utilizes parallel processing where a great many processors work in tandem with each other to perform a high number of tasks simultaneously. These processors can communicate with each other and can access the same data or memory banks, making them very efficient and cohesive.
GPUs were initially developed for graphics applications like video games, computer animation, and, more recently, artificial intelligence. These programs require a tremendous number of processes to be performed at the same time and in perfect unison for them to work correctly. Otherwise, computer animation would appear choppy, and video games would always freeze.
The Power of Parallel Processing Applied to Crypto Mining
For these reasons, GPUs are ideally suited for crypto mining. As we have discussed, the key to successful mining is churning out hashes as quickly as possible to compare against the target hash and repeating this process until the target conditions are satisfied. These highly repetitive tasks that are performed simultaneously are perfect for GPUs.
Whereas a CPU may have up to four “cores” (processing units), high-end GPUs can have over 4,000 cores. With all of these processors hashing out potential solutions to the target hash in rapid-fire succession, one after the other and at lightning speeds, one can understand why crypto miners are willing to invest thousands of dollars in upgrading their computers to the latest GPU technology.
(Take, for example, this new release which is touted as the latest-generation GPU for hardcore PC gamers, and features 4,352 processors.)
Why Are Crypto Miners Buying Graphics Cards?
Although the terms are often used interchangeably, there is a distinct difference between a GPU and a graphics card. The GPU is a circuit that is integrated into the graphics card. The graphics card is the complete structure that includes the GPU, a memory bus (which is needed for the CPU to communicate with the graphics card), and other components.
Graphics cards consume a large amount of electricity and generate a tremendous amount of heat. For this reason, larger graphics cards have built-in fans to cool the delicate circuitry as they perform their work.
The functionality of graphics cards is such that they can be easily added to mining rigs (computer systems designed specifically for crypto mining) and can be stacked one in front of the other for massive computing firepower.
The Future of Crypto Mining?
An interesting feature of Bitcoin and other proof of work cryptocurrencies is that they are limited release crypto. In other words, the number of coins that will ever be issued has been predetermined. Additionally, Bitcoin, Litecoin, and a few other cryptocurrencies periodically halve their rewards.
Will this force crypto miners to seek alternate sources of income and reduce their numbers? Or will it lead to greater resourcefulness and innovation in computing hardware? Not many people gave cryptocurrency a chance of success when it first arrived. Nearly a decade later, its universal value is in the hundreds of billions, so it is safe to say that if there is crypto, there will undoubtedly be miners.
- The Cryptocurrency Forums participates in the following affiliate programs
- Amazon, NordVPN, Ledger Nano Wallets, Satoshi Labs Trezor Wallets, Coinbase Cryptocurrency Exchange, WPX hosting
- All links in this disclaimer and in all TCF content are authentic links to official company pages.
- There are no scams or phishing, redirection or counterfeit page links here. Product links in articles pay us a small commission if used to purchase the items listed. There is no additional cost to the buyer for using these links.