1inch / profanity2

Vanity address generator for Ethereum
337 stars 91 forks source link

[Feature Request] Add a mode to score the result based on the number of zero-bytes #35

Open 0xSynon opened 6 months ago

0xSynon commented 6 months ago

Currently with the option --zeros this address the program scores a result higher if it has more characters zero even if there are fewer zero bytes. Example:

  Time:     0s Score: 13 Private: 0x... Contract: 0xcc00a0c121016f0d000e7a740fada0bd0066086f
  Time:     1s Score: 14 Private: 0x... Contract: 0x400ab2800f0032900f00a1d0580630846044557b
  Time:     1s Score: 15 Private: 0x... Contract: 0xc0e250000ad20bf5d079a002003fe900c00d1e32
  Time:     2s Score: 16 Private: 0x... Contract: 0x9afd138054000005209086700005c9b0007c1908
  Time:     3s Score: 17 Private: 0x... Contract: 0x07a316d0f0eb0900090002606080d00d093c4045

In zero-byte mode, the scores for these results would be

I don't know OpenCL at all but I tried to change the profanity_score_matching function like this:

__kernel void profanity_score_matching(__global mp_number * const pInverse, __global result * const pResult, __constant const uchar * const data1, __constant const uchar * const data2, const uchar scoreMax) {
    const size_t id = get_global_id(0);
    __global const uchar * const hash = pInverse[id].d;
    int score = 0;

    for (int i = 0; i < 20; ++i) {
        if (hash[i] == 0) {       // <---- here
            ++score;
        }
    }

    profanity_result_update(id, hash, pResult, score, scoreMax);
}

But it didn't change anything. I'm probably modifying the wrong function.