upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/01.md
diff options
context:
space:
mode:
authorSemisol <45574030+Semisol@users.noreply.github.com>2023-07-03 18:02:15 +0300
committerGitHub <noreply@github.com>2023-07-03 18:02:15 +0300
commitb5a7b67d78ad2b8ea52d81704be6b71a9cc80dac (patch)
tree499d9c89eaea7e4f3108e717873d00de334362c0 /01.md
parente0fc913719aae2ed1b10884e80f085218738f65d (diff)
Clarify JSON serialization for the `id` field
Diffstat (limited to '01.md')
-rw-r--r--01.md10
1 files changed, 9 insertions, 1 deletions
diff --git a/01.md b/01.md
index 2ff81eb..9258d2f 100644
--- a/01.md
+++ b/01.md
@@ -30,7 +30,7 @@ The only object type that exists is the `event`, which has the following format
30} 30}
31``` 31```
32 32
33To obtain the `event.id`, we `sha256` the serialized event. The serialization is done over the UTF-8 JSON-serialized string (with no white space or line breaks) of the following structure: 33To obtain the `event.id`, we `sha256` the serialized event. The serialization is done over the UTF-8 JSON-serialized string (which is described below) of the following structure:
34 34
35```json 35```json
36[ 36[
@@ -43,6 +43,14 @@ To obtain the `event.id`, we `sha256` the serialized event. The serialization is
43] 43]
44``` 44```
45 45
46To prevent implementation differences from creating a different event ID for the same event, the following rules MUST be followed while serializing:
47- No whitespace, line breaks or other unnecessary formatting should be included in the output JSON.
48- No characters except the following should be escaped, and instead should be included verbatim:
49 - The line break, `0x0A`, as `\n`
50 - A double quote, `0x22`, as `\"`
51 - A backspace, `0x5C`, as `\\`
52- UTF-8 should be used for encoding.
53
46## Communication between clients and relays 54## Communication between clients and relays
47 55
48Relays expose a websocket endpoint to which clients can connect. 56Relays expose a websocket endpoint to which clients can connect.