Post
Topic
Board Bitcoin Discussion
Re: Bitcoin puzzle transaction ~32 BTC prize to who solves it
by
Bram24732
on 11/04/2025, 15:14:34 UTC
Also, I don't see the point of saving keys that have some 0-bits prefix. It saves some kernel instructions to simply skip that check, and use the hash target itself as PoW evidence.

I don't see how checking against 0 gives anything better/worse than checking against target ?
Which kernel instructions do you skip checking against the target ? You would still have to do the CMP. Sure you can mutualize the first 32 bits to check, but then you need to check a subset of the next 32 bits and you're introducing complexity, branching, etc...
If anything checking against zero frees the compiler from the dependency to the target registers on this instruction.

Because you're doing two checks (target and zero). There's also no need to check more than a single register in the kernel itself or complicate things.

lets imagine I want all 5 zero bytes leading prefixes. I can do :

Code:
const int32 candidate[5];
const bool check = !candidate[0] && !(candidate[1] & 0xFF000000)
// Then check against the target

if I want to mutualize the target check I need something like this :

Code:
const int32 candidate[5];
if (target[0] != candidate[0]){
     return; // We dont go any further
}

// Here, we mutualized the pattern check for the first int
// You still need to check the extra byte here
if (candidate[1] & 0xFF000000 == target[1] & 0xFF000000){
    // handle prefix found
}

if (target[1] != candidate[1]){
    return; // We dont go any further
}