Firebox
Jr. Member
Offline
Activity: 59
Merit: 3
|
|
September 16, 2019, 05:22:09 PM |
|
I've optimized the code. Hopping speed improved about 50% per core. with 4 cores I've reached 850000 h/s. Timing: Case # time (sec) 50 148.46 51 120.88 52 189.33 53 204.99 54 674.51 55 441.58 56 945.33 57 1509.22 58 2685.02 59 2300.80 60 4389.98 61 2958.66 62 7802.91 63 10239.27
Could you share your optimized code for testing?
|
|
|
|
racminer
Member
Offline
Activity: 245
Merit: 17
|
|
September 16, 2019, 07:02:21 PM |
|
This is my code (only monocore for obvious reasons ) import time import random import math import sys import gmpy2 import os
modulo = 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFC2F order = 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 Gx = 0x79BE667EF9DCBBAC55A06295CE870B07029BFCDB2DCE28D959F2815B16F81798 Gy = 0x483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8
class Point: def __init__(self, x=0, y=0): self.x = x self.y = y
PG = Point(Gx,Gy) Z = Point(0,0) # zero-point, infinite in real x,y - plane def mul2(P, p = modulo): R = Point() c = 3*P.x*P.x*gmpy2.invert(2*P.y, p) % p R.x = (c*c-2*P.x) % p R.y = (c*(P.x - R.x)-P.y) % p return R
def addk(Pk, Qk, Nn, p = modulo): R = Point() Rk=[] for k in range(Nn): P=Pk[k] Q=Qk[k] R=add(P, Q) Rk.append(R) return Rk
def add(P, Q, p = modulo): R = Point() dx = Q.x - P.x dy = Q.y - P.y c = dy * gmpy2.invert(dx, p) % p R.x = (c*c - P.x - Q.x) % p R.y = (c*(P.x - R.x) - P.y) % p return R # 6 sub, 3 mul, 1 inv
def mulk(k, P = PG, p = modulo): if k == 0: return Z elif k == 1: return P elif (k % 2 == 0): return mulk(k>>1, mul2(P, p), p) else: return add(P, mulk( (k-1)>>1, mul2(P, p), p), p)
def X2Y(X, p = modulo): if p % 4 != 3: print ('prime must be 3 modulo 4') return 0 X = (X**3+7)%p pw = (p + 1) // 4 Y = 1 for w in range(256): if (pw >> w) & 1 == 1: tmp = X for k in range(w): tmp = (tmp**2)%p Y *= tmp Y %= p return Y
def comparator(A,B,Ak,Bk): result = list(set(A) & set(B)) if len(result) > 0: sol_kt = A.index(result[0]) sol_kw = B.index(result[0]) d = Ak[sol_kt] - Bk[sol_kw] print ('total time: %.2f sec' % (time.time()-starttime )) print ('SOLVED: %64X' % d + '\n') file = open("results.txt",'a') file.write(('%X'%(Ak[sol_kt] - Bk[sol_kw])) + ' - total time: %.2f sec' % (time.time()-starttime) +'\n') file.write("---------------\n") file.close() return True else: return False
Ptable = [PG] for k in range(255): Ptable.append(mul2(Ptable[k])) print ('P-table prepared')
def search(): global solved s=(ka+kb)>>1 d=(kb-ka) problem=int(math.log(d,2)) DP_rarity = 1 << ((problem - kangoo_powerT - kangoo_powerW)//2 - 2) hop_modulo = (problem-1 + kangoo_powerT+kangoo_powerW)//2 T, t, dt = [], [], [] W, w, dw = [], [], [] PW,PT = [],[] buft,bufw,buftk,bufwk = [],[],[],[] for k in range(Nt): qt=s+random.randint(1,d) t.append(qt) T.append(mulk(t[k])) PT.append(W0) dt.append(0) for k in range(Nw): qw=random.randint(1, d) w.append(qw) W.append(add(W0,mulk(w[k]))) PW.append(W0) dw.append(0) print ('tame and wild herds are prepared') oldtime = time.time() starttime = oldtime Hops, Hops_old = 0, 0 t0 = time.time() oldtime = time.time() starttime = oldtime while (1): for k in range(Nt): Hops += 1 ptk = T[k].x if ptk % (DP_rarity) == 0: buft.append(ptk) buftk.append(t[k]) pw = ptk % hop_modulo dt[k] = 1 << pw t[k] += dt[k] PT[k] = Ptable[pw] T=addk(PT, T, Nt) for k in range(Nw): Hops += 1 pwk = W[k].x if pwk % (DP_rarity) == 0: bufw.append(pwk) bufwk.append(w[k]) pw = pwk % hop_modulo dw[k] = 1 << pw w[k] += dw[k] PW[k] = Ptable[pw] W=addk(PW, W, Nw) t1 = time.time() if (Hops % Cycle) == 0: hopsp = (Hops-Hops_old)/(t1-t0) print('Total rate %d h/s, Total W %d, Total T %d' % (hopsp,len(bufw),len(buft))) if comparator(buft,bufw,buftk,bufwk) : solved=1 return t0 = t1 Hops_old = Hops return s=sys.argv[1] sa = sys.argv[2] sb = sys.argv[3] skw = sys.argv[4] skt = sys.argv[5] scyc = sys.argv[6] # ka = int(sa, 16) kb = int(sb, 16) # kangoo_powerT = int(skt, 10) kangoo_powerW = int(skw, 10) Cycle = 10**(int(scyc,10))
Nt = 2**kangoo_powerT Nw = 2**kangoo_powerW X = int(s, 16) Y = X2Y(X % (2**256)) if Y % 2 != (X >> 256) % 2: Y = modulo - Y X = X % (2**256) W0 = Point(X,Y)
starttime = oldtime = time.time() Hops = 0 random.seed() solved=0 search() print('Done ...')
command: $python play3.py 03a2efa402fd5268400c77c20e574ba86409ededee7c4020e4b9f0edbee53de0d4 8000000000 FFFFFFFFFF 3 3 6 P-table prepared tame and wild herds are prepared Total rate 175651 h/s, Total W 33, Total T 29 Total rate 173849 h/s, Total W 59, Total T 45 Total rate 174196 h/s, Total W 92, Total T 85 Total rate 171762 h/s, Total W 111, Total T 111 Total rate 172377 h/s, Total W 138, Total T 139 total time: 28.81 sec SOLVED: E9AE4933D6 Done ... My previous hopping speed was around 110000. > I removed text files wild.txt and tame.txt > gained speed because A) I update wild and tame lists outside calculation loops B) I do not check collisions (comparator) at each step in the while loop, but only once every cycle (if (Hops % Cycle) == One more thing, you can experiment with different tame and wild kangaroo herd sizes Nw and Nt.
|
|
|
|
MeBender
Jr. Member
Offline
Activity: 114
Merit: 5
|
|
September 16, 2019, 07:46:37 PM |
|
hey has anyone checked out vanitysearch?
With vanitygen I get 100MKey/s, with cubitcrack I get 350Mkey/s but with vanitysearch I get 1000Mkey/s and that's on a 1080ti
Vanitysearch has a starting point parameter but no end point parameter but I reckon the code could be altered for keyspace parameters
|
CryptoCoin - The latest Cuckoo Cycle coin - https://crypt-o-coin.cash Github: https://github.com/GonzoTheDev
|
|
|
racminer
Member
Offline
Activity: 245
Merit: 17
|
|
September 16, 2019, 09:06:16 PM |
|
hey has anyone checked out vanitysearch?
With vanitygen I get 100MKey/s, with cubitcrack I get 350Mkey/s but with vanitysearch I get 1000Mkey/s and that's on a 1080ti
Vanitysearch has a starting point parameter but no end point parameter but I reckon the code could be altered for keyspace parameters
-snip- Suggestions are always welcome.
The brute force way: Start @ ~607809 (multiplied the last known value by 1.7) convert to hex, create addresses, check if one address matches the next in turn. What would be the best tool to attack this in a brute force way while we all think on something better or discover a easier way? Some GPU bot would be the best to brute force it, like shorena was saying. Need to code one, but I'm not in the mood now Anyone out there doing it? Or maybe there is something existing? I think the best existing tool currently is yours or otherwise private. I would think the best way would be to modify (ocl)vanitygen according to BurtW's suggestion. You would need to limit the random number generator to a certain amount of bits and keep the rest. Yes lol ... vanitygen is being checked since 2015, early days of the "~32 BTC prize to who solves it"
|
|
|
|
MeBender
Jr. Member
Offline
Activity: 114
Merit: 5
|
|
September 16, 2019, 09:40:54 PM |
|
Yeah I know vanitygen has been around a while but I found another vanity program called vanitysearch that is 10 times faster than vanitygen and 3 times as fast as bitcrack, at least it is with my 1080ti! https://github.com/JeanLucPons/VanitySearch
|
CryptoCoin - The latest Cuckoo Cycle coin - https://crypt-o-coin.cash Github: https://github.com/GonzoTheDev
|
|
|
AirShark
Newbie
Offline
Activity: 28
Merit: 0
|
|
September 17, 2019, 04:54:42 AM |
|
MeBenderAchievement: you invented a bicycle
|
|
|
|
brainless
Member
Offline
Activity: 330
Merit: 34
|
|
September 17, 2019, 05:30:36 AM |
|
This is my code (only monocore for obvious reasons ) import time import random import math import sys import gmpy2 import os
modulo = 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFC2F order = 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 Gx = 0x79BE667EF9DCBBAC55A06295CE870B07029BFCDB2DCE28D959F2815B16F81798 Gy = 0x483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8
class Point: def __init__(self, x=0, y=0): self.x = x self.y = y
PG = Point(Gx,Gy) Z = Point(0,0) # zero-point, infinite in real x,y - plane def mul2(P, p = modulo): R = Point() c = 3*P.x*P.x*gmpy2.invert(2*P.y, p) % p R.x = (c*c-2*P.x) % p R.y = (c*(P.x - R.x)-P.y) % p return R
def addk(Pk, Qk, Nn, p = modulo): R = Point() Rk=[] for k in range(Nn): P=Pk[k] Q=Qk[k] R=add(P, Q) Rk.append(R) return Rk
def add(P, Q, p = modulo): R = Point() dx = Q.x - P.x dy = Q.y - P.y c = dy * gmpy2.invert(dx, p) % p R.x = (c*c - P.x - Q.x) % p R.y = (c*(P.x - R.x) - P.y) % p return R # 6 sub, 3 mul, 1 inv
def mulk(k, P = PG, p = modulo): if k == 0: return Z elif k == 1: return P elif (k % 2 == 0): return mulk(k>>1, mul2(P, p), p) else: return add(P, mulk( (k-1)>>1, mul2(P, p), p), p)
def X2Y(X, p = modulo): if p % 4 != 3: print ('prime must be 3 modulo 4') return 0 X = (X**3+7)%p pw = (p + 1) // 4 Y = 1 for w in range(256): if (pw >> w) & 1 == 1: tmp = X for k in range(w): tmp = (tmp**2)%p Y *= tmp Y %= p return Y
def comparator(A,B,Ak,Bk): result = list(set(A) & set(B)) if len(result) > 0: sol_kt = A.index(result[0]) sol_kw = B.index(result[0]) d = Ak[sol_kt] - Bk[sol_kw] print ('total time: %.2f sec' % (time.time()-starttime )) print ('SOLVED: %64X' % d + '\n') file = open("results.txt",'a') file.write(('%X'%(Ak[sol_kt] - Bk[sol_kw])) + ' - total time: %.2f sec' % (time.time()-starttime) +'\n') file.write("---------------\n") file.close() return True else: return False
Ptable = [PG] for k in range(255): Ptable.append(mul2(Ptable[k])) print ('P-table prepared')
def search(): global solved s=(ka+kb)>>1 d=(kb-ka) problem=int(math.log(d,2)) DP_rarity = 1 << ((problem - kangoo_powerT - kangoo_powerW)//2 - 2) hop_modulo = (problem-1 + kangoo_powerT+kangoo_powerW)//2 T, t, dt = [], [], [] W, w, dw = [], [], [] PW,PT = [],[] buft,bufw,buftk,bufwk = [],[],[],[] for k in range(Nt): qt=s+random.randint(1,d) t.append(qt) T.append(mulk(t[k])) PT.append(W0) dt.append(0) for k in range(Nw): qw=random.randint(1, d) w.append(qw) W.append(add(W0,mulk(w[k]))) PW.append(W0) dw.append(0) print ('tame and wild herds are prepared') oldtime = time.time() starttime = oldtime Hops, Hops_old = 0, 0 t0 = time.time() oldtime = time.time() starttime = oldtime while (1): for k in range(Nt): Hops += 1 ptk = T[k].x if ptk % (DP_rarity) == 0: buft.append(ptk) buftk.append(t[k]) pw = ptk % hop_modulo dt[k] = 1 << pw t[k] += dt[k] PT[k] = Ptable[pw] T=addk(PT, T, Nt) for k in range(Nw): Hops += 1 pwk = W[k].x if pwk % (DP_rarity) == 0: bufw.append(pwk) bufwk.append(w[k]) pw = pwk % hop_modulo dw[k] = 1 << pw w[k] += dw[k] PW[k] = Ptable[pw] W=addk(PW, W, Nw) t1 = time.time() if (Hops % Cycle) == 0: hopsp = (Hops-Hops_old)/(t1-t0) print('Total rate %d h/s, Total W %d, Total T %d' % (hopsp,len(bufw),len(buft))) if comparator(buft,bufw,buftk,bufwk) : solved=1 return t0 = t1 Hops_old = Hops return s=sys.argv[1] sa = sys.argv[2] sb = sys.argv[3] skw = sys.argv[4] skt = sys.argv[5] scyc = sys.argv[6] # ka = int(sa, 16) kb = int(sb, 16) # kangoo_powerT = int(skt, 10) kangoo_powerW = int(skw, 10) Cycle = 10**(int(scyc,10))
Nt = 2**kangoo_powerT Nw = 2**kangoo_powerW X = int(s, 16) Y = X2Y(X % (2**256)) if Y % 2 != (X >> 256) % 2: Y = modulo - Y X = X % (2**256) W0 = Point(X,Y)
starttime = oldtime = time.time() Hops = 0 random.seed() solved=0 search() print('Done ...')
command: $python play3.py 03a2efa402fd5268400c77c20e574ba86409ededee7c4020e4b9f0edbee53de0d4 8000000000 FFFFFFFFFF 3 3 6 P-table prepared tame and wild herds are prepared Total rate 175651 h/s, Total W 33, Total T 29 Total rate 173849 h/s, Total W 59, Total T 45 Total rate 174196 h/s, Total W 92, Total T 85 Total rate 171762 h/s, Total W 111, Total T 111 Total rate 172377 h/s, Total W 138, Total T 139 total time: 28.81 sec SOLVED: E9AE4933D6 Done ... My previous hopping speed was around 110000. > I removed text files wild.txt and tame.txt > gained speed because A) I update wild and tame lists outside calculation loops B) I do not check collisions (comparator) at each step in the while loop, but only once every cycle (if (Hops % Cycle) == One more thing, you can experiment with different tame and wild kangaroo herd sizes Nw and Nt. its single pubkey cheking can you add read from pubkey.txt ( where more then 1 pubkey listed) for check in same bit range
|
13sXkWqtivcMtNGQpskD78iqsgVy9hcHLF
|
|
|
iparktur
Jr. Member
Offline
Activity: 119
Merit: 1
|
|
September 17, 2019, 07:30:04 AM |
|
Yeah I know vanitygen has been around a while but I found another vanity program called vanitysearch that is 10 times faster than vanitygen and 3 times as fast as bitcrack, at least it is with my 1080ti! https://github.com/JeanLucPons/VanitySearchThis one ( VanitySearch.exe 1.15 ) is infected with a virus.
|
|
|
|
MeBender
Jr. Member
Offline
Activity: 114
Merit: 5
|
|
September 17, 2019, 08:46:33 AM Last edit: September 17, 2019, 08:58:01 AM by MeBender |
|
Yeah I know vanitygen has been around a while but I found another vanity program called vanitysearch that is 10 times faster than vanitygen and 3 times as fast as bitcrack, at least it is with my 1080ti! https://github.com/JeanLucPons/VanitySearchThis one ( VanitySearch.exe 1.15 ) is infected with a virus. Ah crap is it? what virus? Edit: I just scanned it with kaspersky online and it said no threats found, also my windows defender didn't pick anything up? Edit 2: Zielar already found it lol https://github.com/JeanLucPons/VanitySearch/issues/23
|
CryptoCoin - The latest Cuckoo Cycle coin - https://crypt-o-coin.cash Github: https://github.com/GonzoTheDev
|
|
|
almightyruler
Legendary
Offline
Activity: 2268
Merit: 1092
|
|
September 17, 2019, 08:55:06 AM |
|
This one ( VanitySearch.exe 1.15 ) is infected with a virus.
Ah crap is it? what virus? Could be a false positive, since searching for vanity addresses is similar to proof-of-work mining. It may be detected as mining malware. I've seen some coin clients that I compiled myself -- on a NON Windows system -- throw up antivirus warnings...
|
|
|
|
ayiphelmy
Copper Member
Full Member
Offline
Activity: 416
Merit: 105
|
|
September 17, 2019, 11:48:52 AM |
|
hey has anyone checked out vanitysearch?
With vanitygen I get 100MKey/s, with cubitcrack I get 350Mkey/s but with vanitysearch I get 1000Mkey/s and that's on a 1080ti
Vanitysearch has a starting point parameter but no end point parameter but I reckon the code could be altered for keyspace parameters
can u show me example bat command?
|
|
|
|
cactus87
Member
Offline
Activity: 112
Merit: 16
|
|
September 17, 2019, 12:41:21 PM |
|
nice thread thank you. I join the game, with a laptop I have no chance at all
|
|
|
|
iparktur
Jr. Member
Offline
Activity: 119
Merit: 1
|
|
September 17, 2019, 01:29:53 PM |
|
Yeah I know vanitygen has been around a while but I found another vanity program called vanitysearch that is 10 times faster than vanitygen and 3 times as fast as bitcrack, at least it is with my 1080ti! https://github.com/JeanLucPons/VanitySearchThis one ( VanitySearch.exe 1.15 ) is infected with a virus. Ah crap is it? what virus? Edit: I just scanned it with kaspersky online and it said no threats found, also my windows defender didn't pick anything up? Edit 2: Zielar already found it lol https://github.com/JeanLucPons/VanitySearch/issues/23SecureAge APEX - MaliciousSophos ML - Heuristic
|
|
|
|
MeBender
Jr. Member
Offline
Activity: 114
Merit: 5
|
|
September 17, 2019, 01:51:02 PM |
|
Yeah I know vanitygen has been around a while but I found another vanity program called vanitysearch that is 10 times faster than vanitygen and 3 times as fast as bitcrack, at least it is with my 1080ti! https://github.com/JeanLucPons/VanitySearchThis one ( VanitySearch.exe 1.15 ) is infected with a virus. Ah crap is it? what virus? Edit: I just scanned it with kaspersky online and it said no threats found, also my windows defender didn't pick anything up? Edit 2: Zielar already found it lol https://github.com/JeanLucPons/VanitySearch/issues/23SecureAge APEX - MaliciousSophos ML - HeuristicAs almightyruler said, it's probably just picking up on the fact that it's essentially a modified crypto miner, but can you provide more details? I have it running on my main PC and I don't want any viruses
|
CryptoCoin - The latest Cuckoo Cycle coin - https://crypt-o-coin.cash Github: https://github.com/GonzoTheDev
|
|
|
MrFreeDragon
|
|
September 18, 2019, 08:53:17 PM |
|
62. Wallet
Private Key : KwDiBf89QgGbjEhKnhXJuH7LrciVrZi3qYpCemuaUp7NigjvtJug
Public Key : 03231a67e424caf7d01a00d5cd49b0464942255b8e48766f96602bdfa4ea14fea8
Private Key (Hex): 363D541EB611ABEE Private Key (Decimal): 3908372542507822062
Another private key to wallet #62: HEX: FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BF60FB2AB8647ED2F DEC: 115792089237316195423570985008687907852837564279074904382609071514060669316399 WIF: L5oLkpV3aqBjhki6LmvChTCV6odsp4SXM6LBVeqHTSj1w9XhwfuR
|
|
|
|
supika
Newbie
Offline
Activity: 43
Merit: 0
|
|
September 18, 2019, 09:06:48 PM |
|
62. Wallet
Private Key : KwDiBf89QgGbjEhKnhXJuH7LrciVrZi3qYpCemuaUp7NigjvtJug
Public Key : 03231a67e424caf7d01a00d5cd49b0464942255b8e48766f96602bdfa4ea14fea8
Private Key (Hex): 363D541EB611ABEE Private Key (Decimal): 3908372542507822062
Another private key to wallet #62: HEX: FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BF60FB2AB8647ED2F DEC: 115792089237316195423570985008687907852837564279074904382609071514060669316399 WIF: L5oLkpV3aqBjhki6LmvChTCV6odsp4SXM6LBVeqHTSj1w9XhwfuR WTF? It`s possible to exist 2 private keys for the same address?
|
|
|
|
MeBender
Jr. Member
Offline
Activity: 114
Merit: 5
|
|
September 18, 2019, 09:13:29 PM |
|
62. Wallet
Private Key : KwDiBf89QgGbjEhKnhXJuH7LrciVrZi3qYpCemuaUp7NigjvtJug
Public Key : 03231a67e424caf7d01a00d5cd49b0464942255b8e48766f96602bdfa4ea14fea8
Private Key (Hex): 363D541EB611ABEE Private Key (Decimal): 3908372542507822062
Another private key to wallet #62: HEX: FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BF60FB2AB8647ED2F DEC: 115792089237316195423570985008687907852837564279074904382609071514060669316399 WIF: L5oLkpV3aqBjhki6LmvChTCV6odsp4SXM6LBVeqHTSj1w9XhwfuR WTF? lol that key is outside of bitcoins curve range, what is he talking about?
|
CryptoCoin - The latest Cuckoo Cycle coin - https://crypt-o-coin.cash Github: https://github.com/GonzoTheDev
|
|
|
MrFreeDragon
|
|
September 18, 2019, 09:38:30 PM |
|
This "another" key works as well. Try to check it in bitcoin address generator, or try to import this file into your wallet. You will receive the access to the same address of wallet #62 lol )
|
|
|
|
racminer
Member
Offline
Activity: 245
Merit: 17
|
|
September 18, 2019, 10:40:39 PM |
|
This "another" key works as well. Try to check it in bitcoin address generator, or try to import this file into your wallet. You will receive the access to the same address of wallet #62 lol )
This private key does not appear to be on the ECDSA curve
|
|
|
|
almightyruler
Legendary
Offline
Activity: 2268
Merit: 1092
|
|
September 19, 2019, 02:09:32 AM |
|
This "another" key works as well. Try to check it in bitcoin address generator, or try to import this file into your wallet. You will receive the access to the same address of wallet #62 lol )
Maximum value for secp256k1 is: FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFE BAAEDCE6 AF48A03B BFD25E8C D0364141Your key is above this value: FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFE BAAEDCE6 AF48A03B F60FB2AB 8647ED2FSome software will correctly reject this out of range value, but others will just overflow and wrap max+1 to 0. The result of F60FB2AB 8647ED2F minus BFD25E8C D0364141 is 363D541E B611ABEE, which is the "proper" key. That's why your key works: when wrapped around it ends up being the same calculated value. (If this was a clever joke, sorry that I spoiled it. )
|
|
|
|
|