8

What does the mining-pool architecture look like? Obviously GPU's can hash data much faster than it can be distributed via the internet, so I assume pools must allocate a range of nonces for miners to work on at any given time?

So if there were 2 miners, would the pool server allocate nonces 1-100,000 to miner 1, 100,101-200,000 to miner 2, then keep allocating the work as each set of nonces are completed? Or do I have it wrong?

I tried digging into the source of Eloipool, but it all seems very cryptic/there is very little (if any?) documentation?

Anonymous
  • 473
  • 5
  • 6

1 Answers1

7

Traditionally, pools gave miners work units covering the entire nonce range 0-4,294,967,295. When the miner finishes work, he requests a new work unit with a different extraNonce (or payout address). Different miners also get work units with different details.

To reduce load, pools are now moving on to a setting where the miner can himself change details of the generation transaction and compute the Merkle root, so he can do as much work as he pleases without needing new assignment from the pool.

Meni Rosenfeld
  • 19,700
  • 37
  • 70
  • What is the 'extraNonce' field? I saw this question (http://bitcoin.stackexchange.com/questions/5048/what-is-the-extranonce) but it wasn't all that clear. I can't find anything about elsewhere. – Anonymous Aug 27 '13 at 13:38
  • 1
    Ah, this article explains better: https://en.bitcoin.it/wiki/Transactions - Thanks anyway. – Anonymous Aug 27 '13 at 13:39
  • You say that pools give miners work units covering the entire nonce range... do you mean that a miner could eventually span the entire range or that the entire range is provided up front? If the assigned range is a subset of the whole range, what determines how big of a range is assigned? Also, if only one block can ever be mined at once and the number of miners goes up, wouldn't the assigned ranges start to diminish ultimately lowering one's change of finding the winning nonce? I suppose in a pool it doesnt matter who finds it... – a432511 Apr 18 '14 at 17:02
  • 1
    @a432511: A block header consists of 640 bits. A (traditional) work unit consists of 608 of these fixed by the pool and the other 32 bits chosen by the miner. This gives the miner 4 billion different hashes to try. Each has a chance to be a valid block depending on the difficulty. If doesn't find a block he requests another work unit (with different 608 bits), and so on. Of course if there are more miners the difficulty will be higher. – Meni Rosenfeld Apr 19 '14 at 17:17
  • @MeniRosenfeld Hm, I still don't quite understand. So the block header may not have a valid nonce at a given difficulty? Then the pool would generate a new block with a new 608 bits? See this question too: http://bitcoin.stackexchange.com/questions/25283/how-is-block-assembled – a432511 May 12 '14 at 14:46
  • @MeniRosenfeld What do you mean 608 fixed by the pool? Would a subset of the 608 bits be assigned to each miner in the pool? When you say the 32 is chosen by the miner, you mean each "hasher" in the pool can choose the 32 bits. – a432511 May 12 '14 at 14:47
  • 1
    @a432511: The pool gives the miner a work unit which is a string of 608 bits. These are all the fields described in https://en.bitcoin.it/wiki/Protocol_specification#Block_Headers except for the nonce - version, prev block hash, Merkle root, Timestamp, bits (difficulty). The 32-bit nonce field is filled in by the miner. He tries each one of the 4 billion possibilities (2^32) hoping to find a combination that hashes to a value that satisfies the difficulty requirement. Most of the time none of the combinations will do so, so he will request a new work unit and continue trying. – Meni Rosenfeld May 12 '14 at 15:06
  • 1
    @a432511: The Merkle root field is the representation of all the transactions in the block. However the pool will not make drastic changes to the transaction list whenever it assigns a new work unit (whether to the same miner or a different one). It will modify slightly the generation transaction, resulting in a new Merkle root. The rest of the fields can stay the same, but the change in Merkle root guarantees a fresh new chance. – Meni Rosenfeld May 12 '14 at 15:08
  • @a432511: Again, I am describing a traditional pool. Pools these days have a variety of other tricks. – Meni Rosenfeld May 12 '14 at 15:09
  • @MeniRosenfeld You sir are fantastic at explaining this. And, I am getting it! Another question (maybe all this back and forth is better suited for a different medium) - What is the generation transaction? Is this a transaction added to the stack by the pool operator (or solo miner)? Is it a zero value transaction? – a432511 May 13 '14 at 00:24