Post
Topic
Board Bitcoin Discussion
Re: Bitcoin puzzle transaction ~32 BTC prize to who solves it
by
nomachine
on 23/10/2023, 16:30:06 UTC

I'm not talking about missing characters or puzzle 66, I'm talking about a way to determine last characters of a private key by working with points.

Ok.

I'm working on Kangaroo Twimi algorithm on  hash160.
I don't know if it will work, but this is an idea.
It uses two EC_POINT objects (K and W) and iteratively moves them around the elliptic curve by adding random steps until they land on the same point.
When the Kangaroo and Wallaby points collide, the algorithm returns the discrete logarithm k.

Code:
bool kangarooTwimi(const EC_GROUP* group, const BIGNUM* order, BIGNUM* x, BIGNUM* result) {
    BIGNUM *k = BN_new();
    BIGNUM *k1 = BN_new();
    BIGNUM *k2 = BN_new();
    BIGNUM *x1 = BN_new();
    BIGNUM *x2 = BN_new();

    // Set k to a random value
    BN_rand_range(k, order);

    EC_POINT *G = EC_POINT_new(group);
    EC_POINT *kG = EC_POINT_new(group);
    EC_POINT *xG = EC_POINT_new(group);

    EC_POINT_mul(group, G, k, NULL, NULL, NULL); // G = k * G

    while (true) {
        EC_POINT_mul(group, kG, NULL, G, k, NULL); // kG = k * G
        EC_POINT_mul(group, xG, NULL, x, NULL, NULL); // xG = x * G

        EC_POINT_get_affine_coordinates_GFp(group, kG, k1, NULL, NULL);
        EC_POINT_get_affine_coordinates_GFp(group, xG, x1, NULL, NULL);

        if (BN_cmp(k1, x1) == 0) {
            BN_copy(result, k);
            BN_free(k);
            BN_free(k1);
            BN_free(k2);
            BN_free(x1);
            BN_free(x2);
            EC_POINT_free(G);
            EC_POINT_free(kG);
            EC_POINT_free(xG);
            return true;
        }

        BN_add(k, k, BN_value_one());
    }
}
rest is similiar as Bytea HASH160 Search from here :
https://bitcointalk.org/index.php?topic=1306983.msg63029958#msg63029958

100% OpenSSL code...