diff options
Diffstat (limited to '01.md')
| -rw-r--r-- | 01.md | 10 |
1 files changed, 6 insertions, 4 deletions
| @@ -62,11 +62,13 @@ Each tag is an array of strings of arbitrary size, with some conventions around | |||
| 62 | 62 | ||
| 63 | The first element of the tag array is referred to as the tag _name_ or _key_ and the second as the tag _value_. So we can safely say that the event above has an `e` tag set to `"5c83da77af1dec6d7289834998ad7aafbd9e2191396d75ec3cc27f5a77226f36"`, an `alt` tag set to `"reply"` and so on. All elements after the second do not have a conventional name. | 63 | The first element of the tag array is referred to as the tag _name_ or _key_ and the second as the tag _value_. So we can safely say that the event above has an `e` tag set to `"5c83da77af1dec6d7289834998ad7aafbd9e2191396d75ec3cc27f5a77226f36"`, an `alt` tag set to `"reply"` and so on. All elements after the second do not have a conventional name. |
| 64 | 64 | ||
| 65 | This NIP defines 3 standard tags that can be used accross all event kinds with the same meaning. They are as follows: | 65 | This NIP defines 3 standard tags that can be used across all event kinds with the same meaning. They are as follows: |
| 66 | 66 | ||
| 67 | - The `e` tag, used to refer to an event: `["e", <32-bytes lowercase hex of the id of another event>, <recommended relay URL, optional>]` | 67 | - The `e` tag, used to refer to an event: `["e", <32-bytes lowercase hex of the id of another event>, <recommended relay URL, optional>]` |
| 68 | - The `p` tag, used to refer to another user: `["p", <32-bytes lowercase hex of a pubkey>, <recommended relay URL, optional>]` | 68 | - The `p` tag, used to refer to another user: `["p", <32-bytes lowercase hex of a pubkey>, <recommended relay URL, optional>]` |
| 69 | - The `a` tag, used to refer to a parameterized replaceable event: `["a", <kind integer>:<32-bytes lowercase hex of a pubkey>:<d tag value>, <recommended relay URL, optional>]` | 69 | - The `a` tag, used to refer to a (maybe parameterized) replaceable event |
| 70 | - for a parameterized replaceable event: `["a", <kind integer>:<32-bytes lowercase hex of a pubkey>:<d tag value>, <recommended relay URL, optional>]` | ||
| 71 | - for a non-parameterized replaceable event: `["a", <kind integer>:<32-bytes lowercase hex of a pubkey>:, <recommended relay URL, optional>]` | ||
| 70 | 72 | ||
| 71 | As a convention, all single-letter (only english alphabet letters: a-z, A-Z) key tags are expected to be indexed by relays, such that it is possible, for example, to query or subscribe to events that reference the event `"5c83da77af1dec6d7289834998ad7aafbd9e2191396d75ec3cc27f5a77226f36"` by using the `{"#e": "5c83da77af1dec6d7289834998ad7aafbd9e2191396d75ec3cc27f5a77226f36"}` filter. | 73 | As a convention, all single-letter (only english alphabet letters: a-z, A-Z) key tags are expected to be indexed by relays, such that it is possible, for example, to query or subscribe to events that reference the event `"5c83da77af1dec6d7289834998ad7aafbd9e2191396d75ec3cc27f5a77226f36"` by using the `{"#e": "5c83da77af1dec6d7289834998ad7aafbd9e2191396d75ec3cc27f5a77226f36"}` filter. |
| 72 | 74 | ||
| @@ -80,9 +82,9 @@ Kinds specify how clients should interpret the meaning of each event and the oth | |||
| 80 | And also a convention for kind ranges that allow for easier experimentation and flexibility of relay implementation: | 82 | And also a convention for kind ranges that allow for easier experimentation and flexibility of relay implementation: |
| 81 | 83 | ||
| 82 | - for kind `n` such that `1000 <= n < 10000`, events are **regular**, which means they're all expected to be stored by relays. | 84 | - for kind `n` such that `1000 <= n < 10000`, events are **regular**, which means they're all expected to be stored by relays. |
| 83 | - for kind `n` such that `10000 <= n < 20000 || k == 0 || k == 3`, events are **replaceable**, which means that, for each combination of `pubkey` and `kind`, only the latest event is expected to (SHOULD) be stored by relays, older versions are expected to be discarded. | 85 | - for kind `n` such that `10000 <= n < 20000 || n == 0 || n == 3`, events are **replaceable**, which means that, for each combination of `pubkey` and `kind`, only the latest event is expected to (SHOULD) be stored by relays, older versions are expected to be discarded. |
| 84 | - for kind `n` such that `20000 <= n < 30000`, events are **ephemeral**, which means they are not expected to be stored by relays. | 86 | - for kind `n` such that `20000 <= n < 30000`, events are **ephemeral**, which means they are not expected to be stored by relays. |
| 85 | - for kind `n` such that `30000 <= n < 40000`, events are **parameterized replaceable**, which means that, for each combination of `pubkey`, `kind` and the `d` tag, only the latest event is expected to be stored by relays, older versions are expected to be discarded. | 87 | - for kind `n` such that `30000 <= n < 40000`, events are **parameterized replaceable**, which means that, for each combination of `pubkey`, `kind` and the `d` tag's first value, only the latest event is expected to be stored by relays, older versions are expected to be discarded. |
| 86 | 88 | ||
| 87 | In case of replaceable events with the same timestamp, the event with the lowest id (first in lexical order) should be retained, and the other discarded. | 89 | In case of replaceable events with the same timestamp, the event with the lowest id (first in lexical order) should be retained, and the other discarded. |
| 88 | 90 | ||