Post
Topic
Board Bitcoin Discussion
Re: Bitcoin puzzle transaction ~32 BTC prize to who solves it
by
racminer
on 15/06/2019, 13:50:37 UTC
How to modify the current Baby-step-giant-step code to be able to compile on the current keyspace? I realize how long it will last and how much RAM will need.

with these declarations:

typedef struct hashtable_entry {
    uint128_t x;
    uint128_t exponent;
} hashtable_entry;

#define HASH_SIZE (2*GSTEP)
hashtable_entry table[HASH_SIZE];

using
#define GSTEP ((uint128_t)1<<32)

requires 256 Gb RAM !!!

to solve case #85, I assume that you need #define GSTEP ((uint128_t)1<<42)

that's 256*2*2*2*2*2*2*2*2*2*2 =  256 Tb RAM  Roll Eyes

Doesn't work.

warning: format ‘%lx’ expects argument of type ‘long unsigned int’, but argument 4 has type ‘uint128_t {aka __int128 unsigned}’ [-Wformat=]
                     printf("Found private key %2d: %16lx or %16lx\n", j + 1,


Easy to solve. Just rewrite the print section by separating lo and hi 64bits.
this is what I did
Code:
           while (table[entry].exponent != 0) {
                if (table[entry].x == (uint64_t) xst.n[2]) {
                    uint128_t key = (uint128_t) i *  (uint128_t) (2 * GSTEP);

                    uint128_t key1 = key - table[entry].exponent ;
                    uint128_t key2 = key + table[entry].exponent;

uint64_t key1lo = key1;
uint64_t key1hi = (key1 >> 64);
uint64_t key2lo = key2;
uint64_t key2hi = (key2 >> 64);
                    printf("Found private key %2d: %lx %lx or %lx %lx\n", j + 1,  key1hi,key1lo,key2hi,key2lo);
                    next++;
              ..................................