Bitcoin Forum
May 21, 2024, 04:04:35 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: How could you ever solo-mine bitcoin with CPU?  (Read 268 times)
Coding Enthusiast (OP)
Legendary
*
Offline Offline

Activity: 1039
Merit: 2783


Bitcoin and C♯ Enthusiast


View Profile WWW
June 23, 2019, 06:24:59 AM
 #1

I am having trouble with some numbers, they don't make sense!

Let's say it is 2009, difficulty is 1, you are mining with your Core 2 duo E7300 CPU (the CPU of that time [1]) which gives you a hashrate of 3 (rounded up from 2.52) MHash/s [2] to find block #3 [3]
Nonce max value is 4,294,967,295 and to go through a whole set of hashes takes:
4,294,967,295 hash / 3,000,000 Hash/sec = 1,431 sec = 23 minutes.

Block #3 was found in ~7 minutes which is the result of calculating 4,294,967,295 hashes more than once (since the nonce in coinbase was changed).

[1] https://www.computerhope.com/history/processor.htm
[2] https://en.bitcoin.it/wiki/Non-specialized_hardware_comparison
[3] https://www.blockchain.com/btc/block-height/3

Projects List+Suggestion box
Donate: 1Q9s or bc1q
|
|
|
FinderOuter(0.19.1)Ann-git
Denovo(0.7.0)Ann-git
Bitcoin.Net(0.26.0)Ann-git
|
|
|
BitcoinTransactionTool(0.11.0)Ann-git
WatchOnlyBitcoinWallet(3.2.1)Ann-git
SharpPusher(0.12.0)Ann-git
HeRetiK
Legendary
*
Offline Offline

Activity: 2940
Merit: 2092



View Profile
June 23, 2019, 11:06:49 AM
 #2

I think this is the math you are looking for:
https://math.stackexchange.com/questions/903870/probability-of-guessing-correctly-after-x-tries-with-multiple-right-answers

Applied to the mining example at hand, if it takes 23 minutes to go through all possible combinations, the chance of finding a correct block within 7 minutes of mining with 3 MHash/s is higher than 50%.
Coding Enthusiast (OP)
Legendary
*
Offline Offline

Activity: 1039
Merit: 2783


Bitcoin and C♯ Enthusiast


View Profile WWW
June 23, 2019, 03:15:24 PM
 #3

if it takes 23 minutes to go through all possible combinations,

That is not "all" possible combinations. That is only all possible nonces. We go through all the ~4.3 billion of them and perform the hash, when we fail to find the result we want, then we change something else and start nonce from 0. For example in block #3 if you deduct 1 second from the time (the block time field) we won't find the hash we were looking for (smaller than the target).
So practically you may do this multiple times to find the correct result and my problem is that the numbers (according to hashrate) don't make sense.

Projects List+Suggestion box
Donate: 1Q9s or bc1q
|
|
|
FinderOuter(0.19.1)Ann-git
Denovo(0.7.0)Ann-git
Bitcoin.Net(0.26.0)Ann-git
|
|
|
BitcoinTransactionTool(0.11.0)Ann-git
WatchOnlyBitcoinWallet(3.2.1)Ann-git
SharpPusher(0.12.0)Ann-git
DaCryptoRaccoon
Hero Member
*****
Offline Offline

Activity: 1214
Merit: 591


OGRaccoon


View Profile
June 23, 2019, 04:03:54 PM
 #4

Could it be possible that more that one machine was being used?

┏━━━━━━━━━━━━━━━━━┓
┃   💎 Mine Solo with CKPool 💎    ┃
┃    ➤ Hit Blocks on Your Own!      ┃
┃ ███▓▓  ███▓▓  ███▓▓  ███▓▓┃
HeRetiK
Legendary
*
Offline Offline

Activity: 2940
Merit: 2092



View Profile
June 23, 2019, 04:38:03 PM
 #5

[...] For example in block #3 if you deduct 1 second from the time (the block time field) we won't find the hash we were looking for (smaller than the target).
So practically you may do this multiple times to find the correct result and my problem is that the numbers (according to hashrate) don't make sense.

Ah, you're right. I forgot that you'll have to retry nonces due to the changing block time field.

But yes, like MagicByt3 pointed out they might have simply had multiple machines running? Even if satoshi was the only one running the client until Hal Finney came along a few days later this doesn't mean that they only had the client running on a single machine. It only needs a second or third machine for the numbers to make sense.
DaCryptoRaccoon
Hero Member
*****
Offline Offline

Activity: 1214
Merit: 591


OGRaccoon


View Profile
June 23, 2019, 04:58:54 PM
Last edit: June 23, 2019, 09:44:47 PM by MagicByt3
 #6

[...] For example in block #3 if you deduct 1 second from the time (the block time field) we won't find the hash we were looking for (smaller than the target).
So practically you may do this multiple times to find the correct result and my problem is that the numbers (according to hashrate) don't make sense.

Ah, you're right. I forgot that you'll have to retry nonces due to the changing block time field.

But yes, like MagicByt3 pointed out they might have simply had multiple machines running? Even if satoshi was the only one running the client until Hal Finney came along a few days later this doesn't mean that they only had the client running on a single machine. It only needs a second or third machine for the numbers to make sense.

This seems like the most likley reason the numbers don't add up.
I recall reading a post by Satoshi that said something about using more than one machine but I cannot seem to find it..

This mail might give a better idea.



page 13

https://www.courtlistener.com/recap/gov.uscourts.flsd.521536/gov.uscourts.flsd.521536.24.8.pdf


┏━━━━━━━━━━━━━━━━━┓
┃   💎 Mine Solo with CKPool 💎    ┃
┃    ➤ Hit Blocks on Your Own!      ┃
┃ ███▓▓  ███▓▓  ███▓▓  ███▓▓┃
itod
Legendary
*
Offline Offline

Activity: 1974
Merit: 1076


^ Will code for Bitcoins


View Profile
June 24, 2019, 10:02:52 AM
 #7

[...] For example in block #3 if you deduct 1 second from the time (the block time field) we won't find the hash we were looking for (smaller than the target).
So practically you may do this multiple times to find the correct result and my problem is that the numbers (according to hashrate) don't make sense.

Ah, you're right. I forgot that you'll have to retry nonces due to the changing block time field.

But yes, like MagicByt3 pointed out they might have simply had multiple machines running? Even if satoshi was the only one running the client until Hal Finney came along a few days later this doesn't mean that they only had the client running on a single machine. It only needs a second or third machine for the numbers to make sense.

This seems like the most likley reason the numbers don't add up.
I recall reading a post by Satoshi that said something about using more than one machine but I cannot seem to find it..

...

Can't find where Satoshi said he was using multiple computers from the beginning, but I'm almost certain I've read it somewhere, and if I remember correctly number of machines were in double digits. That's why many people think he was working in Academia, otherwise it would be rather hard to get hold of so many computers to play with your own personal project. It makes complete sense, how would you otherwise test networking part of the code?
DaCryptoRaccoon
Hero Member
*****
Offline Offline

Activity: 1214
Merit: 591


OGRaccoon


View Profile
June 24, 2019, 12:27:24 PM
 #8

[...] For example in block #3 if you deduct 1 second from the time (the block time field) we won't find the hash we were looking for (smaller than the target).
So practically you may do this multiple times to find the correct result and my problem is that the numbers (according to hashrate) don't make sense.

Ah, you're right. I forgot that you'll have to retry nonces due to the changing block time field.

But yes, like MagicByt3 pointed out they might have simply had multiple machines running? Even if satoshi was the only one running the client until Hal Finney came along a few days later this doesn't mean that they only had the client running on a single machine. It only needs a second or third machine for the numbers to make sense.

This seems like the most likley reason the numbers don't add up.
I recall reading a post by Satoshi that said something about using more than one machine but I cannot seem to find it..

...

Can't find where Satoshi said he was using multiple computers from the beginning, but I'm almost certain I've read it somewhere, and if I remember correctly number of machines were in double digits. That's why many people think he was working in Academia, otherwise it would be rather hard to get hold of so many computers to play with your own personal project. It makes complete sense, how would you otherwise test networking part of the code?


I recall reading it too in a early post here there was also the spec of the machine and some figures if I recall correctly.


┏━━━━━━━━━━━━━━━━━┓
┃   💎 Mine Solo with CKPool 💎    ┃
┃    ➤ Hit Blocks on Your Own!      ┃
┃ ███▓▓  ███▓▓  ███▓▓  ███▓▓┃
klaaas
Hero Member
*****
Offline Offline

Activity: 1568
Merit: 544



View Profile
June 24, 2019, 01:24:52 PM
 #9

If i understand your question correct it boils down to this
Quote
If your hash is below the target, then you win. If not, you increment the nonce (completely changing the hash) and try again.
quote from the wiki

For the inner details for the difficulty check this page https://en.bitcoin.it/wiki/Mining and for the target here https://en.bitcoin.it/wiki/Target

Shopping online and sats back as a discount! (satsback) + LightningNetwork
Coding Enthusiast (OP)
Legendary
*
Offline Offline

Activity: 1039
Merit: 2783


Bitcoin and C♯ Enthusiast


View Profile WWW
June 24, 2019, 03:12:57 PM
 #10

I recall reading it too in a early post here there was also the spec of the machine and some figures if I recall correctly.

You might be referring to the guesswork about number of coins Satoshi owns which also included an estimation of his hashrate. That put it around 7.16 MHS and concluded Satoshi must have had more than one machine mining bitcoin. https://organofcorti.blogspot.com/2014/08/167-satoshis-hashrate.html

BTW 7.16 still doesn't make sense to me because of what I explained before and since it takes 10 min to go through 4.2 billion hashes.

Projects List+Suggestion box
Donate: 1Q9s or bc1q
|
|
|
FinderOuter(0.19.1)Ann-git
Denovo(0.7.0)Ann-git
Bitcoin.Net(0.26.0)Ann-git
|
|
|
BitcoinTransactionTool(0.11.0)Ann-git
WatchOnlyBitcoinWallet(3.2.1)Ann-git
SharpPusher(0.12.0)Ann-git
HeRetiK
Legendary
*
Offline Offline

Activity: 2940
Merit: 2092



View Profile
June 24, 2019, 04:00:19 PM
 #11

BTW 7.16 still doesn't make sense to me because of what I explained before and since it takes 10 min to go through 4.2 billion hashes.

Why do you assume that one has to go through "all" 4.2 billion hashes to successfully mine a block? After all PoW mining is a probabilistic affair.
Coding Enthusiast (OP)
Legendary
*
Offline Offline

Activity: 1039
Merit: 2783


Bitcoin and C♯ Enthusiast


View Profile WWW
June 24, 2019, 04:18:03 PM
 #12

BTW 7.16 still doesn't make sense to me because of what I explained before and since it takes 10 min to go through 4.2 billion hashes.

Why do you assume that one has to go through "all" 4.2 billion hashes to successfully mine a block? After all PoW mining is a probabilistic affair.

Actually I'm assuming you have to go through all of them multiple times not just once and the reason is because I keep changing the header and hash it with all nonces and don't get any results. For example as I said above if the block time was 1231470172 instead of 1231470173 no acceptable hash could have been found.
Obviously I haven't tested that many cases due to having only 1.7 MH/s with 1 core, to talk probability and this is just an assumption based on small number of tests.

Projects List+Suggestion box
Donate: 1Q9s or bc1q
|
|
|
FinderOuter(0.19.1)Ann-git
Denovo(0.7.0)Ann-git
Bitcoin.Net(0.26.0)Ann-git
|
|
|
BitcoinTransactionTool(0.11.0)Ann-git
WatchOnlyBitcoinWallet(3.2.1)Ann-git
SharpPusher(0.12.0)Ann-git
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!