Bitcoin Forum
April 25, 2025, 04:55:18 PM *
News: Merit Poker is still available for a limited time
 
   Home   Help Search Login Register More  
Pages: « 1 ... 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 [191] 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 ... 480 »
  Print  
Author Topic: Bitcoin puzzle transaction ~32 BTC prize to who solves it  (Read 286196 times)
rosengold
Jr. Member
*
Offline Offline

Activity: 149
Merit: 7


View Profile
October 25, 2023, 05:47:36 PM
 #3801


Code:
#include <iostream>
#include <vector>...

  • Bytea HASH160 Search by NoMachine
  • Sat Oct 21 10:39:23 2023
  • Puzzle: 15
  • Public Key Hash (Hash 160): fe7c45126731f7384640b0b0045fd40bac72e2a2
  • PUZZLE SOLVED: 2023-10-21 10:39:24
  • Target Public Key Hash (Hash160) found! Private Key: 00000000000000000000000000000000000000000
Hi @nomachine

how to make it work sequential instead of random ?




here you go,  buddy

Code:
#include <iostream>
#include <vector>
#include <iomanip>
#include <openssl/bn.h>
#include <openssl/ec.h>
#include <openssl/obj_mac.h>
#include <openssl/sha.h>
#include <openssl/evp.h>
#include <openssl/ripemd.h>
#include <ctime>
#include <sstream>
#include <fstream>

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

// Function to calculate the RIPEMD160 hash of a byte vector
std::vector<unsigned char> calculateRIPEMD160(const std::vector<unsigned char>& data) {
    std::vector<unsigned char> 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;
    }

    // Define the range
    std::string start_range_hex = "000000000000000000000000000000000000000000000001ffffffffffffffff";
    std::string end_range_hex = "000000000000000000000000000000000000000000000003ffffffffffffffff";
    // Set the target Hash160 value (replace with your target hash)
    std::string target_hash160_hex = "20d45a6a762535700ce9e0b216e31994335db8a5";

    // 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<unsigned char> ripemd160_result(RIPEMD160_DIGEST_LENGTH);

    BIGNUM* start_range = BN_new();
    BIGNUM* end_range = BN_new();
    BN_hex2bn(&start_range, start_range_hex.c_str());
    BN_hex2bn(&end_range, end_range_hex.c_str());

    while (BN_cmp(start_range, end_range) <= 0) {
        // Create a BIGNUM from the current value in the range
        BIGNUM* bn_private_key = BN_dup(start_range);

        // 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<unsigned char> 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);

        SHA256(public_key_bytes.data(), public_key_bytes.size(), sha256_result);
        ripemd160_result = calculateRIPEMD160(std::vector<unsigned char>(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(&currentTime);
            std::tm tmStruct = *std::localtime(&currentTime);

            // 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: " << BN_bn2hex(bn_private_key) << 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): " << BN_bn2hex(bn_private_key);
                file << "\n--------------------------------------------------------------------------------------------------------------------------------------------";
                file.close();
            }

            BN_free(bn_private_key);
            break;
        }

        // Increment the current value in the range
        BN_add_word(start_range, 1);
    }

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

    return 0;
}

Code:
g++ -m64 -march=native -pthread -O3 -I. -o puzzle66 puzzle.cpp -lssl -lcrypto -ldl




Amazing thanks
patsat
Newbie
*
Offline Offline

Activity: 3
Merit: 0


View Profile
October 25, 2023, 06:28:38 PM
 #3802

Anyone can find one bit of the K nonce ?
nomachine
Member
**
Offline Offline

Activity: 630
Merit: 53


View Profile
October 25, 2023, 06:42:20 PM
Last edit: October 25, 2023, 06:59:02 PM by nomachine
 #3803

Anyone can find one bit of the K nonce ?

What exactly do you mean?

There are 2^32 possible values, which means there are 4,294,967,296 different nonces.

Scientists from Sorbonne University claim to be able to solve the entire 256-bit
SECP256K1 in 9 Hours with Cat Qubits  Grin

However, it's important to exercise caution when evaluating such claims, as cryptographic claims in the context of quantum computing are often met with skepticism and scrutiny. Quantum computing is still an emerging field, and practical quantum computers capable of breaking widely used cryptographic algorithms are not yet a reality.
But I wouldn't be surprised if some government organizations make this first.

bc1qdwnxr7s08xwelpjy3cc52rrxg63xsmagv50fa8
digaran
Copper Member
Hero Member
*****
Offline Offline

Activity: 1330
Merit: 901

🖤😏


View Profile
October 25, 2023, 10:44:43 PM
Last edit: October 26, 2023, 08:19:16 AM by digaran
 #3804

I love it how knowledge sharing works in our favour, every time I share I gain more. I can see a solution for low bit range keys, especially because when we use their inverse, -n keys, they all start with Fs, and since we can work with scalar, if we try to divide 2 scalar mod n and then add/sub the results, you can see keys starting with many leading hexadecimal characters, it depends on the size of the keys we are dividing.

Another thing to note, if you try to divide then add/sub 2 keys larger than this one:
Code:
000000000000000000000000000000014551231950b75fc4402da1732fc9bebf

You could find the results of addition/subtraction starting with 8, a, b etc following with many zeros, what that means, when we are dividing a key we must consider that we are dividing a key like this :
Code:
fffffffffffffffffffffffffffffffd755db9cd5e9140777fa4bd19a06c8282
Instead of the first one above, so when you divide a key, try to either add 31 leading Fs, or subtract 31 leading Fs before doing your thing. Btw, puzzle 130 has 33 characters right? Anyways good luck.

Edit:
I just got this idea, where is our code genius  @mcdouglasx, 😉 how about a script which subtracts G as many times as we want from target and divides target and all subtracted keys by a number we decide, then subtracts the same from all the results and does the same division, but it should discard all the previously generated keys. And when we reach a low range and find a known key, we can multiply and add the same way we subtracted and divided, but in order to do that, we just need to keep an index in order of subtraction, example: we will call target a, -1 of target b, -2 of target c, etc and when we reach a known key, it could have a name like f,d,k,o,a,r,p,m,a,r,w etc then we'd know exactly which one of the keys on each step was the actual result.

This has become boring, lets make some noise.

🖤😏
frozenen
Newbie
*
Offline Offline

Activity: 42
Merit: 0


View Profile
October 26, 2023, 08:29:09 AM
 #3805

Hi friends, after a few months of trying I have found what is definitely the key to this puzzle. I am not a professional programmer or math teacher.
I am a graphic designer and through the drawing of figures and maps, I reached a place where the relationship of these numbers and how they support each other through the 4 main mathematical operations (* + - /) is clearly visible.
Numbers have a strange order and order in chaos! I don't know what to call it
  In this order, you can see outputs that are a few numbers of private keys, mostly the first 3 digits
My shape and drawing is animated and with each key it has its own shape, but with all its changes, the connection and order of the numbers is not lost.
  I have a triangle which, by changing its size and moving in the range and even rotating from 0 to 360 degrees, displays the three sides of a single number or the sum of the other two sides.
We all know that the shapes are some kind of mathematical formulas, and this means that there is an algorithm, only a formula has not been written for it.
My friends, I need a programmer to program my shapes and actions so that the key is fully calculated.
Because the keys are related to each other from any direction, angle and distance. It was not without reason that the creator revealed the public keys in 5 steps.
Anyway, after a few years of heavy problems, I have now reached a point where I need to trust someone again. Now there is a possibility that this trust will destroy my life like in the past, but there is no other way.
Friends, I only work with an experienced programmer. Someone who has a portfolio on GitHub. Because there is nothing that can be told to a few people.
The next thing is that this algorithm is definitely correct, and the programmer and I should collect a maximum of 20 bits so that the rights of those who are trying and working on this puzzle are not lost and they can reach the keys in their own way. All this money is not for us.

My email is amir.k3nt@gmail.com

I used Google translation, so I apologize if there is a mistake.
What are the 3 first digits? If your shapes/drawings are correct, we would know within a day or two.
Then you would probably have lots of people trying to help code your idea for #67, #68, etc.
If you send me the first 3 digits of #66, and I find the key; I would split it with you 50/50.
I can guarantee you, 1000% I have ranges ran for every first 3 digit combination; so I would only have to check so many keys vs starting from scratch.


Yo, Ill take you all up on that offer 50/50 split , #66 first 3 digits = 37A is the most likely then 33A or 35A, here is my wallet 1Dqsy2uo24Mq9Awg1gU4R7tjs3XYRrHyTZ
nomachine
Member
**
Offline Offline

Activity: 630
Merit: 53


View Profile
October 26, 2023, 09:24:38 AM
Last edit: October 26, 2023, 12:46:19 PM by nomachine
 #3806

This has become boring, lets make some noise.

I already have a collection of completely ridiculous programs. Grin


Code:
import ecdsa
import hashlib

start_bytes = bytearray(b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\xff\xff\xff\xff\xff\xff\xff\xff')
end_bytes = bytearray(b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x03\xff\xff\xff\xff\xff\xff\xff\xff')
target_binary = b'\x20\xd4Zjv%5p\x0c\xe9\xe0\xb2\x16\xe3\x19\x9435\xb8\xa5'

current_bytes = start_bytes[:]

while current_bytes <= end_bytes:
    signing_key = ecdsa.SigningKey.from_string(bytes(current_bytes), curve=ecdsa.SECP256k1)
    HASH160 = hashlib.new('ripemd160', hashlib.sha256(signing_key.get_verifying_key().to_string("compressed")).digest()).digest()
    if HASH160 == target_binary:
        with open("KEYFOUNDKEYFOUND.txt", "a") as f:
            wif = current_bytes.hex().upper()
            f.write("WIF: " + wif + '\n\n')
    # Increment the bytes from the right (little-endian)
    for i in range(len(current_bytes) - 1, -1, -1):
        if current_bytes[i] != 255:
            current_bytes[i] += 1
            break
        else:
            current_bytes[i] = 0

This is Puzzle 66 believe it or not . .

bc1qdwnxr7s08xwelpjy3cc52rrxg63xsmagv50fa8
MoreForUs
Newbie
*
Offline Offline

Activity: 17
Merit: 0


View Profile
October 26, 2023, 01:46:18 PM
 #3807

Code:
import ecdsa
import hashlib
import base58
import random
import time

def generate_bitcoin_address(private_key_hex):
    private_key = ecdsa.SigningKey.from_string(bytes.fromhex(private_key_hex), curve=ecdsa.SECP256k1)
    public_key = private_key.get_verifying_key()
    public_key_bytes = public_key.to_string("compressed")
   
    sha256_hash = hashlib.sha256(public_key_bytes)
    ripemd160_hash = hashlib.new("ripemd160")
    ripemd160_hash.update(sha256_hash.digest())
    bitcoin_address = ripemd160_hash.digest()

    # Mainnet prefix (0x00)
    network_byte = b'\x00'
    bitcoin_address = network_byte + bitcoin_address

    # Double SHA-256 hash for checksum
    checksum = hashlib.sha256(hashlib.sha256(bitcoin_address).digest()).digest()[:4]
   
    bitcoin_address += checksum
   
    base58_address = base58.b58encode(bitcoin_address)

    return base58_address.decode()

# Define the lower and upper bounds for the private key hex range
lower_bound = '20000000000000000'
upper_bound = '2ffffffffffffffff'
batch_size = 1000  # Number of private keys to search in each batch
total_parts = 100 # Total number of parts to break the range into

# Calculate the part size to make them equal
start_int = int(lower_bound, 16)
end_int = int(upper_bound, 16)
total_keys = end_int - start_int
part_size = total_keys // total_parts

# Generate a list of parts to search and reverse it
parts_to_search = [i for i in range(total_parts)][::-1]

target_addresses = ['13zb1hQbWVsc2S7ZTZnP2G4undNNpdh5so', '1BY8GQbnueYofwSuFAT3USAhGjPrkxDdW9', '1MVDYgVaSN6iKKEsbzRUAYFrYJadLYZvvZ']

additional_hex_numbers = ['2','3','4','5','6','7','8','9','a','b','c','d','e','f']

update_interval = 1
iteration_count = 0

found_addresses = set()

for current_part in parts_to_search:
    current_private_key_hex_start = start_int + current_part * part_size
    current_private_key_hex_end = current_private_key_hex_start + part_size
    iteration_start_time = time.time()

    while time.time() - iteration_start_time < 30:  # Iterate for 15 seconds
        if current_private_key_hex_start >= current_private_key_hex_end:
            break

        private_key_hex = hex(current_private_key_hex_start)[2:].zfill(64)  # Ensure the hex string is 64 characters long

        # Check if the private_key_hex contains non-hexadecimal characters
        if all(c in '0123bcdef' for c in private_key_hex):
            bitcoin_address = generate_bitcoin_address(private_key_hex)
            iteration_count += 1

            if iteration_count % update_interval == 0:
                print(f"Current Iteration Count: {iteration_count}")
                print(f"Current Private Key Hex: {private_key_hex}")
                print(f"Current Bitcoin Address: {bitcoin_address}")

            if bitcoin_address in target_addresses:
                print(f"Target address found: {bitcoin_address}")
                print(f"Private Key Hex: {private_key_hex}")
                found_addresses.add((bitcoin_address, private_key_hex))
                with open("found_addresses.txt", "a") as file:
                    file.write(f"Address: {bitcoin_address}, Private Key: {private_key_hex}\n")
                break

        found_match = False
        for hex_number in additional_hex_numbers:
            modified_private_key_hex = private_key_hex.replace('2', hex_number, 1).zfill(64)

            # Check if the modified_private_key_hex contains non-hexadecimal characters
            if all(c in '0123456789abcdef' for c in modified_private_key_hex):
                modified_bitcoin_address = generate_bitcoin_address(modified_private_key_hex)
                iteration_count += 1

                if iteration_count % update_interval == 0:
                    print(f"Current Iteration Count: {iteration_count}")
                    print(f"Current Private Key Hex (Modified): {modified_private_key_hex}")
                    print(f"Current Bitcoin Address (Modified): {modified_bitcoin_address}")

                if modified_bitcoin_address in target_addresses:
                    print(f"Target address found (Modified): {modified_bitcoin_address}")
                    print(f"Modified Private Key Hex: {modified_private_key_hex}")
                    found_addresses.add((modified_bitcoin_address, modified_private_key_hex))
                    with open("found_addresses.txt", "a") as file:
                        file.write(f"Address: {modified_bitcoin_address}, Private Key: {modified_private_key_hex}\n")
                    found_match = True
                    break
       
        if found_match:
            break
   
        current_private_key_hex_start += -1
Lets make some noise  Huh Shocked
digaran
Copper Member
Hero Member
*****
Offline Offline

Activity: 1330
Merit: 901

🖤😏


View Profile
October 26, 2023, 06:00:39 PM
 #3808

Guys come on, seeing a few things like puzzle 66, sha256 double, base58 in your scripts is a turn off.🤣

For how long you are going to stick with finding addresses? I believe I have said this before, you don't need to go beyond rmd160 check, just generate public key, do a sha256 and a rmd160 then compare with rmd160 of puzzle, when you convert rmd160 to address, you are doing the following which is unnecessary : adding network byte + sha256d + taking checksum + adding checksum + encoding to base58. So 5 extra steps, 5 useless operations per key.

Anyways, try this one, subtract G 99 times from target, you will have 100 keys in total, then divide them all by 100, one of the results will definitely be the target/100. Then come here ask me what's next. But first I would need to test your script to see if it does what I said.😉

🖤😏
nomachine
Member
**
Offline Offline

Activity: 630
Merit: 53


View Profile
October 26, 2023, 06:24:59 PM
Last edit: May 04, 2024, 08:17:52 PM by nomachine
 #3809

So 5 extra steps, 5 useless operations per key.

Code:
import sys, os, random, secrets, hashlib, ecdsa
while True:
   dec = secrets.SystemRandom().randrange(36893488147419103231, 73786976294838206463)
   h160 = hashlib.new('ripemd160', hashlib.sha256(ecdsa.SigningKey.from_string((b'\x00' * 32)[:-len(dec.to_bytes((dec.bit_length() + 7) // 8, 'big'))] + dec.to_bytes((dec.bit_length() + 7) // 8, 'big'), curve=ecdsa.SECP256k1).get_verifying_key().to_string("compressed")).digest()).digest()   
   message = "\r[+] {} ".format(h160.hex());messages = [];messages.append(message);output = "\033[01;33m" + ''.join(messages) + "\r";sys.stdout.write(output);sys.stdout.flush()
   if h160.hex() == "20d45a6a762535700ce9e0b216e31994335db8a5":
        print(dec);break


It can't be simpler than this.. But even for this you have to wait 5000 years.  Grin

bc1qdwnxr7s08xwelpjy3cc52rrxg63xsmagv50fa8
mcdouglasx
Full Member
***
Offline Offline

Activity: 616
Merit: 241


Success depends on how much you try


View Profile WWW
October 26, 2023, 07:36:44 PM
Merited by digaran (1)
 #3810

subtract G 99 times from target, you will have 100 keys in total, then divide them all by 100, one of the results will definitely be the target/100. Then come here ask me what's next. But first I would need to test your script to see if it does what I said.😉

Hello, is this what you need?

Code:
import secp256k1 as ice
import bitcoin

target= "03633cbe3ec02b9401c5effa144c5b4d22f87940259634858fc7e59b1c09937852"
print("Target:", target)
Target_upub= ice.pub2upub(target)

for i in range (100):
    A= ice.scalar_multiplication(i)
    B= ice.point_subtraction(Target_upub, A)
    C= ice.to_cpub(B.hex())
    D= bitcoin.divide(C, 100)

    data = open("S-1.txt","a")
    data.write(str(i)+" = "+str(C)+"\n")
    data.close()

    data = open("D-1.txt","a")
    data.write(str(i)+" = "+str(D)+"\n")
    data.close()

█████████████████████████
Run your own Bitcoin Node
🚀 Start decentralization now.
LuckyRandomFisher
Newbie
*
Offline Offline

Activity: 3
Merit: 0


View Profile
October 26, 2023, 09:15:13 PM
 #3811

Hello folks!

I've just got a new PC (latest i9 + 4090) and allocated it full-time for #66 just ~1h ago  Grin
Set it up in complete random mode (keyhunt & bitcrack) and it randomeforces #66 with the following pace:

CPU (keyhunt)
Total 50247107966976 keys in 10095 seconds: ~4 Gkeys/s (4977425256 keys/s)

GPU (bitcrack)
NVIDIA GeForce R / 24217MB | 1 target 3307.00 MKey/s (11,423,035,949,056 total) [00:56:47]

Here is my plan: gonna polish and tune up these scripts to get more performance out of it. As soon as I reach the ceil, I'll start looking into the algo part) Gonna be fun)

Luck + Fun + Polishing and 6.6 BTC is mine  Grin
Woz2000
Jr. Member
*
Offline Offline

Activity: 85
Merit: 2


View Profile
October 26, 2023, 10:39:08 PM
 #3812

How is that i9 able to outperform the 4090 in straight brute forcing?


Hello folks!

I've just got a new PC (latest i9 + 4090) and allocated it full-time for #66 just ~1h ago  Grin
Set it up in complete random mode (keyhunt & bitcrack) and it randomeforces #66 with the following pace:

CPU (keyhunt)
Total 50247107966976 keys in 10095 seconds: ~4 Gkeys/s (4977425256 keys/s)

GPU (bitcrack)
NVIDIA GeForce R / 24217MB | 1 target 3307.00 MKey/s (11,423,035,949,056 total) [00:56:47]

Here is my plan: gonna polish and tune up these scripts to get more performance out of it. As soon as I reach the ceil, I'll start looking into the algo part) Gonna be fun)

Luck + Fun + Polishing and 6.6 BTC is mine  Grin
digaran
Copper Member
Hero Member
*****
Offline Offline

Activity: 1330
Merit: 901

🖤😏


View Profile
October 26, 2023, 11:11:03 PM
Merited by mcdouglasx (1)
 #3813


Hello, is this what you need?
Hi, it's close but not so much, here is the logic:

Target = 3487790154155768 now if we subtract 99 G from it, on our 68th subtraction we will land on 3487790154155700, then we can divide it by 100, to get 34877901541557 now with this new key our 57th subtraction lands on  34877901541500 , then we divide it by 100 to get 348779015415 , but since we don't know which key is what, we would consider our target as 100 then by subtracting G 99 times from it, we will have 100 keys, 1, 2, 3, 4, ...........100. We divide and index them in order, like:
Target(100)/100 = 100/100, 99(which is -1 of our target)/100, 98/100, 97/100. We don't save them all, we just specify that we want our target to be divided by 100 for 30 times in a *row and it keeps doing that.

We just need to divide our key by 100, for 2 or 3 times as a test.

*= lol, I didn't calculate RAM needed for such exponentially large number.


How is that i9 able to outperform the 4090 in straight brute forcing?
By polishing.😉

🖤😏
WanderingPhilospher
Sr. Member
****
Online Online

Activity: 1358
Merit: 266

Shooters Shoot...


View Profile
October 27, 2023, 03:16:48 AM
 #3814


Hello, is this what you need?
Hi, it's close but not so much, here is the logic:

Target = 3487790154155768 now if we subtract 99 G from it, on our 68th subtraction we will land on 3487790154155700, then we can divide it by 100, to get 34877901541557 now with this new key our 57th subtraction lands on  34877901541500 , then we divide it by 100 to get 348779015415 , but since we don't know which key is what, we would consider our target as 100 then by subtracting G 99 times from it, we will have 100 keys, 1, 2, 3, 4, ...........100. We divide and index them in order, like:
Target(100)/100 = 100/100, 99(which is -1 of our target)/100, 98/100, 97/100. We don't save them all, we just specify that we want our target to be divided by 100 for 30 times in a *row and it keeps doing that.

We just need to divide our key by 100, for 2 or 3 times as a test.

*= lol, I didn't calculate RAM needed for such exponentially large number.


How is that i9 able to outperform the 4090 in straight brute forcing?
By polishing.😉


Why would you do this?

Just divide by the total number from the beginning and let the program subtract then divide.

Not sure what doing it that way would do, except cause confusion lol.
AlanJohnson
Member
**
Offline Offline

Activity: 181
Merit: 11


View Profile
October 27, 2023, 05:17:20 AM
 #3815

Luck + Fun + Polishing and 6.6 BTC is mine  Grin

... or you will burn your GPU and don't find anything anyway.

There are people here that have access to server farms and multi GPU miners. If they didn't found it till now it means that method is pointless.

And remember that comparing bitcrack speed and keyhunt speed is pointless.
nomachine
Member
**
Offline Offline

Activity: 630
Merit: 53


View Profile
October 27, 2023, 08:22:18 AM
Last edit: October 27, 2023, 12:59:34 PM by nomachine
 #3816

How is that i9 able to outperform the 4090 in straight brute forcing?

It depends on what the script calculates and how it calculates.
Are only compressed keys counted or all together? Is it a key or a hash?
Which parameters do you use in one script and which in the other? (user input)*
You can practice in Python to see how counting works.

Code:
import sys, os, time, secrets, multiprocessing, random
import binascii, base58, hashlib, ecdsa

def generate_private_key_WIF(start, miss):
    characters = "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"
    return start + "".join(secrets.choice(characters) for _ in range(miss))

def format_hash_rate(hash_rate):
    suffixes = ["", "k", "M", "G", "T", "P"]

    magnitude = 0
    while hash_rate >= 1000 and magnitude < len(suffixes) - 1:
        hash_rate /= 1000.0
        magnitude += 1

    return f"{hash_rate:.2f} {suffixes[magnitude]}Hash/s"

def check_private_key(start, miss, target_binary, min_range, max_range):
    while not STOP_EVENT.is_set():
        private_key_WIF = generate_private_key_WIF(start, miss)
        dec = int(binascii.hexlify(base58.b58decode(private_key_WIF))[2:-10].decode("utf-8")[0:64], 16)
        if min_range <= dec <= max_range:
            private_key_bytes = (b'\x00' * 32)[:-len(dec.to_bytes((dec.bit_length() + 7) // 8, 'big'))] + dec.to_bytes((dec.bit_length() + 7) // 8, 'big')
            signing_key = ecdsa.SigningKey.from_string(private_key_bytes, curve=ecdsa.SECP256k1)
            HASH160 = hashlib.new('ripemd160', hashlib.sha256(signing_key.get_verifying_key().to_string("compressed")).digest()).digest()

            hashes_per_second = 0
            target_hash_count = 1000000  # You can adjust this to your desired count
            start_time = time.time()

            while hashes_per_second < target_hash_count:
                HASH160.hex()
                hashes_per_second += 1

            end_time = time.time()
            elapsed_time = end_time - start_time
            hashes_per_second = target_hash_count / elapsed_time

            formatted_hash_rate = format_hash_rate(hashes_per_second)

            message = "\r[+] Hashes per second: {}".format(formatted_hash_rate)
            messages = []
            messages.append(message)
            output = "\033[01;33m" + ''.join(messages) + "\r"
            sys.stdout.write(output)

            if HASH160 == target_binary:
                dec_to_hex = hex(dec).split('x')[-1]
                HASH160_wif = base58.b58encode(b'\x80' + private_key_bytes + b'\x01' + hashlib.sha256(hashlib.sha256(b'\x80' + private_key_bytes + b'\x01').digest()).digest()[:4]).decode()
                bitcoin_address = base58.b58encode(b'\x00' + HASH160 + hashlib.sha256(hashlib.sha256(b'\x00' + HASH160).digest()).digest()[:4]).decode()
                t = time.ctime()
                sys.stdout.write(f"\033[0m\n\n")
                sys.stdout.write(f"[+] SOLVED:    |\033[32m {t}                                                                  \033[0m\n")
                sys.stdout.write(f"[+] Key Found: |\033[32m {dec_to_hex}                                                \033[0m\n"
                                 f"[+] WIF:       |\033[32m {HASH160_wif}                                                  \033[0m\n"
                                 f"[+] Address:   |\033[32m {bitcoin_address}                                           \033[0m")
                sys.stdout.flush()

                with open("KEYFOUNDKEYFOUND.txt", "a") as f:
                    f.write("SOLVED: " + str(t) + '\n' + "HEX: " + str(dec_to_hex) + '\n' + "WIF: " + str(HASH160_wif) + '\n' + "Address: " + str(bitcoin_address) + '\n\n')
                    f.flush()
                    f.close()

                STOP_EVENT.set()
                sys.stdout.write("\033[?25h")
                sys.stdout.flush()
                return

if __name__ == '__main__':
    start = "KwDiBf89QgGbjEhKnhXJuH7LrciVrZi3qZ"
    miss = 52 - (len(start))
    min_range = 36893488147419103231
    max_range = 73786976294838206463
    target_hex = "20d45a6a762535700ce9e0b216e31994335db8a5"
    target_binary = bytes.fromhex(target_hex)
    puzzle = 0
    while max_range >= 2 ** puzzle:
        puzzle += 1
    if min_range <= (2 ** puzzle) - 1:
        puzzle = puzzle

    STOP_EVENT = multiprocessing.Event()
    num_processes = multiprocessing.cpu_count()

    os.system("clear")
    t = time.ctime()
    sys.stdout.write(f"\033[01;33m[+] {t}\n")
    sys.stdout.write(f"\033[01;33m[+] Puzzle = {puzzle}\n")
    sys.stdout.write(f"\033[01;33m[+] Ending characters missing: {miss}\n")
    sys.stdout.write(f"\033[01;33m[+] Public Key Hash (Hash 160): {target_hex}\n")
    sys.stdout.flush()

    pool = multiprocessing.Pool(processes=num_processes)

    for i in range(num_processes):
        pool.apply_async(check_private_key, args=(start, miss, target_binary, min_range, max_range))

    pool.close()
    pool.join()


Let's say in raw Python you can achieve about 3.98 MHash/s on 12 cores

  • Fri Oct 27 10:06:46 2023
  • Puzzle = 66
  • Ending characters missing: 18
  • Public Key Hash (Hash 160): 20d45a6a762535700ce9e0b216e31994335db8a5
  • Hashes per second: 3.98 MHash/s

In the same Python with the kangaroo algorithm I have about 50 MKeys/s (if you count jumps)


In C++ everything is 10 or 100 times more (if is GPU).

What exactly is counted depends on which algorithm was used  and how is used. Grin

*It even depends on how it is compiled for which platform - for example: AMD Ryzen 9 7950X3D
Code:
gcc -Q -march=native --help=target | grep -E '^\s+-.*(sse|march)'

g++ -m64 -march=native -mtune=native -msse4.2 -pthread -O3 -I. -o ...etc...

The presence of SSE4.1 and SSE4.2 instruction sets can be particularly beneficial for cryptographic operations, as they include instructions that can accelerate certain mathematical operations required for SECPK1 calculations.
You can experiment with these flags for cryptographic workloads.

Effectiveness of this flag depends on the specific algorithms and code you are working with. It's a good practice to benchmark code with and without the flag. Wink

bc1qdwnxr7s08xwelpjy3cc52rrxg63xsmagv50fa8
digaran
Copper Member
Hero Member
*****
Offline Offline

Activity: 1330
Merit: 901

🖤😏


View Profile
October 27, 2023, 12:31:38 PM
Last edit: October 27, 2023, 02:03:36 PM by digaran
 #3817


Not sure what doing it that way would do, except cause confusion lol.
You know about point torsion? It subtracts 1 from target then divides either by 2 or anything you want, but we want similar code to subtract whatever we want, keeps all the subtracted keys, does the division and repeat the same with the results, in this *way when we work with scalar instead of points, we can observe and learn by tweaking our values step by step. That's how you learn, by studying the small details.


I just used my double point torsion script and it seems it doesn't work the way I wanted, that's why I tried to save the results of that script to separate files and use another script to subtract the results in the files.

One other thing, I thought if we multiply by n/4 -2 , 3, 4 or by  n/4 + 2, 3, 4 we could get for example target.75 or 1/75, or 1/25 of our target, I haven't tried it yet on scalar, but I know for sure that if you multiply by n/2 +2 you would get 1/5 or one and half of your target 1.5, then imagine dividing that by 2, you'd get 0.75 of target, then multiply that by 3 to get 2.25 of target, 2.25/2 = 1.125, then you could continue that and see what happens in scalar. You could find patterns that way.

I might cause some confusion sometimes, it's for the best, as hyenas are lurking around the corner.😉

Edit, I'm not sure if I have shared the 2 point torsion subtraction script before, it's useless. Ignore it.😅
*= 5 w in a row. Lol

Second edit : (hey Joe mentality mode activated, lol)

Anyone has any idea how to make this thing find lambda and beta quick? With small values it says there is no result very fast and for large values of P and N, it takes forever without any results. This is beyond my pay grade to handle properly, and AI, well this is the product of asking AI for help. 😂
Code:
import random
from math import isqrt

def find_lambda_beta(n: int, p: int) -> tuple[int, int]:
    # Check if n and p are valid inputs
    if not (is_prime(n) and is_prime(p)):
        raise ValueError("n and p must be prime numbers")
    if n <= 2 or p <= 2:
        raise ValueError("n and p must be greater than 2")

    # Find prime factors of n and p
    factors_n = prime_factors(n)
    factors_p = prime_factors(p)

    # Choose two different prime factors q, m of n and p, respectively
    found = False
    while not found:
        q = random.choice(factors_n)
        m = random.choice(factors_p)
        if q != m:
            found = True

    # Find a primitive root of 1 modulo q
    a = find_primitive_root(q)

    # Compute the cube root of 1 modulo q
    k = pow(a, (q-1)//3, q)

    # Find a primitive root of 1 modulo m
    b = find_primitive_root(m)

    # Compute lambda as the cube root of 1 modulo m
    lam = pow(b, (m-1)//3, m)

    # Check which cube root of 1 modulo q matches lambda
    match_found = False
    for c in [2, 3]:
        if pow(lam, c, q) == k:
            beta = pow(k, ((q-1)//3 * (m-1)//2) % (p-1), p)
            match_found = True
            break

    if match_found:
        return lam, beta
    else:
        raise ValueError("No solutions found")

def is_prime(n: int) -> bool:
    if n <= 3:
        return n > 1
    elif n % 2 == 0 or n % 3 == 0:
        return False
    else:
        i = 5
        while i*i <= n:
            if n % i == 0 or n % (i+2) == 0:
                return False
            i += 6
        return True

def prime_factors(n: int) -> list[int]:
    factors = []
    while n % 2 == 0:
        factors.append(2)
        n //= 2
    for i in range(3, isqrt(n) + 1, 2):
        while n % i == 0:
            factors.append(i)
            n //= i
    if n > 2:
        factors.append(n)
    return factors

def find_primitive_root(p: int) -> int:
    if not is_prime(p):
        raise ValueError("p must be a prime number")

    phi = p-1
    factors = prime_factors(phi)
    for r in range(2, p):
        is_primitive = True
        for factor in factors:
            if pow(r, phi//factor, p) == 1:
                is_primitive = False
                break
        if is_primitive:
            return r

    raise ValueError("Cannot find primitive root")

# Example usage:
n = 0xd82254710ec6131d
p = 0xa4dd92ac1ff9dd0f
lam, beta = find_lambda_beta(n, p)
print("Lambda:", lam)
print("Beta:", beta)

🖤😏
WanderingPhilospher
Sr. Member
****
Online Online

Activity: 1358
Merit: 266

Shooters Shoot...


View Profile
October 27, 2023, 02:27:45 PM
 #3818

Quote
You know about point torsion? It subtracts 1 from target then divides either by 2 or anything you want, but we want similar code to subtract whatever we want, keeps all the subtracted keys, does the division and repeat the same with the results, in this *way when we work with scalar instead of points, we can observe and learn by tweaking our values step by step. That's how you learn, by studying the small details.

Lol, torsion. I know your "torsion".

I still do not know what you hope to learn versus running a script that divides a pub by x and stores results in a file, then rinse and repeat for other pubs that are related to the first pub.
Again, to me, your way is causing oneself confusion to keep track of everything.

And you have not given one example of what you have learned by all of your scripts or how it helps in reducing ranges/pubs. I think your comments/scripts confuse people more than helps them, IMO.
MoreForUs
Newbie
*
Offline Offline

Activity: 17
Merit: 0


View Profile
October 27, 2023, 02:40:44 PM
 #3819

Code:
import subprocess
import time
import os
from decimal import Decimal
import base58
import hashlib
import ecdsa

# Function to clear the terminal screen
def clear_terminal():
    subprocess.call('clear', shell=True)

# Function to calculate the Hash 160 of a public key
def calculate_public_key_hash(public_key):
    sha256_hash = hashlib.sha256(public_key).digest()
    ripemd160_hash = hashlib.new('ripemd160')
    ripemd160_hash.update(sha256_hash)
    return ripemd160_hash.digest()

# Function to convert a decimal number to a private key in hexadecimal format
def decimal_to_private_key_hex(decimal_number):
    private_key_bytes = int(decimal_number).to_bytes(32, byteorder='big')
    private_key_hex = private_key_bytes.hex()
    private_key_hex_flipped = private_key_hex.replace('2', '3', 2)
    return private_key_hex, private_key_hex_flipped

# Function to check if a target Hash 160 is found
def check_target_hash(public_key_hash, decimal_number, private_key_hex):
    if public_key_hash in target_public_key_hashes:
        target_hashes_found.append(public_key_hash)
        print(f"Target Hash 160 found: {public_key_hash.hex()}")
        print(f"Decimal Number: {decimal_number}")
        print(f"Private Key Hex: {private_key_hex}")

        # Write the found Hash 160 to the file found_addresses.txt
        with open("found_addresses.txt", "a") as found_file:
            found_file.write(f"Target Hash 160 found: {public_key_hash.hex()}\n")
            found_file.write(f"Decimal Number: {decimal_number}\n")
            found_file.write(f"Private Key Hex: {private_key_hex}\n\n")
            found_file.flush()  # Flush the buffer to ensure data is written immediately

        return True
    return False

# List of target Hash 160 values to search for
target_public_key_hashes = [
    bytes.fromhex('20d45a6a762535700ce9e0b216e31994335db8a5'),
    bytes.fromhex('739437bb3dd6d1983e66629c5f08c70e52769371'),
    bytes.fromhex('e0b8a2baee1b77fc703455f39d51477451fc8cfc'),
    bytes.fromhex('61eb8a50c86b0584bb727dd65bed8d2400d6d5aa'),
    bytes.fromhex('f6f5431d25bbf7b12e8add9af5e3475c44a0a5b8'),


]

target_hashes_found = []

# Define the lower and upper bounds for the decimal number search range
lower_bound = Decimal('37000000000000000000')
upper_bound = Decimal('55340232221128654832')

# List of additional hex numbers to modify the decimal number
additional_hex_numbers = ['3','4','5','6','7','8', '9', 'a', 'b', 'c', 'd', 'e', 'f','10','11','12','13','14','15','16','17','18','19','1a', '1b', '1c','1d', '1e', '1f'
,'40','41','42','43','44','45','46','47','48','49','4a', '4b', '4c','4d', '4e', '4f' ,'50','51','52','53','54','55','56','57','58','59','5a', '5b', '5c','5d', '5e', '5f' ,'60','61','62','63','64','65','66','67','68','69','6a', '6b', '6c','6d', '6e', '6f' ,'70','71','72','73','74','75','76','77','78','79','7a', '7b', '7c','7d', '7e', '7f' ]

# Initialize time and iteration tracking variables
start_time = time.time()
total_iterations = 0

# Function to search for target Hash 160 values within a specified range
def search_decimal_range(decimal_number, upper_bound):
    global total_iterations  # Use the global variable
    iterations = 0
    update_interval = 1
    step_size = 10000000000000000  # Initial step size

    while decimal_number <= upper_bound:
        private_key_hex, flipped_private_key_hex = decimal_to_private_key_hex(decimal_number)
        private_key = int(decimal_number).to_bytes(32, byteorder='big')
        signing_key = ecdsa.SigningKey.from_string(private_key, curve=ecdsa.SECP256k1, hashfunc=hashlib.sha256)
        verifying_key = signing_key.verifying_key
        public_key = verifying_key.to_string("compressed")
        public_key_hash = calculate_public_key_hash(public_key)

        if check_target_hash(public_key_hash, decimal_number, private_key_hex):
            return True  # Stop the loop if a match is found

        found_match = False

        additional_hashes = []
        for hex_number in additional_hex_numbers:
            modified_decimal_number = int(hex(int(decimal_number))[2:].replace('2', hex_number, 1), 16)
            modified_private_key_hex, _ = decimal_to_private_key_hex(modified_decimal_number)
            modified_private_key = int(modified_decimal_number).to_bytes(32, byteorder='big')
            modified_signing_key = ecdsa.SigningKey.from_string(modified_private_key, curve=ecdsa.SECP256k1, hashfunc=hashlib.sha256)
            modified_verifying_key = modified_signing_key.verifying_key
            modified_public_key = modified_verifying_key.to_string("compressed")
            modified_hash = calculate_public_key_hash(modified_public_key)
            additional_hashes.append(modified_hash)

            if check_target_hash(modified_hash, modified_decimal_number, modified_private_key_hex):
                found_match = True
                break

        if found_match:
            return True

        if len(target_hashes_found) == len(target_public_key_hashes):
            return True

        if iterations % update_interval == 0:
            elapsed_time = time.time() - start_time
            iterations_per_second = iterations / elapsed_time
            print(f"Reached {iterations} iterations.")
            print(f"Elapsed Time: {elapsed_time:.2f} seconds")
            print(f"Iterations per Second: {iterations_per_second:.2f}")
            print(f"Decimal Number: {decimal_number}")
            print(f"Private Key Hex: {private_key_hex}")
            print(f"Target Hash 160: {public_key_hash.hex()}")
            print(f"Target Decimal Number: {decimal_number}")
            if target_hashes_found:
                print_hashes_side_by_side(target_hashes_found[-1], decimal_number, private_key_hex, additional_hashes)
            print("\n")

        decimal_number += step_size  # Increase the decimal number by the current step size
        iterations += 1

        # Adjust the step size dynamically based on the search space
        if iterations % 1000 == 0:
            step_size *= 2  # Double the step size every 1 million iterations

# Function to print the target Hash 160 and additional Hash 160 values side by side
def print_hashes_side_by_side(target_hash, decimal_number, private_key_hex, additional_hashes):
    print(f"Decimal Number: {decimal_number}")
    print(f"Target Hash 160: {target_hash.hex()}")
    print(f"Private Key Hex: {private_key_hex}")
    print(f"Target Decimal Number: {decimal_number}")
    for i, hash in enumerate(additional_hashes):
        print(f" ({additional_hex_numbers[i]}): {hash.hex()}")
    print("\n")

# Function to continuously search for target Hash 160 values in the specified range
def continuous_search(lower_bound, upper_bound):
    global total_iterations, start_time  # Use the global variables
    current_decimal = lower_bound

    while True:
        elapsed_time = time.time() - start_time
        total_iterations += 1

        if search_decimal_range(current_decimal, upper_bound):
            print("All target Hash 160 values found. Restarting search...")
            time.sleep(0)  # Optional: Add a delay before restarting the search
            current_decimal = lower_bound  # Reset the current_decimal to the lower_bound
        else:
            current_decimal += 1484585542367  # Increment by 1

# Start the continuous search
while True:
    continuous_search(lower_bound, upper_bound)

# Add sound notification when the script completes
print("Glass sound (indicating script completion)")
subprocess.run(["afplay", "/System/Library/Sounds/glass.aiff"])


hows this one? ready for some fun?  Roll Eyes THIS ONE SCRIPT IS SEARCHING FOR PUZZLES 66 -71 from a single hex which is 20000000000000000...2ffffffffffffffff. I can also adjust the step size.
WanderingPhilospher
Sr. Member
****
Online Online

Activity: 1358
Merit: 266

Shooters Shoot...


View Profile
October 27, 2023, 02:51:25 PM
 #3820

Code:
import subprocess
import time
import os
from decimal import Decimal
import base58
import hashlib
import ecdsa

# Function to clear the terminal screen
def clear_terminal():
    subprocess.call('clear', shell=True)

# Function to calculate the Hash 160 of a public key
def calculate_public_key_hash(public_key):
    sha256_hash = hashlib.sha256(public_key).digest()
    ripemd160_hash = hashlib.new('ripemd160')
    ripemd160_hash.update(sha256_hash)
    return ripemd160_hash.digest()

# Function to convert a decimal number to a private key in hexadecimal format
def decimal_to_private_key_hex(decimal_number):
    private_key_bytes = int(decimal_number).to_bytes(32, byteorder='big')
    private_key_hex = private_key_bytes.hex()
    private_key_hex_flipped = private_key_hex.replace('2', '3', 2)
    return private_key_hex, private_key_hex_flipped

# Function to check if a target Hash 160 is found
def check_target_hash(public_key_hash, decimal_number, private_key_hex):
    if public_key_hash in target_public_key_hashes:
        target_hashes_found.append(public_key_hash)
        print(f"Target Hash 160 found: {public_key_hash.hex()}")
        print(f"Decimal Number: {decimal_number}")
        print(f"Private Key Hex: {private_key_hex}")

        # Write the found Hash 160 to the file found_addresses.txt
        with open("found_addresses.txt", "a") as found_file:
            found_file.write(f"Target Hash 160 found: {public_key_hash.hex()}\n")
            found_file.write(f"Decimal Number: {decimal_number}\n")
            found_file.write(f"Private Key Hex: {private_key_hex}\n\n")
            found_file.flush()  # Flush the buffer to ensure data is written immediately

        return True
    return False

# List of target Hash 160 values to search for
target_public_key_hashes = [
    bytes.fromhex('20d45a6a762535700ce9e0b216e31994335db8a5'),
    bytes.fromhex('739437bb3dd6d1983e66629c5f08c70e52769371'),
    bytes.fromhex('e0b8a2baee1b77fc703455f39d51477451fc8cfc'),
    bytes.fromhex('61eb8a50c86b0584bb727dd65bed8d2400d6d5aa'),
    bytes.fromhex('f6f5431d25bbf7b12e8add9af5e3475c44a0a5b8'),


]

target_hashes_found = []

# Define the lower and upper bounds for the decimal number search range
lower_bound = Decimal('37000000000000000000')
upper_bound = Decimal('55340232221128654832')

# List of additional hex numbers to modify the decimal number
additional_hex_numbers = ['3','4','5','6','7','8', '9', 'a', 'b', 'c', 'd', 'e', 'f','10','11','12','13','14','15','16','17','18','19','1a', '1b', '1c','1d', '1e', '1f'
,'40','41','42','43','44','45','46','47','48','49','4a', '4b', '4c','4d', '4e', '4f' ,'50','51','52','53','54','55','56','57','58','59','5a', '5b', '5c','5d', '5e', '5f' ,'60','61','62','63','64','65','66','67','68','69','6a', '6b', '6c','6d', '6e', '6f' ,'70','71','72','73','74','75','76','77','78','79','7a', '7b', '7c','7d', '7e', '7f' ]

# Initialize time and iteration tracking variables
start_time = time.time()
total_iterations = 0

# Function to search for target Hash 160 values within a specified range
def search_decimal_range(decimal_number, upper_bound):
    global total_iterations  # Use the global variable
    iterations = 0
    update_interval = 1
    step_size = 10000000000000000  # Initial step size

    while decimal_number <= upper_bound:
        private_key_hex, flipped_private_key_hex = decimal_to_private_key_hex(decimal_number)
        private_key = int(decimal_number).to_bytes(32, byteorder='big')
        signing_key = ecdsa.SigningKey.from_string(private_key, curve=ecdsa.SECP256k1, hashfunc=hashlib.sha256)
        verifying_key = signing_key.verifying_key
        public_key = verifying_key.to_string("compressed")
        public_key_hash = calculate_public_key_hash(public_key)

        if check_target_hash(public_key_hash, decimal_number, private_key_hex):
            return True  # Stop the loop if a match is found

        found_match = False

        additional_hashes = []
        for hex_number in additional_hex_numbers:
            modified_decimal_number = int(hex(int(decimal_number))[2:].replace('2', hex_number, 1), 16)
            modified_private_key_hex, _ = decimal_to_private_key_hex(modified_decimal_number)
            modified_private_key = int(modified_decimal_number).to_bytes(32, byteorder='big')
            modified_signing_key = ecdsa.SigningKey.from_string(modified_private_key, curve=ecdsa.SECP256k1, hashfunc=hashlib.sha256)
            modified_verifying_key = modified_signing_key.verifying_key
            modified_public_key = modified_verifying_key.to_string("compressed")
            modified_hash = calculate_public_key_hash(modified_public_key)
            additional_hashes.append(modified_hash)

            if check_target_hash(modified_hash, modified_decimal_number, modified_private_key_hex):
                found_match = True
                break

        if found_match:
            return True

        if len(target_hashes_found) == len(target_public_key_hashes):
            return True

        if iterations % update_interval == 0:
            elapsed_time = time.time() - start_time
            iterations_per_second = iterations / elapsed_time
            print(f"Reached {iterations} iterations.")
            print(f"Elapsed Time: {elapsed_time:.2f} seconds")
            print(f"Iterations per Second: {iterations_per_second:.2f}")
            print(f"Decimal Number: {decimal_number}")
            print(f"Private Key Hex: {private_key_hex}")
            print(f"Target Hash 160: {public_key_hash.hex()}")
            print(f"Target Decimal Number: {decimal_number}")
            if target_hashes_found:
                print_hashes_side_by_side(target_hashes_found[-1], decimal_number, private_key_hex, additional_hashes)
            print("\n")

        decimal_number += step_size  # Increase the decimal number by the current step size
        iterations += 1

        # Adjust the step size dynamically based on the search space
        if iterations % 1000 == 0:
            step_size *= 2  # Double the step size every 1 million iterations

# Function to print the target Hash 160 and additional Hash 160 values side by side
def print_hashes_side_by_side(target_hash, decimal_number, private_key_hex, additional_hashes):
    print(f"Decimal Number: {decimal_number}")
    print(f"Target Hash 160: {target_hash.hex()}")
    print(f"Private Key Hex: {private_key_hex}")
    print(f"Target Decimal Number: {decimal_number}")
    for i, hash in enumerate(additional_hashes):
        print(f" ({additional_hex_numbers[i]}): {hash.hex()}")
    print("\n")

# Function to continuously search for target Hash 160 values in the specified range
def continuous_search(lower_bound, upper_bound):
    global total_iterations, start_time  # Use the global variables
    current_decimal = lower_bound

    while True:
        elapsed_time = time.time() - start_time
        total_iterations += 1

        if search_decimal_range(current_decimal, upper_bound):
            print("All target Hash 160 values found. Restarting search...")
            time.sleep(0)  # Optional: Add a delay before restarting the search
            current_decimal = lower_bound  # Reset the current_decimal to the lower_bound
        else:
            current_decimal += 1484585542367  # Increment by 1

# Start the continuous search
while True:
    continuous_search(lower_bound, upper_bound)

# Add sound notification when the script completes
print("Glass sound (indicating script completion)")
subprocess.run(["afplay", "/System/Library/Sounds/glass.aiff"])


hows this one? ready for some fun?  Roll Eyes THIS ONE SCRIPT IS SEARCHING FOR PUZZLES 66 -71 from a single hex which is 20000000000000000...2ffffffffffffffff. I can also adjust the step size.
I like it and have something similar however, my script has many less lines of code than yours.
There's no right or wrong way, yours is just super long.
Pages: « 1 ... 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 [191] 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 ... 480 »
  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!