A wire format fixes its byte order. The host it runs on has one of its own, and the two agree only by accident. When a binary parsing library lets the order go unstated (a u16() with no argument, a packed struct, a memcpy into a uint32_t ), the host answers a question that only the format's specification is allowed to answer, and the code is correct on the machine it was written on. Make the order a required argument of every multi-byte read and write and that answer moves into the call site, which is the only place a reviewer can hold it next to the spec.
I have been shipping payments and crypto systems since 2018: card rails and account-to-account flows, custodial wallet services for BTC and ETH, an on-chain payment system, e-signature document workflows. Underneath all of it sits the same shape, a record that arrives as bytes (a tag, a version, a length, a body), and the orders are not uniform.…