4 ms·
After reading about the protocol I came to a similar conclusion as you. Although it needs to be noted that the JSON serialization is defined as JSON.stringify a
by SyrupThinker 6y ago
After reading about the protocol I came to a similar conclusion as you. Although it needs to be noted that the JSON serialization is defined as JSON.stringify as defined in ECMA-262 6th Ed. plus some more.
To me it's worse that key order must be preserved, which this standard does not specify the way I understand it.
Source:
https://ssbc.github.io/scuttlebutt-protocol-guide/#message-format https://ssbc.github.io/scuttlebutt-protocol-guide/#message-f...
- viraptor 6y agoThis is terrible. It's basically not JSON anymore. It's some custom text protocol with similar value escaping... If they wanted both the descriptions to be visible and the order to be preserved, they could use: [ ["previous", "..."], ["author", "..."], ...
- tptacek 6y agolvh at Latacora wrote a blog post about this problem. https://latacora.micro.blog/2019/07/24/how-not-to.html https://latacora.micro.blog/2019/07/24/how-not-to.html
- kbumsik 6y ago> In brief, the rules are: - Two spaces for indentation. - Dictionary entries and list elements each on their own line. - etc... This is so weird to me. Why a protocol needs a strict, opinionated format of JSON? If they really need a very specific format of JSON, why they even bother JSON? There are better options like protobuf. This seems the worst example of "Use JSON for everything".
- jitschlit 6y agoJust a guess, but maybe so they can reliable hash it?