diff options
Diffstat (limited to '33.md')
| -rw-r--r-- | 33.md | 25 |
1 files changed, 23 insertions, 2 deletions
| @@ -10,10 +10,14 @@ This NIP adds a new event range that allows for replacement of events that have | |||
| 10 | 10 | ||
| 11 | Implementation | 11 | Implementation |
| 12 | -------------- | 12 | -------------- |
| 13 | The value of a tag is defined as the first parameter of a tag after the tag name. | ||
| 14 | |||
| 13 | A *parameterized replaceable event* is defined as an event with a kind `30000 <= n < 40000`. | 15 | A *parameterized replaceable event* is defined as an event with a kind `30000 <= n < 40000`. |
| 14 | Upon a parameterized replaceable event with a newer timestamp than the currently known latest | 16 | Upon a parameterized replaceable event with a newer timestamp than the currently known latest |
| 15 | replaceable event with the same kind and first `d` tag value being received, the old event | 17 | replaceable event with the same kind, author and first `d` tag value being received, the old event |
| 16 | SHOULD be discarded and replaced with the newer event. | 18 | SHOULD be discarded, effectively replacing what gets returned when querying for |
| 19 | `author:kind:d-tag` tuples. | ||
| 20 | |||
| 17 | A missing or a `d` tag with no value should be interpreted equivalent to a `d` tag with the | 21 | A missing or a `d` tag with no value should be interpreted equivalent to a `d` tag with the |
| 18 | value as an empty string. Events from the same author with any of the following `tags` | 22 | value as an empty string. Events from the same author with any of the following `tags` |
| 19 | replace each other: | 23 | replace each other: |
| @@ -24,6 +28,23 @@ replace each other: | |||
| 24 | * `"tags":[["d",""],["d","not empty"]]`: only first `d` tag is considered | 28 | * `"tags":[["d",""],["d","not empty"]]`: only first `d` tag is considered |
| 25 | * `"tags":[["d"],["d","some value"]]`: only first `d` tag is considered | 29 | * `"tags":[["d"],["d","some value"]]`: only first `d` tag is considered |
| 26 | * `"tags":[["e"]]`: same as no tags | 30 | * `"tags":[["e"]]`: same as no tags |
| 31 | * `"tags":[["d","","1"]]`: only the first value is considered (`""`) | ||
| 32 | |||
| 33 | Clients SHOULD NOT use `d` tags with multiple values and SHOULD include the `d` tag even if it has no value to allow querying using the `#d` filter. | ||
| 34 | |||
| 35 | Referencing and tagging | ||
| 36 | ----------------------- | ||
| 37 | |||
| 38 | Normally (as per NIP-01, NIP-12) the `"p"` tag is used for referencing public keys and the | ||
| 39 | `"e"` tag for referencing event ids and the `note`, `npub`, `nprofile` or `nevent` are their | ||
| 40 | equivalents for event tags (i.e. an `nprofile` is generally translated into a tag | ||
| 41 | `["p", "<event hex id>", "<relay url>"]`). | ||
| 42 | |||
| 43 | To support linking to parameterized replaceable events, the `naddr` code is introduced on | ||
| 44 | NIP-19. It includes the public key of the event author and the `d` tag (and relays) such that | ||
| 45 | the referenced combination of public key and `d` tag can be found. | ||
| 46 | |||
| 47 | The equivalent in `tags` to the `naddr` code is the tag `"a"`, comprised of `["a", "<kind>:<pubkey>:<d-identifier>", "<relay url>"]`. | ||
| 27 | 48 | ||
| 28 | Client Behavior | 49 | Client Behavior |
| 29 | --------------- | 50 | --------------- |