<p>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 <a href="https://en.bitcoin.it/wiki/BIP_0022" rel="nofollow">BIP 22</a>, which is the Draft-status standard detailing the getmemorypool protocol.</p>

CC BY-SA 3.0
2012-03-05T22:15:09.110Z
2012-03-05T22:15:09.110Z
Luke Dashjr
<p>Do you mean the <code>data</code> response for a <code>getwork</code> call?  Because <code>getmemorypool</code> only returns <code>version</code>, <code>previousblockhash</code>, <code>transactions</code>, <code>coinbasevalue</code>, <code>coinbaseflags</code>, <code>time</code>, <code>mintime</code>, <code>curtime</code>, and <code>bits</code>.</p>

<p>If so, I answered that <a href="https://bitcoin.stackexchange.com/a/2907/659">here</a>.</p>

CC BY-SA 3.0
2012-02-26T05:37:23.107Z
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
CC BY-SA 3.0
2012-03-06T00:58:03.490Z
In 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
CC BY-SA 3.0
2012-02-26T05:05:53.747Z
2012-02-26T05:05:53.747Z
2017-04-13T12:47:33.610Z
Chris Moore
<p>As there are a couple endiannesses used by Bitcoin, what is the proper way to encode the <code>data</code> parameter for a <code>getmemorypool</code> <a href="https://en.bitcoin.it/wiki/Original_Bitcoin_client/API_calls_list" rel="nofollow">JSON API call</a>?</p>

<protocol><bitcoind><getmemorypool><api><endianness>
Proper getmemorypool data endianness?
ThePiachu
# Proper getmemorypool data endianness?

(Asked by: username_0 on 2012-02-26)

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](https://en.bitcoin.it/wiki/Original_Bitcoin_client/API_calls_list)?

**Tags:** protocol, bitcoind, getmemorypool, api, endianness


---

## 2 answers

### Answer by username_1 on 2012-03-05. Score: 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](https://en.bitcoin.it/wiki/BIP_0022), which is the Draft-status standard detailing the getmemorypool protocol.


---

### Answer by username_2 on 2012-02-26. Score: 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](https://bitcoin.stackexchange.com/a/2907/659).

> **Comments:**
> **username_0**: 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".  
> **username_3**: In 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.  

---

