Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Score wallets by unique characters #7

Open
opne opened this issue Aug 19, 2024 · 1 comment
Open

Score wallets by unique characters #7

opne opened this issue Aug 19, 2024 · 1 comment

Comments

@opne
Copy link

opne commented Aug 19, 2024

I want to score the wallets generated by the number of unique characters (case-insensitive) in the public key.

I can generate this with simple CPU-limited python code but it's far too slow.

    acct, mnemonic = Account.create_with_mnemonic(num_words=24)
    if len(set(acct.address.lower()))<9:
        print(len(set(acct.address.lower())))
        print(acct.address)
        print(acct.key.hex())
        print(mnemonic)

Is this something that's possible with GPU? where can I start? I can't myself seem to find any resources that can help me write something like this up.

@MrSpike63
Copy link
Owner

You could replace the current score_zero_bytes function here with something like this, which counts the number of characters then flips it, since you seem to want to make it lower. Note that this tool doesn't support mnemonics.

__device__ int score_zero_bytes(Address a) {
    uint32_t mask = 0;

    #define count_unique_chars(x) \
        for (int i = 0; i < 8; i++) { \
            mask |= (1 << (x & 15)); \
            x >>= 4; \
        }

    count_unique_chars(a.a);
    count_unique_chars(a.b);
    count_unique_chars(a.c);
    count_unique_chars(a.d);
    count_unique_chars(a.e);
    #undef get_unique_chars

    return 16 - __popc(mask);
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants