<p>This is not how mining typically works in a pool. Mining software typically assigns a different <code>extranonce</code> to each miner, which is part of the coinbase transaction, and will result in a different merkle root (and different block header. Then they can all start on nonce 0 as you suggest, but they will not be racing each other for the same block because they are different. See <a href="https://bitcointalk.org/index.php?topic=9438.msg136344#msg136344" rel="nofollow noreferrer">https://bitcointalk.org/index.php?topic=9438.msg136344#msg136344</a>.</p>

<p>Also, just for clarification, the data that is hashing during mining is the block header, which consists of:</p>

<ul>
<li>Version</li>
<li>hashPrevBlock    </li>
<li>hashMerkleRoot   </li>
<li>Time     </li>
<li>Bits     </li>
<li>Nonce    </li>
</ul>

<p>See <a href="https://en.bitcoin.it/wiki/Block_hashing_algorithm" rel="nofollow noreferrer">https://en.bitcoin.it/wiki/Block_hashing_algorithm</a></p>

CC BY-SA 4.0
2018-09-04T13:38:13.370Z
2018-09-04T13:38:13.370Z
JBaczuk
<p>Let us consider we have <strong>n</strong> miners in our mining pool. Now the manager of the pool verified the transactions and packed into a block to be mined. Then it passed the block to all n miners in the pool.</p>

<p>Lets assume that out block is as below:</p>

<pre><code>    to_mine_block = {
    Block No: 1000
    Prev Block:999 
    timestamp: "1000-01-01 00:00:00"
    Data : "XYZ"
    nonce : ?
}
</code></pre>

<p>Now,<strong>to_mine_block</strong> is sent to all <strong>n</strong> miners. Will <strong>n</strong> miners runs the following code to</p>

<pre><code>String target = new String(new char[difficulty]).replace('\0', '0'); 

while(!hash.substring( 0, difficulty).equals(target)) {
    nonce ++;
    hash = calculateHash();
}
</code></pre>

<p>Will all <strong>n</strong> miners run this code individually in the pool ? If so, this race will always be wined by the miners with the highest mining power. Because the one with highest mining power will move ahead in the loop than the ones with low hash power.</p>

<bitcoin-core><blockchain><bitcoind><bitcoin-core-development>
Does all miners in mining pool increase the nonce variable one by one starting from zero?
aginos awen
# Does all miners in mining pool increase the nonce variable one by one starting from zero?

(Asked by: username_0 on 2018-09-02)

Let us consider we have **n** miners in our mining pool. Now the manager of the pool verified the transactions and packed into a block to be mined. Then it passed the block to all n miners in the pool.

Lets assume that out block is as below:

```
    to_mine_block = {
    Block No: 1000
    Prev Block:999 
    timestamp: "1000-01-01 00:00:00"
    Data : "XYZ"
    nonce : ?
}

```

Now,**to\_mine\_block** is sent to all **n** miners. Will **n** miners runs the following code to

```
String target = new String(new char[difficulty]).replace('\0', '0'); 

while(!hash.substring( 0, difficulty).equals(target)) {
    nonce ++;
    hash = calculateHash();
}

```

Will all **n** miners run this code individually in the pool ? If so, this race will always be wined by the miners with the highest mining power. Because the one with highest mining power will move ahead in the loop than the ones with low hash power.

**Tags:** bitcoin-core, blockchain, bitcoind, bitcoin-core-development


---

## 1 answers

### Answer by username_1 on 2018-09-04. Score: 2

This is not how mining typically works in a pool. Mining software typically assigns a different `extranonce` to each miner, which is part of the coinbase transaction, and will result in a different merkle root (and different block header. Then they can all start on nonce 0 as you suggest, but they will not be racing each other for the same block because they are different. See <https://bitcointalk.org/index.php?topic=9438.msg136344#msg136344>.

Also, just for clarification, the data that is hashing during mining is the block header, which consists of:

* Version
* hashPrevBlock
* hashMerkleRoot
* Time
* Bits
* Nonce

See <https://en.bitcoin.it/wiki/Block_hashing_algorithm>


---

