Proper getmemorypool data endianness?

1

As there are a couple endiannesses used by Bitcoin, what is the proper way to encode the data parameter for a getmemorypool JSON API call?

ThePiachu

Posted 2012-02-26T03:14:33.037

Reputation: 41 594

Answers

2

The "data" is not a number (only numbers have endian issues), but the raw byte data of a valid block. You may wish to read over BIP 22, which is the Draft-status standard detailing the getmemorypool protocol.

Luke-Jr

Posted 2012-02-26T03:14:33.037

Reputation: 1 064

1

Do you mean the data response for a getwork call? Because getmemorypool only returns version, previousblockhash, transactions, coinbasevalue, coinbaseflags, time, mintime, curtime, and bits.

If so, I answered that here.

Chris Moore

Posted 2012-02-26T03:14:33.037

Reputation: 13 952

No, I'm specifically referring to getmemorypool call's data field, as in a whole, solved block, rather than just a block header. Maybe I shouldn't have called it "response", but a "parameter".ThePiachu 2012-02-26T05:37:23.107

2In that case: it's a byte-per-byte encoding in hex of the serialized block, the same way it would be serialized on disk in blk0001.dat or on the network.Pieter Wuille 2012-03-06T00:58:03.490