6

Section 4.3.4, item 48 of the yellow paper states the has nonce, n, must be lte 2^256/current difficulty. The effect of this, assuming current difficulty is < 2^256, the range of the nonce gets smaller, making it easier to validate a block due to less possible nonce values to try. This seems counterintuitive to the purpose of increasing the current difficulty. Am I missing something?

5

In that equation, the fancy n doesn't refer to nonce. Hn refers to nonce.

Here's the full, put together equation which might clarify it:

equation


More info on difficulty:

Given an approximately uniform distribution in the range [0,2^64), the expected time to find a solution is proportional to the difficulty, Hd.

or, more frankly stated:

This mechanism enforces a homeostasis in terms of the time between blocks; a smaller period between the last two blocks results in an increase in the difficulty level and thus additional computation required, lengthening the likely next period. Conversely, if the period is too large, the difficulty, and expected time to the next block, is reduced.

So. Shorter time between blocks = more difficulty.


The PoW evaluates to an array where...

  • First item: Hn with the strikethru thingy = mix-hash to prove that a correct DAG (d) as been used. Hn with the strikethru thingy is the block's header H but without the nonce and mix-hash components.

  • Second item: Hn (the nonce) which is a pseudo-random number cryptographically dependent on H (new blocks header) and d (DAG)

  • Third item: d = current DAG.

In more easily understandable language, Vitalik covered a lot about mining in this blog post.

The idea is for the miner to repeatedly compute a pseudorandom function on a block and a nonce, trying a different nonce each time, until eventually some nonce produces a result which starts with a large number of zeroes.

So...I know this doesn't exactly answer your question but I think the basis of your original question was an assumption that is wrong, so the question really isn't answerable. (I think. I'm just grasping most of this.)

3

To simplify the answer, I will use decimal numbers instead of hexadecimal numbers. And instead of 2^256 in the numerator, I will use 10^10 (= 10,000,000,000).

(A) When difficulty is set to 1,000,000 , the "target" is to find a number below 10^10 / 1,000,000 . This is 10,000,000,000 / 1,000,000 = 10,000 . We have to find a hash function result in the range between 0 and 10,000,000,000 that falls below 10,000 .

(B) Let us now increase difficulty a hundred times to 100,000,000 . The "target" is to find a number below 10^10 / 100,000,000. This is 10,000,000,000 / 100,000,000 = 100 . We now have to find a hash function result in the range between 0 and 10,000,000,000 that falls below 100 .

The nonce is a random number which is hashed with other block data information to come up with a hash function result in the range between 0 and 10,000,000,000 .

In (A) above, the probability of finding a hash function result (from the nonce random number + block data) below the target is 10,000 / 10,000,000,000 which is one in a million.

In (B) above with the higher difficulty, the probability of getting a hash function result (from the nonce random number + block data) below the target is 100 / 10,000,000,000 which is one in 100,000,000, or one in a hundred million.

A higher difficulty results in a lower probability of finding a hash function result (from the nonce random number + block data) that is below the target.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.