D) there is 2 rounds of sha256, and one sha256 round is 64 rounds. 2*64=128rounds.
the way to calculate the hash of a block is: sha256(sha256(blockdata))
To be exact, a constant is prepended to the inner sha256 hash to pad it to the 512 data bytes needed for the outer hash.the way to calculate the hash of a block is: sha256(sha256(blockdata))
btw. its 512 bytes its 512 bits. a byte is 8 bits.
kokjo, gentakin & TheSeven - Thanks for your replies. The explanations (and LINKS!) helped me quickly understand what is happening, and in what state the FPGAs are getting the work. (I knew it was some "midstate" but not exactly where.) I'll spell it out here so you can check my understanding, and so the next noob can get a head start.
1) The first 1/2 of DATA is *already* hashed, and sitting in MIDSTATE. Gotcha. (So toss/ignore the first 1/2 of DATA for hash searching purposes.)
2) The next four 32bit long-words are:
2 a) the last 32bits of merkel tree
2 b) unix time in seconds
2 c) "bits", the current difficulty (encoded slightly)
2 d) nonce 0x00000000, which we iterate through 2^32 combinations looking for golden tickets
3) The remaining 384bits are the SHA256 spec for padding, which states:
Code:
re-processing:
append the bit '1' to the message
append k bits '0', where k is the minimum number >= 0 such that the resulting message
length (in bits) is congruent to 448 (mod 512)
append length of message (before pre-processing), in bits, as 64-bit big-endian integer
3 a) Padding starts with 0x00000080, which big-little endian converts to 0x80000000, the high-order bit is the '1' appended to the message.
3 b) followed by all zeros until the last 64bits
3 c) last 64bits specify message length 0x00000000 0x80200000 which big-little endian converts to 0x00000000 0x00000280. 0x280 = 640bits = 80bytes, and ALL header blocks are 80 bytes. Check ... it all makes sense now. (THANKS!)
While trying to read the protocols and make sense of FPGAminer's code, I wrote a quick perl script to print out repeated getwork() responses in nice columns for analysis. If anyone wants, I can post it. Besides, it's kind of mesmerizing to watch.
![Smiley](https://bitcointalk.org/Smileys/default/smiley.gif)
Thanks again, guys!