diff options
Diffstat (limited to '01.md')
| -rw-r--r-- | 01.md | 13 |
1 files changed, 6 insertions, 7 deletions
| @@ -14,7 +14,7 @@ Each user has a keypair. Signatures, public key, and encodings are done accordin | |||
| 14 | 14 | ||
| 15 | The only object type that exists is the `event`, which has the following format on the wire: | 15 | The only object type that exists is the `event`, which has the following format on the wire: |
| 16 | 16 | ||
| 17 | ```json | 17 | ```jsonc |
| 18 | { | 18 | { |
| 19 | "id": <32-bytes lowercase hex-encoded sha256 of the serialized event data>, | 19 | "id": <32-bytes lowercase hex-encoded sha256 of the serialized event data>, |
| 20 | "pubkey": <32-bytes lowercase hex-encoded public key of the event creator>, | 20 | "pubkey": <32-bytes lowercase hex-encoded public key of the event creator>, |
| @@ -22,7 +22,7 @@ The only object type that exists is the `event`, which has the following format | |||
| 22 | "kind": <integer between 0 and 65535>, | 22 | "kind": <integer between 0 and 65535>, |
| 23 | "tags": [ | 23 | "tags": [ |
| 24 | [<arbitrary string>...], | 24 | [<arbitrary string>...], |
| 25 | ... | 25 | // ... |
| 26 | ], | 26 | ], |
| 27 | "content": <arbitrary string>, | 27 | "content": <arbitrary string>, |
| 28 | "sig": <64-bytes lowercase hex of the signature of the sha256 hash of the serialized event data, which is the same as the "id" field> | 28 | "sig": <64-bytes lowercase hex of the signature of the sha256 hash of the serialized event data, which is the same as the "id" field> |
| @@ -58,17 +58,16 @@ To prevent implementation differences from creating a different event ID for the | |||
| 58 | 58 | ||
| 59 | Each tag is an array of strings of arbitrary size, with some conventions around them. Take a look at the example below: | 59 | Each tag is an array of strings of arbitrary size, with some conventions around them. Take a look at the example below: |
| 60 | 60 | ||
| 61 | ```json | 61 | ```jsonc |
| 62 | { | 62 | { |
| 63 | ..., | ||
| 64 | "tags": [ | 63 | "tags": [ |
| 65 | ["e", "5c83da77af1dec6d7289834998ad7aafbd9e2191396d75ec3cc27f5a77226f36", "wss://nostr.example.com"], | 64 | ["e", "5c83da77af1dec6d7289834998ad7aafbd9e2191396d75ec3cc27f5a77226f36", "wss://nostr.example.com"], |
| 66 | ["p", "f7234bd4c1394dda46d09f35bd384dd30cc552ad5541990f98844fb06676e9ca"], | 65 | ["p", "f7234bd4c1394dda46d09f35bd384dd30cc552ad5541990f98844fb06676e9ca"], |
| 67 | ["a", "30023:f7234bd4c1394dda46d09f35bd384dd30cc552ad5541990f98844fb06676e9ca:abcd", "wss://nostr.example.com"], | 66 | ["a", "30023:f7234bd4c1394dda46d09f35bd384dd30cc552ad5541990f98844fb06676e9ca:abcd", "wss://nostr.example.com"], |
| 68 | ["alt", "reply"], | 67 | ["alt", "reply"], |
| 69 | ... | 68 | // ... |
| 70 | ], | 69 | ], |
| 71 | ... | 70 | // ... |
| 72 | } | 71 | } |
| 73 | ``` | 72 | ``` |
| 74 | 73 | ||
| @@ -125,7 +124,7 @@ Clients can send 3 types of messages, which must be JSON arrays, according to th | |||
| 125 | "ids": <a list of event ids>, | 124 | "ids": <a list of event ids>, |
| 126 | "authors": <a list of lowercase pubkeys, the pubkey of an event must be one of these>, | 125 | "authors": <a list of lowercase pubkeys, the pubkey of an event must be one of these>, |
| 127 | "kinds": <a list of a kind numbers>, | 126 | "kinds": <a list of a kind numbers>, |
| 128 | "#<single-letter (a-zA-Z)>": <a list of tag values, for #e — a list of event ids, for #p — a list of event pubkeys etc>, | 127 | "#<single-letter (a-zA-Z)>": <a list of tag values, for #e — a list of event ids, for #p — a list of pubkeys, etc.>, |
| 129 | "since": <an integer unix timestamp in seconds, events must be newer than this to pass>, | 128 | "since": <an integer unix timestamp in seconds, events must be newer than this to pass>, |
| 130 | "until": <an integer unix timestamp in seconds, events must be older than this to pass>, | 129 | "until": <an integer unix timestamp in seconds, events must be older than this to pass>, |
| 131 | "limit": <maximum number of events relays SHOULD return in the initial query> | 130 | "limit": <maximum number of events relays SHOULD return in the initial query> |