Bitcoin Forum
May 10, 2024, 01:33:02 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1] 2 3 4 »  All
  Print  
Author Topic: keysubtracter - test - development requests - bug reports  (Read 1808 times)
albert0bsd (OP)
Hero Member
*****
Offline Offline

Activity: 856
Merit: 662



View Profile WWW
September 18, 2021, 07:40:45 PM
Last edit: November 30, 2023, 11:12:32 AM by albert0bsd
Merited by ABCbits (24), hugeblack (2), WanderingPhilospher (1), Stroncow (1)
 #1

Github page: https://github.com/albertobsd/keysubtracter

I publish this code on github in April 5, but i never update it until now, this is a small tool to make some substracted publickeys, address or hashes rmd160 from a target publickey.

This can be useful to increment our chances of hit some privatekey of the puzzles.

For example to make 100 copies of the puzzle 120 you need to execute the next command:

Code:
./keysubtracter -p 02ceb6cbbcdbdf5ef7150682150f4ce2c6f4807b349827dcdbdd1f2efa885a2630 -n 100 -b 120

Output
Code:
03f1d41da8acf0506f3bf7140b5629dd33a5cf546133479530cd8065e335a97666 # - 13292279957849158729038070602803446
022ec3a210bcb8ef6cf7b703b39539a83dc0c1318ccdb42daf48db2f0742971239 # + 13292279957849158729038070602803446
02b70ae2dcb442548570313f652b91ca093a3acac3a2441cb64614e8195505b6b8 # - 26584559915698317458076141205606892
0367dabeef20a6a8b7b5555b162cc8c8489e3134dcec624fe028573c34dbbf20f6 # + 26584559915698317458076141205606892
02a1d21298779f888cd8169f9ed59e4383219cdadbdb342ba886034ef9013b89be # - 39876839873547476187114211808410338
02ae015703cbaee9570dc648d7bce78ac7cb438630e09d69eef4f1208655e1027d # + 39876839873547476187114211808410338
(Output omitted)

but what that mean:

Code:
./keysubtracter -p <publickey to be substracted> -n <number of requested keys> -b  <bit range>

Output:
Code:
New Publickey 1 # offset from original publickey
New Publickey 2 # offset from original publickey
...

Windows version thanks to WanderingPhilospher

https://github.com/WanderingPhilosopher/Windows-KeySubtractor

The network tries to produce one block per 10 minutes. It does this by automatically adjusting how difficult it is to produce blocks.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
Stroncow
Jr. Member
*
Offline Offline

Activity: 38
Merit: 13


View Profile
September 19, 2021, 04:58:03 PM
Last edit: September 19, 2021, 06:28:39 PM by Stroncow
 #2

Hello Alberto,

Can you make the mapping from the list by converting all extracted keys to HASH160?

I think it would be more effective than Pub2RMD feature.

Edit : I just checked. You made an update today, exactly what I wanted. Thank you very much.
bigvito19
Full Member
***
Offline Offline

Activity: 706
Merit: 111


View Profile
September 19, 2021, 06:30:42 PM
 #3

Github page: https://github.com/albertobsd/keysubtracter

I publish this code on github in April 5, but i never update it until now, this is a small tool to make some substracted publickeys, address or hashes rmd160 from a target publickey.

This can be useful to increment our chances of hit some privatekey of the puzzles.

For example to make 100 copies of the puzzle 120 you need to execute the next command:

Code:
./keysubtracter -p 02ceb6cbbcdbdf5ef7150682150f4ce2c6f4807b349827dcdbdd1f2efa885a2630 -n 100 -b 120

Output
Code:
03f1d41da8acf0506f3bf7140b5629dd33a5cf546133479530cd8065e335a97666 # - 13292279957849158729038070602803446
022ec3a210bcb8ef6cf7b703b39539a83dc0c1318ccdb42daf48db2f0742971239 # + 13292279957849158729038070602803446
02b70ae2dcb442548570313f652b91ca093a3acac3a2441cb64614e8195505b6b8 # - 26584559915698317458076141205606892
0367dabeef20a6a8b7b5555b162cc8c8489e3134dcec624fe028573c34dbbf20f6 # + 26584559915698317458076141205606892
02a1d21298779f888cd8169f9ed59e4383219cdadbdb342ba886034ef9013b89be # - 39876839873547476187114211808410338
02ae015703cbaee9570dc648d7bce78ac7cb438630e09d69eef4f1208655e1027d # + 39876839873547476187114211808410338
(Output omitted)

but what that mean:

Code:
./keysubtracter -p <publickey to be substracted> -n <number of requested keys> -b  <bit range>

Output:
Code:
New Publickey 1 # offset from original publickey
New Publickey 2 # offset from original publickey
...


How many bits does it subtract it by?
stilichovandal
Newbie
*
Offline Offline

Activity: 28
Merit: 5


View Profile
September 19, 2021, 10:35:29 PM
 #4

I am not sure if I understand the reason to add and compare.

It makes total sense to subtract from the 120bit key and compare it with a smaller range.


WanderingPhilospher
Full Member
***
Offline Offline

Activity: 1064
Merit: 219

Shooters Shoot...


View Profile
September 20, 2021, 05:06:31 AM
 #5

I have built the KeyHunt for Windows using Mingw64 -make, but I receive this error when trying to use the make for keysubtracter:

Code:
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: gmpecc.o:gmpecc.c:(.bss+0x2000): multiple definition of `G'; C:\msys64\tmp\ccQTx1CF.o:keysubtracter.:(.bss+0x20): first defined here
collect2.exe: error: ld returned 1 exit status
make: *** [Makefile:7: default] Error 1

I know you mainly build for Linux but wasn't sure if this was something you have seen/experienced before.
WanderingPhilospher
Full Member
***
Offline Offline

Activity: 1064
Merit: 219

Shooters Shoot...


View Profile
September 20, 2021, 05:31:52 AM
 #6

Github page: https://github.com/albertobsd/keysubtracter

I publish this code on github in April 5, but i never update it until now, this is a small tool to make some substracted publickeys, address or hashes rmd160 from a target publickey.

This can be useful to increment our chances of hit some privatekey of the puzzles.

For example to make 100 copies of the puzzle 120 you need to execute the next command:

Code:
./keysubtracter -p 02ceb6cbbcdbdf5ef7150682150f4ce2c6f4807b349827dcdbdd1f2efa885a2630 -n 100 -b 120

Output
Code:
03f1d41da8acf0506f3bf7140b5629dd33a5cf546133479530cd8065e335a97666 # - 13292279957849158729038070602803446
022ec3a210bcb8ef6cf7b703b39539a83dc0c1318ccdb42daf48db2f0742971239 # + 13292279957849158729038070602803446
02b70ae2dcb442548570313f652b91ca093a3acac3a2441cb64614e8195505b6b8 # - 26584559915698317458076141205606892
0367dabeef20a6a8b7b5555b162cc8c8489e3134dcec624fe028573c34dbbf20f6 # + 26584559915698317458076141205606892
02a1d21298779f888cd8169f9ed59e4383219cdadbdb342ba886034ef9013b89be # - 39876839873547476187114211808410338
02ae015703cbaee9570dc648d7bce78ac7cb438630e09d69eef4f1208655e1027d # + 39876839873547476187114211808410338
(Output omitted)

but what that mean:

Code:
./keysubtracter -p <publickey to be substracted> -n <number of requested keys> -b  <bit range>

Output:
Code:
New Publickey 1 # offset from original publickey
New Publickey 2 # offset from original publickey
...


How many bits does it subtract it by?
It will subtract by however many bits you tell it to.
In his example:
Code:
./keysubtracter -p 02ceb6cbbcdbdf5ef7150682150f4ce2c6f4807b349827dcdbdd1f2efa885a2630 -n 100 -b 120
He is telling the program to add and subtract up to 120 bits. You could change -b 120 to whatever; -b 50, -b 74, and that would be 50 and 74 bits. You can spread the bits out over a range as well using the -n 2048 -r 0:fffffffffff option as well. That will generate 2048 keys spread out evenly over the range of 0 through fffffffffff
WanderingPhilospher
Full Member
***
Offline Offline

Activity: 1064
Merit: 219

Shooters Shoot...


View Profile
September 20, 2021, 05:50:55 AM
 #7

I am not sure if I understand the reason to add and compare.

It makes total sense to subtract from the 120bit key and compare it with a smaller range.



You can use this program in many ways. But if you generate millions of offset keys say with a -b 100 flag, then all of those keys, whether added or subtracted, will still all be within the 8000... through ffff.... range that the 120 key lies in.  In this way, you have created millions of keys to search in the original range. You can use this program to reduce/subtract down to a given range and extract just the subtracted keys, but you will have many keys generated that do not lie in your reduced range.
albert0bsd (OP)
Hero Member
*****
Offline Offline

Activity: 856
Merit: 662



View Profile WWW
September 20, 2021, 05:54:40 AM
 #8


How many bits does it subtract it by?

Code:
03f1d41da8acf0506f3bf7140b5629dd33a5cf546133479530cd8065e335a97666 # - 13292279957849158729038070602803446
022ec3a210bcb8ef6cf7b703b39539a83dc0c1318ccdb42daf48db2f0742971239 # + 13292279957849158729038070602803446
02b70ae2dcb442548570313f652b91ca093a3acac3a2441cb64614e8195505b6b8 # - 26584559915698317458076141205606892
0367dabeef20a6a8b7b5555b162cc8c8489e3134dcec624fe028573c34dbbf20f6 # + 26584559915698317458076141205606892
02a1d21298779f888cd8169f9ed59e4383219cdadbdb342ba886034ef9013b89be # - 39876839873547476187114211808410338
02ae015703cbaee9570dc648d7bce78ac7cb438630e09d69eef4f1208655e1027d # + 39876839873547476187114211808410338
(Output omitted)

If you see the number after the # char, is that the number that is being substracted or added to the original given publickey.

I am not sure if I understand the reason to add and compare.

It makes total sense to subtract from the 120bit key and compare it with a smaller range.

Yes you are totally right, my logic in the first version was was the next:

  • if the target publickey was at the middle of the range, the subtracted keys will land from the beginning of the bit range up to the end of the same bit range.
  • if  the target publickey was at the begging of the range, the subtracted keys will land in the first half of the bit range and the other half will land in the previous bit range
  • but if the target publickey was at the end of the range, the subtracted keys will land in the last half of the bit range and the other half will land in the next bit range
  • Obviously those are perfect cases, but the reality is that we don't know where is the target publickey, so my orignal idea was just increase the probability to have near a subtracted key in anywhere in the selected keyspace

But I repeat you are right i will add the option of select only make a subtract or addition.

Also think in the next one:

  • if you are working with targets in the 256 bit space, any addition may end in a lower bit space due to cyclical behavior of the eliptic curve


I know you mainly build for Linux but wasn't sure if this was something you have seen/experienced before.

Yes i see that error before, is some re-declaration of that G variable (gmpecc.c  load the gmpecc.h but also keysubtracter is loading that header file, i manage avoid that with the Makefile), maybe  adding some header directive like #prama once can be useful , but i don't know if it can work for you.

Are you using the command "make" in Mingw64 ?

If not, can you add the command that you are using to compile it?

WanderingPhilospher
Full Member
***
Offline Offline

Activity: 1064
Merit: 219

Shooters Shoot...


View Profile
September 20, 2021, 05:57:55 AM
 #9

Quote
Yes i see that error before, is some re-declaration of that G variable (gmpecc.c  load the gmpecc.h but also keysubtracter is loading that header file, i manage avoid that with the Makefile), maybe  adding some header directive like #prama once can be useful , but i don't know if it can work for you.

Are you using the command "make" in Mingw64 ?

If not, can you add the command that you are using to compile it?
Yes, I am using the "make" command in Mingw64.

I also used "make" command for KeyHunt and it compiled and worked perfectly.
WanderingPhilospher
Full Member
***
Offline Offline

Activity: 1064
Merit: 219

Shooters Shoot...


View Profile
September 20, 2021, 06:02:47 AM
 #10

Quote
Yes you are totally right, my logic in the first version was was the next:

if the target publickey was at the middle of the range, the subtracted keys will land from the beginning of the bit range up to the end of the same bit range.
if  the target publickey was at the begging of the range, the subtracted keys will land in the first half of the bit range and the other half will land in the previous bit range
but if the target publickey was at the end of the range, the subtracted keys will land in the last half of the bit range and the other half will land in the next bit range
Obviously those are perfect cases, but the reality is that we don't know where is the target publickey, so my orignal idea was just increase the probability to have near a subtracted key in anywhere in the selected keyspace

But I repeat you are right i will add the option of select only make a subtract or addition.

Also think in the next one:

if you are working with targets in the 256 bit space, any addition may end in a lower bit space due to cyclical behavior of the eliptic curve

I think it is good the way it is. Your logic is different that mine but your program works just fine for the way some would use it. Like I said, I can generate millions of offset keys with -b 100 and all of those offset keys will be in the original 119 keyspace for pubkey #120. You can also pre-subtract pubkey down to a specific range and then use keysubtracter, which is what I do. So I have millions of pubkeys in a 116 bit range, but only 1/8th of those new offset keys will be within that range.

I do like the option of selecting just subtract or addition, but not 100% necessary. A great, fast program that I have been looking for, for a long time. Many thanks!
albert0bsd (OP)
Hero Member
*****
Offline Offline

Activity: 856
Merit: 662



View Profile WWW
September 20, 2021, 06:06:14 AM
 #11

I also used "make" command for KeyHunt and it compiled and worked perfectly.

OK, i see that, please edit the gmpecc.h file and add the next line at the begging of the file

Code:
#pragma once

And try to recompile it again

More info here: https://docs.microsoft.com/en-us/cpp/preprocessor/once?view=msvc-160

if that works please let me know for make that change too in the next update

WanderingPhilospher
Full Member
***
Offline Offline

Activity: 1064
Merit: 219

Shooters Shoot...


View Profile
September 20, 2021, 06:22:30 AM
 #12

I also used "make" command for KeyHunt and it compiled and worked perfectly.

OK, i see that, please edit the gmpecc.h file and add the next line at the begging of the file

Code:
#pragma once

And try to recompile it again

More info here: https://docs.microsoft.com/en-us/cpp/preprocessor/once?view=msvc-160

if that works please let me know for make that change too in the next update

This did not work...I will work on it more later today. Thanks for responding!
WanderingPhilospher
Full Member
***
Offline Offline

Activity: 1064
Merit: 219

Shooters Shoot...


View Profile
September 23, 2021, 02:22:48 AM
 #13

I finally figured it out...how to compile in Windows using Mingw64 with make command!

I am learning more and more outside of my comfort zone of Visual Studio.

Sorry it took me so long lol.

I will post code for this code, the keysubtracter and your new code for, ecctools

Many thanks for the 2 cool programs
WanderingPhilospher
Full Member
***
Offline Offline

Activity: 1064
Merit: 219

Shooters Shoot...


View Profile
September 23, 2021, 02:43:28 AM
Last edit: September 23, 2021, 02:57:42 AM by WanderingPhilospher
 #14

Here is the Windows version:

https://github.com/WanderingPhilosopher/Windows-KeySubtractor

albert0bsd,

You may want to add the link in your main post so people who use Windows know they can use your program as well.

WP

Edit:  If Windows users wish to compile on their own, I followed this guide  https://www.msys2.org/  to download, install, setup the mingw-w64 GCC. Follow the instructions. Once complete, you can go to the above github page that has my Windows release and download the files and unzip. Open up MSYS MinGW 64-bit, do a cd (change directory) to the folder containing the files. Once there, simply type in make.

Enjoy.
mausuv
Jr. Member
*
Offline Offline

Activity: 70
Merit: 1


View Profile
November 20, 2021, 04:18:01 PM
 #15

this code subtracte in c language https://github.com/WanderingPhilosopher/Windows-KeySubtractor/releases/tag/v1.0


yes i know this git code
i am not understand c language so,
                         
input two point
privatekey    3     -    2      =   1
                 point1 - point2 = point3
                                               X                                                                                                                         Y
point1 f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9      388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672
point2 c6047f9441ed7d6d3045406e95c07cd85c778e4b8cef3ca7abac09b95c709ee5   1ae168fea63dc339a3c58419466ceaeef7f632653266d0e1236431a950cfe52a


i need 3rd point subtract value

please write easy understand make python or explain mathematicaly
albert0bsd (OP)
Hero Member
*****
Offline Offline

Activity: 856
Merit: 662



View Profile WWW
November 22, 2021, 08:45:58 PM
Last edit: November 22, 2021, 09:02:24 PM by albert0bsd
 #16

please write easy understand make python or explain mathematicaly

I don't know python, but here is a link that explain the point Negation in eliptic curves:

https://www.youtube.com/watch?v=0EsyHJvf_JE

https://trustica.cz/en/2018/03/08/elliptic-curves-point-negation/

For you example the negated Point is : 04c6047f9441ed7d6d3045406e95c07cd85c778e4b8cef3ca7abac09b95c709ee5e51e970159c23 cc65c3a7be6b99315110809cd9acd992f1edc9bce55af301705

And the result is:

0479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c 4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8

Regards!


fxsniper
Member
**
Offline Offline

Activity: 406
Merit: 45


View Profile
November 23, 2021, 05:07:41 AM
 #17


I don't know subtract method will work or not? not yet have sample case for test with any puzzle improve
but many people try, I will tri to test this subtract method (not yet clear to understand on this knowledge)
Is there any other scripts keysubtracter in python language (sorry for ask, I am not expert on c++, I am not programmer)?

For this keysubtracter in c++ language, why not try to add GPU calculate to work faster (Dev both CUDA and OpenCL will be great)
Crypto_Lord_Natoshi
Newbie
*
Offline Offline

Activity: 1
Merit: 0


View Profile
November 18, 2022, 08:23:42 PM
 #18

Quote
gcc -o keysubtracter keysubtracter.c gmpecc.o util.o sha256.o base58.o rmd160.o -lgmp
/usr/bin/ld: gmpecc.o:(.bss+0x2020): multiple definition of `EC'; /tmp/ccmArVbb.o:(.bss+0x0): first defined here
/usr/bin/ld: gmpecc.o:(.bss+0x0): multiple definition of `DoublingG'; /tmp/ccmArVbb.o:(.bss+0x40): first defined here
/usr/bin/ld: gmpecc.o:(.bss+0x2000): multiple definition of `G'; /tmp/ccmArVbb.o:(.bss+0x20): first defined here
collect2: error: ld returned 1 exit status
make: *** [Makefile:7: default] Error 1

Hello everyone,
i can't build this on windows ubuntu shell
albert0bsd (OP)
Hero Member
*****
Offline Offline

Activity: 856
Merit: 662



View Profile WWW
November 19, 2022, 11:09:36 AM
 #19

What version of Ubuntu do you have?

Code:
uname -a

What version of gcc do you have?

Code:
gcc -v

rahulroy4676
Newbie
*
Offline Offline

Activity: 1
Merit: 0


View Profile
December 10, 2022, 05:04:26 AM
 #20

 @albert0bsd, I am facing the same error issue while running this in ubantu 22.04 LTS

having gcc version gcc (Ubuntu 11.3.0-1ubuntu1~22.04) 11.3.0

How to solve this please help.

thanks and Regards.
Pages: [1] 2 3 4 »  All
  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!