2
When I called:
print bitcoin.getmemorypool()
print bitcoin.getwork()
using Python JSON for a testnet BitcoinQT server, I got the following responces:
{'previousblockhash': '00000000032e361b246e96c4e594523b6ff42bc0527e560f203fb20a08a86185', 'transactions': ..., 'version': 1, 'coinbasevalue': 5000400000, 'time': 1329342730, 'bits': '1c2336a4'}
{... 'data': '0000000108a86185203fb20a527e560f6ff42bc0e594523b246e96c4032e361b000000004c50804820b143e1583c8c49dd43a6ddb8bc777c57c2da4a92b39ee0e709bf504f3c290b1c2336a400000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000080020000', ...}
Comparing the previous block hash from GetMemoryPool and one extracted from the block header from Getwork:
00000000 032e361b 246e96c4 e594523b 6ff42bc0 527e560f 203fb20a 08a86185
08a86185 203fb20a 527e560f 6ff42bc0 e594523b 246e96c4 032e361b 00000000
From what I can see, the data is reversed in chunks of 4 bytes. Why is such a procedure done, and what other fields from those two RPC calls undergo such an operation?
Like, seriously, it's bad enough that Bitcoin uses two different endiannesses on bytes, now we also have a little endianness of a big endianness words (I guess that's what one would call a set of 4 bytes?)? – ThePiachu – 2012-02-15T22:09:00.730