5

Bitcoin's pow is sha256, the hash of header is taken and check against a given target to see whether it is smaller than the target, this can be easy seen as block hash starts with zeros. But how does litecoin's scrypt works, from the block explorer, its block hashes are just arbitrary, not starting with zeros. What is scrypt mining actually trying to find?

1 Answer 1

6

It's the same: the proof-of-work is that the scrypt hash of the block header must start with a certain number of zeros (or, more precisely, be numerically less than a certain target value). However, the scrypt hash is not what's used as the block ID; rather, the sha256d hash (double sha256) is used instead. The sha256d hash doesn't have to follow any particular pattern.

For instance, the previous block field of a header contains the sha256d hash of the previous block's header, not its scrypt hash. The scrypt hash of the header isn't contained anywhere in the block chain, and the block explorers I checked don't seem to show it, though it would be nice if they did.

I don't know exactly why this choice was made. It could be for efficiency: there might be places in the code where we need to find the ID from the block header, but don't need to verify the proof-of-work. Since sha256d is much faster than scrypt, it would save time to be able to use sha256d in such cases. Or it might have been for convenience, so that there was less code to change from the original Bitcoin source.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.