January 24, 2026

Capitalizations Index – B ∞/21M

Target and Difficulty – 손동하 –

Target and Difficulty – 손동하 –

5. Difficulty Bit

Let’s look at the Difficulty and Bits in the picture above. The content involves some mathematical calculations, so you may skip the calculation process after looking at the basic concepts.

First of all, Difficulty indicates the difficulty of mining the block, which is automatically set according to the height of the block. It will be explained later on why the setup is automatic and how it is done.

The Target value that corresponds to the level of difficulty exists, and the Target value is marked as “Bits”. This number is made up of coefficients and index.

We will continue to do mathematical calculations for those who have questions about that number. It would be better to use a hexadecimal calculator to calculate and compare it.

First of all, there will be questions about the relationship between difficulty and the target. The formula in actual code is as follows.

Difficulty = MAX_TARGET / current_target

MAX_TARGET is the ‘first difficulty’, which is the level of difficulty set when the Bitcoin blockchain first run, which means the value of ‘1’ and is written as ‘1d00ffff’ in four bytes.

Mining is the process of finding hash values that are lower than the target value,” he said. So how are ‘current_target’, exactly bits, calculated for comparison with hash value?

Take the picture above, for example.

If you convert the ‘bits’ value of 388618029 to hexadecimal, you will get a value of 0x1729d72d. As I said, Bits are expressed with index and coefficients. The first 1byte is the index, followed by coefficients with 3 bytes. That is, the bits are the index of 0x17 and the coefficient of 0x29d72d. (0x means hexadecimal.)

This results in a form of target value that can be compared with the hash value through the following specific equation.

Target = coefficient * 2 ^ ( 8 * (index — 3) )

If you substitute that value,
0x29d72d * 2 ^ (0x08 * (0x17–0x03) )

If you convert it into decimal form, it is
2742061 * 2 ^( 8 * (23–3) ) 
= 4.0075266411612129867925142360828e+54

Comparable hash values are obtained when converting the values back to hexadecimal.

0x0000 0000 0000 0000 0029 d72d 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000

And when you look at the actual hash value of Block 538695 here,

0x0000 0000 0000 0000 000d 8b40 25c6 3560 88d7 5a7f 3e68 1841 1bab 2b74 8947 dcda

is lower than

0x0000 0000 0000 0000 0029 d72d 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000

which is a target value.

The increase in difficulty can also be seen through other blocks.

The actual target value of the 277316th block is as follows.

0x0000 0000 0000 003A 30C0 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000

and this has fewer 0’s in front compared to the target value of 538695th block which is

0x0000 0000 0000 0000 0029 d72d 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000

This means that the target value is lower and the ‘difficulty’ which is finding a value lower than the target value is higher

It can be said that the longer the Leading Zeros of a certain length of space, the higher the difficulty. Each time you increase the number of zeros by one bit, the search space is halved. In other words, since there are countless and random based cases that can be produced through a hash, but the higher the difficulty, the smaller the number (the value of the target) has to be found. To paraphrase, it is difficult to ‘find items smaller than soccerball’ (= high difficulty, low target value) in a room (= 256-bit hash written space) than in a ‘find items smaller than a refrigerator” (low level, high target value). It is the same concept as using dice as an example.

The higher the difficulty, the lower the target, and in the end, mining is the process of finding the “current block header hash value,” which is lower than the “target value.” Recognizing that ‘block header hash’ is a hash value and therefore is random, you will find out why mining is difficult and why it is random.

6. Nonce

For all of these random processes, the only variable is Nonce. It will come easier to understand the word as ‘number + once’, a number that used once. Nonce starts at zero and increases to countless numbers to find a hash value lower than the price of a target. Eventually, all mining processes are controlled by nonce.

When we look at the structure of the headers, except for the nonce, everything is given. ‘Version’ and ‘Timestamp’ are the values of the moment of mining, ‘Target’ is set automatically, and ‘Previous Block Header hash’ and ‘Merkle Root’ is available by a simple calculation.

The miners prepare a body(actually, transactions) for the blocks they want to mine. As soon as the previous block is completed(‘mined’) and delivered by any node, the (‘previous’) block header hash is calculated and all values of all headers except nonce are prepared. It then attempts to mine by hashing the headers of the current block by changing the nonce value. You might think mining is simple if you just change the nonce, but if you think about the characteristics of a hash function that produces a completely different value, you will know the importance of nonce.

And regardless of the difficulty, even at very high difficulty, you’ll see that mining can succeed in very low numbers, such as ‘2’, in just two instances, to find a hash that satisfies lower value than a particular target value. However, if you knew that the probability was very very very very low, you would have understood mining correctly.

So far, we have been able to look at the structure of the block and understand more accurately the principles of mining accordingly.

By understanding the principles of mining, such questions can be added:

Is the difficulty constant all the time? … then the stronger the hash power, the faster the block can be created and eventually the block can be formed in a second?

With such concerns, Satoshi Nakamoto designed it to automatically adjust the difficulty level. 
Satoshi Nakamoto thought that “1 block in 10 minutes” should be the right level of difficulty, and the difficulty is adjusted automatically accordingly. It did not say the reason for “10 minutes,” but if the blocks were formed in less time, the transaction settlement time would be shorter, but the fork would occur frequently, and if it took longer, the fork would be reduced, but the transaction would take longer to settle before the transaction was put in the block. The appropriate time is set to 10 minutes and the difficulty control method for this is as follows.

Next Difficulty = current difficulty * 2 weeks / T ( Time in which previous 2016 blocks found)

It adjusts the new difficulty by checking the time from the previous cycle until 2016 blocks are formed, with a cycle of 2016. For example, if it took an average of five minutes per block creation until 2016 blocks were formed, the difficulty would increase, and if it took 15 minutes, the difficulty would decrease. That is, the value of each target is reduced and increased.

The ‘Difficulty’ in the picture is the difficulty set for the block, which can be verified that the previous block and the following block contain the same difficulty value. This means that the new difficulty level is maintained at the same value until it is adjusted.

What are the benefits of Mining?

Miners can’t afford to pay huge electricity costs to build blocks and maintain blockchains for no reason. Bitcoin has designed incentives for the miners to enable blockchain activation.

Miners get ‘Fee’ and ‘Reward’ by mining blocks.
Fee” means the sum of the fees in transactions inside the block, and “Reward” is an incentive given to the miner on the Bitcoin protocol.

So how is Reward designed?

The Reward given to the first block miner was 50 BTC, but the volume is halved every 210,000 blocks (about 4 years) by having a half-period to prevent inflation. To roughly calculate, bitcoin issuing will be ended in 2140. After that, rather than stopping the blockchain, the miners form blocks to get fees without reward.

The important fact is, the volume of new bitcoin has not been set from the start. It may be questioned that the total amount of issuance has been obtained through calculations starting with 50BTC, but it is not. In practice, a BTC would be created less than the expected volume (21 million). I’ll explain the reason in the following passage.

So how is the reward given to the miner?

This is a very important question. Bitcoin blockchain is a p2p-based UTXO model, which can be seen as being made up of transactions by all UTXO transaction. Also, UTXO was a concept of ownership transfer that could be consumed when someone handed me the UTXO. So when you think about this concept of UTXO, you might wonder what the first UTXO was. That is, what comes first in the matter of chickens and eggs? And how is it created in a decentralized environment?

Yes, the first UTXO is called the Coinbase transaction as compensation and fees gained by the miner.

So, what is Coinbase
In the next chapter, we will explore the concepts of Coinbase and Genesis Block.

Published at Sat, 04 May 2019 01:58:55 +0000

Previous Article

Coinbase and Priority – 손동하 –

Next Article

Pool & Merkle Root – 손동하 –

You might be interested in …