Cryptocurrency - The Wasted Potential of the Hash
Given that you are currently browsing Steemit, I am willing to wager that most of you have some firsthand experience with crypto-currencies. Maybe you have traded them, or made some investments. Some of you may be familiar with the concept of the blockchain which underlies every crypto-currency. A few of you will have mined your own! But, have you ever stopped to wonder how crypto-currency tokens, or coins, are actually generated behind the scenes?
To understand what mining is in this context, we first need to talk about hashing. A hashing algorithm turns some large set of data into a fixed length hash using the compute power of the miner's machine. The same hash will always result from the same data, which means a third party can verify any hash by repeating the calculation. However, modifying the input data by even a single bit (the unit element of data - either a 1 or a 0) will change the output hash completely.
Having gotten that out of the way, at its most basic level classic crypto-currency mining happens as follows:
While your computer is mining, it creates a block of data which contains the transaction ledger for the coin being mined, as well as a transaction to pay itself a mining bonus. The computer will then hash this data block. If the value of the output hash is lower than a number defined by the mining difficulty, the next block in the blockchain is added and the miner is paid.
More than likely, the resulting hash is not less than the number defined by the mining difficulty. The miner's computer responds by incrementing a random number in the block being hashed without altering the data contained within the block. This random number is called a 'nonce'. The miner's machine will then hash the block again.
Once a block is mined and added to the blockchain, all the miners will start to hash the new block.
This process will continue, but with a twist. Every X number of blocks mined, the difficulty is changed. If the last Y blocks were mined too quickly the difficulty is raised so that successful hashes need to be even smaller. Conversely, if the last Y blocks were mined too slowly, the difficulty may be reduced. A coin may also specify other rules as to how the difficulty will be changed during the lifecycle of the coin.
As a result of this system, as miner A dedicates more compute power to mining a coin, miner B will need to increase their compute power proportionally to keep up. Yet, the net gain for either miner relative to their previous state is zero - they are still mining coins at the same rate as before. Consequently, we are seeing rapid growth in the collective hashing power of the bitcoin mining network.
On the 3rd of June 2017, the Bitcoin mining network (by far the largest mining network in existence) broke a record 5.5 Exa-hashes per second. Let that sink in for a minute.
5.5 Exa-hashes per second is 5.5x1018 (or five and a half quintillon) hashes per second. Other than mining Bitcoin, every single one of those calculations was utterly worthless, and added noting of intrinsic value to society. However, to properly appreciate these wasted calculations we are going to have to take a detour and compare hashes to FLOPS.
FLOPS stands for Floating Point Operations Per Second, meaning that they are calculations done with decimal numbers. FLOPS are a standard measure of compute speed for pretty much everything other than mining cryptocurrency. Meanwhile, hashes involve only integer operations (they only do calculations with whole numbers). As a result, any comparison between a hash rate and FLOPS is an approximation at best. We are going to make such an approximation:
Let's take a relatively standard piece of Bitcoin mining hardware, the AMD Radeon HD 5970, which according to the Bitcoin Wiki outputs roughly 740 MH/s. We can get its compute rate from the AMD GPUs Wikipedia page as a relatively humble 4640 GFLOPS. Dividing the FLOP rate by the hash rate gives us a factor of 6270 FLOPS per hash. This means our 5.5 Exa-hashes before can be approximated as roughly 3.5x1022 FLOPS. The world's fastest supercomputer (that is not locked away in some secret military compound) is the Sunway TaihuLight, which 'only' reaches speeds of 93 PFLOPS, or 9.3x1016 FLOPS. The combined compute power of the (known) top 500 supercomputers in the world is 'only' about 1 Exa-FLOP, or 1018 FLOPS.
Let's put that in perspective. All the compute power of the top 500 supercomputer clusters today would represent less than 0.01% of all the Bitcoin mining operations worldwide. The sheer degree of what is happening is not being appreciated by the press, nor government or most private citizens. To take this idea a step further, if ALL the world's university and research institutions were to turn off everything they are doing right now, and point the collective sum of their research compute power at the Bitcoin network, they would make up less than 0.3%...
But why am I telling you all this?
Cutting edge research in most modern scientific fields now involves large quantities of computational science, which is the fusion of algorithms, computer science, and compute infrastructure. Every day, the science community understands and documents more of the mathematical laws that govern the universe as we know it. We can write the algorithms. We can apply computer science to use and optimise the hardware. But what does modern research lack?
Hundreds of thousands of researchers in innumerable fields will be meeting compute roadblocks over and over in their careers. This isn't just limited to a few scientific subfields. It includes disease research, material science, polymer research, astronomy, even art! We have a professor at my university who has written software that can reliably detect fakes vs true works of many great masters with incredible accuracy. It boils down to a massive compute problem. The scope of potential research applications is immense - this research ledger for the Titan Supercomputer demonstrates what just one machine can work on:
If we pretend for a moment that ASICs were not a thing, and we could point the collective power of the crypto-currency mining networks at the betterment of humanity, it is unimaginable what could be achieved. Right now, as you are reading this, there are cures for AIDS being developed. Cures for cancer. Drugs to fix genetic abnormalities. Can you guess the underlying problem all of them are facing right now? They are waiting on computations to complete.