-

@ mleku
2025-06-07 08:40:47
so, i'm in the process of trying to write code to generate database indexes out of events, and hitting up against a problem related to standard Go json marshal mangling the event content and tags fields with its default html and unicode escapes.
i wrote a whole complex of event parsing that i'm certain is correct to the spec for realy and i kinda hoped i could just do this with the standard libraries but i can't.
and it's got me thinking, ok, i wrote all this nice code so far that does nice things but then i hit up against this issue that json marshal/unmarshal libraries are highly variable and create encodings that don't return the same json as they receive from "standard" nip-01 spec
and you know what
i'm over it
fuck json.
the string quoting regime is completely inconsistent across implementations and that's fine until you need a stable set of bytes to do cryptographic signatures on it. then you become dependent on reference libraries for nostr to enable actually encoding, decoding, and verifying nostr events.
i'm gonna put a pause on my work right now because of this insanity, i mean, what do i do at this point?
this has a broad impact in that it affects lots of things, i need to have standardised nip-01 things to do tag indexes and get standard hashes out of events that therefore have to be re-encoded correctly so they are the same as what was received and i wrote all this code and i think it's fair to say that these two parts have been the absolutely most time consuming part of implementing nostr.
so, actually. my intuition says, fuck this shit, i am just going to make a whole new protocol. i keep coming and going with this idea and realising just how deep the complexity is for handling json strings, and how i can't do this according to shitty implementations that have quirks ...
>_< i need a pause