Author

Topic: Pollard's kangaroo ECDLP solver - page 132. (Read 60189 times)

sr. member
Activity: 652
Merit: 316
May 24, 2020, 04:20:26 AM
@JeanLuc I have a suggestion regarding the server and client side.
I think that it will not optimally support a constant client-server connection. Firstly, because if data is not transmitted to keep connection, you need to play ping ping from time to time.
And Windows does not always work out the client shutdown correctly. If internet broken on client side, windows os on server side don`t know about this and keep this connection like live.
And this can lead to errors in the socket when trying to send data to an already non-existent connection.
In my opinion, it would be better if the client accumulated its DPs before some moment, and then sent them to the server at once.
The amount of accumulated dp should be related to the size of dp bit.
The second is that only the client should be the initiator of all messages, again to avoid errors in the socket.
In this case, even if the server crashes, the clients will still continue job and accumulate their dp and after the server is online they will be sent.
sr. member
Activity: 443
Merit: 350
May 24, 2020, 02:57:28 AM
Server autorestart now works fine. You calmed me down, gentlemen. I must admit that I hope to find # 110 in the next few days ... I will remember you if I do it, and of course about the author of this tool, to which I already owe a lot :-)
Greetings !

How much power are you going to use for this task?
newbie
Activity: 26
Merit: 0
May 24, 2020, 02:15:28 AM
zielar
I hope you do not find you are greedy
and they will be taken from you again
full member
Activity: 1232
Merit: 242
Shooters Shoot...
May 23, 2020, 01:13:16 PM
Ok, I figured out how to see the difference; my NB_JUMP has to be 32 or less and I can then see about a 2^7 difference in avg jumps at 40 bit range. Will test and compare later today.
Do not forget to put the seed before the table and after.
You can check this:
Code:
by Pollard (.. The best choice of m (mean jump size: 2^27) is w^(1/2)/2 ..)
Create Jump Table (size: 32) Max Jump: 2^28
Jump: 0 Distance: 1
Jump: 1 Distance: 2
Jump: 2 Distance: 4
Jump: 3 Distance: 8
Jump: 4 Distance: 10
Jump: 5 Distance: 20
Jump: 6 Distance: 40
Jump: 7 Distance: 80
Jump: 8 Distance: 100
Jump: 9 Distance: 200
Jump: 10 Distance: 400
Jump: 11 Distance: 800
Jump: 12 Distance: 1000
Jump: 13 Distance: 2000
Jump: 14 Distance: 4000
Jump: 15 Distance: 8000
Jump: 16 Distance: 5FF2560
Jump: 17 Distance: D25C0B2
Jump: 18 Distance: 93C08DF
Jump: 19 Distance: E01F5E3
Jump: 20 Distance: BEE16A6
Jump: 21 Distance: A3F7E94
Jump: 22 Distance: B660AF2
Jump: 23 Distance: D180EA
Jump: 24 Distance: 36B8F2
Jump: 25 Distance: 1976C19
Jump: 26 Distance: B4BD788
Jump: 27 Distance: A4193F8
Jump: 28 Distance: C82D7F7
Jump: 29 Distance: B42ABDF
Jump: 30 Distance: 68FDB3B
Jump: 31 Distance: 95F559
Jump Avg distance: 2^26.03
I do.

My results:
Code:
Range width: 2^40
Jump: 0 Distance: 1
Jump: 1 Distance: 2
Jump: 2 Distance: 4
Jump: 3 Distance: 8
Jump: 4 Distance: 10
Jump: 5 Distance: 20
Jump: 6 Distance: 40
Jump: 7 Distance: 80
Jump: 8 Distance: 100
Jump: 9 Distance: 200
Jump: 10 Distance: 400
Jump: 11 Distance: 800
Jump: 12 Distance: 1000
Jump: 13 Distance: 2000
Jump: 14 Distance: 4000
Jump: 15 Distance: 8000
Jump: 16 Distance: AAF37
Jump: 17 Distance: 141FFB
Jump: 18 Distance: D8795
Jump: 19 Distance: 5100D
Jump: 20 Distance: 96CE9
Jump: 21 Distance: C66E9
Jump: 22 Distance: 76A30
Jump: 23 Distance: 1416AC
Jump: 24 Distance: 18D
Jump: 25 Distance: 1EB7B5
Jump: 26 Distance: 45C0E
Jump: 27 Distance: 1F48AA
Jump: 28 Distance: 2E7AC
Jump: 29 Distance: 7A66D
Jump: 30 Distance: 179085
Jump: 31 Distance: E4B99
Jump Avg distance: 2^18.74
sr. member
Activity: 652
Merit: 316
May 23, 2020, 01:01:48 PM
With prices I see here, 1MKs on 2080ti is 200% of 1MKs on 2070 !
i agree with you that 2070 is the best card to calculation and mining in 2000series by criterion cost/hashrate/power
sr. member
Activity: 661
Merit: 250
May 23, 2020, 12:56:02 PM
With prices I see here, 1MKs on 2080ti is 200% of 1MKs on 2070 !
sr. member
Activity: 661
Merit: 250
May 23, 2020, 12:48:35 PM
Thanks
sr. member
Activity: 652
Merit: 316
May 23, 2020, 12:43:10 PM
I'm testing with what I already have Smiley
Have some numbers on 2000 series ?
5x1066=1050mkeys
6x1070=1690mkeys
10x1080ti=4200mkeys
6x2070 = 4900mkeys
8x2080ti = 9000mkeys
4xV100 = 7200mkeys
that what i tested
sr. member
Activity: 661
Merit: 250
May 23, 2020, 12:40:13 PM
I'm testing with what I already have Smiley
Have some numbers on 2000 series ?
sr. member
Activity: 652
Merit: 316
May 23, 2020, 12:36:17 PM
Did some other tests :
1070 : 284MKs
1070ti : 291MKs
1080 : 306MKs
Why so less difference ?

All 3 cards are on 1x riser, but I tested 1070ti on 16x and there's no difference with 1x
6x1070 1697Mkey/s, but it is no good idea used 1000 series in calculations.
Huge amount of power and result little bit more as 1 rtx 2080ti, best card for calculation power/mkeys 2000 series
sr. member
Activity: 661
Merit: 250
May 23, 2020, 12:32:14 PM
Did some other tests :
1070 : 284MKs
1070ti : 291MKs
1080 : 306MKs
Why so less difference ?

All 3 cards are on 1x riser, but I tested 1070ti on 16x and there's no difference with 1x
full member
Activity: 1232
Merit: 242
Shooters Shoot...
May 23, 2020, 12:25:14 PM
Doing some tests with a 1070ti.
Why playing with OC does not affect hashrate ?


I'm not sure but I noticed the same thing...I normally adjust volts, etc. and it seemed to decrease the MKey rate a small percentage.
sr. member
Activity: 661
Merit: 250
May 23, 2020, 12:20:21 PM
Doing some tests with a 1070ti.
Why playing with OC does not affect hashrate ?
full member
Activity: 1232
Merit: 242
Shooters Shoot...
May 23, 2020, 09:30:05 AM
Server autorestart now works fine. You calmed me down, gentlemen. I must admit that I hope to find # 110 in the next few days ... I will remember you if I do it, and of course about the author of this tool, to which I already owe a lot :-)

Greetings !

Good luck! And I must admit, I hope I find it first  Grin
full member
Activity: 282
Merit: 114
May 23, 2020, 08:36:32 AM
Server autorestart now works fine. You calmed me down, gentlemen. I must admit that I hope to find # 110 in the next few days ... I will remember you if I do it, and of course about the author of this tool, to which I already owe a lot :-)

Greetings !
full member
Activity: 282
Merit: 114
May 23, 2020, 08:23:08 AM
My changes:

In Constans.h:
Code:
#define CLIENT_TIMEOUT 36000.0

In Kangaroo.cpp:
...added
Code:
bool Kangaroo::output(string msg) {
  
  FILE *f = stdout;
  f = fopen("Result.txt", "a");
    
  if (f == NULL) {
 printf("[error] Cannot open file Result.txt\n");
 f = stdout;
 return false;
  }
  else {
 fprintf(f, "%s\n", msg.c_str());
 fclose(f);
 printf("[i] Success saved to file Result.txt\n");
 return true;
  }
}

// ----------------------------------------------------------------------------

bool  Kangaroo::CheckKey(Int d1,Int d2,uint8_t type) {

  // Resolve equivalence collision

  if(type & 0x1)
    d1.ModNegK1order();
  if(type & 0x2)
    d2.ModNegK1order();

  Int pk(&d1);
  pk.ModAddK1order(&d2);

  Point P = secp->ComputePublicKey(&pk);

  if(P.equals(keyToSearch)) {
    // Key solved    
#ifdef USE_SYMMETRY
    pk.ModAddK1order(&rangeWidthDiv2);
#endif
    pk.ModAddK1order(&rangeStart);    
    Point PR = secp->ComputePublicKey(&pk);
    ::printf("\nKey#%2d [%dN]Pub:  0x%s \n",keyIdx,type,secp->GetPublicKeyHex(true,keysToSearch[keyIdx]).c_str());
    // Save Priv
    std::string prvkey = pk.GetBase16().c_str();
    bool save_pk = output(prvkey + string(":") + string("04") + PR.x.GetBase16().c_str() + PR.y.GetBase16().c_str() );
    if( PR.equals(keysToSearch[keyIdx]) ) {
      ::printf("       Priv: 0x%s \n",pk.GetBase16().c_str());
    } else {
      ::printf("       Failed !\n");
      ::printf("       Priv: 0x%s \n",pk.GetBase16().c_str());
      return false;
    }
    return true;
  }

  if(P.equals(keyToSearchNeg)) {
    // Key solved
    pk.ModNegK1order();
#ifdef USE_SYMMETRY
    pk.ModAddK1order(&rangeWidthDiv2);
#endif
    pk.ModAddK1order(&rangeStart);
    Point PR = secp->ComputePublicKey(&pk);
    ::printf("\nKey#%2d [%dS]Pub:  0x%s \n",keyIdx,type,secp->GetPublicKeyHex(true,keysToSearch[keyIdx]).c_str());
    // Save Priv
    std::string prvkeyNeg = pk.GetBase16().c_str();
    bool save_pk = output(prvkeyNeg + string(":") + string("04") + PR.x.GetBase16().c_str() + PR.y.GetBase16().c_str() );
    if(PR.equals(keysToSearch[keyIdx]) ) {
      ::printf("       Priv: 0x%s \n",pk.GetBase16().c_str());
    } else {
      ::printf("       Failed !\n");
      ::printf("       Priv: 0x%s \n",pk.GetBase16().c_str());
      return false;
    }
    return true;
  }

  return false;

}


afer
Code:
bool Kangaroo::ParseConfigFile(std::string &fileName) {

  // In client mode, config come from the server
  if(clientMode)
    return true;

  // Check file
  FILE *fp = fopen(fileName.c_str(),"rb");
  if(fp == NULL) {
    ::printf("Error: Cannot open %s %s\n",fileName.c_str(),strerror(errno));
    return false;
  }
  fclose(fp);

  // Get lines
  vector lines;
  int nbLine = 0;
  string line;
  ifstream inFile(fileName);
  while(getline(inFile,line)) {

    // Remove ending \r\n
    int l = (int)line.length() - 1;
    while(l >= 0 && isspace(line.at(l))) {
      line.pop_back();
      l--;
    }

    if(line.length() > 0) {
      lines.push_back(line);
      nbLine++;
    }

  }

  if(lines.size()<3) {
    ::printf("Error: %s not enough arguments\n",fileName.c_str());
    return false;
  }

  rangeStart.SetBase16((char *)lines[0].c_str());
  rangeEnd.SetBase16((char *)lines[1].c_str());
  for(int i=2;i<(int)lines.size();i++) {
    
    Point p;
    bool isCompressed;
    if( !secp->ParsePublicKeyHex(lines[i],p,isCompressed) ) {
      ::printf("%s, error line %d: %s\n",fileName.c_str(),i,lines[i].c_str());
      return false;
    }
    keysToSearch.push_back(p);

  }

  ::printf("Start:%s\n",rangeStart.GetBase16().c_str());
  ::printf("Stop :%s\n",rangeEnd.GetBase16().c_str());
  ::printf("Keys :%d\n",(int)keysToSearch.size());

  return true;

}

// ----------------------------------------------------------------------------

and in Kangaroo.h

added
Code:
bool output(std::string msg);

after

Code:
 bool saveKangaroo;
and before
Code:
  int wtimeout;
  int ntimeout;
(section //Backup stuff)
full member
Activity: 282
Merit: 114
May 23, 2020, 08:11:20 AM
OK.It works :-) Many thanks.

What do you think about the error I received before? :

Code:
Unexpected wrong collision, reset kangaroo !
Found: Td-73xxxxxxxxx57E8567EB949E04A8
Found: Wd-34xxxxxxxxxE8567EB949E04A8
i don`t know) JeanLucPons say in Kangaroo.cpp
Quote
// Should not happen, reset the kangaroo


Shit... :/

JeanLucPons...
So I am waiting for you to take a position on this matter, because the question mark is the sense of engaging further power :-)
maybe i wrong but i think it is not a big problem. because hashtable do not store full x coordinat but only DP i think there can be false collision.
in that case when reconstuct pubkey from TD and WD can be different pubkey. it think with DP=10 can get a lot of this error (maybe)
This is just my thinking. what to do is up to you.

Maybe ... I am more concerned about the "restart kangaroo" part :-)
full member
Activity: 1232
Merit: 242
Shooters Shoot...
May 23, 2020, 08:10:30 AM
OK.It works :-) Many thanks.

What do you think about the error I received before? :

Code:
Unexpected wrong collision, reset kangaroo !
Found: Td-73xxxxxxxxx57E8567EB949E04A8
Found: Wd-34xxxxxxxxxE8567EB949E04A8
i don`t know) JeanLucPons say in Kangaroo.cpp
Quote
// Should not happen, reset the kangaroo


Shit... :/

JeanLucPons...
So I am waiting for you to take a position on this matter, because the question mark is the sense of engaging further power :-)

Did you change anything in source code? I will get the same error when I am tweaking the code with different settings. It happens. The good news is, the program automatically resets the kangaroos and it keeps on jumping to the key!
sr. member
Activity: 652
Merit: 316
May 23, 2020, 08:05:37 AM
OK.It works :-) Many thanks.

What do you think about the error I received before? :

Code:
Unexpected wrong collision, reset kangaroo !
Found: Td-73xxxxxxxxx57E8567EB949E04A8
Found: Wd-34xxxxxxxxxE8567EB949E04A8
i don`t know) JeanLucPons say in Kangaroo.cpp
Quote
// Should not happen, reset the kangaroo


Shit... :/

JeanLucPons...
So I am waiting for you to take a position on this matter, because the question mark is the sense of engaging further power :-)
maybe i wrong but i think it is not a big problem. because hashtable do not store full x coordinat but only DP i think there can be false collision.
in that case when reconstuct pubkey from TD and WD can be different pubkey. it think with DP=10 can get a lot of this error (maybe)
This is just my thinking. what to do is up to you.
full member
Activity: 282
Merit: 114
May 23, 2020, 07:41:42 AM
OK.It works :-) Many thanks.

What do you think about the error I received before? :

Code:
Unexpected wrong collision, reset kangaroo !
Found: Td-73xxxxxxxxx57E8567EB949E04A8
Found: Wd-34xxxxxxxxxE8567EB949E04A8
i don`t know) JeanLucPons say in Kangaroo.cpp
Quote
// Should not happen, reset the kangaroo


Shit... :/

JeanLucPons...
So I am waiting for you to take a position on this matter, because the question mark is the sense of engaging further power :-)
Jump to: