import secp256k1 as ice
target_public_key = "023d62d9d64a7164a2ae6f0561f7e8317e69b4a1ee61048fe768a1316b39b1d3a7"
target = ice.pub2upub(target_public_key)
num = 100 # number of times.
sustract= 1 #amount to subtract each time.
sustract_pub= ice.scalar_multiplication(sustract)
res= ice.point_loop_subtraction(num, target, sustract_pub)
for t in range (num+1):
h= res[t*65:t*65+65]
data = open("data-base.txt","a")
data.write(str(h.hex())+"\n")
data.close()
Is it possible to make it possible to specify an unlimited number in num?
If set num = 1000000000
That throws an error:
Traceback (most recent call last):
File "D :\PubSub\PubSub.py", line 8, in <module>
res= ice.point_loop_subtraction(num, target, sustract_pub).hex()
File "D :\PubSub\secp256k1.py", line 504, in point_loop_subtraction
res = _point_loop_subtraction(num, pubkey1_bytes, pubkey2_bytes)
File "D :\PubSub\secp256k1.py", line 497, in _point_loop_subtraction
res = (b'\x00') * (65 * num)
MemoryError
this may be because secp256k1 loop stores the result in memory first, and exceeds the capacity of your ram.
choose a smaller amount and then change the target with the last pubkey in the database list (to continue from there).
This is all clear.
But we don't know what range our last key fell into, do we? Accordingly, we cannot know what amount and how many times it can be subtracted from it so as not to go into a minus. That's where the snag is.