“therefore it has weird and unnecessary quirks like signing a JSON string which must strictly follow the rules of ECMA-262 6th Edition” It's hilarious how many things the original nostr readme was clearly wrong about. Round-tripping is such an obvious problem to anyone who has ever worked on crypto codebases, and it has caused lots of problems for nostr implementations.

Replies (4)

Why should you have to rigorously store exactly the same string every single time? The fact that people keep running into this issue shows that not taking round tripping into account is nuts. Bitcoin does _not_ work this way. Serialization is tightly defined and you can easily and reliably re-serialize data structures reliably.
Yess, I was just trying to get around the issues in the current scheme, but nip01 actually specifies the order of the keys in the event structure right? I think it is at least a little detailed on how to avoid ambiguity in the serialization infact the event id is a sha256 of a JSON array and not an object, it also details on how to escape special characters, whuch should resolve most of the ambiguities right?