Bitcoin Forum
September 16, 2019, 05:35:15 PM *
News: If you like a topic and you see an orange "bump" link, click it. More info.
 
   Home   Help Search Login Register More  
Pages: « 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 [18] 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 »
  Print  
Author Topic: [ARCHIVE] Bitcoin challenge discusion  (Read 21590 times)
racminer
Member
**
Offline Offline

Activity: 196
Merit: 16


View Profile
September 16, 2019, 03:44:47 PM
 #341

Here is the code with my changes
Code:

import time
import random
import gmpy2
import math
import sys

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

# return (g, x, y) a*x + b*y = gcd(x, y)
def egcd(a, b):
    if a == 0:
        return (b, 0, 1)
    else:
        g, x, y = egcd(b % a, a)
        return (g, y - (b // a) * x, x)

def rev(b, n = modulo):
    while b < 0:
        b += modulo
    g, x, _ = egcd(b, n)
    if g == 1:
        return x % n
       
def mul2(P, p = modulo):
    R = Point()
#    c = 3*P.x*P.x*rev(2*P.y, p) % p
    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 add(P, Q, p = modulo):
    R = Point()
    dx = Q.x - P.x
    dy = Q.y - P.y   
    c = dy * gmpy2.invert(dx, p) % p     
    #c = dy * rev(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/2, mul2(P, p), p)
    else:
        return add(P, mulk( (k-1)/2, 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, Ak, B, Bk = [], [], [], []
    with open('tame.txt') as f:
        for line in f:
            L = line.split()
            a = int(L[0],16)
            b = int(L[1],16)
            A.append(a)
            Ak.append(b)
    with open('wild.txt') as f:
        for line in f:
            L = line.split()
            a = int(L[0],16)
            b = int(L[1],16)
            B.append(a)
            Bk.append(b)
    result = list(set(A) & set(B))
    if len(result) > 0:
        sol_kt = A.index(result[0])
        sol_kw = B.index(result[0])
        print ('total time: %.2f sec' % (time.time()-starttime))
        d = Ak[sol_kt] - Bk[sol_kw]
        print ('SOLVED: %64X' % d + '\n')
        file = open("results.txt",'a')
        file.write(('%X'%(Ak[sol_kt] - Bk[sol_kw])) + "\n")
        file.write("---------------\n")
        file.close()
        return True
    else:
        return False

def check(P, Pindex, DP_rarity, file2save):
    if P.x % (DP_rarity) == 0:
        file = open(file2save,'a')
        file.write(('%064X %064X'%(P.x,Pindex)) + "\n")
        file.close()
        return comparator()
    else:
        return False
   
P = [PG]
for k in range(255): P.append(mul2(P[k]))   
print ('P-table prepared')   

def search(a,b):
    global solved
    s=(a+b)>>1
    d=(b-a)
    problem=int(math.log(d,2))
#    print(a,b,s,d,'\n')
    DP_rarity = 1 << ((problem -  2*kangoo_power)//2 - 2)
    hop_modulo = ((problem-1)// 2) + kangoo_power
    T, t, dt = [], [], []
    W, w, dw = [], [], []
    for k in range(Nt):
        qtf= s
        qtr= random.randint(1,d)
 #       print('tame\n',qtf,qtr)
        qt=qtf+qtr
        t.append(qt) 
        T.append(mulk(t[k]))
        dt.append(0)
    for k in range(Nw):
        qw=(random.randint(1, d))
  #      print('wild\n',qw)
        w.append(qw)
        W.append(add(W0,mulk(w[k])))
        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
            pw = T[k].x % hop_modulo
            dt[k] = 1 << pw
            solved = check(T[k], t[k], DP_rarity, "tame.txt")
            if solved: break
            t[k] += dt[k]
            T[k] = add(P[pw], T[k])
        if solved: break           
        for k in range(Nw):
            Hops += 1
            pw = W[k].x % hop_modulo
            dw[k] = 1 << pw
            solved = check(W[k], w[k], DP_rarity, "wild.txt")
            if solved: break
            w[k] += dw[k]
            W[k] = add(P[pw], W[k])
        if solved: break
        t1 = time.time()
        if (t1-t0) > 5:
            print ('%.3f h/s'%((Hops-Hops_old)/(t1-t0)))
            t0 = t1
            Hops_old = Hops
    hops_list.append(Hops)       
    print ('Hops:', Hops)       
    return 'sol. time: %.2f sec' % (time.time()-starttime)   

s=sys.argv[1]
sa = sys.argv[2]
sb = sys.argv[3]
sk = sys.argv[4]
a = int(sa, 16)
b = int(sb, 16)
kangoo_power = int(sk, 10)
Nt = Nw = 2**kangoo_power
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()

hops_list = []

solved = False
open("tame.txt",'w').close()
open("wild.txt",'w').close()
search(a,b)

Example (case 32)

python kang.py 0387dc70db1806cd9a9a76637412ec11dd998be666584849b3185f7f9313c8fd28 80000000 FFFFFFFF 3

(the last number 3 is the kangooro_power)

P-table prepared
tame and wild herds are prepared
total time: 0.21 sec
SOLVED:                                                         7D4FE747

('Hops:', 23072)


 python 2.py 03d2063d40402f030d4cc71331468827aa41a8a09bd6fd801ba77fb64f8e67e617 0xaf55fc59c335c8e0000000000 0xaf55fc59c335c8f0000000000 3
P-table prepared
tame and wild herds are prepared
220012.055 h/s
229034.780 h/s
total time: 11.90 sec
SOLVED:                                        AF55FC59C335C8EC67ED24826

('Hops:', 2691957)


Nice

I see you reproduce the example I mentioned here https://bitcointalk.org/index.php?topic=5173445.msg52376505#msg52376505
(If you are using windows, you might get the wrong answer for case > 60 bit)


I've optimized the code. Hopping speed improved about  50% per core.
with 4 cores I've reached 850000 h/s.
Timing:
Code:
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



 
1582135621
Hero Member
*
Offline Offline

Posts: 1582135621

View Profile Personal Message (Offline)

Ignore
1582135621
Reply with quote  #2

1582135621
Report to moderator
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction. Advertise here.
vimp666
Newbie
*
Offline Offline

Activity: 30
Merit: 0


View Profile
September 16, 2019, 04:16:12 PM
 #342

Here is the code with my changes
Code:

import time
import random
import gmpy2
import math
import sys

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

# return (g, x, y) a*x + b*y = gcd(x, y)
def egcd(a, b):
    if a == 0:
        return (b, 0, 1)
    else:
        g, x, y = egcd(b % a, a)
        return (g, y - (b // a) * x, x)

def rev(b, n = modulo):
    while b < 0:
        b += modulo
    g, x, _ = egcd(b, n)
    if g == 1:
        return x % n
        
def mul2(P, p = modulo):
    R = Point()
#    c = 3*P.x*P.x*rev(2*P.y, p) % p
    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 add(P, Q, p = modulo):
    R = Point()
    dx = Q.x - P.x
    dy = Q.y - P.y    
    c = dy * gmpy2.invert(dx, p) % p    
    #c = dy * rev(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/2, mul2(P, p), p)
    else:
        return add(P, mulk( (k-1)/2, 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, Ak, B, Bk = [], [], [], []
    with open('tame.txt') as f:
        for line in f:
            L = line.split()
            a = int(L[0],16)
            b = int(L[1],16)
            A.append(a)
            Ak.append(b)
    with open('wild.txt') as f:
        for line in f:
            L = line.split()
            a = int(L[0],16)
            b = int(L[1],16)
            B.append(a)
            Bk.append(b)
    result = list(set(A) & set(B))
    if len(result) > 0:
        sol_kt = A.index(result[0])
        sol_kw = B.index(result[0])
        print ('total time: %.2f sec' % (time.time()-starttime))
        d = Ak[sol_kt] - Bk[sol_kw]
        print ('SOLVED: %64X' % d + '\n')
        file = open("results.txt",'a')
        file.write(('%X'%(Ak[sol_kt] - Bk[sol_kw])) + "\n")
        file.write("---------------\n")
        file.close()
        return True
    else:
        return False

def check(P, Pindex, DP_rarity, file2save):
    if P.x % (DP_rarity) == 0:
        file = open(file2save,'a')
        file.write(('%064X %064X'%(P.x,Pindex)) + "\n")
        file.close()
        return comparator()
    else:
        return False
    
P = [PG]
for k in range(255): P.append(mul2(P[k]))    
print ('P-table prepared')    

def search(a,b):
    global solved
    s=(a+b)>>1
    d=(b-a)
    problem=int(math.log(d,2))
#    print(a,b,s,d,'\n')
    DP_rarity = 1 << ((problem -  2*kangoo_power)//2 - 2)
    hop_modulo = ((problem-1)// 2) + kangoo_power
    T, t, dt = [], [], []
    W, w, dw = [], [], []
    for k in range(Nt):
        qtf= s
        qtr= random.randint(1,d)
 #       print('tame\n',qtf,qtr)
        qt=qtf+qtr
        t.append(qt)  
        T.append(mulk(t[k]))
        dt.append(0)
    for k in range(Nw):
        qw=(random.randint(1, d))
  #      print('wild\n',qw)
        w.append(qw)
        W.append(add(W0,mulk(w[k])))
        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
            pw = T[k].x % hop_modulo
            dt[k] = 1 << pw
            solved = check(T[k], t[k], DP_rarity, "tame.txt")
            if solved: break
            t[k] += dt[k]
            T[k] = add(P[pw], T[k])
        if solved: break            
        for k in range(Nw):
            Hops += 1
            pw = W[k].x % hop_modulo
            dw[k] = 1 << pw
            solved = check(W[k], w[k], DP_rarity, "wild.txt")
            if solved: break
            w[k] += dw[k]
            W[k] = add(P[pw], W[k])
        if solved: break
        t1 = time.time()
        if (t1-t0) > 5:
            print ('%.3f h/s'%((Hops-Hops_old)/(t1-t0)))
            t0 = t1
            Hops_old = Hops
    hops_list.append(Hops)        
    print ('Hops:', Hops)        
    return 'sol. time: %.2f sec' % (time.time()-starttime)    

s=sys.argv[1]
sa = sys.argv[2]
sb = sys.argv[3]
sk = sys.argv[4]
a = int(sa, 16)
b = int(sb, 16)
kangoo_power = int(sk, 10)
Nt = Nw = 2**kangoo_power
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()

hops_list = []

solved = False
open("tame.txt",'w').close()
open("wild.txt",'w').close()
search(a,b)

Example (case 32)

python kang.py 0387dc70db1806cd9a9a76637412ec11dd998be666584849b3185f7f9313c8fd28 80000000 FFFFFFFF 3

(the last number 3 is the kangooro_power)

P-table prepared
tame and wild herds are prepared
total time: 0.21 sec
SOLVED:                                                         7D4FE747

('Hops:', 23072)


 python 2.py 03d2063d40402f030d4cc71331468827aa41a8a09bd6fd801ba77fb64f8e67e617 0xaf55fc59c335c8e0000000000 0xaf55fc59c335c8f0000000000 3
P-table prepared
tame and wild herds are prepared
220012.055 h/s
229034.780 h/s
total time: 11.90 sec
SOLVED:                                        AF55FC59C335C8EC67ED24826

('Hops:', 2691957)


Nice

I see you reproduce the example I mentioned here https://bitcointalk.org/index.php?topic=5173445.msg52376505#msg52376505
(If you are using windows, you might get the wrong answer for case > 60 bit)


I've optimized the code. Hopping speed improved about  50% per core.
with 4 cores I've reached 850000 h/s.
Timing:
Code:
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



 
but in your post the old code.
Firebox
Jr. Member
*
Offline Offline

Activity: 52
Merit: 3


View Profile
September 16, 2019, 05:22:09 PM
 #343

I've optimized the code. Hopping speed improved about  50% per core.
with 4 cores I've reached 850000 h/s.
Timing:
Code:
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 Offline

Activity: 196
Merit: 16


View Profile
September 16, 2019, 07:02:21 PM
 #344

This is my code (only monocore for obvious reasons  Grin )
Code:
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
Newbie
*
Offline Offline

Activity: 41
Merit: 0


View Profile
September 16, 2019, 07:46:37 PM
 #345

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
racminer
Member
**
Offline Offline

Activity: 196
Merit: 16


View Profile
September 16, 2019, 09:06:16 PM
 #346

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 Smiley

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
Newbie
*
Offline Offline

Activity: 41
Merit: 0


View Profile
September 16, 2019, 09:40:54 PM
 #347

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
AirShark
Newbie
*
Offline Offline

Activity: 28
Merit: 0


View Profile
September 17, 2019, 04:54:42 AM
 #348

MeBender
Achievement: you invented a bicycle  Wink
brainless
Jr. Member
*
Offline Offline

Activity: 41
Merit: 1


View Profile
September 17, 2019, 05:30:36 AM
 #349

This is my code (only monocore for obvious reasons  Grin )
Code:
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
iparktur
Newbie
*
Offline Offline

Activity: 114
Merit: 0


View Profile WWW
September 17, 2019, 07:30:04 AM
 #350

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

This one  ( VanitySearch.exe 1.15  ) is infected with a virus.
MeBender
Newbie
*
Offline Offline

Activity: 41
Merit: 0


View Profile
September 17, 2019, 08:46:33 AM
Last edit: September 17, 2019, 08:58:01 AM by MeBender
 #351

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

This 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
almightyruler
Legendary
*
Offline Offline

Activity: 2198
Merit: 1077


View Profile
September 17, 2019, 08:55:06 AM
 #352

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 Offline

Activity: 351
Merit: 104


View Profile
September 17, 2019, 11:48:52 AM
 #353

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 Offline

Activity: 111
Merit: 11


View Profile
September 17, 2019, 12:41:21 PM
 #354

nice thread thank you.
I join the game, with a laptop Cheesy I have no chance at all

iparktur
Newbie
*
Offline Offline

Activity: 114
Merit: 0


View Profile WWW
September 17, 2019, 01:29:53 PM
 #355

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

This 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

SecureAge APEX - Malicious
Sophos ML         - Heuristic
MeBender
Newbie
*
Offline Offline

Activity: 41
Merit: 0


View Profile
September 17, 2019, 01:51:02 PM
 #356

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

This 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

SecureAge APEX - Malicious
Sophos ML         - Heuristic

As 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
MrFreeDragon
Full Member
***
Offline Offline

Activity: 193
Merit: 107


View Profile
September 18, 2019, 08:53:17 PM
 #357

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 Offline

Activity: 37
Merit: 0


View Profile
September 18, 2019, 09:06:48 PM
 #358

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?Huh It`s possible to exist 2 private keys for the same address?
MeBender
Newbie
*
Offline Offline

Activity: 41
Merit: 0


View Profile
September 18, 2019, 09:13:29 PM
 #359

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?Huh

lol that key is outside of bitcoins curve range, what is he talking about?
MrFreeDragon
Full Member
***
Offline Offline

Activity: 193
Merit: 107


View Profile
September 18, 2019, 09:38:30 PM
 #360

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 )
Pages: « 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 [18] 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 »
  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!