1
Guys I have a few points that are not clear for me. 1) In the link below it says there are some fields we have to combine and hash. However when I get a work by saying getwork from a pool. What I get is in the below either. The problem is that I cannot find the fields listed in the first link, Version, hashPrevBlock etc.
https://en.bitcoin.it/wiki/Block_hashing_algorithm
Getwork result.
{ 'data':'0000000271112b7a1cf8e97b8367102f7e155499bf5c7303cbcdd4360000000000000000427719b35a84bc7732edd34ff3a6278dc4ac0ec2a9544e6088bc0bd719e17a8e52db3b211902666600000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000080020000',
'hash1':'00000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000010000',
'target':'0000000000000000000000000000000000000000000000000000ffff00000000',
'midstate':'45aebb01c0fdb704ee7d2bbf02665943f50f299ff8bb252e614100065bc5c20c'
}
2) It says in the first link "Whenever Nonce overflows (which it does frequently), the extraNonce portion of the generation transaction is incremented, which changes the Merkle root." Should I put extra 32 bits for extranonce?
3) What is the reason reversing the header?
you mean the only thing I care about will be the last 4 bytes of the data, right? But whose last bytes, the little-endian one or the other? :) – Eray Tuncer – 2014-01-26T10:42:51.270
it really doesn't matter. typically, at least on x86 computers, people increment the little-endian number, then convert the block to big-endian for hashing. I just use random numbers so I couldn't care less about endianness; just have to make sure to put it in the right order for submission to the server. – jcomeau_ictx – 2014-01-26T18:06:24.097
remember, it's the same 4 bytes in each case; you're not reversing the 80 bytes, you're reversing every 4 bytes within the 80 bytes, so 0x12345678 becomes 0x78563412. – jcomeau_ictx – 2014-01-26T18:13:45.857
In the example of 0x12345678 you are reversing every 1 byte chunks within a 4 byte value right? 0x12345678 = 00010010-00110100-01010110-01111000.
0x78563412 = 01111000-01010110-00110100-00010010 – Eray Tuncer – 2014-01-27T01:03:53.687
yes, that's the idea. – jcomeau_ictx – 2014-01-27T01:07:52.233