Post
Topic
Board Bitcoin Discussion
Re: Bitcoin puzzle transaction ~32 BTC prize to who solves it
by
joseperal
on 09/04/2024, 18:43:07 UTC
Thanks again for the detailed answer Alberto. I will try what you suggested.


My tool actually calculates for all the ID Bytes, 0x02, 0x03, 0x04, 0x06, and 0x07.

Code:

//-----------------------------------------------------------------
// Wallet Generation
//
    do{

        // 0) Priv Key print
        if(single_calculation){
printf("\r\n\r\n(0) Private ECDSA Key (64 hex chars, 256 bits): ");
printf("\r\n    " COLOR_RED);
for(k=0;k<32;k++) printf("%02x", privkey[k]);
printf(COLOR_RESET);
        }

        // 1) Calculate Public Key using SECP256K1 eliptic curve
if(single_calculation){
printf("\r\n(1) (U)ncompressed & (C)ompressed Public Key from SECP256K1 curve (130 hex chars, 520 bits): ");
if(single_calculation) start=omp_get_wtime();
}
        result=secp256k1_ec_pubkey_create(ctx, &pubkey_from_secp256k1.p, privkey);       //secp256k1_ec_pubkey_create(const secp256k1_context* ctx,  secp256k1_pubkey *pubkey, const unsigned char *seckey)
if(single_calculation){
end=omp_get_wtime();
printf("%.2f us",(end - start)*1000000);
}

//---------------------------------------------
// Public Key
// https://github.com/bitcoin/bitcoin/blob/ba4b3fbcf21317a9410f3be913e4437d58968091/src/secp256k1/include/secp256k1.h#L179
//
// Prefix byte used to tag various encoded curvepoints for specific purposes
#define SECP256K1_TAG_PUBKEY_EVEN 0x02          // par
#define SECP256K1_TAG_PUBKEY_ODD 0x03 // impar
#define SECP256K1_TAG_PUBKEY_UNCOMPRESSED 0x04
#define SECP256K1_TAG_PUBKEY_HYBRID_EVEN 0x06
#define SECP256K1_TAG_PUBKEY_HYBRID_ODD 0x07

// ID Byte
  compressed_02_pubkey[0]=SECP256K1_TAG_PUBKEY_EVEN;
  compressed_03_pubkey[0]=SECP256K1_TAG_PUBKEY_ODD;
  uncompressed_04_pubkey[0]=SECP256K1_TAG_PUBKEY_UNCOMPRESSED;
  compressed_06_pubkey[0]=SECP256K1_TAG_PUBKEY_HYBRID_EVEN;
  compressed_07_pubkey[0]=SECP256K1_TAG_PUBKEY_HYBRID_ODD;

//---------------------------------------------
        // Uncompressed Pubkey reordering from 2 chunks of 32bytes to 65 bytes most significative byte lower index, and adding the key ID.
//
// 0x04 - Uncompressed public key format ID 0x04.
//
l=32;                                      // First 32 bytes chunk
for(k=0;k<32;k++){
uncompressed_04_pubkey[l]=pubkey_from_secp256k1.eb[k];  // .eb is the union element to access the memory in (E)igth (B)its.
l--;
}
l=64;                                      // second 32 bytes chunk
for(k=32;k<64;k++){
uncompressed_04_pubkey[l]=pubkey_from_secp256k1.eb[k];
l--;
}

//---------------------------------------------
        // Compressed PubKey get X from uncompressed and select ID byte using parity 0x02-0x03
//
// Copy X coordinate to new array with ID byte
        l=32;                                      // First 32 bytes chunk
        for(k=0;k<32;k++){
          compressed_02_pubkey[l]=pubkey_from_secp256k1.eb[k];  // .eb is the union element to access the memory in (E)igth (B)its.
          compressed_03_pubkey[l]=pubkey_from_secp256k1.eb[k];  // .eb is the union element to access the memory in (E)igth (B)its.
  compressed_06_pubkey[l]=pubkey_from_secp256k1.eb[k];  // .eb is the union element to access the memory in (E)igth (B)its.
          compressed_07_pubkey[l]=pubkey_from_secp256k1.eb[k];  // .eb is the union element to access the memory in (E)igth (B)its.  
          l--;
        }

if(single_calculation){
printf("\r\n          (C-02)" COLOR_GREEN ); for(k=0;k<33;k++) printf("%02x", compressed_02_pubkey[k]); printf(COLOR_RESET);
printf("\r\n          (C-03)" COLOR_GREEN ); for(k=0;k<33;k++) printf("%02x", compressed_03_pubkey[k]); printf(COLOR_RESET);
printf("\r\n          (U-04)" COLOR_GREEN ); for(k=0;k<65;k++) printf("%02x", uncompressed_04_pubkey[k]); printf(COLOR_RESET);
printf("\r\n          (C-06)" COLOR_GREEN ); for(k=0;k<33;k++) printf("%02x", compressed_06_pubkey[k]); printf(COLOR_RESET);
printf("\r\n          (C-07)" COLOR_GREEN ); for(k=0;k<33;k++) printf("%02x", compressed_07_pubkey[k]); printf(COLOR_RESET);
}


Also talking about ID's. I realized the puzzle pieces are alternatively Compressed-02 and 03 only.

I got the list below just running my tool using the know private keys found here.

I know the puzzle creator said there is no pattern just a mask from HD wallets.

For example puzzle-1 to 5 are Compressed-02, and puzzle-6 is Compressed-03.


Code:

1, Asc, C-02, 000000000000000001, 0000000000000000000000000000000000000001,            1,           2, 0000000000000000000000000000000000000010
 2, Asc, C-02, 000000000000000003, 0000000000000000000000000000000000000011,            3,           4, 0000000000000000000000000000000000000100
 3, Asc, C-02, 000000000000000007, 0000000000000000000000000000000000000111,            7,           1, 0000000000000000000000000000000000000001
 4, Asc, C-02, 000000000000000008, 0000000000000000000000000000000000001000,            8,          13, 0000000000000000000000000000000000001101
 5, Asc, C-02, 000000000000000015, 0000000000000000000000000000000000010101,           21,          28, 0000000000000000000000000000000000011100
 6, Asc, [b]C-03[/b], 000000000000000031, 0000000000000000000000000000000000110001,           49,          27, 0000000000000000000000000000000000011011
 7, Asc, C-02, 00000000000000004c, 0000000000000000000000000000000001001100,           76,         148, 0000000000000000000000000000000010010100
 8, Asc, C-03, 0000000000000000e0, 0000000000000000000000000000000011100000,          224,         243, 0000000000000000000000000000000011110011
 9, Asc, C-02, 0000000000000001d3, 0000000000000000000000000000000111010011,          467,          47, 0000000000000000000000000000000000101111
10, Asc, C-03, 000000000000000202, 0000000000000000000000000000001000000010,          514,         641, 0000000000000000000000000000001010000001
11, Asc, C-03, 000000000000000483, 0000000000000000000000000000010010000011,         1155,        1528, 0000000000000000000000000000010111111000
12, Asc, C-03, 000000000000000a7b, 0000000000000000000000000000101001111011,         2683,        2533, 0000000000000000000000000000100111100101
13, Asc, C-03, 000000000000001460, 0000000000000000000000000001010001100000,         5216,        5328, 0000000000000000000000000001010011010000
14, Asc, C-03, 000000000000002930, 0000000000000000000000000010100100110000,        10544,       16323, 0000000000000000000000000011111111000011
15, Asc, C-02, 0000000000000068f3, 0000000000000000000000000110100011110011,        26867,       24643, 0000000000000000000000000110000001000011
16, Asc, C-02, 00000000000000c936, 0000000000000000000000001100100100110110,        51510,       44313, 0000000000000000000000001010110100011001
17, Asc, C-03, 00000000000001764f, 0000000000000000000000010111011001001111,        95823,      102846, 0000000000000000000000011001000110111110
18, Asc, C-02, 00000000000003080d, 0000000000000000000000110000100000001101,       198669,      158866, 0000000000000000000000100110110010010010
19, Asc, C-03, 00000000000005749f, 0000000000000000000001010111010010011111,       357535,      505782, 0000000000000000000001111011011110110110
20, Asc, C-03, 0000000000000d2c55, 0000000000000000000011010010110001010101,       863317,      948447, 0000000000000000000011100111100011011111
21, Asc, C-03, 0000000000001ba534, 0000000000000000000110111010010100110100,      1811764,     1195739, 0000000000000000000100100011111011011011
22, Asc, C-02, 0000000000002de40f, 0000000000000000001011011110010000001111,      3007503,     2591299, 0000000000000000001001111000101001000011
23, Asc, C-03, 000000000000556e52, 0000000000000000010101010110111001010010,      5598802,     8829874, 0000000000000000100001101011101110110010
24, Asc, C-03, 000000000000dc2a04, 0000000000000000110111000010101000000100,     14428676,    18756833, 0000000000000001000111100011010011100001
25, Asc, C-03, 000000000001fa5ee5, 0000000000000001111110100101111011100101,     33185509,    21353353, 0000000000000001010001011101001110001001
26, Asc, C-02, 00000000000340326e, 0000000000000011010000000011001001101110,     54538862,    57411079, 0000000000000011011011000000011000000111
27, Asc, C-03, 000000000006ac3875, 0000000000000110101011000011100001110101,    111949941,   115684467, 0000000000000110111001010011010001110011
28, Asc, C-03, 00000000000d916ce8, 0000000000001101100100010110110011101000,    227634408,   173074486, 0000000000001010010100001110100000110110 
29, Asc, C-02, 000000000017e2551e, 0000000000010111111000100101010100011110,    400708894,   632453190, 0000000000100101101100100111100001000110
30, Asc, C-03, 00000000003d94cd64, 0000000000111101100101001100110101100100,   1033162084,  1069226467, 0000000000111111101110110001100111100011
31, Asc, C-03, 00000000007d4fe747, 0000000001111101010011111110011101000111,   2102388551,   991084263, 0000000000111011000100101011111011100111
32, Asc, C-02, 0000000000b862a62e, 0000000010111000011000101010011000101110,   3093472814,  4043965098, 0000000011110001000010100000001010101010
33, Asc, C-03, 0000000001a96ca8d8, 0000000110101001011011001010100011011000,   7137437912,  6995634245, 0000000110100000111110001110100001000101
34, Asc, C-03, 00000000034a65911d, 0000001101001010011001011001000100011101,  14133072157,  5979799635, 0000000101100100011011001000000001010011
35, Asc, C-02, 0000000004aed21170, 0000010010101110110100100001000101110000,  20112871792, 22274898188, 0000010100101111101011111111100100001100
36, Asc, C-02, 0000000009de820a7c, 0000100111011110100000100000101001111100,  42387769980, 57863790615, 0000110101111000111100110110000000010111
37, Asc, C-02, 000000001757756a93, 0001011101010111011101010110101010010011, 100251560595, 46719975997, 0000101011100000101110100100001000111101

I will drop the uncompressed (04) and the Compressed 06-07 as the puzzle seems not using them.

Does anyone know if the uncompressed (04) and the Compressed 06-07 were used so far on any early days wallet? I always dreamed finding something unspent on those ID's (04-06-07).