Basically the first problem with miner are :
Based on python
Starting cracking with 0 to 2147483647 00.1% of chance the nounce are low with a high difficulty.
Original version of all miner are example nounce 0 to 2147483647:
for nounce in xrange(0, 0x7fffffff, 1):
nounce_bin = struct.pack(' header_bin = header_prefix_bin + nounce_bin
header_hex = hexlify(header_bin)
scrypt = ltc_scrypt.getPoWHash(header_bin)
pow = hexlify(scrypt[::-1])
if pow <= target:
print "FOUND ########################################################"
print "[" + str(nounce) + "]" + pow
break
_hash_count += 1
Example nounce 2147483647 to 0
for nounce in xrange(0, 0x7fffffff, 1):
nounce = 0x7fffffff-nounce
nounce_bin = struct.pack(' header_bin = header_prefix_bin + nounce_bin
header_hex = hexlify(header_bin)
scrypt = ltc_scrypt.getPoWHash(header_bin)
pow = hexlify(scrypt[::-1])
if pow <= target:
print "FOUND ########################################################"
print "[" + str(nounce) + "]" + pow
break
_hash_count += 1
Example lottery version nounce random
for nounce in xrange(0, 0x7fffffff, 1):
nounce = randint( 0, 2147483647)
nounce_bin = struct.pack(' header_bin = header_prefix_bin + nounce_bin
header_hex = hexlify(header_bin)
scrypt = ltc_scrypt.getPoWHash(header_bin)
pow = hexlify(scrypt[::-1])
if pow <= target:
print "FOUND ########################################################"
print "[" + str(nounce) + "]" + pow
break
_hash_count += 1
The best of my version are first nounce 1 to 2147483647 the next 2147483647 to 1 the next random betwen 0 to 2147483647 all in same time..
for nounce in xrange(nounce_start, 0x7fffffff, nounce_stride):
if self._done:
self._dt += (time.time() - t0)
raise StopIteration()
for test in xrange(0, 3):
if test == 0:
nounce = nounce
if test == 1:
nounce = randint( 1, 2147483647)
if test == 2:
nounce = 0x7fffffff-nounce
nounce_bin = struct.pack(' pow = self.proof_of_work(header_prefix_bin + nounce_bin)[::-1].encode('hex')
#print "[ " + self.id + " ] " + str(nounce) + ":" + pow
#print self.target
if pow <= self.target:
print self.target + ":" + pow
Is only the one of 10 upgrade we can edit in our miner