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.