<blockquote>
<p>So question is - do miners always search the space of blocks in the same order?</p>
</blockquote>
<p>This is your misunderstanding. No two miners search the same space at all, ever. Since the block candidates miners work on include a payout to themselves, and that payout address is different for every miner, they are all searching independent parts of the block space.</p>
<p>If this weren't the case, the fastest miner would always win. This isn't the case: on average, mining profitability is roughly proportional to hashrate, even at fairly low hashrates. And this is independent of the order they choose to search in.</p>
<blockquote>
<p>Am I right that a miner who selects blocks at random will have an advantage over those who do it according to the &quot;one by one&quot; scheme?</p>
</blockquote>
<p>It makes no difference.</p>

CC BY-SA 4.0
2022-04-06T23:58:01.930Z
Exactly, I felt that I did not understand something here. You're right that if this weren't the case (all of them searching independent parts of the block space), the fastest miner would always win, and yet this is not true, we see that. So now it is clear that it makes no difference how they are searching, because every block has an equal chance of being an answear.
Tom
CC BY-SA 4.0
2022-04-07T11:20:32.690Z
This is true for solo miners, but in a mining pool the payout address might be the same for many miners. Can you clarify what prevents the fastest miner to win every time in this case?
Vojtěch Strnad
CC BY-SA 4.0
2022-04-07T13:53:39.527Z
@VojtěchStrnad In a pool, the pool just assigns different ranges to different workers. No two miners ever try the same hash, ever - anything else would just be grossly wasteful.
Pieter Wuille
CC BY-SA 4.0
2022-04-08T07:22:11.823Z
@user253751: the coinbase transaction contains, in addition to the 'payout', a dummy input which is used for data that extends the nonce, called **extranonce**. At current difficulty, even a solo miner must try millions of extranonces to find a winning block; pool members are given different ranges of extranonce to try. See https://bitcoin.stackexchange.com/questions/37279/work-distribution-in-a-mining-pool and https://bitcoin.stackexchange.com/questions/41989/question-about-getblocktemplate .
dave_thompson_085
CC BY-SA 4.0
2022-04-06T23:40:06.197Z
2022-04-06T23:40:06.197Z
Pieter Wuille
<p>When miners have a block to mine, this is comparable to finding an effectively (impossible to guess) random number in a set from 0 to n. From what I once read, since the number is random, it makes no sense to start searching from the middle of the set, or from the end - every place we choose is equally good. So we start searching the set sequentially, we check the number 1,2,3,... and so on. Because the solution can be a number 1 as well as n.</p>
<p>But it looks like from game theory point of view, another strategy should be more profitable. If everyone starts searching the set simultaneously in the order of numbers/blocks, and the solution sometimes ends up at the end of the set, then when we, as the only ones, search from the end - we will gain a significant advantage. Each time the solution is in the end of the set, we would be the first to find a solution, because all the rest will search from the beginning of the set.</p>
<p>But, if that were true, it would quickly become reality that half of the miners searched the set from one edge and half from the other - and finally we do not gain an advantage (because other miners also want to earn as much as possible). Then we can gain an advantage by attacking the middle of the set, with some frequency.</p>
<p>Finally, is there any strategy for searching a set of solutions that will give us the maximum benefit, or at least won't put us in a worse position? It seems to me that blocks should be searched, by generating them completely randomly. Not because block 12345 is more likely than block 1, but because we have competition in mining blocks, and if everyone started their search from the beginning of the set, it would be easy to gain an advantage here. If everyone were to use a pseudo-random number generator to select blocks, it would be impossible to come up with a strategy that would benefit anyone.</p>
<p>So question is - do miners always search the space of blocks in the same order? Am I right that a miner who selects blocks at random will have an advantage over those who do it according to the &quot;one by one&quot; scheme? Or maybe a random block search in proof of work already takes place? Does the speed of PRNGs used matter in the mining process?</p>

<mining-theory>
Using PRNG to get better mining results
Tom
# Using PRNG to get better mining results

(Asked by: username_0 on 2022-04-06)

When miners have a block to mine, this is comparable to finding an effectively (impossible to guess) random number in a set from 0 to n. From what I once read, since the number is random, it makes no sense to start searching from the middle of the set, or from the end - every place we choose is equally good. So we start searching the set sequentially, we check the number 1,2,3,... and so on. Because the solution can be a number 1 as well as n.

But it looks like from game theory point of view, another strategy should be more profitable. If everyone starts searching the set simultaneously in the order of numbers/blocks, and the solution sometimes ends up at the end of the set, then when we, as the only ones, search from the end - we will gain a significant advantage. Each time the solution is in the end of the set, we would be the first to find a solution, because all the rest will search from the beginning of the set.

But, if that were true, it would quickly become reality that half of the miners searched the set from one edge and half from the other - and finally we do not gain an advantage (because other miners also want to earn as much as possible). Then we can gain an advantage by attacking the middle of the set, with some frequency.

Finally, is there any strategy for searching a set of solutions that will give us the maximum benefit, or at least won't put us in a worse position? It seems to me that blocks should be searched, by generating them completely randomly. Not because block 12345 is more likely than block 1, but because we have competition in mining blocks, and if everyone started their search from the beginning of the set, it would be easy to gain an advantage here. If everyone were to use a pseudo-random number generator to select blocks, it would be impossible to come up with a strategy that would benefit anyone.

So question is - do miners always search the space of blocks in the same order? Am I right that a miner who selects blocks at random will have an advantage over those who do it according to the "one by one" scheme? Or maybe a random block search in proof of work already takes place? Does the speed of PRNGs used matter in the mining process?

**Tags:** mining-theory


---

## 1 answers

### Answer by username_1 on 2022-04-06. Score: 7 | Accepted answer

> So question is - do miners always search the space of blocks in the same order?

This is your misunderstanding. No two miners search the same space at all, ever. Since the block candidates miners work on include a payout to themselves, and that payout address is different for every miner, they are all searching independent parts of the block space.

If this weren't the case, the fastest miner would always win. This isn't the case: on average, mining profitability is roughly proportional to hashrate, even at fairly low hashrates. And this is independent of the order they choose to search in.

> Am I right that a miner who selects blocks at random will have an advantage over those who do it according to the "one by one" scheme?

It makes no difference.

> **Comments:**
> **username_0**: Exactly, I felt that I did not understand something here. You're right that if this weren't the case (all of them searching independent parts of the block space), the fastest miner would always win, and yet this is not true, we see that. So now it is clear that it makes no difference how they are searching, because every block has an equal chance of being an answear.  
> **username_2**: This is true for solo miners, but in a mining pool the payout address might be the same for many miners. Can you clarify what prevents the fastest miner to win every time in this case?  
> **username_1**: @username_2 In a pool, the pool just assigns different ranges to different workers. No two miners ever try the same hash, ever - anything else would just be grossly wasteful.  
> **username_3**: @user253751: the coinbase transaction contains, in addition to the 'payout', a dummy input which is used for data that extends the nonce, called **extranonce**. At current difficulty, even a solo miner must try millions of extranonces to find a winning block; pool members are given different ranges of extranonce to try. See https://bitcoin.stackexchange.com/questions/37279/work-distribution-in-a-mining-pool and https://bitcoin.stackexchange.com/questions/41989/question-about-getblocktemplate .  

---

