- we run keyhunt in BSGS mode on 8 CPU threads with about 16GB RAM allocation and get about 80 PKey/s.
Is Kangaroo with multi-GPU usage more advantageous and more likely to get a hit, even though keyhunt with CPU usage in BSGS can process 80 PKey/s?
Try changing the random generator in both. Play what works best in your environment. example keyhunt.cpp replace to replace seed random generator with minstd_rand rng #if defined(_WIN64) && !defined(__CYGWIN__) // Any Windows secure random source goes here rseed(clock() + time(NULL) + rand()); #else std::random_device rd; std::minstd_rand rng(rd()); // Seed the random number generator rseed(rng()); #endif I have from 80 to ~177 Pkeys/s (177940438134284990 keys/s) These apps can't get better if we don't all work on them and test them. An windows version ?
|
|
|
this python script generates about 144M private keys with the X and Y keys, which takes a long time to generate, so I'd like to know if it would be possible to speed up the process by keeping the calculation method used in the script, even if it's just a matter of generating the private keys while keeping the calculation method? addressgeneration.pyfrom ecdsa import SigningKey, SECP256k1 import sha3 from binascii import unhexlify import hashlib from base58 import b58encode import bech32 from cashaddress import convert import datetime
def PrivateKeyComputation(p1: int, p2: int, p3: int, base: int, n: int): order = (2 ** 6) * 3 * 149 * 631 * p1 * p2 * p3 prod = p1 * p2 * p3 g = pow(base, prod, order + 1) privateSet = [None] * n
for i in range(n): if i == 0: privateSet[0] = hex(g) else: k = (g * int(privateSet[i - 1], 16)) % (order + 1) privateSet[i] = hex(k)
return privateSet
def CosetPrivateKeyComputation(p1: int, p2: int, p3: int, base: int, n: int): print("Coset PrivateKey Computation started at", datetime.datetime.now()) prod = p1 * p2 * p3 h = (2 ** 6) * 3 * 149 * 631 order = h * prod g = pow(base, prod, order + 1) privateSet = [None] * n * 8
for i in range(n): if i == 0: privateSet[0] = hex(g) else: k = (g * int(privateSet[i - 1], 16)) % (order + 1) privateSet[i] = hex(k)
pows = [h, h*p1, h*p2, h*p3, h*p1*p2, h*p1*p3, h*p2*p3]
for j in range(len(pows)): g = pow(base, pows[j], order + 1) for i in range(n): value = (g * int(privateSet[i], 16)) % (order + 1) privateSet[(j+1)*h+i] = hex(value) print("Coset PrivateKey Computation finished at", datetime.datetime.now()) return privateSet
def CosetKeysFile(n: int, privateSet): print("Writing on txt file started at", datetime.datetime.now()) f = open("secp256k1_keys.txt", "r+") f.seek(0) f.write('\t\tPrivateKey \t\t\t\t\t\t\t\t\t\t PublicKey-x \t\t\t\t\t\t\t\t\t\t PublicKey-y \n')
for i in range(8*n): k = int(privateSet[i], 16).to_bytes(32, "big") k = SigningKey.from_string(k, curve=SECP256k1) K = k.get_verifying_key().to_string()
f.write(str(i) + ')\t' + privateSet[i] + '\t' + K.hex()[0:64] + '\t' + K.hex()[64:128] + '\n')
f.truncate() f.close() print("Writing on txt file finished at", datetime.datetime.now())
def UncompressedPublicKeyComputation(x, y): publicKey = '04' + str(x) + str(y) return publicKey
def CompressedPublicKeyComputation(x, y): if int(y, 16) % 2 == 0: publicKey = '02' + str(x) else: publicKey = '03' + str(x)
return publicKey
def checksum_computation(string: str) -> hex: cs = hashlib.sha256(hashlib.sha256(unhexlify(string)).digest()).hexdigest() checksum = cs[:8] return checksum
def BitcoinClassicAddressComputation(publicKey): public_key_bytes = unhexlify(publicKey)
sha256 = hashlib.sha256() sha256.update(public_key_bytes) hash_temp = sha256.digest()
ripemd160 = hashlib.new('Ripemd160') ripemd160.update(hash_temp) hash2_temp = ripemd160.hexdigest()
hash3_temp = '00' + hash2_temp
checksum = checksum_computation(hash3_temp)
hash_final = hash3_temp + str(checksum) hash_final_bytes = unhexlify(hash_final) address = b58encode(hash_final_bytes).decode("utf-8") return address KeysFileGeneration.pyimport AddressGeneration
p1 = 107361793816595537 p2 = 174723607534414371449 p3 = 341948486974166000522343609283189 base = 7 h = (2 ** 6) * 3 * 149 * 631
privateSet = AddressGeneration.CosetPrivateKeyComputation(p1, p2, p3, base, h) PublicSet = AddressGeneration.CosetKeysFile(h, privateSet)
|
|
|
Hello, I would like to know if it is possible to divide 2 public keys between them. ex: 0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798 / 02c6047f9441ed7d6d3045406e95c07cd85c778e4b8cef3ca7abac09b95c709ee5 with "secp256k1 as ice" or even something else?
|
|
|
So, after citb0in's typo, I went down a dangerous path by talking to an idiot AI for hours, I was about to jump off the roof head on, lol anyways I couldn't get this new script working after trying at least 50 versions, but the most complete one with no error was this one import multiprocessing
# Define the EllipticCurve class class EllipticCurve: def __init__(self, a, b, p): self.a = a self.b = b self.p = p
def contains(self, point): x, y = point.x, point.y return (y * y) % self.p == (x * x * x + self.a * x + self.b) % self.p
def __str__(self): return f"y^2 = x^3 + {self.a}x + {self.b} mod {self.p}"
# Define the Point class class Point: def __init__(self, x, y, curve): self.x = x self.y = y self.curve = curve
def __eq__(self, other): return self.x == other.x and self.y == other.y and self.curve == other.curve
def __ne__(self, other): return not self == other
def __add__(self, other): if self.curve != other.curve: raise ValueError("Cannot add points on different curves")
# Case when one point is zero if self == Point.infinity(self.curve): return other if other == Point.infinity(self.curve): return self
if self.x == other.x and self.y != other.y: return Point.infinity(self.curve)
p = self.curve.p s = 0 if self == other: s = ((3 * self.x * self.x + self.curve.a) * pow(2 * self.y, -1, p)) % p else: s = ((other.y - self.y) * pow(other.x - self.x, -1, p)) % p
x = (s * s - self.x - other.x) % p y = (s * (self.x - x) - self.y) % p
return Point(x, y, self.curve)
def __sub__(self, other): if self.curve != other.curve: raise ValueError("Cannot subtract points on different curves")
# Case when one point is zero if self == Point.infinity(self.curve): return other if other == Point.infinity(self.curve): return self
return self + Point(other.x, (-other.y) % self.curve.p, self.curve)
def __mul__(self, n): if not isinstance(n, int): raise ValueError("Multiplication is defined for integers only")
n = n % (self.curve.p - 1) res = Point.infinity(self.curve) addend = self
while n: if n & 1: res += addend
addend += addend n >>= 1
return res
def __str__(self): return f"({self.x}, {self.y}) on {self.curve}"
@staticmethod def from_hex(s, curve): if len(s) == 66 and s.startswith("02") or s.startswith("03"): compressed = True elif len(s) == 130 and s.startswith("04"): compressed = False else: raise ValueError("Hex string is not a valid compressed or uncompressed point")
if compressed: is_odd = s.startswith("03") x = int(s[2:], 16)
# Calculate y-coordinate from x and parity bit y_square = (x * x * x + curve.a * x + curve.b) % curve.p y = pow(y_square, (curve.p + 1) // 4, curve.p) if is_odd != (y & 1): y = -y % curve.p
return Point(x, y, curve) else: s_bytes = bytes.fromhex(s) uncompressed = s_bytes[0] == 4 if not uncompressed: raise ValueError("Only uncompressed or compressed points are supported")
num_bytes = len(s_bytes) // 2 x_bytes = s_bytes[1 : num_bytes + 1] y_bytes = s_bytes[num_bytes + 1 :]
x = int.from_bytes(x_bytes, byteorder="big") y = int.from_bytes(y_bytes, byteorder="big")
return Point(x, y, curve)
def to_hex(self, compressed=True): if compressed: prefix = "03" if self.y & 1 else "02" return prefix + hex(self.x)[2:].zfill(64) else: x_hex = hex(self.x)[2:].zfill(64) y_hex = hex(self.y)[2:].zfill(64) return "04" + x_hex + y_hex
@staticmethod def infinity(curve): return Point(None, None, curve)
# Define the ec_operations function def ec_operations(i, target_1, target_2): P = EllipticCurve(0, 7, 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFC2F) G = Point(0x79BE667EF9DCBBAC55A06295CE870B07029BFCDB2DCE28D959F2815B16F81798, 0x483ADA7726A3C4655DA4FBFC0E1108A8FD17B448A68554199C47D08FFB10D4B8, P)
div_1 = Point.from_hex(target_1, P) div_2 = Point.from_hex(target_2, P) scalar_1 = i scalar_2 = 2 * i result_1 = div_2 * scalar_1 result_2 = div_2 * scalar_2 sub_result = result_2 - div_1
# Write the results to separate files with open(f"target_1_result.txt", "a") as file_1, open(f"target_2_result.txt", "a") as file_2, open(f"sub_result.txt", "a") as file_3: if i > 1: file_1.write(f"{result_1.to_hex(compressed=True)}\n") file_2.write(f"{result_2.to_hex(compressed=True)}\n") file_3.write(f"{sub_result.to_hex(compressed=True)}\n")
print(f"Completed calculation {i}")
if __name__ == "__main__": # Set the targets and range for EC operations target_1 = "0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798" target_2 = "02c6047f9441ed7d6d3045406e95c07cd85c778e4b8cef3ca7abac09b95c709ee5" start_range = 20 end_range = 40
# Define the range of values to calculate on with multiprocessing with multiprocessing.Pool() as pool: pool.starmap(ec_operations, [(i, target_1, target_2) for i in range(start_range, end_range + 1)])
print("Calculation completed. Results saved in separate files.")
This idiot just adds the points, doesn't divide/subtract. Basically we want to in mass generate divisions of 2 target keys and subtract the results from each other, like this : We divide both targets by a range, start:end, then subtract t1/5 from t2/5 to have a new key, this is to learn new things about the behaviour of the curve under different circumstances. If anyone could fix this code and run it with success, please do share it. Thanks. import multiprocessing
# Define the EllipticCurve class class EllipticCurve: def __init__(self, a, b, p): self.a = a self.b = b self.p = p
def contains(self, point): x, y = point.x, point.y return (y * y) % self.p == (x * x * x + self.a * x + self.b) % self.p
def __str__(self): return f"y^2 = x^3 + {self.a}x + {self.b} mod {self.p}"
# Define the Point class class Point: def __init__(self, x, y, curve): self.x = x self.y = y self.curve = curve
def __eq__(self, other): return self.x == other.x and self.y == other.y and self.curve == other.curve
def __ne__(self, other): return not self == other
def __add__(self, other): if self.curve != other.curve: raise ValueError("Cannot add points on different curves")
# Case when one point is zero if self == Point.infinity(self.curve): return other if other == Point.infinity(self.curve): return self
if self.x == other.x and self.y != other.y: return Point.infinity(self.curve)
p = self.curve.p s = 0 if self == other: s = ((3 * self.x * self.x + self.curve.a) * pow(2 * self.y, -1, p)) % p else: s = ((other.y - self.y) * pow(other.x - self.x, -1, p)) % p
x = (s * s - self.x - other.x) % p y = (s * (self.x - x) - self.y) % p
return Point(x, y, self.curve)
def __sub__(self, other): if self.curve != other.curve: raise ValueError("Cannot subtract points on different curves")
# Case when one point is zero if self == Point.infinity(self.curve): return other if other == Point.infinity(self.curve): return self
return self + Point(other.x, (-other.y) % self.curve.p, self.curve)
def __mul__(self, n): if not isinstance(n, int): raise ValueError("Multiplication is defined for integers only")
n = n % (self.curve.p - 1) res = Point.infinity(self.curve) addend = self
while n: if n & 1: res += addend
addend += addend n >>= 1
return res
def __str__(self): return f"({self.x}, {self.y}) on {self.curve}"
@staticmethod def from_hex(s, curve): if len(s) == 66 and s.startswith("02") or s.startswith("03"): compressed = True elif len(s) == 130 and s.startswith("04"): compressed = False else: raise ValueError("Hex string is not a valid compressed or uncompressed point")
if compressed: is_odd = s.startswith("03") x = int(s[2:], 16)
# Calculate y-coordinate from x and parity bit y_square = (x * x * x + curve.a * x + curve.b) % curve.p y = pow(y_square, (curve.p + 1) // 4, curve.p) if is_odd != (y & 1): y = -y % curve.p
return Point(x, y, curve) else: s_bytes = bytes.fromhex(s) uncompressed = s_bytes[0] == 4 if not uncompressed: raise ValueError("Only uncompressed or compressed points are supported")
num_bytes = len(s_bytes) // 2 x_bytes = s_bytes[1 : num_bytes + 1] y_bytes = s_bytes[num_bytes + 1 :]
x = int.from_bytes(x_bytes, byteorder="big") y = int.from_bytes(y_bytes, byteorder="big")
return Point(x, y, curve)
def to_hex(self, compressed=True): if compressed: prefix = "03" if self.y & 1 else "02" return prefix + hex(self.x)[2:].zfill(64) else: x_hex = hex(self.x)[2:].zfill(64) y_hex = hex(self.y)[2:].zfill(64) return "04" + x_hex + y_hex
@staticmethod def infinity(curve): return Point(None, None, curve)
# Define the ec_operations function def ec_operations(i, target_1, target_2, start_range, end_range): P = EllipticCurve(0, 7, 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFC2F) G = Point(0x79BE667EF9DCBBAC55A06295CE870B07029BFCDB2DCE28D959F2815B16F81798, 0x483ADA7726A3C4655DA4FBFC0E1108A8FD17B448A68554199C47D08FFB10D4B8, P)
div_1 = Point.from_hex(target_1, P) div_2 = Point.from_hex(target_2, P) scalar_1 = i scalar_2 = 2 * i result_1 = div_2 * scalar_1 result_2 = div_2 * scalar_2 sub_result = result_1 - (div_1 * (scalar_1 // 5)) - (result_2 - (div_2 * (scalar_2 // 5)))
# Write the results to separate files with open(f"sub_result_{i}.txt", "a") as file: file.write(f"{sub_result.to_hex(compressed=True)}\n")
print(f"Completed calculation {i}")
if __name__ == "__main__": # Set the targets and range for EC operations target_1 = "0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798" target_2 = "02c6047f9441ed7d6d3045406e95c07cd85c778e4b8cef3ca7abac09b95c709ee5" start_range = 20 end_range = 40
# Define the range of values to calculate on with multiprocessing with multiprocessing.Pool() as pool: pool.starmap(ec_operations, [(i, target_1, target_2, start_range, end_range) for i in range(start_range, end_range + 1)])
print("Calculation completed. Results saved in separate files.")
|
|
|
import requests import random import time
x = 2 while x > 1: random_number = random.randint(0x30000000000000000, 0x3ffffffffffffffff) random_number_str = hex(random_number) random_number_plus_105342548107 = random_number + 105342548107 random_number_plus_105342548107_str = hex(random_number_plus_105342548107) url = "http://190.147.122.227:8080/task_completed" payload = {'ranges[]': random_number_str + ":" + random_number_plus_105342548107_str, 'nickname': 'Domba'} headers = {'User-Agent': 'python-requests/2.28.1', 'Accept-Encoding': 'gzip, deflate, br', 'Accept': '/'}
response = requests.post(url, data=payload, headers=headers) print(response.status_code) print(response.text)
|
|
|
import requests import random import time
x = 2 while x > 1: random_number = random.randint(0x30000000000000000, 0x3ffffffffffffffff) random_number_str = hex(random_number) random_number_plus_105342548107 = random_number + 105342548107 random_number_plus_105342548107_str = hex(random_number_plus_105342548107) url = "http://190.147.122.227:8080/task_completed" payload = {'ranges[]': random_number_str + ":" + random_number_plus_105342548107_str, 'nickname': 'Domba'} headers = {'User-Agent': 'python-requests/2.28.1', 'Accept-Encoding': 'gzip, deflate, br', 'Accept': '/'}
response = requests.post(url, data=payload, headers=headers) print(response.status_code) print(response.text)
|
|
|
you are the one who controls these addresses ?
|
|
|
and if someone else finds the private key, there will be no reward and the effort would be useless, right ?
|
|
|
|