What is network difficulty?

It is intuitive to most cryptocurrency miners that when more people join the mining operation, less reward is paid to each participating miner.

It seems logical that it should work this way, but how exactly does this get implemented in Bitcoin and other cryptocurrency Proof of Work protocols?

In this article we take a brief look at cryptocurrency network difficulty and how it determines how much each miner might make, should they solve a block.

What does solving a block actually mean?

First things first: what does it mean to “solve a block“? What is it that miners work for after all? The answer to these questions lead us directly to the concept of difficulty.

Let’s have a look.

Miners basically run one repetitive operation over and over again, changing just one or a few parameters which we call nonces with every repetition, hoping that the next nonce attempted will produce a hash, which is a cryptographic “summary” of the block, that has a certain number of zeroes in front of it.

Why do we want zeroes in front of a cryptographic hash?

Because it’s a numerical way to make finding that hash as hard or as easy as we want it to. It’s all based on probability theory.

Here’s how it works.

Number Systems

If you have a number made up of 5 digits, how many different 5 digit numbers can you compose using the decimal system?

It’s easy math, for each position on the 5 digit number we can use 10 different  numbers from the decimal system.

So for the first digit we can use 0 to 9, for the second digit we use 0 to 9 again, and so on. From the fundamental counting principle, if we have 10 options and want to combine them with 10 other options, we get 100 total combinations.

If we do this for 5 digits we get total 10 x 10 x 10 x 10 x 10 combinations.

Why do we multiply by 10? Because we’re working with the decimal system, of course!

What if we were working with cryptographic hashes instead where the base is 16 and not 10?

Each digit could then have 16 values and not 10. The zero byte then would be one in 16 instead of one in 10. In a hexadecimal system, the amount of 5 digit numbers we would be able to compose is 16 x 16 x 16 x 16 x 16 – which is a LOT larger than the same logic performed in the decimal system.

Computers use the hexadecimal system, because it is a power of 2.  Working with powers of two is required in a system that is based on binary logic.

Computer numbers are all represented by zeroes and ones, which are the two possible values in a binary system, therefore we always work with powers of 2 deep down when programming cryptographic algorithms.

Difficulty Calculation

So what does it mean when we require a hash to have a certain number of zeroes in front of it?

It means that the probability of each zero showing up in front of the hash is one in 16 possibilities. It just so happens that computers work with bytes, which are two hexadecimal numbers next to each other.

Which makes each position on a hash to have a total of 256 possible values (16×16)! So the probability of each byte in a hash being zero is one in 256.

If we require three zeroes in front of a hash, then we require 256 x 256 x 256. This number is proportional to the difficulty! When we say we need a certain number of zeroes in a hash, we’re actually determining how difficult it is for miners to find a hash that has that many zeroes.

To find a hash that has 10 zeroes in front of it, means a difficulty of one divided by 256 x 256 x 256 x ….. x 256 ten times over. It’s a HUGE number and it is exponential as you can see, based on powers of 256.

Network Difficulty

The Bitcoin network is made up of P2P nodes talking to each other.

Mining pools lead the network since they accumulate the greatest computing power. Mining pools know how much computing power is sending them work in a proof of work system, because they’re able to estimate the number of attempted hashes from each participant based on the work the participants sends in. Based on the amount of computing power they calculate, they must readjust the difficulty to assure that a bitcoin block will be found approximately every 10 minutes.

So the network difficulty is the difficulty calculated in the above method of powers of 256 that is communicated to all nodes. Every miner in the Bitcoin network receives a signal with the difficulty of the current block. From the difficulty, the miners can calculate how many zeroes are needed in front of each hash, it’s a direct conversion from number of zeroes and vice-versa.

We hope this article has helped clarify the concept of network difficulty and how it relates to Bitcoin mining. In fact, this same system applies to all proof of work schemes, including Ethereum, Dogecoin, Litecoin and other PoW based cryptos.

About the Author
Published by Crypto Bill - Bill is a writer, geek, crypto-curious polyheurist, a dog's best friend and coffee addict. Information security expert, encryption software with interests in P2P networking, decentralized applications (dApps), smart contracts and crypto based payment solutions. Learn More About Us