What is Nostr?
mleku
npub1fjq…leku
2024-10-08 06:19:57
in reply to nevent1q…9g29

mleku on Nostr: lol what you don't understand is that CBOR has a lot of extra metadata in it and we ...

lol

what you don't understand is that CBOR has a lot of extra metadata in it and we have exactly two primary data types, the event and filter, and the envelopes, which are mostly just a few fields and an event or filter or array of such

the extra data wasted by this and the processing time required on both ends of the process could be left out

i say that if we have a binary wire ercoding for nostr, it should be one that is designed precisely for our purpose

you can literally encode events and filters without any metadata fields because they are such simple structures

you probably know what the structure for a canonical event array, the `[0,"pubkey",...]` structure, this is the event without the detachable elements

just make the same thing except in hex, put a versioned magic string at the front, and the fields are either varints for numbers, binary for hex, and length prefix for strings, and you know exactly what they are... the tags the first value is a varint representing the number of tags, and then each tag has a number of fields prefix, and each field has a number of characters prefix

it's so damn simple it's insane to use some complicated nonsense that is going to be 100x slower and use more data on the wire than a simple binary format
Author Public Key
npub1fjqqy4a93z5zsjwsfxqhc2764kvykfdyttvldkkkdera8dr78vhsmmleku