bernardladenthin / BitcoinAddressFinder

A high performance bitcoin address finder.
Apache License 2.0
170 stars 49 forks source link

Why is so slow? #27

Closed AndrewSingleplayer closed 3 months ago

AndrewSingleplayer commented 1 year ago

Hi! I have an issue due to speed of calculation, i have nvidia 1650 and i7-8750H CPU @ 2.20GHz 2.21 GHz Picked up _JAVA_OPTIONS: -Xmx512M 2023-03-02 16:48:57,521 [main] INFO net.ladenthin.bitcoinaddressfinder.cli.Main - Find 2023-03-02 16:48:57,880 [main] INFO net.ladenthin.bitcoinaddressfinder.persistence.lmdb.LMDBPersistence - ##### BEGIN: LMDB stats ##### 2023-03-02 16:48:57,880 [main] INFO net.ladenthin.bitcoinaddressfinder.persistence.lmdb.LMDBPersistence - ... this may take a lot of time ... 2023-03-02 16:48:57,880 [main] INFO net.ladenthin.bitcoinaddressfinder.persistence.lmdb.LMDBPersistence - DatabaseSize: 4708.55859375 MiB 2023-03-02 16:48:57,880 [main] INFO net.ladenthin.bitcoinaddressfinder.persistence.lmdb.LMDBPersistence - IncreasedCounter: 0 2023-03-02 16:48:57,880 [main] INFO net.ladenthin.bitcoinaddressfinder.persistence.lmdb.LMDBPersistence - IncreasedSum: 0.0 MiB 2023-03-02 16:48:57,880 [main] INFO net.ladenthin.bitcoinaddressfinder.persistence.lmdb.LMDBPersistence - Stat: Stat{branchPages=0, depth=1, entries=1, leafPages=1, overflowPages=0, pageSize=4096} 2023-03-02 16:52:17,996 [main] INFO net.ladenthin.bitcoinaddressfinder.persistence.lmdb.LMDBPersistence - LMDB contains 111983796 unique entries. 2023-03-02 16:52:18,021 [main] INFO net.ladenthin.bitcoinaddressfinder.persistence.lmdb.LMDBPersistence - ##### END: LMDB stats ##### 2023-03-02 16:52:28,105 [Timer-0] INFO net.ladenthin.bitcoinaddressfinder.ConsumerJava - Statistics: [Checked 0 M keys in 0 minutes] [0 k keys/second] [0 M keys/minute] [Times an empty consumer: 1296] [Average contains time: 0 ms] [keys queue size: 0] [Hits: 0] 2023-03-02 16:52:38,108 [Timer-0] INFO net.ladenthin.bitcoinaddressfinder.ConsumerJava - Statistics: [Checked 0 M keys in 0 minutes] [0 k keys/second] [0 M keys/minute] [Times an empty consumer: 2601] [Average contains time: 0 ms] [keys queue size: 0] [Hits: 0] 2023-03-02 16:52:48,111 [Timer-0] INFO net.ladenthin.bitcoinaddressfinder.ConsumerJava - Statistics: [Checked 0 M keys in 0 minutes] [0 k keys/second] [0 M keys/minute] [Times an empty consumer: 3928] [Average contains time: 0 ms] [keys queue size: 0] [Hits: 0] 2023-03-02 16:52:58,100 [Timer-0] INFO net.ladenthin.bitcoinaddressfinder.ConsumerJava - Statistics: [Checked 0 M keys in 0 minutes] [0 k keys/second] [0 M keys/minute] [Times an empty consumer: 5496] [Average contains time: 0 ms] [keys queue size: 0] [Hits: 0] 2023-03-02 16:53:08,100 [Timer-0] INFO net.ladenthin.bitcoinaddressfinder.ConsumerJava - Statistics: [Checked 0 M keys in 0 minutes] [2 k keys/second] [0 M keys/minute] [Times an empty consumer: 6621] [Average contains time: 0 ms] [keys queue size: 0] [Hits: 0] Mar 02, 2023 4:53:13 PM jnr.ffi.util.ref.internal.Finalizer cleanUp SEVERE: Error cleaning up after reference. java.lang.OutOfMemoryError: Java heap space

2023-03-02 16:53:18,106 [Timer-0] INFO net.ladenthin.bitcoinaddressfinder.ConsumerJava - Statistics: [Checked 0 M keys in 1 minutes] [6 k keys/second] [0 M keys/minute] [Times an empty consumer: 6710] [Average contains time: 0 ms] [keys queue size: 0] [Hits: 0] 2023-03-02 16:53:28,099 [Timer-0] INFO net.ladenthin.bitcoinaddressfinder.ConsumerJava - Statistics: [Checked 1 M keys in 1 minutes] [18 k keys/second] [1 M keys/minute] [Times an empty consumer: 6907] [Average contains time: 0 ms] [keys queue size: 0] [Hits: 0] 2023-03-02 16:53:38,113 [Timer-0] INFO net.ladenthin.bitcoinaddressfinder.ConsumerJava - Statistics: [Checked 2 M keys in 1 minutes] [27 k keys/second] [2 M keys/minute] [Times an empty consumer: 7067] [Average contains time: 0 ms] [keys queue size: 0] [Hits: 0] 2023-03-02 16:53:48,099 [Timer-0] INFO net.ladenthin.bitcoinaddressfinder.ConsumerJava - Statistics: [Checked 2 M keys in 1 minutes] [29 k keys/second] [2 M keys/minute] [Times an empty consumer: 7879] [Average contains time: 0 ms] [keys queue size: 0] [Hits: 0] 2023-03-02 16:53:58,106 [Timer-0] INFO net.ladenthin.bitcoinaddressfinder.ConsumerJava - Statistics: [Checked 2 M keys in 1 minutes] [26 k keys/second] [2 M keys/minute] [Times an empty consumer: 8841] [Average contains time: 0 ms] [keys queue size: 0] [Hits: 0] 2023-03-02 16:54:08,099 [Timer-0] INFO net.ladenthin.bitcoinaddressfinder.ConsumerJava - Statistics: [Checked 2 M keys in 1 minutes] [23 k keys/second] [2 M keys/minute] [Times an empty consumer: 10029] [Average contains time: 0 ms] [keys queue size: 0] [Hits: 0] 2023-03-02 16:54:18,104 [Timer-0] INFO net.ladenthin.bitcoinaddressfinder.ConsumerJava - Statistics: [Checked 2 M keys in 2 minutes] [21 k keys/second] [1 M keys/minute] [Times an empty consumer: 10993] [Average contains time: 0 ms] [keys queue size: 0] [Hits: 0] 2023-03-02 16:54:28,099 [Timer-0] INFO net.ladenthin.bitcoinaddressfinder.ConsumerJava - Statistics: [Checked 2 M keys in 2 minutes] [20 k keys/second] [1 M keys/minute] [Times an empty consumer: 12183] [Average contains time: 0 ms] [keys queue size: 0] [Hits: 0] 2023-03-02 16:54:38,114 [Timer-0] INFO net.ladenthin.bitcoinaddressfinder.ConsumerJava - Statistics: [Checked 2 M keys in 2 minutes] [18 k keys/second] [1 M keys/minute] [Times an empty consumer: 13143] [Average contains time: 0 ms] [keys queue size: 0] [Hits: 0] 2023-03-02 16:54:48,099 [Timer-0] INFO net.ladenthin.bitcoinaddressfinder.ConsumerJava - Statistics: [Checked 2 M keys in 2 minutes] [17 k keys/second] [1 M keys/minute] [Times an empty consumer: 14331] [Average contains time: 0 ms] [keys queue size: 0] [Hits: 0] 2023-03-02 16:54:58,114 [Timer-0] INFO net.ladenthin.bitcoinaddressfinder.ConsumerJava - Statistics: [Checked 2 M keys in 2 minutes] [16 k keys/second] [1 M keys/minute] [Times an empty consumer: 15291] [Average contains time: 0 ms] [keys queue size: 0] [Hits: 0] 2023-03-02 16:55:08,100 [Timer-0] INFO net.ladenthin.bitcoinaddressfinder.ConsumerJava - Statistics: [Checked 2 M keys in 2 minutes] [15 k keys/second] [1 M keys/minute] [Times an empty consumer: 16479] [Average contains time: 0 ms] [keys queue size: 0] [Hits: 0] 2023-03-02 16:55:18,099 [Timer-0] INFO net.ladenthin.bitcoinaddressfinder.ConsumerJava - Statistics: [Checked 2 M keys in 3 minutes] [14 k keys/second] [0 M keys/minute] [Times an empty consumer: 17673] [Average contains time: 0 ms] [keys queue size: 0] [Hits: 0] 2023-03-02 16:55:28,107 [Timer-0] INFO net.ladenthin.bitcoinaddressfinder.ConsumerJava - Statistics: [Checked 2 M keys in 3 minutes] [13 k keys/second] [0 M keys/minute] [Times an empty consumer: 18639] [Average contains time: 0 ms] [keys queue size: 0] [Hits: 0] 2023-03-02 16:55:38,099 [Timer-0] INFO net.ladenthin.bitcoinaddressfinder.ConsumerJava - Statistics: [Checked 2 M keys in 3 minutes] [13 k keys/second] [0 M keys/minute] [Times an empty consumer: 19827] [Average contains time: 0 ms] [keys queue size: 0] [Hits: 0] 2023-03-02 16:55:48,107 [Timer-0] INFO net.ladenthin.bitcoinaddressfinder.ConsumerJava - Statistics: [Checked 2 M keys in 3 minutes] [12 k keys/second] [0 M keys/minute] [Times an empty consumer: 20791] [Average contains time: 0 ms] [keys queue size: 0] [Hits: 0] 2023-03-02 16:55:58,099 [Timer-0] INFO net.ladenthin.bitcoinaddressfinder.ConsumerJava - Statistics: [Checked 2 M keys in 3 minutes] [11 k keys/second] [0 M keys/minute] [Times an empty consumer: 21981] [Average contains time: 0 ms] [keys queue size: 0] [Hits: 0] 2023-03-02 16:56:08,108 [Timer-0] INFO net.ladenthin.bitcoinaddressfinder.ConsumerJava - Statistics: [Checked 2 M keys in 3 minutes] [11 k keys/second] [0 M keys/minute] [Times an empty consumer: 22941] [Average contains time: 0 ms] [keys queue size: 0] [Hits: 0] 2023-03-02 16:56:18,100 [Timer-0] INFO net.ladenthin.bitcoinaddressfinder.ConsumerJava - Statistics: [Checked 2 M keys in 4 minutes] [10 k keys/second] [0 M keys/minute] [Times an empty consumer: 24135] [Average contains time: 0 ms] [keys queue size: 0] [Hits: 0] 2023-03-02 16:56:28,099 [Timer-0] INFO net.ladenthin.bitcoinaddressfinder.ConsumerJava - Statistics: [Checked 2 M keys in 4 minutes] [10 k keys/second] [0 M keys/minute] [Times an empty consumer: 25329] [Average contains time: 0 ms] [keys queue size: 0] [Hits: 0] 2023-03-02 16:56:38,113 [Timer-0] INFO net.ladenthin.bitcoinaddressfinder.ConsumerJava - Statistics: [Checked 2 M keys in 4 minutes] [10 k keys/second] [0 M keys/minute] [Times an empty consumer: 26289] [Average contains time: 0 ms] [keys queue size: 0] [Hits: 0] 2023-03-02 16:56:48,099 [Timer-0] INFO net.ladenthin.bitcoinaddressfinder.ConsumerJava - Statistics: [Checked 2 M keys in 4 minutes] [9 k keys/second] [0 M keys/minute] [Times an empty consumer: 27481] [Average contains time: 0 ms] [keys queue size: 0] [Hits: 0] 2023-03-02 16:56:58,113 [Timer-0] INFO net.ladenthin.bitcoinaddressfinder.ConsumerJava - Statistics: [Checked 2 M keys in 4 minutes] [9 k keys/second] [0 M keys/minute] [Times an empty consumer: 28443] [Average contains time: 0 ms] [keys queue size: 0] [Hits: 0] 2023-03-02 16:57:08,100 [Timer-0] INFO net.ladenthin.bitcoinaddressfinder.ConsumerJava - Statistics: [Checked 2 M keys in 4 minutes] [9 k keys/second] [0 M keys/minute] [Times an empty consumer: 29634] [Average contains time: 0 ms] [keys queue size: 0] [Hits: 0] 2023-03-02 16:57:18,100 [Timer-0] INFO net.ladenthin.bitcoinaddressfinder.ConsumerJava - Statistics: [Checked 2 M keys in 5 minutes] [8 k keys/second] [0 M keys/minute] [Times an empty consumer: 30827] [Average contains time: 0 ms] [keys queue size: 0] [Hits: 0] 2023-03-02 16:57:28,099 [Timer-0] INFO net.ladenthin.bitcoinaddressfinder.ConsumerJava - Statistics: [Checked 2 M keys in 5 minutes] [8 k keys/second] [0 M keys/minute] [Times an empty consumer: 32020] [Average contains time: 0 ms] [keys queue size: 0] [Hits: 0] 2023-03-02 16:57:38,113 [Timer-0] INFO net.ladenthin.bitcoinaddressfinder.ConsumerJava - Statistics: [Checked 2 M keys in 5 minutes] [8 k keys/second] [0 M keys/minute] [Times an empty consumer: 32982] [Average contains time: 0 ms] [keys queue size: 0] [Hits: 0] 2023-03-02 16:57:48,099 [Timer-0] INFO net.ladenthin.bitcoinaddressfinder.ConsumerJava - Statistics: [Checked 2 M keys in 5 minutes] [7 k keys/second] [0 M keys/minute] [Times an empty consumer: 34174] [Average contains time: 0 This is a part of my log.

bernardladenthin commented 1 year ago

Hi,

it seems you have not enough memory (RAM)?

SEVERE: Error cleaning up after reference. java.lang.OutOfMemoryError: Java heap space

plaber commented 1 year ago

How can you rich 2000 k keys/s on rtx2060, i made database from http://addresses.loyce.club/?C=M;O=D this file, so it 2gb size db, i have 32gb ram, and when i run run_Find_1OpenCLDevice, all my ram go to use, and i have 1062 k keys/s with ~30% cuda load and 100% load of my i5 9400 cpu

bernardladenthin commented 1 year ago

Hi, your CPU limits the keys/s. The SHA256 and RIPEMD160 will be done on CPU and this might be solved in future. But it needs to be implemented and is a complex problem.

plaber commented 1 year ago

plz add example with Key range, what CPU do you use?

bernardladenthin commented 1 year ago

CPU is AMD Ryzen 9 3950x. Key range of 160 is enough to scan every possible address.

plaber commented 12 months ago

You writed:Key range A key range can be defined (e.g. 64-bit) whereas the first (e.g. 192-bit (256-bit - 64-bit)) are zeroed. This can be used to creaty keys in a specific range to find keys in a known range (e.g. Bitcoin Puzzle Transaction). This can be also used to proof that the software works.

So i added 1GL148eHmksSwjo4cVEicCGTfyGDBSbakY to wallets and i want to start random generation from 5K8AFtY1ikpCTESEM7u2ywEA9CDV1HBTkYEd2iB9Zg8j8Krppo8 for example ( i got this key pair here https://keys.lol/bitcoin/608786848605066771695207212229659213228862548324147378430462746829474617469) to proof of work

bernardladenthin commented 12 months ago

Hi,

key generation within a specific key range is not supported currently. The range is meant to be in bits and not for a specific private key start value. But I can try to implement this feature soon.

plaber commented 11 months ago

for example in python i doing like this

test_hash = '1MueGqjgebb2HgxbCGVEfm4zfUptenExPj'
test_key = '5JgZf6s3CpSxBkhgDWDbMS3UJ55E95axdh2Ma8uDusttAyRqNDX'
    # add test hash to db
    test_hashb = base58.b58decode(test_hash)
    lset.add(test_hashb)
    while True:
        i += 1
        priv_key = os.urandom(32)
        if i == 1:
            # set test key
            test_keyb = base58.b58decode(test_key);
            priv_key = test_keyb[1:-4]
...
        if pub in lset:
            if i == 1:
                sprint (r, kek, ' test passed ---- ' +dt.datetime.now().strftime('%Y-%m-%d %H:%M:%S') + ' ' + pubd + ' ' + priv[:10] + '...' + priv[-10:])
                start_time = dt.datetime.today().timestamp()
                continue
            print ('WINNER WINNER CHICKEN DINNER!!! ---- ' +dt.datetime.now().strftime('%Y-%m-%d %H:%M:%S'), pubd, priv)

so just decode base5 and cut first and last bytes to get 32bit hex private p.s. this python script give me 300M keys for 8 hours of work, your script give it for 2 minutes

bernardladenthin commented 3 months ago

I've added the idea of setting a key range to future improvements.