ynniv on Nostr: JSON is just an encoding. For nostr it's necessary to produce this encoding in order ...
JSON is just an encoding. For nostr it's necessary to produce this encoding in order to verify the signature, but if your medium is constrained, there's no reason you can't define a new encoding. Nostr timestamps are unix timestamps: the essential information in them is four bytes. For essential fields you can just declare an ordering: they need to be there, this is the order, this is their size etc. A receiver would then reconstruct the JSON object based on the format, and then be able to verify the signature.
Published at
2025-03-02 04:25:51Event JSON
{
"id": "cd5bbe71bcc04edb6a4eb3e631c823bcbfcbe6cd69c64456ca12338fa2f64142",
"pubkey": "576d23dc3db2056d208849462fee358cf9f0f3310a2c63cb6c267a4b9f5848f9",
"created_at": 1740889551,
"kind": 1,
"tags": [
[
"e",
"797109e6f3daa051c3afb31a60187e6f9343714b6328bb79327b1eb2a534d6c3",
"",
"root"
],
[
"e",
"9591d4a511539bec9d1a552c3df4ae020ac37d9c55dd58e70c3851f911d24736",
"",
"reply"
],
[
"p",
"e3aefda887252a72cee3578d33b2dcd90e9fe53b8bed6347ef5e26f74211adbb"
]
],
"content": "JSON is just an encoding. For nostr it's necessary to produce this encoding in order to verify the signature, but if your medium is constrained, there's no reason you can't define a new encoding. Nostr timestamps are unix timestamps: the essential information in them is four bytes. For essential fields you can just declare an ordering: they need to be there, this is the order, this is their size etc. A receiver would then reconstruct the JSON object based on the format, and then be able to verify the signature.",
"sig": "4aa15016b1125ac3c635222964df339a652a66c874781f4db11bee06c9244c7c6c663f41351872b4e467ab545172dd1dfd464a1102fa1c3efa69b885ae8a66cd"
}