_Counselor
Member


Activity: 111
Merit: 61
|
 |
September 09, 2023, 05:23:08 PM |
|
Just to share something I found out, so if you for example divide a point by 35, and then add 1 G to your point and divide the +1 of your point by 35, what do you think will happen? Well the results of both divisions will have a distance equal of n/35, so if you after dividing p/35, start adding n/35 to your result, for each addition you'd get the result of +1p/35, add n/35 twice, you'd get +2p/35.
Do not fix on EC points, elliptic curve is just "graphical" interpretation of a numbers, all maths behind it works at finite field and obey all laws of "real" numbers math. If you divide any "real" number by 35, then divide number+1 by 35, then difference between results will be 1/35. This is also works in finite fields and for EC points. of course if after adding 9 to p, your k ends with 5, then dividing by 5 adding 9/5 won't give you the right key, that's how you can determine what the last digit of your k is.
This is not true, for example - 26/5 = 5,2; 35/5 = 7; 9/5 = 1,8. 26/5+9/5 = 5,2+1,8 = 7 = 35/5 you can also check this with EC points like: p95 = curve.fromPrivate(9).div(5) p265 = curve.fromPrivate(26).div(5) p355 = curve.fromPrivate(35).div(5) print(p265, p355) print(p265.add(p95))
output: 03F18D7188F16C93BB251A68DE95A057E02356BA0602854041BA4E170676E54169 025CBDF0646E5DB4EAA398F365F2EA7A0E3D419B7E0330E39CE92BDDEDCAC4F9BC 025CBDF0646E5DB4EAA398F365F2EA7A0E3D419B7E0330E39CE92BDDEDCAC4F9BC
|
|
|
|
|
digaran
Copper Member
Hero Member
   

Activity: 1330
Merit: 905
🖤😏
|
 |
September 09, 2023, 06:17:16 PM |
|
Just to share something I found out, so if you for example divide a point by 35, and then add 1 G to your point and divide the +1 of your point by 35, what do you think will happen? Well the results of both divisions will have a distance equal of n/35, so if you after dividing p/35, start adding n/35 to your result, for each addition you'd get the result of +1p/35, add n/35 twice, you'd get +2p/35.
Do not fix on EC points, elliptic curve is just "graphical" interpretation of a numbers, all maths behind it works at finite field and obey all laws of "real" numbers math. If you divide any "real" number by 35, then divide number+1 by 35, then difference between results will be 1/35. This is also works in finite fields and for EC points. of course if after adding 9 to p, your k ends with 5, then dividing by 5 adding 9/5 won't give you the right key, that's how you can determine what the last digit of your k is.
This is not true, for example - 26/5 = 5,2; 35/5 = 7; 9/5 = 1,8. 26/5+9/5 = 5,2+1,8 = 7 = 35/5 you can also check this with EC points like: p95 = curve.fromPrivate(9).div(5) p265 = curve.fromPrivate(26).div(5) p355 = curve.fromPrivate(35).div(5) print(p265, p355) print(p265.add(p95))
output: 03F18D7188F16C93BB251A68DE95A057E02356BA0602854041BA4E170676E54169 025CBDF0646E5DB4EAA398F365F2EA7A0E3D419B7E0330E39CE92BDDEDCAC4F9BC 025CBDF0646E5DB4EAA398F365F2EA7A0E3D419B7E0330E39CE92BDDEDCAC4F9BC
Ok, but did I say otherwise? If we add 9 to 26 we get 35, dividing 35/5 = 7 + 9/5 = 8.8, and 8.8 is the wrong answer. As I said if our k ends with 5, adding 9/5 to result returns wrong key. And of course that when we are working with secp256k1, we are dealing with a prime and mod n. Ps, I am really uneducated totally, I just share my experience, please nobody take my posts as if I am arrogant, I am 0.00000001 while everyone here is beyond 100.🙂
|
🖤😏
|
|
|
|
nomachine
|
 |
September 09, 2023, 06:30:46 PM |
|
Ps, I am really uneducated totally, I just share my experience, please nobody take my posts as if I am arrogant, I am 0.00000001 while everyone here is beyond 100.🙂
Problem is people are so consumed by media these days that their dopamine receptors are completely fried.. therefore have no patience or joy. They need to go outside and touch some grass. Sleep on it. And then come back down to reality. 
|
BTC: bc1qdwnxr7s08xwelpjy3cc52rrxg63xsmagv50fa8
|
|
|
|
mcdouglasx
|
 |
September 09, 2023, 08:27:25 PM |
|
So after some research, I have found a new and yet useless solution, is there a script which could divide a point by a set range?
Like dividing target public key by 1000, 999, 998, 997 etc, we select start and end range for division and it should divide the target as many times as we specify.
For educational purposes only.😉
I did it like this by only changing the divisor because a sequential division doesn't make sense because it would end in a long float. import bitcoin import secp256k1 as ice
print("Generating Div-Range...")
target= "03633cbe3ec02b9401c5effa144c5b4d22f87940259634858fc7e59b1c09937852"
print("Target:",target)
Start_Range= 1000
end_Range= 2000
for i in range(Start_Range, end_Range+1):
Div = bitcoin.divide(target, i) data = open("Div-Range.txt","a") data.write(str(Div) +"\n") data.close() I don't know what a long float is, but if I do the division the way I described, I might find new tricks. Anyways thanks for the code, I hope it works as intended, if it doesn't, there is an idiot AI which can help. 😉 Just to share something I found out, so if you for example divide a point by 35, and then add 1 G to your point and divide the +1 of your point by 35, what do you think will happen? Well the results of both divisions will have a distance equal of n/35, so if you after dividing p/35, start adding n/35 to your result, for each addition you'd get the result of +1p/35, add n/35 twice, you'd get +2p/35. Any point on the curve, no matter what the private key is acts like "1" in real numbers, for instance, if you add 9 to your p and then divide by 5, to get the correct result you'd need to add 9/5 to your result to have the correct key. ( of course if after adding 9 to p, your k ends with 5, then dividing by 5 adding 9/5 won't give you the right key, that's how you can determine what the last digit of your k is. Ps, about the division method, dividing a key by 1000 and then dividing it by 999, what do you think will happen? In EC, both results of both divisions will have a distance equal to "1". Just to show what I mean : 500/260 = 1.9>>>2<<<30769230769230769230769230769230769230769230769230769230769230769230769231 500/259 = 1.9>>>3<<<05019305019305019305019305019305019305019305019305019305019305019305019305 Note 2 and 3 pointed out with >>><<<, in EC that 2 turning to 3 will only add 1 to your result. take ecc as numbers, if in numbers 3/2 = 1.5 then on the curve it will be the same. Therefore I recommend doing your theory in numbers, and then you transfer that to ecc. For example: This script always gives you 3 results, one of which is always an integer. target= 100 N = 3
A = target / N B = (target + 1) / N
C = target - (A + B)
print("pk:",target) print("A:",A) print("B:",B) print("C:",str(C)+"\n") After you have the idea, you materialize it in ECC import bitcoin import secp256k1 as ice
print("creating div....")
# target pubkey Compressed target ="02ed3bace23c5e17652e174c835fb72bf53ee306b3406a26890221b4cef7500f88"
N = 3
A_r = bitcoin.divide(target, N)# target / N t_0 = ice.pub2upub(target) T_1 = ice.point_sequential_increment(1, t_0).hex() T_2 = ice.to_cpub(T_1)
B_r = bitcoin.divide(T_2, N)#(target + 1) / N
B_0 = ice.pub2upub(A_r) B_1 = ice.pub2upub(B_r) B_2 = ice.point_addition(B_0, B_1) B_3 = B_2.hex() C_0 = ice.point_subtraction(t_0 , B_2) #target - (A + B) C_1 = C_0.hex() C_r = ice.to_cpub(C_1)
A= str(A_r) B= str(B_r) C= str(C_r) print("target:", target+"\n") print("A:",A) print("B:",B) print("C:",C+"\n")
|
|
|
|
digaran
Copper Member
Hero Member
   

Activity: 1330
Merit: 905
🖤😏
|
 |
September 10, 2023, 12:00:20 AM |
|
import bitcoin import secp256k1 as ice
print("creating div....")
# target pubkey Compressed target ="02ed3bace23c5e17652e174c835fb72bf53ee306b3406a26890221b4cef7500f88"
N = 3
A_r = bitcoin.divide(target, N)# target / N t_0 = ice.pub2upub(target) T_1 = ice.point_sequential_increment(1, t_0).hex() T_2 = ice.to_cpub(T_1)
B_r = bitcoin.divide(T_2, N)#(target + 1) / N
B_0 = ice.pub2upub(A_r) B_1 = ice.pub2upub(B_r) B_2 = ice.point_addition(B_0, B_1) B_3 = B_2.hex() C_0 = ice.point_subtraction(t_0 , B_2) #target - (A + B) C_1 = C_0.hex() C_r = ice.to_cpub(C_1)
A= str(A_r) B= str(B_r) C= str(C_r) print("target:", target+"\n") print("A:",A) print("B:",B) print("C:",C+"\n") Alright, as I was in the middle of the night on the roof looking at orion and ursa major ( I think ), since I couldn't find any green grass to touch for no apparent reason, lol. I thought it's best to use my phone to run scripts, so I downloaded Py 3 installed secp256k1 lib and ran your script, but it says no attribute for pub2upub in secp256k1, but here is another thing, start exec(open(mainpyfile).read(), __main__.__dict__) File "<string>", line 17 ^ SyntaxError: invalid non-printable character U+00A0 [Program finished] I will find a fix, just wanted to thank you for the time you spend responding.
|
🖤😏
|
|
|
|
mcdouglasx
|
 |
September 10, 2023, 02:38:16 PM |
|
import bitcoin import secp256k1 as ice
print("creating div....")
# target pubkey Compressed target ="02ed3bace23c5e17652e174c835fb72bf53ee306b3406a26890221b4cef7500f88"
N = 3
A_r = bitcoin.divide(target, N)# target / N t_0 = ice.pub2upub(target) T_1 = ice.point_sequential_increment(1, t_0).hex() T_2 = ice.to_cpub(T_1)
B_r = bitcoin.divide(T_2, N)#(target + 1) / N
B_0 = ice.pub2upub(A_r) B_1 = ice.pub2upub(B_r) B_2 = ice.point_addition(B_0, B_1) B_3 = B_2.hex() C_0 = ice.point_subtraction(t_0 , B_2) #target - (A + B) C_1 = C_0.hex() C_r = ice.to_cpub(C_1)
A= str(A_r) B= str(B_r) C= str(C_r) print("target:", target+"\n") print("A:",A) print("B:",B) print("C:",C+"\n") Alright, as I was in the middle of the night on the roof looking at orion and ursa major ( I think ), since I couldn't find any green grass to touch for no apparent reason, lol. I thought it's best to use my phone to run scripts, so I downloaded Py 3 installed secp256k1 lib and ran your script, but it says no attribute for pub2upub in secp256k1, but here is another thing, start exec(open(mainpyfile).read(), __main__.__dict__) File "<string>", line 17 ^ SyntaxError: invalid non-printable character U+00A0 [Program finished] I will find a fix, just wanted to thank you for the time you spend responding. Maybe you have not installed the Bitcoin module “pip install bitcoin”, or you did not place secp256k1.py and .dll in the directory where the script is.
|
|
|
|
digaran
Copper Member
Hero Member
   

Activity: 1330
Merit: 905
🖤😏
|
 |
September 11, 2023, 07:34:36 AM |
|
Can someone tell me why there is nothing in my output file even though the target is in the file this script is searching, it even says saved in matches.txt Here is the script import re
# List of target public keys target_public_keys = '0370e7c3d922008d9ccea410d560cd440a834a811a1ea74c2967637ca015a788a3'
# Regular expression pattern for matching public keys pattern = r"\b(" + "|".join(target_public_keys) + r")\b"
# Output file to log matches output_file = "matches.txt"
# List of files to search through files_to_search =[ "Finish-him-Jack-wins.txt"]
# Open the output file for writing with open(output_file, "w") as output: for filename in files_to_search: with open(filename, "r") as file: content = file.read() matches = re.findall(pattern, content) if matches: output.write(f"Matches found in {filename}:\n") for match in matches: output.write(match + "\n") output.write("\n")
print("Search completed. Matching public keys saved in", output_file) Appreciate any help.
|
🖤😏
|
|
|
|
citb0in
|
 |
September 11, 2023, 09:19:47 AM Last edit: September 11, 2023, 02:11:19 PM by citb0in |
|
import re
# List of target public keys target_public_keys = ['0370e7c3d922008d9ccea410d560cd440a834a811a1ea74c2967637ca015a788a3'] # as a list
# Regular expression pattern for matching public keys pattern = r"\b(" + "|".join(target_public_keys) + r")\b"
# Output file to log matches output_file = "matches.txt"
# List of files to search through files_to_search = ["Finish-him-Jack-wins.txt"]
# Open the output file for writing with open(output_file, "a") as output:
for filename in files_to_search: with open(filename, "r") as file: content = file.read() matches = re.findall(pattern, content) if matches: output.write(f"Matches found in {filename}:\n") for match in matches: output.write(match + "\n") output.write("\n")
print("Search completed. Matching public keys saved in", output_file)
|
Some signs are invisible, some paths are hidden - but those who see, know what to do. Follow the trail - Follow your intuition - [bc1qqnrjshpjpypepxvuagatsqqemnyetsmvzqnafh]
|
|
|
Denis_Hitov
Newbie

Activity: 52
Merit: 0
|
 |
September 11, 2023, 12:57:43 PM Last edit: September 11, 2023, 02:56:24 PM by Denis_Hitov |
|
import re
# List of target public keys target_public_keys = ['0370e7c3d922008d9ccea410d560cd440a834a811a1ea74c2967637ca015a788a3'] # as a list
# Regular expression pattern for matching public keys pattern = r"\b(" + "|".join(target_public_keys) + r")\b"
# Output file to log matches output_file = "matches.txt"
# List of files to search through files_to_search = ["Finish-him-Jack-wins.tx"]
# Open the output file for writing with open(output_file, "[b]a[/b]") as output:
for filename in files_to_search: with open(filename, "r") as file: content = file.read() matches = re.findall(pattern, content) if matches: output.write(f"Matches found in {filename}:\n") for match in matches: output.write(match + "\n") output.write("\n")
print("Search completed. Matching public keys saved in", output_file)
Error!!!  with open(output_file, "[b]a[/b]") as output: ValueError: invalid mode: '[b]a[/b]'
|
|
|
|
|
|
citb0in
|
 |
September 11, 2023, 02:10:46 PM |
|
LoL  I emphasized (bold) the letter a but the code block did mess it up. But those are small ones, just think about it and correct it yourself.
|
Some signs are invisible, some paths are hidden - but those who see, know what to do. Follow the trail - Follow your intuition - [bc1qqnrjshpjpypepxvuagatsqqemnyetsmvzqnafh]
|
|
|
Denis_Hitov
Newbie

Activity: 52
Merit: 0
|
 |
September 11, 2023, 02:16:42 PM Last edit: September 11, 2023, 08:14:24 PM by Denis_Hitov |
|
Can someone tell me why there is nothing in my output file even though the target is in the file this script is searching, it even says saved in matches.txt Here is the script import re
# List of target public keys target_public_keys = '0370e7c3d922008d9ccea410d560cd440a834a811a1ea74c2967637ca015a788a3'
# Regular expression pattern for matching public keys pattern = r"\b(" + "|".join(target_public_keys) + r")\b"
# Output file to log matches output_file = "matches.txt"
# List of files to search through files_to_search =[ "Finish-him-Jack-wins.txt"]
# Open the output file for writing with open(output_file, "w") as output: for filename in files_to_search: with open(filename, "r") as file: content = file.read() matches = re.findall(pattern, content) if matches: output.write(f"Matches found in {filename}:\n") for match in matches: output.write(match + "\n") output.write("\n")
print("Search completed. Matching public keys saved in", output_file) Appreciate any help. with open(output_file, "w") as output: instead of " w" put " a" P.S.: Tell me why you need this script? The pub can be found by regular file search)
|
|
|
|
|
|
citb0in
|
 |
September 11, 2023, 06:32:42 PM |
|
the w flag opens the file for writing and truncating; use "a" as write mode. This means append
|
Some signs are invisible, some paths are hidden - but those who see, know what to do. Follow the trail - Follow your intuition - [bc1qqnrjshpjpypepxvuagatsqqemnyetsmvzqnafh]
|
|
|
digaran
Copper Member
Hero Member
   

Activity: 1330
Merit: 905
🖤😏
|
 |
September 11, 2023, 09:14:13 PM |
|
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.
|
🖤😏
|
|
|
Kostelooscoin
Member


Activity: 208
Merit: 16
|
 |
September 12, 2023, 02:12:43 PM |
|
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.")
|
|
|
|
|
digaran
Copper Member
Hero Member
   

Activity: 1330
Merit: 905
🖤😏
|
 |
September 12, 2023, 05:07:05 PM |
|
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.")
My man, I think I explained incorrectly, what we want is this : Example : T1 = 20 T2 = 40 Start range = 2 End range = 8 Divide t1 by 2 = 10 Divide t2 by 2 = 20 Subtract 10 from 20 = 10.
T1 20/3 = 6.666666667 T2 40/3 = 13.33333333 Subtract 6.666666667 from 13.33333333 = 6.666666663
T1 20/4 = 5 T2 40/4 = 10 Subtract 5 from 10 = 5 And so on, in my example 20 is half of 40, but in reality we can set any target we want, do you think you can modify the code to do that please? Thank you for your time and effort.
|
🖤😏
|
|
|
Dexed
Newbie

Activity: 17
Merit: 0
|
 |
September 12, 2023, 08:21:56 PM |
|
By the way, and you know why their puzzle addresses were removed from the 161st? My thought is that this is the limit of public addresses. That is the further search in the theory goes on a circle.
Because all the funds from 161 through 255 were redundant (Bitcoin addresses only use 160 bits) the author of the puzzle moved all the funds from the 160-255 ranged down into the 1-160 range. It is explained up thread. Is it? I thought it uses almost 256 bits (the last possible private key is FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364140)
|
|
|
|
|
|
albert0bsd
|
 |
September 12, 2023, 09:45:45 PM |
|
Because all the funds from 161 through 255 were redundant (Bitcoin addresses only use 160 bits) the author of the puzzle moved all the funds from the 160-255 ranged down into the 1-160 range. It is explained up thread.
Is it? I thought it uses almost 256 bits (the last possible private key is FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364140) The maximum value of a Privatekey is the value that you pointed, what they actually want to said is that address is a reduction of the public key, it is a 160 bit hash, so if you are capable to fin a collision on a 160 bits hash, that mean that you are capable to find any collision, regarless that those private keys are up to 256 bits
|
₿ SIGNATURE SPACE AVAILABLE • HERO MEMBER • PM • bc1qjyhcjacmpc9pg8wes82lktyrjcwk4sdvqtm7ky
|
|
|
digaran
Copper Member
Hero Member
   

Activity: 1330
Merit: 905
🖤😏
|
 |
September 12, 2023, 10:20:10 PM Last edit: September 12, 2023, 11:12:17 PM by digaran |
|
from sympy import mod_inverse import secp256k1 as ice pub=ice.pub2upub('Here Compressed Public Key') N=0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141
k=mod_inverse(2,N) neg1=ice.point_negation(ice.scalar_multiplication(1))
def ters(Qx,Scalar): ScalarBin = str(bin(Scalar))[2:] le=len(ScalarBin) for i in range (1,le+1): if ScalarBin[le-i] == "0": Qx=ice.point_multiplication(k,Qx) else: Qx=ice.point_addition(Qx,neg1) Qx=ice.point_multiplication(k,Qx) return ice.point_to_cpub(Qx)
for x in range(1,65536): f= (ters(pub,x)) data= open(“halfpub.txt”,”a”) data.write(f+”\n”) data.close() Note this is where you decide how many bits should be reduced for x in range(1,65536): For example reducing 26 bits requires 67108864 to be generated, 1 of them is the correct 26 bit reduced key. Will you release for public to use? Yes this is my code, I can write bit reduction code in another way if you want. If you want, you can reduce bits by subtraction. I'm developing a new algorithm for downgrading from a known bit range to the bit range I want. When I complete it by giving only 1 correct pubkey, I will share it here. @lordfrs, I was thinking, why do we need to keep all the 65556 keys if we are reducing 16 bits? One other thing, if we multiply one of the keys from the end of the output file by 65556 we should see our target, correct? I haven't thought about on how to calculate, since we are subtracting one dividing by 2, one result if multiplied by 2^16 should reach the target or close to target, so why not discarding 90% of the generated keys and start multiplying the remaining 10% by 2^16? Could you add such operation to your script? I guess if we could operate on private keys instead of public keys using your script, we could reach some results, ( as a test of course ) To test with scalar only, I use this script : from sympy import mod_inverse N = 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141
def ters(scalar): k = mod_inverse(2, N) scalar_bin = bin(scalar)[2:] result = 2 for i in range(len(scalar_bin)): if scalar_bin[i] == '0': result = (result * k) % N else: result = ((result * k) % N + N - 1) % N return hex(result)[2:].zfill(64)
for x in range(1, 20): f = ters(x) print(f) It was a lucky shot at AI generated code and it worked.😅 Btw, the first "result" in the script above, represents your target, I couldn't risk the AI to mess one thing she has done right. So result = 2, replace 2 with your own scalar in decimal.
|
🖤😏
|
|
|
kalos15btc
Jr. Member

Activity: 50
Merit: 1
|
 |
September 13, 2023, 09:53:17 PM |
|
By the way, and you know why their puzzle addresses were removed from the 161st? My thought is that this is the limit of public addresses. That is the further search in the theory goes on a circle.
Because all the funds from 161 through 255 were redundant (Bitcoin addresses only use 160 bits) the author of the puzzle moved all the funds from the 160-255 ranged down into the 1-160 range. It is explained up thread. Is it? I thought it uses almost 256 bits (the last possible private key is FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364140) OH, HIII, Good morning from sympy import mod_inverse import secp256k1 as ice pub=ice.pub2upub('Here Compressed Public Key') N=0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141
k=mod_inverse(2,N) neg1=ice.point_negation(ice.scalar_multiplication(1))
def ters(Qx,Scalar): ScalarBin = str(bin(Scalar))[2:] le=len(ScalarBin) for i in range (1,le+1): if ScalarBin[le-i] == "0": Qx=ice.point_multiplication(k,Qx) else: Qx=ice.point_addition(Qx,neg1) Qx=ice.point_multiplication(k,Qx) return ice.point_to_cpub(Qx)
for x in range(1,65536): f= (ters(pub,x)) data= open(“halfpub.txt”,”a”) data.write(f+”\n”) data.close() Note this is where you decide how many bits should be reduced for x in range(1,65536): For example reducing 26 bits requires 67108864 to be generated, 1 of them is the correct 26 bit reduced key. Will you release for public to use? Yes this is my code, I can write bit reduction code in another way if you want. If you want, you can reduce bits by subtraction. I'm developing a new algorithm for downgrading from a known bit range to the bit range I want. When I complete it by giving only 1 correct pubkey, I will share it here. @lordfrs, I was thinking, why do we need to keep all the 65556 keys if we are reducing 16 bits? One other thing, if we multiply one of the keys from the end of the output file by 65556 we should see our target, correct? I haven't thought about on how to calculate, since we are subtracting one dividing by 2, one result if multiplied by 2^16 should reach the target or close to target, so why not discarding 90% of the generated keys and start multiplying the remaining 10% by 2^16? Could you add such operation to your script? I guess if we could operate on private keys instead of public keys using your script, we could reach some results, ( as a test of course ) To test with scalar only, I use this script : from sympy import mod_inverse N = 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141
def ters(scalar): k = mod_inverse(2, N) scalar_bin = bin(scalar)[2:] result = 2 for i in range(len(scalar_bin)): if scalar_bin[i] == '0': result = (result * k) % N else: result = ((result * k) % N + N - 1) % N return hex(result)[2:].zfill(64)
for x in range(1, 20): f = ters(x) print(f) It was a lucky shot at AI generated code and it worked.😅 Btw, the first "result" in the script above, represents your target, I couldn't risk the AI to mess one thing she has done right. So result = 2, replace 2 with your own scalar in decimal. bro please stop replying with those comments copy past from chatgpt you are doing nothing except replying and talk too much, you are doing nothing for real men, stop it bro,  thank you
|
|
|
|
|
|
albert0bsd
|
 |
September 13, 2023, 11:24:16 PM Last edit: September 14, 2023, 05:04:05 AM by albert0bsd |
|
Personally i believe that this post just lost its purpose there is a lot of non-sense post or just some offtopic (Some moderator should close it) A lot of discutions if some slowly python code do this or that, if you have something substantial to contribute to that discussion, it would be best to start a new thread. In the field of the search of the solucion of this challenge there is no new algorithms or programs. We can resume the progress of the last year in the next. - Puzzle/challenge 64 solve by Unknown a year ago 2022-09-09 privatekey f7051f27b09112d4 - Puzzle/challenge 120 solve by unknown on 2023-02-27 and the private key remains unknown. - Puzzle/challenge 125 solve by unknown on 2023-07-09 and the private key remains unknown. And there is not clue of who solve those and what hardware they use, the wallet 3Emiwzxme7Mrj4d89uqohXNncnRM15YESs is still untouch Next challenges to be solve are 66 bits with just brute force/pool and puzzle 130 with kangaroo/pool  Best idea to solve puzzle 66 proposed on this thread is giving less priotiry to some repeated patterns. (But the expected time that the user give was ridiculus) And thats all.
|
₿ SIGNATURE SPACE AVAILABLE • HERO MEMBER • PM • bc1qjyhcjacmpc9pg8wes82lktyrjcwk4sdvqtm7ky
|
|
|
|