## Mining cryptocurrency can be a lucrative endeavor with enough computing power

Mining cryptocurrency is in the news a lot lately. People are finding their computers have been compromised by malware and are mining, or in some cases entire botnets are mining. But what does that mean?

This isn’t mining in the traditional sense. There are no pick axes or canaries involved. Instead. it’s more about trying to win a blockchain lottery to earn the reward at the end.

What does that all mean? Let’s hash it out.

## What is cryptocurrency?

To begin a discussion of mining cryptocurrency we need to start with what cryptocurrency is. Cryptocurrency is a digital form of currency with a cryptographic underpinning that is used as a secure medium of exchange. There are literally hundreds of different cryptocurrencies with varying real-world values. Many believe it’s the future of currency.

The most popular cryptocurrency is bitcoin, you may have heard of others like Etherium, too. While cryptocurrencies may differ in terms of the algorithms and encryption they use, they all share one similiarity: blockchain. And that’s what we need to talk about next.

## What is blockchain?

Blockchain is a digital ledger of transactions that is impossible to alter. It uses hashing and a concept similar to salting to continuously complete blocks of information that chain to form an immutable ledger.

Hashing is the act of mapping data of any length to a fixed-length output. When cryptography is involved it’s a one-way function. The most popular hashing algorithm is SHA-256, which outputs at a length of 256 bits. Every hash value is unique. Even the tiniest alteration to the data being hashed caused the entire value to change.

Hashing is considered one-way because of the amount of computing power it would take to reverse-hash it. For a 256-bit output, calculate 2 to the power of 256 (2 X 2 X 2… 256 times). Your odds of finding the correct value are 1 in… the product of that equation. Those are astronomical odds. It would take a supercomputer thousands of years to compute that.

## Blockchain + Cryptocurrency

Now let’s fit it all together. With a cryptocurrency blockchain, as transactions occur they are broadcast and added to various private ledgers. Each one of these transactions is digitally signed for the sake of authenticity. On the other end, there are people or groups collecting these transactions and building ledgers. They are also computing to find a value that when hashed along with the ledger, produces a set number of 0s at the beginning of the hash value. That’s the portion that’s similar to salting.

So let’s say that for our example cryptocurrency, we’ve set the total to 10 0s. That means the first 10 spots of the 256-character hash value should all be 0s.

When the correct value is found, the block is closed, it’s broadcast officially and added to everyone’s blockchain, then the hash of the old block is put atop the new ledger and the process begins again. This is how blocks are created in the chain.

## So, what is mining cryptocurrency?

The act of computing the correct value to satisfy the hash function in blockchain is called mining. When it comes to cryptocurrency, a reward is provided to whoever solves for the correct value. That makes it lucrative to compute the correct value, though it takes quite a bit of power to accomplish that.

Oftentimes people pool their computing power together and split the reward if they solve for the correct value. In other cases, hackers have been known to co-opt others computers and use some of their computing power – behind the scenes – to mine cryptocurrency. There are entire botnets doing nothing but mining.

Really, solving for the correct value is like winning the lotto. There are countless people and botnets attempting to find the value and whoever finds it first gets the reward.

Of course, if you can accumulate enough computing power you could solve for the value enough of the time that you could accrue a substantial amount of cryptocurrency.

## Wrapping Up

When someone says “mining cryptocurrency” what they’re referring to is the act of trying to compute a specific hash value by producing a set value that, when hashed along with the block ledger, produces a specific result. This requires considerable computing power, but considering the rewards – it’s well worth it.

## What we Hashed Out (for Skimmers)

Here’s what we covered in today’s discussion:

- Blockchain is an immutable ledger of digital transactions
- Cryptocurrency is a digital currency that is a secure medium of exchange
- Mining cryptocurrency is computing a specific value that produces a specific hash result and completes a block on the blockchain

## Rod Smith

8 November 2017 at 20:10

I don’t understand the comment “When it comes to cryptocurrency, a reward is provided to whoever solves for the correct value.” Where does the reward come from. Who creates it, and controls the distribution of it. And why is there even a reward in the first place.