Does all miners in mining pool increase the nonce variable one by one starting from zero?

1

1

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.

aginos awen

Posted 2018-09-02T06:54:03.390

Reputation: 11

Answers

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

JBaczuk

Posted 2018-09-02T06:54:03.390

Reputation: 6 172