4

The first answer here does a good job explaining how the SHA-256 function requires more than one input (an initial one is specified by to the SHA-256 specs). As far as I understand it, the "midstate" value is the initial hash of the first half of the data, used to later serve as an input into the double-hash of the second half of the data.

Is this correct?

And here is an explanation of what the "hash1" value actually is and means, but what is it used for?

  • What do you mean by "half" here? If b=SHA(a=SHA(data)), a = "initial hash" and b = "second half"? So, a is the midstate? – Geremia Mar 27 '15 at 4:15
  • This defines midstate well; it's "the contents of the 'state' after having processed the first [SHA256] block." Thus, it's not a in b=SHA(a=SHA(data)) if data is longer than one SHA256 block (64 bytes). Isn't the Bitcoin block header 80 bytes? – Geremia Jun 11 '15 at 6:21
2

1) Yes, it is correct.

2) It is deprecated. Generally, it is used to write the result of the mining over to be sent to the pool. This is to ensure the result is of correct length and adheres to some rules. In practice, it is always the same trailing string of numbers.

  • So the hash1 value itself is never actually used? It just serves as a formatting template? – ConstableJoe Oct 11 '12 at 13:28
  • @ConstableJoe Well, it's not used for any calculations, it is deprecated in general and eventually it will be left out of the getwork protocol. – ThePiachu Oct 11 '12 at 13:46
  • Interesting. Seems pretty useless, unless I'm missing something. – ConstableJoe Oct 12 '12 at 3:57

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.