<p>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.</p>

CC BY-SA 4.0
2019-05-03T13:33:46.180Z
2019-05-03T13:33:46.180Z
MCCCS
<p>I'm long time really confused about LITTLE/BIG endian encoding. With regard to bitcoin when you check protocol documentation <a href="https://en.bitcoin.it/wiki/Protocol_documentation#Message_structure" rel="nofollow noreferrer">here</a> it says that btc magic number as send over the wire <strong>0xF9BEB4D9</strong> which has to be as RFC1700 specifies BIG ENDIAN. </p>

<p>However in <a href="https://bitcoin.stackexchange.com/questions/2337/how-was-the-magic-network-id-value-chosen/2355#2355">this</a> thread, one answer states that <strong>0xF9BEB4D9</strong> is little endian encoded. </p>

<p>Can soemone explain, please?</p>

CC BY-SA 4.0
2019-05-03T15:24:19.913Z
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.
Nate Eldredge
<protocol>
Magic numbers BIG-LITTLE endian
scagbackbone
# Magic numbers BIG-LITTLE endian

(Asked by: username_0 on 2019-05-03)

I'm long time really confused about LITTLE/BIG endian encoding. With regard to bitcoin when you check protocol documentation [here](https://en.bitcoin.it/wiki/Protocol_documentation#Message_structure) it says that btc magic number as send over the wire **0xF9BEB4D9** which has to be as RFC1700 specifies BIG ENDIAN.

However in [this](https://bitcoin.stackexchange.com/questions/2337/how-was-the-magic-network-id-value-chosen/2355#2355) thread, one answer states that **0xF9BEB4D9** is little endian encoded.

Can soemone explain, please?

**Tags:** protocol

> **Comments:**
> **username_1**: 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.  

---

## 1 answers

### Answer by username_2 on 2019-05-03. Score: 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.


---

