Need help?

Blockchain Basics - Difficulty

We often read and hear about mining difficulty. We know that it also affects mining profitability, but what exactly is difficulty? How and why is it implemented in Proof of Work consensus? Read this article to learn what mining difficulty is.

What is crypto mining difficulty?

To understand what difficulty is, one must first understand how proof of work works and what problems it solves. We already explained that in this article.

Proof of Work solves a double-spending issue where a vicious person (or entity) has a bad intention of spending one Bitcoin twice. To perform double-spending, one must control at least 51% of the network.

To prevent one person from controlling 51% of the network, Proof of Work allows an infinite amount of miners (nodes) to join the blockchain network and thus decentralizing it. But what happens if a lot of miners join or leave the network?

Let’s say, hypothetically, that there are 100 identical miners mining Bitcoin. Each of the miner hashes with 10 TH/s or 1,000 TH/s all combined. This amount of hashing power will statistically guess the block every 10 minutes with a difficulty of 1. This is expected because the Bitcoin network is inclined to 10 minute block time.

If another 100 miners join the network, the hashing power is increased by 2,000 TH/s, which doubles the probability of guessing the block. This would cause a block time to halve to only 5 minutes. This is not okay, because block time should be 10 minutes.

If we increase the difficulty to the value of 2, the difficulty of guessing the correct hash of the block is increased. As a result, the block time is again around the 10 minute mark.

Blockchains adjust the difficulty automatically. For example, Bitcoins difficulty is adjusted every 2,016 blocks or every 2 weeks. Ethereum’s difficulty, on the other hand, is adjusted on every block, or roughly 15 seconds.

Deposit and Withdraw EUR for Free

What exactly is mining difficulty?

As stated above, mining difficulty controls the average block time by increasing the hardness of guessing the next block.

Let’s look at the hypothetical example:

Time to solve the block: 0.236 sec

Type NiceHash in the DATA field and select Difficulty 1 then press the MINE button. Your computer will guess the nonce until the hash output starts with four zeroes. It should take a couple of seconds to solve the problem by finding the correct nonce.

If you change the difficulty level to 2, the computer will guess the nonce until the hash output starts with six zeroes. It should take a bit longer to solve the problem.

Lastly, if you select Difficulty 3, then the computer will guess the nonce until the hash output starts with eight zeros. This will take the longest and will require more computing power.

It is harder to find a hash output with more consecutive zeros. Consequently, the difficulty is increased and more hashing power is needed to guess the correct answer at the same time.

WRITTEN BY
Marko Tarman
Marko is NiceHash's Mining Manager and Content Creator. He started mining back in 2012 before the first ASICs were released. He went from GPU mining BTC, LTC to VTC, and even DOGE. His mining motto: "I've got 99 problems, a bad riser is all of them"