<p>All numeric values on the wire are little-endian with the exception of network addresses and ports, which are big-endian.  This includes Sha-256 digests which are treated as 32-byte numbers.  It does not include data pushed on to the script stack, however, which is copied as-is from the script element.</p>

<p>The regular numbers aren't really a problem since you end up shifting the bytes to form the internal numeric value in either case.  But the 32-byte values are expensive since you end up allocating a new byte array to reverse the bytes as you go to/from the wire protocol byte stream.</p>

CC BY-SA 3.0
2014-02-11T15:50:28.083Z
2014-02-11T15:50:28.083Z
ScripterRon
<p>As mentioned on this <a href="https://en.bitcoin.it/wiki/Hardfork_Wishlist" rel="nofollow">Hardfork Wishlist</a>, many developers want Bitcoin to be entirely Big Endian for consistency and performance reasons.</p>

<p>I'm looking for a concise list of all the areas that Bitcoin uses data in Little (or Big) Endian format so I can create an "endian coin" just for the purposes of testing capacity and performance.</p>

<development><blockchain-fork><performance>
What parts of Bitcoin (litecoin etc) are Little Endian?
makerofthings7
# What parts of Bitcoin (litecoin etc) are Little Endian?

(Asked by: username_0 on 2014-02-11)

As mentioned on this [Hardfork Wishlist](https://en.bitcoin.it/wiki/Hardfork_Wishlist), many developers want Bitcoin to be entirely Big Endian for consistency and performance reasons.

I'm looking for a concise list of all the areas that Bitcoin uses data in Little (or Big) Endian format so I can create an "endian coin" just for the purposes of testing capacity and performance.

**Tags:** development, blockchain-fork, performance


---

## 1 answers

### Answer by username_1 on 2014-02-11. Score: 2

All numeric values on the wire are little-endian with the exception of network addresses and ports, which are big-endian. This includes Sha-256 digests which are treated as 32-byte numbers. It does not include data pushed on to the script stack, however, which is copied as-is from the script element.

The regular numbers aren't really a problem since you end up shifting the bytes to form the internal numeric value in either case. But the 32-byte values are expensive since you end up allocating a new byte array to reverse the bytes as you go to/from the wire protocol byte stream.


---

