Bitcoin Forum
April 04, 2026, 04:49:06 PM *
News: Latest Bitcoin Core release: 30.2 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: exponentially increase a database of sequential ordered public keys(brute-force)  (Read 498 times)
mcdouglasx (OP)
Hero Member
*****
Offline Offline

Activity: 966
Merit: 532



View Profile WWW
December 10, 2024, 03:10:46 AM
 #1

BigDb is an example of how to exponentially increase a database of sequentially ordered public keys.

https://github.com/Mcdouglas-X/BigDb

A database of sequential points is created and stored in a Bloom filter.

Creating the Database

To create a database with 1,000,000 points:


Code:
./BigDb -bs 1000000

Once created, a log file is generated that records the point count. In this case, the log file will record 1,000,000 points. This log file serves as a guide both for expanding the database and for performing accurate searches.

Example of Expanding the Database

If we want to add 1,000,000 more points:


Code:
./BigDb -bs 1000000

This will start creating points from where the log file indicates. For our example, points will be created from 1,000,000 to 2,000,000 (because we are adding 1,000,000 points).

Using the Database
Once our database is created, we run:


Code:
./BigDb -f 30.txt -ht 1000

The -f parameter will read from the "30.txt" file the search range and the target public key, and will create a hash table with the -ht parameter.

The hash table is composed as follows:

It reads the log file to know the size of our database.

It subtracts this amount (2,000,000 in the example) from the target the number of times indicated by -ht (1,000 in the example).

This subtracts 2,000,000 from the public key 1,000 times consecutively, temporarily storing all intermediate results in the hash table.

We have increased the range covered by the database by 1,000 times to 2,000,000 * 1,000 = 2,000,000,000.

This improvement requires extra computation power for the search (explained later).

Search

For the search in this example, we use traditional brute force:


A random number is created within the search range.

This random point is searched by finding the difference with each element of the hash table by subtracting.

If the random point is within the range "target - 2,000,000,000:target", eventually one of those results will be in the Bloom filter and we can easily calculate the private key.

Although we could exponentially increase our database (x10, x100, x1000... x1,000,000), the computational load also increases. In our example, it would add 1,000 additional subtractions.

Thanks for reading. This example is not intended for actual use; the code is just a poorly optimized example.


sneeky777
Newbie
*
Offline Offline

Activity: 21
Merit: 1


View Profile
December 10, 2024, 04:10:46 AM
Last edit: December 10, 2024, 04:40:59 AM by sneeky777
 #2

Hi thanks for this.

Thought i would give win wsl a bash and get many build errors.

First was SECP256k1.h renamed to SECP256K1.h fixed that
Then secp256k1/Timer.h and bloom/bloom.h missing #include <cstdint> done that

after that i now get In file included from bloom/bloom.cpp:6:
/usr/include/openssl/md5.h:52:38: note: declared here
   52 | OSSL_DEPRECATEDIN_3_0 unsigned char *MD5(const unsigned char *d, size_t n,

Now it builds but when running Bigdb -bs 1000000 it gives Bigdb: command not found

Just a heads up maybe its my setup or maybe i smoked too much but i like tinkering with things like this so ill update when running.

well that was quick got it running on wsl.

./BigDb -bs 1000000 didnt work for me renaming to ./Bigdb -bs 1000000 worked

Bigdb v0.1(alpha) by Mcdouglasx
[======================================================================] 100 %

Now i can play.
mcdouglasx (OP)
Hero Member
*****
Offline Offline

Activity: 966
Merit: 532



View Profile WWW
December 10, 2024, 03:02:25 PM
 #3

Hi thanks for this.

Thought i would give win wsl a bash and get many build errors.

First was SECP256k1.h renamed to SECP256K1.h fixed that
Then secp256k1/Timer.h and bloom/bloom.h missing #include <cstdint> done that

after that i now get In file included from bloom/bloom.cpp:6:
/usr/include/openssl/md5.h:52:38: note: declared here
   52 | OSSL_DEPRECATEDIN_3_0 unsigned char *MD5(const unsigned char *d, size_t n,

Now it builds but when running Bigdb -bs 1000000 it gives Bigdb: command not found

Just a heads up maybe its my setup or maybe i smoked too much but i like tinkering with things like this so ill update when running.

well that was quick got it running on wsl.

./BigDb -bs 1000000 didnt work for me renaming to ./Bigdb -bs 1000000 worked

Bigdb v0.1(alpha) by Mcdouglasx
[======================================================================] 100 %

Now i can play.

It is strange what you say, perhaps it is a problem with your WLS or missing libraries.
sneeky777
Newbie
*
Offline Offline

Activity: 21
Merit: 1


View Profile
December 11, 2024, 01:31:43 AM
 #4

Hi thanks for this.

Thought i would give win wsl a bash and get many build errors.

First was SECP256k1.h renamed to SECP256K1.h fixed that
Then secp256k1/Timer.h and bloom/bloom.h missing #include <cstdint> done that

after that i now get In file included from bloom/bloom.cpp:6:
/usr/include/openssl/md5.h:52:38: note: declared here
   52 | OSSL_DEPRECATEDIN_3_0 unsigned char *MD5(const unsigned char *d, size_t n,

Now it builds but when running Bigdb -bs 1000000 it gives Bigdb: command not found

Just a heads up maybe its my setup or maybe i smoked too much but i like tinkering with things like this so ill update when running.

well that was quick got it running on wsl.

./BigDb -bs 1000000 didnt work for me renaming to ./Bigdb -bs 1000000 worked

Bigdb v0.1(alpha) by Mcdouglasx
[======================================================================] 100 %

Now i can play.

It is strange what you say, perhaps it is a problem with your WLS or missing libraries.

Possibly either way its working as you stated.

So i generated the DB with 1,000,000 pubs and only 1 million then the search for puzzle 30 and 40 the results

PrivateKey found: 1033162084
PublicKey: 030D282CF2FF536D2C42F105D0B8588821A915DC3F9A05BD98BB23AF67A2E92A5B
Time to find key: 0.57816 seconds
PrivateKey found: 995061478358
PublicKey: 03CCC97D220A22C4CA538882BD93BFC11356F5C57EC1B5DAEAE47D705C4689905A
Time to find key: 2.62869 seconds

still a lot more to play about with but nice times so far.
COBRAS
Member
**
Offline Offline

Activity: 1137
Merit: 25


View Profile
December 15, 2024, 02:14:25 AM
Last edit: December 15, 2024, 03:07:29 AM by COBRAS
 #5

keyhunt cant work with 1,000,000 point, all regivme's I was try.


I make this :

priv in outlut is a priv of substracted pubkey


Code:
import hashlib
import ecdsa
N =  (2**256 - 2**32 - 2**9 - 2**8 - 2**7 - 2**6 - 2**4 - 1)#  115792089237316195423570985008687907852837564279074904382605163141518161494337

def inv(v): return pow(v, N-2, N)
def divnum(a, b): return ( (a * inv(b) ) % N )

G_x = 0x79BE667EF9DCBBAC55A06295CE870B07029BFCDB2DCE28D959F2815B16F81798
G_y = 0x483ADA7726A3C4655DA4FBFC0E1108A8FD17B448A68554199C47D08FFB10D4B8


P_x=0xfe01eba87de8b92e872b3bb7bcb161b9611a70012e96cecca87590bed92c15b1  #(k * G_x) % (2**256 - 2**32 - 2**9 - 2**8 - 2**7 - 2**6 - 2**4 - 1)
P_y = 0xdbc6315173afdf48da195367b827fe2cf1b6047798f152c9306bb2db9435a119

P_inv = (inv(G_x))

P_inv = ((P_inv * 2%N) %N + P_inv % N) %N

sec = 0x34228895d231df0f17001f5

0x578540107395a50d1725e1be25d183fad

priv = 0

i =1#2**49# 0x47eb1a9a2c802d111ddef980016130e35 - 0xe359
k = 0

K = 0
while i <= 2**90 and sec - i >= 2**88:
    
    #0x1cc6cfbfe0217e5ba5ff2eb816130e35
    K = K +1
    
    
    priv = P_x % ((P_inv* i%N)%N)
    if priv == P_x:
        k = k +1
        print("priv",(hex((0x34228895d231df0f17001f5- i))))
        #print("div",(divnum( 0x2d7ab6a05aa37 - (0x2d7ab6a05aa37- i), 50000000)))
        #print(hex(i))
        
        
        
        #print(hex( 0x2d7ab6a05aa37 - (0x2d7ab6a05aa37- i)))
        
        #print(hex( 0x2d7ab6a05aa37))
        print("iIii",hex(i),i,"K",K,"k",k)
    
    i = i+10000000000000000000 -1





result:

3991
priv 0x100011a8f5b4002da0001f4
iIii 0x242276ecdc7ddee17700001 698945340000000000000000001 K 69894535 k 543992
priv 0x10000bef1e52203cfd801f4
iIii 0x24227ca6b3dfbed21980001 698947030000000000000000001 K 69894704 k 543993
priv 0x1000076d86ff0a82a5001f4
iIii 0x242281284b32d48c7200001 698948360000000000000000001 K 69894837 k 543994
priv 0x100001b3af9d2a9202801f4
iIii 0x242286e22294b47d1480001 698950050000000000000000001 K 69895006 k 543995

K this is total pubkeys


k this is mach smaler pubkeys what is good  for brute


Can you implement k to your scrypt


with sach param:

Code:
while i <= 2**90 and sec - i >= 0x1b3af9d2a9202801f4 and sec - i >=0:#2**8:



result:


784884
priv 0xc3d06aa7760afac0af
iIii 0x34227c58cb8767ae6754146 1008431949999999999899156806 K 100843196 k 784885
priv 0x8bfa4b90a28ea2c116
iIii 0x34227fd62d78d4e62cd40df 1008432979999999999899156703 K 100843299 k 784886
priv 0x54242c79cf124ac17d
iIii 0x342283538f6a421df254078 1008434009999999999899156600 K 100843402 k 784887
priv 0x1c4e0d62fb95f2c1e4
iIii 0x342286d0f15baf55b7d4011 1008435039999999999899156497 K 100843505 k 784888


so, 0x1c4e0d62fb95f2c1e4 - one pubkey 2^69 in 784888 pubkeys

input key 2^90  0x34228895d231df0f17001f5


What you think Huh



[
stilichovandal
Jr. Member
*
Offline Offline

Activity: 34
Merit: 5


View Profile
December 15, 2024, 04:47:24 AM
 #6

I ran the below command and the BabyStep.bf file overwrites after it reached 2GB, could this be a bug?

./Bigdb -bs 1000000000
mcdouglasx (OP)
Hero Member
*****
Offline Offline

Activity: 966
Merit: 532



View Profile WWW
December 15, 2024, 05:21:49 AM
 #7

I ran the below command and the BabyStep.bf file overwrites after it reached 2GB, could this be a bug?

./Bigdb -bs 1000000000

It's not a bug, it's normal!
stilichovandal
Jr. Member
*
Offline Offline

Activity: 34
Merit: 5


View Profile
December 15, 2024, 02:58:19 PM
 #8

I ran the below command and the BabyStep.bf file overwrites after it reached 2GB, could this be a bug?

./Bigdb -bs 1000000000

It's not a bug, it's normal!

How can I create a database with 1,000,000,000 or bigger?
cctv5go
Newbie
*
Offline Offline

Activity: 50
Merit: 0


View Profile
December 18, 2024, 04:21:47 PM
 #9

BloomFilter load successfully.
terminate called after throwing an instance of 'std::out-of-range'
  what():   stol
Aborted (core dumped)
mcdouglasx (OP)
Hero Member
*****
Offline Offline

Activity: 966
Merit: 532



View Profile WWW
December 18, 2024, 06:10:35 PM
 #10

How can I create a database with 1,000,000,000 or bigger?

You would need to optimize the Bloom filter to make it lighter like Keyhunt.

BloomFilter load successfully.
terminate called after throwing an instance of 'std::out-of-range'
  what():   stol
Aborted (core dumped)

Maybe you are using an incongruent hex range
cctv5go
Newbie
*
Offline Offline

Activity: 50
Merit: 0


View Profile
December 19, 2024, 06:16:18 AM
Last edit: January 06, 2025, 08:56:39 PM by Mr. Big
 #11

How to improve and optimize search computation speed.



How can I create a database with 1,000,000,000 or bigger?

You would need to optimize the Bloom filter to make it lighter like Keyhunt.

BloomFilter load successfully.
terminate called after throwing an instance of 'std::out-of-range'
  what():   stol
Aborted (core dumped)

Maybe you are using an incongruent hex range
What is the maximum database that can be created?200,000,000Tested maximum value
Maximum hexadecimal range 7FFFFFFFFFFFFFFF Tested maximum value
The program cannot function beyond this value.
mcdouglasx (OP)
Hero Member
*****
Offline Offline

Activity: 966
Merit: 532



View Profile WWW
December 20, 2024, 01:50:14 AM
 #12

What is the maximum database that can be created?200,000,000Tested maximum value
Maximum hexadecimal range 7FFFFFFFFFFFFFFF Tested maximum value
The program cannot function beyond this value.

This code is a proof of concept, it is not intended for that

This example is not intended for actual use; the code is just a poorly optimized example.

but optimizing bloom and integrating it into another algorithm such as bsgs would have better results.
cctv5go
Newbie
*
Offline Offline

Activity: 50
Merit: 0


View Profile
December 25, 2024, 09:41:05 AM
 #13

Can you further optimize the code to make it run in practice?
mcdouglasx (OP)
Hero Member
*****
Offline Offline

Activity: 966
Merit: 532



View Profile WWW
December 31, 2024, 01:51:31 AM
 #14

Can you further optimize the code to make it run in practice?

Maybe next month if work allows me.
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!