Post
Topic
Board Bitcoin Discussion
Re: Bitcoin puzzle transaction ~32 BTC prize to who solves it
by
Kangaderoo
on 19/01/2017, 16:45:13 UTC

Im very bad at programming, all I did was add

const BN_ULONG rekey_max = 10000000000000000;
   BIGNUM *bnprivkey, *bnpubkey;      
   BIGNUM start;      
   BIGNUM *res;


   BN_init(&start);      
               
   int keylen = 32;      
         
   res = &start;      
   BN_hex2bn(&res,"6000000000000");      
         
         //   pkey = EC_KEY_new_by_curve_name(NID_secp256k1);      
         
   pgroup = EC_KEY_get0_group(pkey);      
         
   pgen = EC_POINT_new(pgroup);      
         
   EC_KEY_set_private_key(pkey,res);      
         
         
   if (!EC_POINT_mul(pgroup, pgen, res, NULL, NULL, vxcp->vxc_bnctx));      
      printf("ERROR AT EC POINT MUL");      
         
         
   EC_KEY_set_public_key(pkey, pgen);      
   rekey_at = 999999999999999;      


my change in the cpu version:
Code:
const BN_ULONG rekey_max = 1000000000000000000;
// snip//
while (!vcp->vc_halt) {
if (++npoints >= rekey_at) {
vg_exec_context_upgrade_lock(vxcp);
/* Generate a new random private key */

// remove the random key generation
// EC_KEY_generate_key(pkey);
// add start point equal to 1 * generator
BN_set_word(&vxcp->vxc_bntmp, 1);
EC_KEY_set_private_key(pkey, &vxcp->vxc_bntmp);
EC_KEY_set_public_key(pkey, pgen);
and the second change I made, just to prevent a EC_point add where EC_Point double is needed
Code:
if (vcp->vc_pubkey_base){
EC_POINT_add(pgroup,
ppnt[0],
ppnt[0],
vcp->vc_pubkey_base,
vxcp->vxc_bnctx);
EC_POINT_add(pgroup,
ppnt[1],
ppnt[0],
pgen,
vxcp->vxc_bnctx);
}
else{
EC_POINT_dbl(pgroup,
ppnt[1],
ppnt[0],
vxcp->vxc_bnctx);
}
// point 0 and 1 in the array are predefined, start from point 2.

for (nbatch = 2;
(nbatch < ptarraysize) && (npoints < rekey_at);
  nbatch++, npoints++) {

and this is the result

:~/workspace/32BTC-Challenge$ ./vanitygen 1CUNE  -F compressed -v -t 1
Pattern: 1CUNE                                                                 
Pubkey (hex): 04f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9388f7b0f632de 8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672
Privkey (hex): 03
Address: 1CUNEBjYrCn2y1SdiUMohaKUi4wpP326Lb
Privkey: KwDidCf1aesp7ibPmj64maKRXJoHJnKKtTvvuwAjME7BcDHW33X2

And using the -P for the offset with the pubkey =  2*the generator pattern:

:~/workspace/32BTC-Challenge$ ./vanitygen 1CUNE  -F compressed -P 04C6047F9441ED7D6D3045406E95C07CD85C778E4B8CEF3CA7ABAC09B95C709EE51AE168FEA63DC 339A3C58419466CEAEEF7F632653266D0E1236431A950CFE52A -v -t 1
Pattern: 1CUNE                                                                 
Pubkey (hex): 0479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c 4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8
Privkey (hex): 01
Address: 1CUNEBjYrCn2y1SdiUMohaKUi4wpP326Lb
PrivkeyPart: KwDidCf1aesp7ibPmj64maKRXJoHJnKKtTvvuwAjME7Bb2yevh1x

I guess the same change should work in oclvanitygen.
The next point(s) generation code was already sequential and based on the generator point.

The only thing you need is the pub key of 2^51 or any other point you want to start (example: 2^51 + 2^33) for your start point of the search.