What parts of Bitcoin (litecoin etc) are Little Endian?

0

1

As mentioned on this 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.

goodguys_activate

Posted 2014-02-11T15:25:57.460

Reputation: 11 898

Answers

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.

ScripterRon

Posted 2014-02-11T15:25:57.460

Reputation: 2 023