Bitcoin Malaysia Training Services

Bitcoin and Blockchain, Bitcoin Exchange, Bitcoins Malaysia, Blockchain Malaysia

Bitcoin Mining – solo or pooled mining.

By on December 10, 2012


Here’s a good clarification on whether you should be doing solo bitcoin mining or pooled mining. Thanks to Chip Geek and Keefe.

A new “block” is a list of all transactions that are in the bitcoin network since the last block was generated. The miner software takes all of the transactions and runs them through the mining algorithm (double SHA-256) and gets a signature that to the human eye looks like a random number. If it was that easy, a new block could be generated in a tiny fraction of a second. So to make it more difficult, we require the first N digits of the signature to be zero. So now the mining software has to add some specific number X to the list of transactions so that the SHA-256 algorithm generates a signature with the first N bits zero. There is no known way to generate X other than guessing a random number then running it through the algorithm to see if it works. That’s why we need many TH/s to get a block in 10 minutes. Every miner in the world is (in theory) trying a different number X. Whoever gets a number X that works first, solves the block and gets the block reward.

More specifically, each miner adds a transaction that pays themselves the 25 BTC, which also affects the hash. Since everyone has a different bitcoin address, that right there practically prevents any miner from repeating hashes others have tried. Then there’s a timestamp and a nonce which also affect the hash. A miner usually iterates through the possible nonces sequentially, and increases the timestamp over time as well, ensuring each hash is different. If the nonces were chosen randomly, there’d be a little duplication of work since the nonce is only a 32-bit number.

Bitcoin pooled mining

With pooled mining, which most miners do, the pool server manages the block reward address, timestamp, and nonce ranges, and gives each client work that doesn’t overlap with other clients. Mining client software divides the incoming work among multiple devices, so no work is done twice. This is the same as with solo mining; the work is just divided at an additional level. The pool server divides the work among clients, and the clients divide the work among devices. And of course, the device firmware or software divides up the work among cores within a device. In both solo and pooled mining, no work is ever done twice. To handle the larger amount of work being served out, a pool server might use multiple addresses for the block reward to get around the 32-bit nonce limit.