albertobsd / keyhunt

privkey hunt for crypto currencies that use secp256k1 elliptic curve
MIT License
640 stars 349 forks source link

different speed on different ranges #227

Closed mirameshs closed 1 year ago

mirameshs commented 1 year ago

hello. I am using keyhunt on ubuntu. as you see in below examples, my speed on first range is 13 MK but on the second range is 3 MK. all parameters are same, just I changed the range

first exapmle : 
myolala@lenovo:~/Desktop/keyhunt$ ./keyhunt -m rmd160 -f tests/66.rmd -r 3db18fc1c85c96d26:3fffffc1c85c96d26 -l compress -t 8 -s 2 -S
[+] Version 0.2.230519 Satoshi Quest, developed by AlbertoBSD
[+] Mode rmd160
[+] Search compress only
[+] Threads : 8
[+] Stats output every 2 seconds
[+] N = 0x100000000
[+] Range 
[+] -- from : 0x3db18fc1c85c96d26
[+] -- to   : 0x3fffffc1c85c96d26
[+] Reading file data_89d05801.dat
[+] Bloom filter for 10000 elements.
[+] Allocating memory for 1 elements: 0.00 MB
^C] Total 163196928 keys in 12 seconds: ~13 Mkeys/s (13599744 keys/s)

second example : 
myolala@lenovo:~/Desktop/keyhunt$ ./keyhunt -m rmd160 -f tests/66.rmd -r 200003f843193c200:200003f846d2e8c00 -l compress -t 8 -s 2 -S
[+] Version 0.2.230519 Satoshi Quest, developed by AlbertoBSD
[+] Mode rmd160
[+] Search compress only
[+] Threads : 8
[+] Stats output every 2 seconds
[+] N = 0x100000000
[+] Range 
[+] -- from : 0x200003f843193c200
[+] -- to   : 0x200003f846d2e8c00
[+] Reading file data_89d05801.dat
[+] Bloom filter for 10000 elements.
[+] Allocating memory for 1 elements: 0.00 MB
^C] Total 72296448 keys in 20 seconds: ~3 Mkeys/s (3614822 keys/s)
myolala@lenovo:~/Desktop/keyhunt$ 

I hope my question do not bother you

albertobsd commented 1 year ago

The problem is th Range lengh choice, if you compare the range:

>>> 0x200003f846d2e8c00 - 0x200003f843193c200
1000000000

The lengh is almost the same than you current N value.

Every thread try to solve a N value at the time, so first thread get the first sub-range and the next threads don't have any subranges left

One way that you can see this is using -M look:

./keyhunt -m rmd160 -f tests/66.rmd -r 200003f843193c200:200003f846d2e8c00 -l compress -t 8 -s 2 -S -M
...
Base key: 200003f843193c200 thread 0
[+] Total 13125632 keys in 2 seconds: ~6 Mkeys/s (6562816 keys/s)

In the previous example only one thread will be executed because the length of the subrange

If we change the size of N to 0x1000000 (24 bits)

./keyhunt -m rmd160 -f tests/66.rmd -r 200003f843193c200:200003f846d2e8c00 -l compress -t 8 -s 1 -S -M -n 0x1000000
....
Base key: 200003f843193c200 thread 0
Base key: 200003f843293c200 thread 1
Base key: 200003f843393c200 thread 4
Base key: 200003f843493c200 thread 2
Base key: 200003f843593c200 thread 3
Base key: 200003f843693c200 thread 6
Base key: 200003f843893c200 thread 7
Base key: 200003f843793c200 thread 5
[+] Total 52076544 keys in 1 seconds: ~52 Mkeys/s (52076544 keys/s)

Different ranges are assigned to different threads.

So decrement your N value or increment the Main range Size.

Again: please don't open an issue every time that you don't undertand how the tools works