Author

Topic: Bitcoin puzzle transaction ~32 BTC prize to who solves it - page 114. (Read 215611 times)

member
Activity: 462
Merit: 24
I am currently working on a method that allows you to find a key in bit30 in less than 10 seconds

Just 10 seconds?

Here's a script that does it in 2 seconds. In Python.

Code:
import time, random, sys, os, secp256k1 as ice
puzzle = 30
target = "1LHtnpd8nU5VHEMkG2TMYYNUjjLc992bps"
lower_range_limit = 2 ** (puzzle - 1);upper_range_limit = (2 ** puzzle) - 1
if os.name=='nt':os.system('cls')
else:os.system('clear')
t = time.ctime();sys.stdout.write(f"\033[?25l");sys.stdout.write(f"\033[01;33m[+] STARTED: {t}\n")
sys.stdout.write(f"[+] Puzzle: {puzzle}\n")
sys.stdout.write(f"[+] Lower range limit: {lower_range_limit}\n")
sys.stdout.write(f"[+] Upper range limit: {upper_range_limit}\n")
while True:
    constant_prefix = b'yx\xcb\x08\xb70'
    prefix_length = len(constant_prefix);length = 8
    ending_length = length - prefix_length;ending_bytes = os.urandom(ending_length)
    random_bytes = constant_prefix + ending_bytes
    random.seed(random_bytes)
    dec = random.randint(lower_range_limit, upper_range_limit)
    caddr = ice.privatekey_to_address(0, True, dec)
    message = "\r[+] {}".format(dec);messages = []
    messages.append(message);output = "\033[01;33m" + ''.join(messages) + "\r"
    sys.stdout.write(output);sys.stdout.flush()
    if caddr == target:
        HEX = "%064x" % dec;wifc = ice.btc_pvk_to_wif(HEX);t = time.ctime()
        print(f'[+] SOLVED:  {t}');print(f'[+] Bitcoin address Compressed: {caddr}')
        print(f'[+] Private key (wif) Compressed: {wifc}');print(f'[+] Random Seed: {random_bytes}')
        break

  • STARTED: Sat Nov 25 05:07:51 2023
  • Puzzle: 30
  • Lower range limit: 536870912
  • Upper range limit: 1073741823
  • SOLVED:  Sat Nov 25 05:07:52 2023
  • Bitcoin address Compressed: 1LHtnpd8nU5VHEMkG2TMYYNUjjLc992bps
  • Private key (wif) Compressed: KwDiBf89QgGbjEhKnhXJuH7LrciVrZi3qYjgd9M8diLSC5MyERoW
  • Random Seed: b'yx\xcb\x08\xb70l\xf1'

 Grin
nice code, this version goes 3 times faster
Code:
import random, os, secp256k1 as ice
puzzle = 30
#target = "1LHtnpd8nU5VHEMkG2TMYYNUjjLc992bps"
target = "d39c4704664e1deb76c9331e637564c257d68a08"
lower_range_limit = 2 ** (puzzle - 1);upper_range_limit = (2 ** puzzle) - 1
for x in range(1000000):
 constant_prefix = b'yx\xcb\x08\xb70'
 prefix_length = len(constant_prefix);length = 8
 ending_length = length - prefix_length;ending_bytes = os.urandom(ending_length)
 random_bytes = constant_prefix + ending_bytes
 random.seed(random_bytes)
 dec = random.randint(lower_range_limit, upper_range_limit)
 caddr = ice.privatekey_to_h160(0, True, dec).hex()
 if caddr == target:
  print(caddr,dec)
  break

The problem is that there has to be a method to find out what a random seed is.
For each Puzzle i start from 0 - constant_prefix = b''
for x in range won't work above puzzle 40 - it needs at least 200 million seeds to go through the script.

For example here I am hunting random seed for Puzzle 65:

Code:
import time, random, sys, os, secp256k1 as ice
puzzle = 65
target = 30568377312064202855
lower_range_limit = 2 ** (puzzle - 1);upper_range_limit = (2 ** puzzle) - 1

while True:
    constant_prefix = b'\xc9\xd9\x1d\xbc\x16\x9d'
    prefix_length = len(constant_prefix);length = 8
    ending_length = length - prefix_length;ending_bytes = os.urandom(ending_length)
    random_bytes = constant_prefix + ending_bytes
    random.seed(random_bytes)
    dec = random.randint(lower_range_limit, upper_range_limit)
    if str(dec).startswith("30568377"):
        message = "\r[+] {} , {}".format(dec, random_bytes);messages = []
        messages.append(message);output = "\033[01;33m" + ''.join(messages) + "\r"
        sys.stdout.write(output);sys.stdout.flush()
        if dec == target:
            caddr = ice.privatekey_to_address(0, True, dec)
            HEX = "%064x" % dec;wifc = ice.btc_pvk_to_wif(HEX);t = time.ctime()
            print(f'[+] SOLVED:  {t}');print(f'[+] Bitcoin address Compressed: {caddr}')
            print(f'[+] Private key (wif) Compressed: {wifc}');print(f'[+] Random Seed: {random_bytes}')
            break

First you search for the seed  with - constant_prefix = b'' - for the first 8 numbers -  if str(dec).startswith("30568377") - then you write the result in the script itself - constant_prefix = b'\xc9\xd9\x1d\xbc\x16\x9d'
Then you go to 10 (removing manually the last two bytes at the end) and so on until you hit  full WIF.

The closest I've come up  to 2 ** 65

30568377238562584866, b'\xc9\xd9\x1d\xbc\x16\x9d\xdb\x86'

But what  if is not  length = 8 ? can be 9, 10, 11 ....and so on  Grin

What if hypothetically there is a common seed for all puzzles, let's say on the seed  length = 28  ?
I'll never know because I've never even attempted that length Roll Eyes
jr. member
Activity: 56
Merit: 1
I am currently working on a method that allows you to find a key in bit30 in less than 10 seconds

Just 10 seconds?

Here's a script that does it in 2 seconds. In Python.

Code:
import time, random, sys, os, secp256k1 as ice
puzzle = 30
target = "1LHtnpd8nU5VHEMkG2TMYYNUjjLc992bps"
lower_range_limit = 2 ** (puzzle - 1);upper_range_limit = (2 ** puzzle) - 1
if os.name=='nt':os.system('cls')
else:os.system('clear')
t = time.ctime();sys.stdout.write(f"\033[?25l");sys.stdout.write(f"\033[01;33m[+] STARTED: {t}\n")
sys.stdout.write(f"[+] Puzzle: {puzzle}\n")
sys.stdout.write(f"[+] Lower range limit: {lower_range_limit}\n")
sys.stdout.write(f"[+] Upper range limit: {upper_range_limit}\n")
while True:
    constant_prefix = b'yx\xcb\x08\xb70'
    prefix_length = len(constant_prefix);length = 8
    ending_length = length - prefix_length;ending_bytes = os.urandom(ending_length)
    random_bytes = constant_prefix + ending_bytes
    random.seed(random_bytes)
    dec = random.randint(lower_range_limit, upper_range_limit)
    caddr = ice.privatekey_to_address(0, True, dec)
    message = "\r[+] {}".format(dec);messages = []
    messages.append(message);output = "\033[01;33m" + ''.join(messages) + "\r"
    sys.stdout.write(output);sys.stdout.flush()
    if caddr == target:
        HEX = "%064x" % dec;wifc = ice.btc_pvk_to_wif(HEX);t = time.ctime()
        print(f'[+] SOLVED:  {t}');print(f'[+] Bitcoin address Compressed: {caddr}')
        print(f'[+] Private key (wif) Compressed: {wifc}');print(f'[+] Random Seed: {random_bytes}')
        break

  • STARTED: Sat Nov 25 05:07:51 2023
  • Puzzle: 30
  • Lower range limit: 536870912
  • Upper range limit: 1073741823
  • SOLVED:  Sat Nov 25 05:07:52 2023
  • Bitcoin address Compressed: 1LHtnpd8nU5VHEMkG2TMYYNUjjLc992bps
  • Private key (wif) Compressed: KwDiBf89QgGbjEhKnhXJuH7LrciVrZi3qYjgd9M8diLSC5MyERoW
  • Random Seed: b'yx\xcb\x08\xb70l\xf1'

 Grin
nice code, this version goes 3 times faster
Code:
import random, os, secp256k1 as ice
puzzle = 30
#target = "1LHtnpd8nU5VHEMkG2TMYYNUjjLc992bps"
target = "d39c4704664e1deb76c9331e637564c257d68a08"
lower_range_limit = 2 ** (puzzle - 1);upper_range_limit = (2 ** puzzle) - 1
for x in range(1000000):
 constant_prefix = b'yx\xcb\x08\xb70'
 prefix_length = len(constant_prefix);length = 8
 ending_length = length - prefix_length;ending_bytes = os.urandom(ending_length)
 random_bytes = constant_prefix + ending_bytes
 random.seed(random_bytes)
 dec = random.randint(lower_range_limit, upper_range_limit)
 caddr = ice.privatekey_to_h160(0, True, dec).hex()
 if caddr == target:
  print(caddr,dec)
hero member
Activity: 630
Merit: 731
Bitcoin g33k
good catch Wink
member
Activity: 462
Merit: 24

ok, delete the "while true:" and write "for i in range(1,20480):"
Then tell me if your search is more effective.
This is not the way how random seed can be hacked. . Wink




Code:
import secp256k1 as ice
import random

print("scaning pub 03...")

target = "13zb1hQbWVsc2S7ZTZnP2G4undNNpdh5so"

start= 50000000000000000000
end=   70000000000000000000
while True:
    
    A0 = random.randint(start, end)
    A1 = ice.scalar_multiplication(A0)
    B0 = ice.to_cpub(A1.hex())
    
    if B0.startswith("03"):
        A2 = ice.pubkey_to_address(0,1, A1)
        print(A2)
        if target in A2:
            print("venga rata")
            data = open("Win.txt","a")
            data.write(str(A0)+" = "+A2+"\n")
            data.close()

Same script, but with concurrent.futures.


Code:
import concurrent.futures
import sys
import os
import time
import secp256k1 as ice
import random
import multiprocessing


os.system("clear");t = time.ctime();sys.stdout.write(f"\033[?25l")
sys.stdout.write(f"\033[01;33m[+] {t}\n")

def generate_key():
    start = 36893488147419103231
    end = 73786976294838206463
    
    A0 = random.randint(start, end)
    A1 = ice.scalar_multiplication(A0)
    B0 = ice.to_cpub(A1.hex())
    
    if B0.startswith("03"):
        A2 = ice.pubkey_to_address(0, 1, A1)
        message = "[+] {}".format(A2);messages = [];messages.append(message);output = ''.join(messages) + "\r";sys.stdout.write(output);sys.stdout.flush()
        return A0, A2
    else:
        return None, None

def main():
    target = "13zb1hQbWVsc2S7ZTZnP2G4undNNpdh5so"
    
    num_cores = multiprocessing.cpu_count()
    
    with concurrent.futures.ProcessPoolExecutor(max_workers=num_cores) as executor:
        while True:
            futures = [executor.submit(generate_key) for _ in range(num_cores)]
            
            for future in concurrent.futures.as_completed(futures):
                A0, A2 = future.result()
                
                if A2 and target in A2:
                    print("venga rata")
                    with open("Win.txt", "a") as data:
                        data.write(f"{A0} = {A2}\n")
                    break

if __name__ == "__main__":
    main()

You can imagine how this works on a 128 Core machine Grin

I use Python for testing or when speed is not required, C is better when it comes to speed, I am currently working on a method that allows you to find a key in bit30 in less than 10 seconds, really this part is not the curious one, the curious thing My script has a speed of 2048keys/s, how does it manage to find a key in that range in such a short time with that speed? There is a mathematical trick involved in it, I'm starting to write it in C, to focus on the puzzle 130, once I finish it, if this does not pose a security risk for bitcoin I will make it free.

those scripts (both) don't work as expected on my side. I tested with puzzle 30, even with 15 which should be cracked in fractions of seconds.

Puzzle 15
address = 1QCbW9HWnwQWiQqVo5exhAnmfqKRrCRsvW
start = 16384
end = 32768

Puzzle 30
address = 1LHtnpd8nU5VHEMkG2TMYYNUjjLc992bps
start = 536870912
end = 1073741824

no hit at all

You have to change   if B0.startswith("03"):   to    if B0.startswith("02"):  for Puzzle 15  

It might get better Wink
hero member
Activity: 630
Merit: 731
Bitcoin g33k

Code:
import secp256k1 as ice
import random

print("scaning pub 03...")

target = "13zb1hQbWVsc2S7ZTZnP2G4undNNpdh5so"

start= 50000000000000000000
end=   70000000000000000000
while True:
    
    A0 = random.randint(start, end)
    A1 = ice.scalar_multiplication(A0)
    B0 = ice.to_cpub(A1.hex())
    
    if B0.startswith("03"):
        A2 = ice.pubkey_to_address(0,1, A1)
        print(A2)
        if target in A2:
            print("venga rata")
            data = open("Win.txt","a")
            data.write(str(A0)+" = "+A2+"\n")
            data.close()

Same script, but with concurrent.futures.


Code:
import concurrent.futures
import sys
import os
import time
import secp256k1 as ice
import random
import multiprocessing


os.system("clear");t = time.ctime();sys.stdout.write(f"\033[?25l")
sys.stdout.write(f"\033[01;33m[+] {t}\n")

def generate_key():
    start = 36893488147419103231
    end = 73786976294838206463
   
    A0 = random.randint(start, end)
    A1 = ice.scalar_multiplication(A0)
    B0 = ice.to_cpub(A1.hex())
   
    if B0.startswith("03"):
        A2 = ice.pubkey_to_address(0, 1, A1)
        message = "[+] {}".format(A2);messages = [];messages.append(message);output = ''.join(messages) + "\r";sys.stdout.write(output);sys.stdout.flush()
        return A0, A2
    else:
        return None, None

def main():
    target = "13zb1hQbWVsc2S7ZTZnP2G4undNNpdh5so"
   
    num_cores = multiprocessing.cpu_count()
   
    with concurrent.futures.ProcessPoolExecutor(max_workers=num_cores) as executor:
        while True:
            futures = [executor.submit(generate_key) for _ in range(num_cores)]
           
            for future in concurrent.futures.as_completed(futures):
                A0, A2 = future.result()
               
                if A2 and target in A2:
                    print("venga rata")
                    with open("Win.txt", "a") as data:
                        data.write(f"{A0} = {A2}\n")
                    break

if __name__ == "__main__":
    main()

You can imagine how this works on a 128 Core machine Grin

I use Python for testing or when speed is not required, C is better when it comes to speed, I am currently working on a method that allows you to find a key in bit30 in less than 10 seconds, really this part is not the curious one, the curious thing My script has a speed of 2048keys/s, how does it manage to find a key in that range in such a short time with that speed? There is a mathematical trick involved in it, I'm starting to write it in C, to focus on the puzzle 130, once I finish it, if this does not pose a security risk for bitcoin I will make it free.

those scripts (both) don't work as expected on my side. I tested with puzzle 30, even with 15 which should be cracked in fractions of seconds.

Puzzle 15
address = 1QCbW9HWnwQWiQqVo5exhAnmfqKRrCRsvW
start = 16384
end = 32768

Puzzle 30
address = 1LHtnpd8nU5VHEMkG2TMYYNUjjLc992bps
start = 536870912
end = 1073741824

no hit at all
member
Activity: 239
Merit: 53
New ideas will be criticized and then admired.
I think you're missing the point, obviously there are tools that analyze millions of keys per second and will almost instantly find the key...

but my script is not based on speed, 2048 keys/s is nothing, but nevertheless it successfully finds the keys in less than 10 seconds.

That's why I say there is mathematics behind this, I think you don't understand the magnitude of this.

If with 2048keys/s I find bit 30, what do you think will happen when I analyze 10mkeys/s, 100mkeys/s.

I hope this time I explained it well.

You explained well. The point is that I still think that Random Seed is the solution to solve any Puzzle in a few seconds.

ok, delete the "while true:" and write "for i in range(1,20480):"
Then tell me if your search is more effective.
member
Activity: 462
Merit: 24
I think you're missing the point, obviously there are tools that analyze millions of keys per second and will almost instantly find the key...

but my script is not based on speed, 2048 keys/s is nothing, but nevertheless it successfully finds the keys in less than 10 seconds.

That's why I say there is mathematics behind this, I think you don't understand the magnitude of this.

If with 2048keys/s I find bit 30, what do you think will happen when I analyze 10mkeys/s, 100mkeys/s.

I hope this time I explained it well.

You explained well. The point is that I still think that Random Seed is the solution to solve any Puzzle in a few seconds.
member
Activity: 239
Merit: 53
New ideas will be criticized and then admired.
I am currently working on a method that allows you to find a key in bit30 in less than 10 seconds

Just 10 seconds?

Here's a script that does it in 2 seconds. In Python.

Code:
import time, random, sys, os, secp256k1 as ice
puzzle = 30
target = "1LHtnpd8nU5VHEMkG2TMYYNUjjLc992bps"
lower_range_limit = 2 ** (puzzle - 1);upper_range_limit = (2 ** puzzle) - 1
if os.name=='nt':os.system('cls')
else:os.system('clear')
t = time.ctime();sys.stdout.write(f"\033[?25l");sys.stdout.write(f"\033[01;33m[+] STARTED: {t}\n")
sys.stdout.write(f"[+] Puzzle: {puzzle}\n")
sys.stdout.write(f"[+] Lower range limit: {lower_range_limit}\n")
sys.stdout.write(f"[+] Upper range limit: {upper_range_limit}\n")
while True:
    constant_prefix = b'yx\xcb\x08\xb70'
    prefix_length = len(constant_prefix);length = 8
    ending_length = length - prefix_length;ending_bytes = os.urandom(ending_length)
    random_bytes = constant_prefix + ending_bytes
    random.seed(random_bytes)
    dec = random.randint(lower_range_limit, upper_range_limit)
    caddr = ice.privatekey_to_address(0, True, dec)
    message = "\r[+] {}".format(dec);messages = []
    messages.append(message);output = "\033[01;33m" + ''.join(messages) + "\r"
    sys.stdout.write(output);sys.stdout.flush()
    if caddr == target:
        HEX = "%064x" % dec;wifc = ice.btc_pvk_to_wif(HEX);t = time.ctime()
        print(f'[+] SOLVED:  {t}');print(f'[+] Bitcoin address Compressed: {caddr}')
        print(f'[+] Private key (wif) Compressed: {wifc}');print(f'[+] Random Seed: {random_bytes}')
        break

  • STARTED: Sat Nov 25 05:07:51 2023
  • Puzzle: 30
  • Lower range limit: 536870912
  • Upper range limit: 1073741823
  • SOLVED:  Sat Nov 25 05:07:52 2023
  • Bitcoin address Compressed: 1LHtnpd8nU5VHEMkG2TMYYNUjjLc992bps
  • Private key (wif) Compressed: KwDiBf89QgGbjEhKnhXJuH7LrciVrZi3qYjgd9M8diLSC5MyERoW
  • Random Seed: b'yx\xcb\x08\xb70l\xf1'

 Grin

I think you're missing the point, obviously there are tools that analyze millions of keys per second and will almost instantly find the key...

but my script is not based on speed, 2048 keys/s is nothing, but nevertheless it successfully finds the keys in less than 10 seconds.

That's why I say there is mathematics behind this, I think you don't understand the magnitude of this.

If with 2048keys/s I find bit 30, what do you think will happen when I analyze 10mkeys/s, 100mkeys/s.

I hope this time I explained it well.
member
Activity: 462
Merit: 24
I am currently working on a method that allows you to find a key in bit30 in less than 10 seconds

Just 10 seconds?

Here's a script that does it in 2 seconds. In Python.

Code:
import time, random, sys, os, secp256k1 as ice
puzzle = 30
target = "1LHtnpd8nU5VHEMkG2TMYYNUjjLc992bps"
lower_range_limit = 2 ** (puzzle - 1);upper_range_limit = (2 ** puzzle) - 1
if os.name=='nt':os.system('cls')
else:os.system('clear')
t = time.ctime();sys.stdout.write(f"\033[?25l");sys.stdout.write(f"\033[01;33m[+] STARTED: {t}\n")
sys.stdout.write(f"[+] Puzzle: {puzzle}\n")
sys.stdout.write(f"[+] Lower range limit: {lower_range_limit}\n")
sys.stdout.write(f"[+] Upper range limit: {upper_range_limit}\n")
while True:
    constant_prefix = b'yx\xcb\x08\xb70'
    prefix_length = len(constant_prefix);length = 8
    ending_length = length - prefix_length;ending_bytes = os.urandom(ending_length)
    random_bytes = constant_prefix + ending_bytes
    random.seed(random_bytes)
    dec = random.randint(lower_range_limit, upper_range_limit)
    caddr = ice.privatekey_to_address(0, True, dec)
    message = "\r[+] {}".format(dec);messages = []
    messages.append(message);output = "\033[01;33m" + ''.join(messages) + "\r"
    sys.stdout.write(output);sys.stdout.flush()
    if caddr == target:
        HEX = "%064x" % dec;wifc = ice.btc_pvk_to_wif(HEX);t = time.ctime()
        print(f'[+] SOLVED:  {t}');print(f'[+] Bitcoin address Compressed: {caddr}')
        print(f'[+] Private key (wif) Compressed: {wifc}');print(f'[+] Random Seed: {random_bytes}')
        break

  • STARTED: Sat Nov 25 05:07:51 2023
  • Puzzle: 30
  • Lower range limit: 536870912
  • Upper range limit: 1073741823
  • SOLVED:  Sat Nov 25 05:07:52 2023
  • Bitcoin address Compressed: 1LHtnpd8nU5VHEMkG2TMYYNUjjLc992bps
  • Private key (wif) Compressed: KwDiBf89QgGbjEhKnhXJuH7LrciVrZi3qYjgd9M8diLSC5MyERoW
  • Random Seed: b'yx\xcb\x08\xb70l\xf1'

 Grin
member
Activity: 239
Merit: 53
New ideas will be criticized and then admired.
Well this was supposed to be a community effort, now that you got something promising, it requires more tests? Just gimme it man, I promise not to share it with anyone else.

We go like this > you take 130, after 1/5 year I take 135, after 2 years after that you take 140, and when we empty 160, we come here and ask for more puzzles if by then we were still alive and kicking.😂

That's how it works, you discover a method, you claim everything you can, when you can't claim more, you share it.
Why does it happen? Because the majority of those who benefit from this do not look back to thank them with a simple tip.

The tycoons roam around here and don't even comment, they don't contribute anything, they just wait for something new to apply their great computing power, and they don't even bother to reveal the keys.

It is not worth revealing something here and having none of those present take advantage of it because we lack computing power.
Basically at this point it is giving more money to the rich.
member
Activity: 239
Merit: 53
New ideas will be criticized and then admired.
I will make it free.
And if it does, what would you do then, sell it? Well you can't trade diamond with glass. If you found it, we will make a double team to take over the world. Lol I will bring coffee, make food, clean your office etc.
Over my dead body if I let anyone pose a threat to Bitcoin.😉
I meant that if the script does not represent a threat, I will share it.
because if with a python script at a speed of 2048 keys/s it finds publick key in the range of puzzle #30 in a few seconds, with C I have no idea where this can go at the moment, I have to do tests in C.
member
Activity: 122
Merit: 11
I will make it free.
And if it does, what would you do then, sell it? Well you can't trade diamond with glass. If you found it, we will make a double team to take over the world. Lol I will bring coffee, make food, clean your office etc.
Over my dead body if I let anyone pose a threat to Bitcoin.😉

I swear this thread gets weirder day by day... Cheesy



member
Activity: 239
Merit: 53
New ideas will be criticized and then admired.

Code:
import secp256k1 as ice
import random

print("scaning pub 03...")

target = "13zb1hQbWVsc2S7ZTZnP2G4undNNpdh5so"

start= 50000000000000000000
end=   70000000000000000000
while True:
    
    A0 = random.randint(start, end)
    A1 = ice.scalar_multiplication(A0)
    B0 = ice.to_cpub(A1.hex())
    
    if B0.startswith("03"):
        A2 = ice.pubkey_to_address(0,1, A1)
        print(A2)
        if target in A2:
            print("venga rata")
            data = open("Win.txt","a")
            data.write(str(A0)+" = "+A2+"\n")
            data.close()

Same script, but with concurrent.futures.


Code:
import concurrent.futures
import sys
import os
import time
import secp256k1 as ice
import random
import multiprocessing


os.system("clear");t = time.ctime();sys.stdout.write(f"\033[?25l")
sys.stdout.write(f"\033[01;33m[+] {t}\n")

def generate_key():
    start = 36893488147419103231
    end = 73786976294838206463
   
    A0 = random.randint(start, end)
    A1 = ice.scalar_multiplication(A0)
    B0 = ice.to_cpub(A1.hex())
   
    if B0.startswith("03"):
        A2 = ice.pubkey_to_address(0, 1, A1)
        message = "[+] {}".format(A2);messages = [];messages.append(message);output = ''.join(messages) + "\r";sys.stdout.write(output);sys.stdout.flush()
        return A0, A2
    else:
        return None, None

def main():
    target = "13zb1hQbWVsc2S7ZTZnP2G4undNNpdh5so"
   
    num_cores = multiprocessing.cpu_count()
   
    with concurrent.futures.ProcessPoolExecutor(max_workers=num_cores) as executor:
        while True:
            futures = [executor.submit(generate_key) for _ in range(num_cores)]
           
            for future in concurrent.futures.as_completed(futures):
                A0, A2 = future.result()
               
                if A2 and target in A2:
                    print("venga rata")
                    with open("Win.txt", "a") as data:
                        data.write(f"{A0} = {A2}\n")
                    break

if __name__ == "__main__":
    main()

You can imagine how this works on a 128 Core machine Grin

I use Python for testing or when speed is not required, C is better when it comes to speed, I am currently working on a method that allows you to find a key in bit30 in less than 10 seconds, really this part is not the curious one, the curious thing My script has a speed of 2048keys/s, how does it manage to find a key in that range in such a short time with that speed? There is a mathematical trick involved in it, I'm starting to write it in C, to focus on the puzzle 130, once I finish it, if this does not pose a security risk for bitcoin I will make it free.
newbie
Activity: 21
Merit: 0
...

it would be awesome if there's a CUDA version for it.

I can give you this same script that works in C++ but you have to do the GPU part yourself.CUDA programming can be complex, and proper error handling and synchronization are crucial. Also, not all parts of your program may benefit from GPU acceleration, so it's essential to profile and optimize as needed.


Code:
import bit
import hashlib, random
import platform
from time import time
import os
import sys
import ctypes

nbits = 130
low = 2**(nbits-1)
high = -1+2**nbits
diff = high - low

filename ='tes.bin'
with open(filename,'rb') as f:
    add = f.read()#.split()
#add = set(add)

if platform.system().lower().startswith('win'):
    dllfile = 'ice_secp256k1.dll'
    if os.path.isfile(dllfile) == True:
        pathdll = os.path.realpath(dllfile)
        ice = ctypes.CDLL(pathdll)
    else:
        print('File {} not found'.format(dllfile))

elif platform.system().lower().startswith('lin'):
    dllfile = 'ice_secp256k1.so'
    if os.path.isfile(dllfile) == True:
        pathdll = os.path.realpath(dllfile)
        ice = ctypes.CDLL(pathdll)
    else:
        print('File {} not found'.format(dllfile))
else:
    print('[-] Unsupported Platform currently for ctypes dll method. Only [Windows and Linux] is working')
    sys.exit()

ice.scalar_multiplication.argtypes = [ctypes.c_char_p, ctypes.c_char_p]            # pvk,ret
ice.point_subtraction.argtypes = [ctypes.c_char_p, ctypes.c_char_p, ctypes.c_char_p, ctypes.c_char_p, ctypes.c_char_p]  # x1,y1,x2,y2,ret
ice.init_secp256_lib()

def scalar_multiplication(kk):
    res = (b'\x00') * 65
    pass_int_value = hex(kk)[2:].encode('utf8')
    ice.scalar_multiplication(pass_int_value, res)
    return res

def point_subtraction(pubkey1_bytes, pubkey2_bytes):
    x1 = pubkey1_bytes[1:33]
    y1 = pubkey1_bytes[33:]
    x2 = pubkey2_bytes[1:33]
    y2 = pubkey2_bytes[33:]
    res = (b'\x00') * 65
    ice.point_subtraction(x1, y1, x2, y2, res)
    return res

def new_pos(full_bytes):
    pos = hashlib.sha256(full_bytes).digest()
    return pos

def fixrange(full_bytes):
    t = low + int(full_bytes.hex(), 16) % diff
    return t

def pub2upub(pub_hex):
    x = int(pub_hex[2:66], 16)
    if len(pub_hex) < 70:
        y = bit.format.x_to_y(x, int(pub_hex[:2], 16) % 2)
    else:
        y = int(pub_hex[66:], 16)
    return bytes.fromhex('04' + hex(x)[2:].zfill(64) + hex(y)[2:].zfill(64))

def upub2cpub(upub_bytes):
    x1 = upub_bytes[1:33]
    prefix = str(2 + int(upub_bytes[33:].hex(), 16) % 2).zfill(2)
    return bytes.fromhex(prefix) + x1

st = time()
key_seed = b''
m = 1
while True:
    pubkey = "03633cbe3ec02b9401c5effa144c5b4d22f87940259634858fc7e59b1c09937852"
    P = pub2upub(pubkey)
    key_seed = new_pos(key_seed)
    qfix = fixrange(key_seed)
    #qfix = m * 1000000  # Use an interval of 1000000 for qfix (stride)
    tpub = bytes(bytearray(scalar_multiplication(qfix)))
    subP = bytes(bytearray(point_subtraction(P, tpub)))
    cpub = bytes(upub2cpub(subP))
    m += 1

    msg = 'Test Cpub : {total}, {num}, {password} '.format(total=m, num=qfix, password=bytes(cpub).hex())
    sys.stdout.write('\r' + msg)
    sys.stdout.flush()

    if cpub in add:
        print("Winner Found!:{num}, {password} ".format(num=qfix, password=bytes(cpub).hex()))
        f = open (u"Winner.txt","a")
        f.write("num:" + str(qfix) +'\n' +
                "cpub:" + str(bytes(cpub).hex())+ '\n\n')
        f.close()
        break
print('[-] Completed in {0:.2f} sec'.format(time() - st))

can you give me the same script that works in cpp? Thanks
jr. member
Activity: 61
Merit: 6
[TARGET: 1] [SPEED: 1632701.66 MKey/s] [TOTAL: 48,937,041,920] [00:05:18]
search 48,937,041,920 keys in 318 seconds

48,937,041,920 / 318
So the real speed is 153,890,068 ~= 153 MKey/s
full member
Activity: 431
Merit: 105
wow shit, 1632701.66 MKey/s a second, is this version available somewhere. thanks for the sharing.
btw looking like you are getting there, keep it going,

jr. member
Activity: 149
Merit: 7

awesome ! I have some cuda functions for Point add and Point Mult, and a basic script working but I need to fix it, sometimes it works and sometimes not... Huh

Code:
[DEV: NVIDIA GeForce G 1111/4095MB] [00000000000000000000000000000000000000000000000000022004DA800000 (50 bit)
[DEV: NVIDIA GeForce G 1111/4095MB] [000000000000000000000000000000000000000000000000000222B60D800000 (50 bit)
[DEV: NVIDIA GeForce G 1111/4095MB] [0000000000000000000000000000000000000000000000000002256266000000 (50 bit)
[DEV: NVIDIA GeForce G 1111/4095MB] [0000000000000000000000000000000000000000000000000002281873800000 (50 bit)
[DEV: NVIDIA GeForce G 1111/4095MB] [00000000000000000000000000000000000000000000000000022AC9A6800000 (50 bit)
[TARGET: 1] [SPEED: 1632701.66 MKey/s] [TOTAL: 48,937,041,920] [00:05:18]
[2023-11-23.11:08:30] [Info] Found key for address '1MEzite4ReNuWaL5Ds17ePKt2dCxWEofwk'. Written to 'found.txt'

[2023-11-23.11:08:30] [Info] No targets remaining

found the #50 in 5 minutes...
member
Activity: 462
Merit: 24
...

it would be awesome if there's a CUDA version for it.

I can give you this same script that works in C++ but you have to do the GPU part yourself.CUDA programming can be complex, and proper error handling and synchronization are crucial. Also, not all parts of your program may benefit from GPU acceleration, so it's essential to profile and optimize as needed.

puzzle66.cpp
Code:
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include

// Function to convert a byte vector to a hexadecimal string
std::string bytesToHex(const std::vector& bytes) {
    std::stringstream ss;
    for (unsigned char byte : bytes) {
        ss << std::hex << std::setw(2) << std::setfill('0') << static_cast(byte);
    }
    return ss.str();
}

// Function to calculate the RIPEMD160 hash of a byte vector
std::vector calculateRIPEMD160(const std::vector& data) {
    std::vector hash(RIPEMD160_DIGEST_LENGTH);
    RIPEMD160(data.data(), data.size(), hash.data());
    return hash;
}

int main() {
    // Initialize the OpenSSL library
    if (OpenSSL_add_all_algorithms() != 1) {
        std::cerr << "OpenSSL initialization failed." << std::endl;
        return 1;
    }

    // Set the target Hash160 value (replace with your target hash)
    std::string target_hash160_hex = "20d45a6a762535700ce9e0b216e31994335db8a5";

    int puzzle = 66;   // The puzzle number (Bits)

    // Clear the console
    std::system("clear");
    std::cout << "\r\033[01;33m[+] Bytea HASH160 Search by NoMachine" << "\n";
    time_t currentTime = std::time(nullptr);
    std::cout << "\r\033[01;33m[+] " << std::ctime(¤tTime) << "\r";
    std::cout << "\r\033[01;33m[+] Puzzle: " << puzzle << "\033[0m" << std::endl;
    std::cout.flush();

    // Calculate the maximum bytes value based on the puzzle
    BIGNUM* limit_int = BN_new();
    BN_set_word(limit_int, 1);
    BN_lshift(limit_int, limit_int, puzzle);
    BN_sub_word(limit_int, 1);
    int max_bytes = (BN_num_bits(limit_int) + 7) / 8;

    // Create an EC_KEY object
    EC_KEY* ec_key = EC_KEY_new_by_curve_name(NID_secp256k1);

    // Calculate the SHA-256 hash of the public key
    unsigned char sha256_result[SHA256_DIGEST_LENGTH];

    // Calculate the RIPEMD160 hash of the SHA-256 hash
    std::vector ripemd160_result(RIPEMD160_DIGEST_LENGTH);

    while (true) {
        // Create a 32-byte private key with 32 zeros followed by random bytes
        std::vector private_key_bytes(32, 0);

        // Generate random bytes for the remaining part of the private key
        std::vector random_bytes(max_bytes);
        if (RAND_bytes(random_bytes.data(), random_bytes.size()) != 1) {
            std::cerr << "Error generating random bytes." << std::endl;
            BN_free(limit_int);
            EC_KEY_free(ec_key);
            return 1;
        }

        // Append the random bytes to the private key
        std::copy(random_bytes.begin(), random_bytes.end(), private_key_bytes.begin() + 32 - max_bytes);

        // Create a BIGNUM from the private key bytes
        BIGNUM* bn_private_key = BN_bin2bn(private_key_bytes.data(), private_key_bytes.size(), NULL);

        // Set the private key in the EC_KEY object
        EC_KEY_set_private_key(ec_key, bn_private_key);

        // Compute the public key from the private key
        EC_POINT* public_key_point = EC_POINT_new(EC_KEY_get0_group(ec_key));
        EC_POINT_mul(EC_KEY_get0_group(ec_key), public_key_point, bn_private_key, NULL, NULL, NULL);

        // Convert the public key point to binary representation (compressed)
        size_t public_key_length = EC_POINT_point2oct(EC_KEY_get0_group(ec_key), public_key_point, POINT_CONVERSION_COMPRESSED, NULL, 0, NULL);
        std::vector public_key_bytes(public_key_length);
        EC_POINT_point2oct(EC_KEY_get0_group(ec_key), public_key_point, POINT_CONVERSION_COMPRESSED, public_key_bytes.data(), public_key_length, NULL);

        // Check if the public key starts with "02" (compressed format)
        if (public_key_bytes[0] == 0x02) {
            SHA256(public_key_bytes.data(), public_key_bytes.size(), sha256_result);
            ripemd160_result = calculateRIPEMD160(std::vector(sha256_result, sha256_result + SHA256_DIGEST_LENGTH));

            // Convert the calculated RIPEMD160 hash to a hexadecimal string
            std::string calculated_hash160_hex = bytesToHex(ripemd160_result);

            // Display the generated public key hash (Hash160) and private key
            std::string message = "\r\033[01;33m[+] Public Key Hash (Hash 160): " + calculated_hash160_hex;
            std::cout << message << "\e[?25l";
            std::cout.flush();

            // Check if the generated public key hash matches the target
            if (calculated_hash160_hex == target_hash160_hex) {
                // Get the current time
                std::time_t currentTime;
                std::time(¤tTime);
                std::tm tmStruct = *std::localtime(¤tTime);

                // Format the current time into a human-readable string
                std::stringstream timeStringStream;
                timeStringStream << std::put_time(&tmStruct, "%Y-%m-%d %H:%M:%S");
                std::string formattedTime = timeStringStream.str();

                std::cout << "\n\033[32m[+] PUZZLE SOLVED: " << formattedTime << "\033[0m" << std::endl;
                std::cout << "\r\033[32m[+] Target Public Key Hash (Hash160) found! Private Key: " << bytesToHex(private_key_bytes) << std::endl;

                // Append the private key information to a file if it matches
                std::ofstream file("KEYFOUNDKEYFOUND.txt", std::ios::app);
                if (file.is_open()) {
                    file << "\nPUZZLE SOLVED " << formattedTime;
                    file << "\nPrivate Key (hex): " << bytesToHex(private_key_bytes);
                    file << "\n--------------------------------------------------------------------------------------------------------------------------------------------";
                    file.close();
                }

                break;
            }
        }
    }

    // Free the EC_KEY and BIGNUM objects
    BN_free(limit_int);
    EC_KEY_free(ec_key);

    return 0;
}

Script check if the public key starts with "02" (compressed format)  and you can change to "03".

Makefile
Code:
# Makefile

# Source files
SRC = puzzle66.cpp

# Compiler and flags
CXX = g++
CXXFLAGS = -m64 -march=native -mtune=native  -mfpmath=sse -Wall -msse2 -msse3 -msse4 -msse4.1 -msse4.2 -msse4a -mavx -pthread -O3 -I.

# OpenSSL libraries
LIBS = -lssl -lcrypto

# Output executable
TARGET = puzzle66

# Default target
all: $(TARGET)

# Rule for compiling the source code
$(TARGET): $(SRC)
$(CXX) $(CXXFLAGS) -o $@ $^ $(LIBS)

# Clean target to remove generated files
clean:
rm -f $(TARGET)

.PHONY: all clean

I am running this on an AMD Ryzen 9 7950X.
It has  compiler flags for AMD which accelerate mathematical crypto functions. A similar file must be created for CUDA.
Good luck....

p.s.
Tested on Puzzle 15 - works fine......
  • Bytea HASH160 Search by NoMachine
  • Thu Nov 23 15:11:22 2023
  • Puzzle: 15
  • Public Key Hash (Hash 160): fe7c45126731f7384640b0b0045fd40bac72e2a2
  • PUZZLE SOLVED: 2023-11-23 15:11:24
  • Target Public Key Hash (Hash160) found! Private Key: 00000000000000000000000000000000000000000000000000000000000068f3
jr. member
Activity: 149
Merit: 7
...

it would be awesome if there's a CUDA version for it.
member
Activity: 238
Merit: 68
The forum of keyboard warriors & crypto pro's!
This seems funny and interesting =) Tho I don't understand a thing here...  But I still want to join you and try to solve this puzzle so if you have a spot open please keep me know =)
Meanwhile I will go deep in YouTube-tutorial's. See you soon and keep grinding.   Cool

- Regards BabyB. 👼
Jump to: