NebulousLabs / Sia-GPU-Miner

A GPU Miner for Sia
MIT License
151 stars 79 forks source link

why only first 8 bytes of target is used for blake2b GPU version? #79

Open fatrat1117 opened 6 years ago

fatrat1117 commented 6 years ago

Hi: Giving Sia target is 32 bytes, I am confused that the source code only uses the first 8 bytes. I extract the code where initialize, compute and compare target.

// Copy target to header.
for (i = 0; i < 8; i++) {
    blockHeader[i + 32] = target[7-i];
}

ulong target = headerIn[4];

if (as_ulong(as_uchar8(0x6a09e667f2bdc928 ^ v[0] ^ v[8]).s76543210) < target) {
    *nonceOut = m[4];
    return;
}

I believe the code is correct. Is there a theory behind this? Thanks!