0

I'm long time really confused about LITTLE/BIG endian encoding. With regard to bitcoin when you check protocol documentation here it says that btc magic number as send over the wire 0xF9BEB4D9 which has to be as RFC1700 specifies BIG ENDIAN.

However in this thread, one answer states that 0xF9BEB4D9 is little endian encoded.

Can soemone explain, please?

1
  • 2
    RFC 1700 isn't a law. Protocols can use little endian if their designers feel like it. It's not like the Internet police are going to come and arrest them. May 3, 2019 at 15:24

1 Answer 1

2

Byte sequences have no endianness, numbers do. Satoshi didn't say that clients must send that number, but the byte sequence. Arbitrarily, he chose to use the little-endian byte sequence, corresponding to his number. He didn't disobey RFC1700 because he didn't say that is derived by serializing his number.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.