Author

Topic: Where does the guessing of nonce begin? (Read 1062 times)

legendary
Activity: 3514
Merit: 4895
February 18, 2014, 10:38:23 PM
#5
i think, yes i said think (not sure) that pools spread out the randomness.

eg lets pretend the nonse is a hash of a random number between 1-1billion

In Bitcoin, the nonce is always a number between 1 and 4,294,967,295 (maximum 32 bit unsigned integer)

instead of all miners starting at 1. they would (or atleast should) tell:
miner A to start at 0 and work to 1million
miner B to start at 1million and 1 and work to 2million
and so on for 1000 miners
that way a block gets solved 1000 times faster then all miners singularly mining from 1-1billion

and if im wrong. then this is how i would program a mining pool

(i know its a bunch of letters and numbers, not just numbers, so replace miner A 0-1mill as a0 to a9blah and miner B as b0 to b9blah(you get the idea))

No, the nonce is just a number.  Any ASIC capable of more than 4GH/s can try all 4,294,967,295 possibilities in a fraction of a second.  Most block headers have no possible solution.  Instead of each miner being assigned a different nonce to start from, each miner receives a different set of block headers to attempt to solve.

Each miner attempts all possible nonces for the blockheaders that they are assigned, and if they don't find any solutions, then they request another set of headers to work on.
legendary
Activity: 4424
Merit: 4794
February 18, 2014, 10:26:41 PM
#4
i think, yes i said think (not sure) that pools spread out the randomness.

eg lets pretend the nonse is a hash of a random number between 1-1billion
instead of all miners starting at 1. they would (or atleast should) tell:
miner A to start at 0 and work to 1million
miner B to start at 1million and 1 and work to 2million
and so on for 1000 miners
that way a block gets solved 1000 times faster then all miners singularly mining from 1-1billion

and if im wrong. then this is how i would program a mining pool

(i know its a bunch of letters and numbers, not just numbers, so replace miner A 0-1mill as a0 to a9blah and miner B as b0 to b9blah(you get the idea))
Edit: i guess it was just numbers then
full member
Activity: 238
Merit: 100
February 18, 2014, 09:39:54 PM
#3
Also, you typically want to do hashing in parallel using multiple threads, and that would be hard to do efficiently by selecting random nonces.
As far as I know, any number is as good as any other number so you might as well use a simple counter and do it sequentially.
legendary
Activity: 3514
Merit: 4895
February 18, 2014, 09:35:20 PM
#2
In btc mining, miners should guess a nonce that produce the right hash.
I just want to know the way of guessing.( in btc-wallet or in cgminer).
Does it begin with 0 and continue the increment(+1).

If I was writing a mining program, that's how I'd do it.  There really isn't any benefit that I can think of for starting at any other number.

Does it just initial a random number and randomly change it.

That would work, but I don't see why you'd do it that way.  Then you'd have to keep track of all the random numbers that you already tried so that you wouldn't waste time trying them again.
newbie
Activity: 8
Merit: 0
February 18, 2014, 08:23:58 PM
#1
In btc mining, miners should guess a nonce that produce the right hash.
I just want to know the way of guessing.( in btc-wallet or in cgminer).
Does it begin with 0 and continue the increment(+1).
Does it just initial a random number and randomly change it.
Jump to: