9

Someone has n machines to mine for bitcoins. What's the simplest way to ensure that mining work isn't duplicated?

(Will separate machines naturally work on different hashes even with the same recipient of rewards, or will there need to be some sort of pool software running organising nodes? Would having each new node create a wallet first be sufficent?)

5

My understanding of the mining mechanism is this:

  • The miner connects to a Bitcoin client (or pool) and submits a getwork request
  • The client (or pool) responds with a chunk of data containing the block data, including the randomized bits, and the nonce (the bit which the miner changes)
  • The miner increments the nonce multiple times until it either finds a solution or overflows, at which point it submits a new getwork request to the client (or pool)

Since the client/pool is responsible for handing out the getwork requests, the client/pool is also responsible for guarding against duplication. Since the entropy of the data handed out by getwork must, by definition, be greater than or equal to the output entropy of SHA256 (2^256 bits) it should have the same or lower chance of collision (1/2^256).

In this case a "collision" would be handing the same work to multiple miners and so we can say that multiple miners being given duplicate work has so low a risk of occurrence as to be a negligible risk.

One of my favorite comp sci professors once told me that the chance of such a collision (per unit of work) is about the same as winning the state lottery 11 times in a row, then being struck by lightning, surviving and being elected president. And he had the math to back this up...

3

By default a bitcoin node does not hand out duplicate getworks. Neither do any of the mining pools. So you don't need to do anything special, just point your miners at some source of work units, either a pool or your own instance of bitcoin, and off you go.

  • 2
    It is technically possible for duplicate getworks to occur, but it's so unlikely as to probably never occur. – David Perry Oct 6 '11 at 0:18
0

Remember that coinbase has no input transactions, its input script can contain some arbitrary message. As long as the pool assigns each work unit with different message, there will be no duplicated work. [1]:

Pools change a value in the coinbase message for each worker/piece of work they assign. Unless the pool wrote their own software and did it HORRIBLY wrong, there is absolutely no way that any two workers will be hashing the same values.

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.