Pages:
Author

Topic: A WIF generator ... but is it possible to generate faster ?? - page 2. (Read 231 times)

jr. member
Activity: 53
Merit: 11
Hi i have found this script but it seems slow, what is the way to make it faster, for education only  Grin

Code:
from bit import Key
from bit.format import bytes_to_wif
from tqdm import tqdm

i = 1
target = 1000000

with open("wif.txt", "w") as f, open("add.txt", "w") as addr_file, open("target.txt", "r") as b_file:
    b_addresses = set(b_file.read().splitlines())

    pbar = tqdm(total=(target - i + 1))

    while i <= target:
        key1 = Key.from_int(i)

        wif = bytes_to_wif(key1.to_bytes(), compressed=False)
        wif2 = bytes_to_wif(key1.to_bytes(), compressed=True)
        key2 = Key(wif)
        key1 == key2

        f.write(wif + "\n")
        f.write(wif2 + "\n")

        address = key1.address
        addr_file.write(address + "\n")

        if address in b_addresses:
            print("Found matching address:", address)

        i += 1
        pbar.update(1)

    pbar.close()

100%|██████████████████████████████████████████████████████████████████████| 1000000/1000000 [02:44<00:00, 6092.40it/s]

This is the Result after testing, i read and hear it is possible to generate 1m in under 20sec but i can´t figure out how !

Maybe somebody can help, only for personal education  Roll Eyes
Pages:
Jump to: