[Bitcoin-development] Endianness (was: Linux packaging letter)

Gregory Maxwell gmaxwell at gmail.com
Wed Jul 24 04:07:37 UTC 2013


On Tue, Jul 23, 2013 at 8:54 PM, Wendell <w at grabhive.com> wrote:
> Forking for curiosity's sake:
> Is there a substantial barrier to endian independence in the Bitcoin codebase?

Not really. The software was originally written to write out memory
order to and from the wire, which is part of why the protocol is LE
everywhere, so fixing that much is pretty typical endianness fixes.
There is an extra kink in that almost everything Bitcoin sends and
receives is an authenticated data structure— the stuff gets hashed for
authentication.  So that simply swizzling the byte order on
immediately on input isn't enough because sometimes you'll go on to
hash that data and it can't be in memory order for that.

Luke gave an initial crack at it a long time ago:
http://gitorious.org/~Luke-Jr/bitcoin/luke-jr-bitcoin/commits/endian
But it wasn't enough yet.

Seems like its just enough of an undertaking that absent a really good
reason to care about it no real progress in fixing it is happening.




More information about the bitcoin-dev mailing list