jimbocoin on Nostr: If we’re gonna go binary, then I’d prefer to just go full binary. WebSockets ...
If we’re gonna go binary, then I’d prefer to just go full binary. WebSockets support binary mode. We could encode these messages using CBOR and suffer minimal loss on the wire. This would still be compatible with stream compression, AFAIK.
Encoding binary data as a string can be completely avoided for this new message type, since both ends of the connection are expected to handle binary payloads anyway. The usual argument of avoiding a human-unreadable format is moot here, IMO.
Published at
2024-09-13 21:59:20Event JSON
{
"id": "9bf34a4d398463fffbcd7cd5c75f87e8dab015adedfe8596384efc01105d215e",
"pubkey": "6140478c9ae12f1d0b540e7c57806649327a91b040b07f7ba3dedc357cab0da5",
"created_at": 1726264760,
"kind": 1,
"tags": [
[
"e",
"8623be03632bdf85e140c275fdf7f39b20e1393c381164f5b25662724663058a",
"",
"root"
],
[
"e",
"775a19aff0631d117bc02dba568bcaae3668aa62fb8829949bab4b824e496bc7",
"",
"reply"
],
[
"p",
"218238431393959d6c8617a3bd899303a96609b44a644e973891038a7de8622d"
],
[
"p",
"3bf0c63fcb93463407af97a5e5ee64fa883d107ef9e558472c4eb9aaaefa459d"
]
],
"content": "If we’re gonna go binary, then I’d prefer to just go full binary. WebSockets support binary mode. We could encode these messages using CBOR and suffer minimal loss on the wire. This would still be compatible with stream compression, AFAIK.\n\nEncoding binary data as a string can be completely avoided for this new message type, since both ends of the connection are expected to handle binary payloads anyway. The usual argument of avoiding a human-unreadable format is moot here, IMO.",
"sig": "fc0f3b0e54f1ad05d88ca725d6a1857800b5730edae45af6e7072821430a363a87f473df04699619b4216d5fa83e0bc934369978e1c523ead12506fff6b9e22b"
}