Bitcoin Forum

Bitcoin => Development & Technical Discussion => Topic started by: TeraPool on July 15, 2011, 05:10:12 PM



Title: How do large pools not waste virtually all of their hashing power?
Post by: TeraPool on July 15, 2011, 05:10:12 PM
In writing this response (http://forum.bitcoin.org/index.php?topic=28958.msg366589#msg366589), I managed to confuse myself pretty well.

Apparently this page (https://en.bitcoin.it/wiki/Block_hashing_algorithm) states that:

Quote
Given just those fields, people would frequently generate the exact same sequence of hashes as each other and the fastest CPU would almost always win. However, it is (nearly) impossible for two people to have the same Merkle root because the first transaction in your block is a generation "sent" to one of your unique Bitcoin addresses. Since your block is different from everyone else's blocks, you are (nearly) guaranteed to produce different hashes. Every hash you calculate has the same chance of winning as every other hash calculated by the network.

Now when everybody is mining solo, that's just fine and dandy.

But when everybody is mining for say deepbit or slush, are the bitcoin addresses (and thus each merkle root) not exactly the same for every miner in the pool?

When Alice asks the pool for more work, mines the first nonce, and it doesn't hash out... she immediately moves onto nonce 2. But so does Bob. Was Bob's hashing of the second nonce redundant if Alice was mining for the same pool and asked for the work first?


Title: Re: How do large pools not waste virtually all of their hashing power?
Post by: JoelKatz on July 15, 2011, 05:29:22 PM
But when everybody is mining for say deepbit or slush, are the bitcoin addresses (and thus each merkle root) not exactly the same for every miner in the pool?
Your 'thus' is invalid. The merkle root depends on the coinbase field of the coinbase transaction, not just the address the coins are sent to.


Title: Re: How do large pools not waste virtually all of their hashing power?
Post by: gmaxwell on July 18, 2011, 06:01:01 AM
When Alice asks the pool for more work, mines the first nonce, and it doesn't hash out... she immediately moves onto nonce 2. But so does Bob. Was Bob's hashing of the second nonce redundant if Alice was mining for the same pool and asked for the work first?

The pool doesn't return the same work to each miner, of course.

It increments the extranonce field in the coinbase transaction for each getwork request.



Title: Re: How do large pools not waste virtually all of their hashing power?
Post by: TeraPool on July 18, 2011, 06:10:29 PM
Ah I see.

So where is the "coinbase" located exactly? In the data field I presume? And pushpool increases the extraNonce inside the coinbase and then hashes it for each individual "getwork" request? Is that correct?


Title: Re: How do large pools not waste virtually all of their hashing power?
Post by: JoelKatz on July 18, 2011, 06:35:55 PM
Ah I see.

So where is the "coinbase" located exactly? In the data field I presume?
It's in the coinbase transaction.

Quote
And pushpool increases the extraNonce inside the coinbase and then hashes it for each individual "getwork" request? Is that correct?
The bitcoin client increments the coinbase field and then recomputes the merkle tree of transactions for each work unit it gives to pushpool.