I store every key, 2^25 keys, represented with a “0” or a “1”.
Ok, then you are using the idea of this thread.
But how does this help you do a search for a key?
What search would you run with this script?
The OPs (and my modified script) basically stores “wilds” a known pubkey’s offset keys.
And the search script can land in any key space, do 64 key computations, and find the key of the key is in that range.
The idea is:
if you know that a public key P is in your db, of course you need only 64 key computations. The same for my script.
( I didn't write a script "search" so far, I made only a script to build the database as small as possible).
The general case is:
1) I have a public keys P. I don't know the private key, but I know it is in range [1 - 2^64] (example). But this range is too big, I cant store or build a such huge database.
There are 2 main possibilities:
a) I generate a database of 2^32 public keys [from 1*G to 2^32*G] (baby steps) and I store all of them, then
I compute P1 = P - 2^32*G and verify if it is in my db, otherwise I compute P2 = P - 2*(2^32*G) and so on (giant steps).
This is baby-giant steps algorithm, about 2^32 computation but a huge size database.
b) I generate a database of 2^32 public keys [from 1*G to 2^32*G], but I store only 1 key each 64 (to save space).
Then I compute P1 = P -2^32G and I verify if it is in my db.
I have to perform 64 subtraction from P1: P1 - G, P1 - 2G, P3 - G , .... P3 - 64*G
to be sure that P1 is or is not in the interval [1->2^32].
If P1 or the other 64 keys are not in my db, I compute P2 = P - 2*(2^32*G) and so on.
I have a database with 63,570,000,000 keys stored in it, with a size of only 7.7GB. This one was created using the BitArray function, but it has flaws when doing a search so I am not using it at the moment.
But when I run the search script, it uses the equivalent in RAM, roughly 7.7GB of RAM used during the search.
But I can make jumps the size of 63,570,000,000 (almost 2^36), do 64 computations, and know within a second if key is in that range or not. So every less than a second, it jumps 2^36 keys and checks for a match. But this is using python, could be much faster in C, C++, and a lot faster with GPU support.