diff --git a/01.md b/01.md index 3fd1cdcb..e0def1ea 100644 --- a/01.md +++ b/01.md @@ -14,7 +14,7 @@ Each user has a keypair. Signatures, public key and encodings are done according The only object type that exists is the `event`, which has the following format on the wire: -``` +```json { "id": <32-bytes sha256 of the the serialized event data> "pubkey": <32-bytes hex-encoded public key of the event creator>, @@ -24,15 +24,15 @@ The only object type that exists is the `event`, which has the following format ["e", <32-bytes hex of the id of another event>, ], ["p", <32-bytes hex of the key>, ], ... // other kinds of tags may be included later - ] + ], "content": , - "sig": <64-bytes signature of the sha256 hash of the serialized event data, which is the same as the "id" field>, + "sig": <64-bytes signature of the sha256 hash of the serialized event data, which is the same as the "id" field> } ``` To obtain the `event.id`, we `sha256` the serialized event. The serialization is done over the UTF-8 JSON-serialized string (with no indentation or extra spaces) of the following structure: -``` +```json [ 0, , @@ -51,15 +51,15 @@ Relays expose a websocket endpoint to which clients can connect. Clients can send 3 types of messages, which must be JSON arrays, according to the following patterns: - * `["EVENT", `], used to publish events. - * `["REQ", , ...`], used to request events and subscribe to new updates. + * `["EVENT", ]`, used to publish events. + * `["REQ", , ...]`, used to request events and subscribe to new updates. * `["CLOSE", ]`, used to stop previous subscriptions. `` is a random string that should be used to represent a subscription. `` is a JSON object that determines what events will be sent in that subscription, it can have the following attributes: -``` +```json { "ids": , "authors": ,