upleb.uk

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

summaryrefslogtreecommitdiff
path: root/33.md
diff options
context:
space:
mode:
Diffstat (limited to '33.md')
-rw-r--r--33.md48
1 files changed, 2 insertions, 46 deletions
diff --git a/33.md b/33.md
index 10681fa..337a1f9 100644
--- a/33.md
+++ b/33.md
@@ -4,50 +4,6 @@ NIP-33
4Parameterized Replaceable Events 4Parameterized Replaceable Events
5-------------------------------- 5--------------------------------
6 6
7`draft` `optional` `author:Semisol` `author:Kukks` `author:Cameri` `author:Giszmo` 7`final` `mandatory`
8 8
9This NIP adds a new event range that allows for replacement of events that have the same `d` tag and kind unlike NIP-16 which only replaced by kind. 9Moved to [NIP-01](01.md).
10
11Implementation
12--------------
13The value of a tag is defined as the first parameter of a tag after the tag name.
14
15A *parameterized replaceable event* is defined as an event with a kind `30000 <= n < 40000`.
16Upon a parameterized replaceable event with a newer timestamp than the currently known latest
17replaceable event with the same kind, author and first `d` tag value being received, the old event
18SHOULD be discarded, effectively replacing what gets returned when querying for
19`author:kind:d-tag` tuples.
20
21A missing or a `d` tag with no value should be interpreted equivalent to a `d` tag with the
22value as an empty string. Events from the same author with any of the following `tags`
23replace each other:
24
25* `"tags":[["d",""]]`
26* `"tags":[]`: implicit `d` tag with empty value
27* `"tags":[["d"]]`: implicit empty value `""`
28* `"tags":[["d",""],["d","not empty"]]`: only first `d` tag is considered
29* `"tags":[["d"],["d","some value"]]`: only first `d` tag is considered
30* `"tags":[["e"]]`: same as no tags
31* `"tags":[["d","","1"]]`: only the first value is considered (`""`)
32
33Clients 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
35Referencing and tagging
36-----------------------
37
38Normally (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
40equivalents for event tags (i.e. an `nprofile` is generally translated into a tag
41`["p", "<event hex id>", "<relay url>"]`).
42
43To support linking to parameterized replaceable events, the `naddr` code is introduced on
44NIP-19. It includes the public key of the event author and the `d` tag (and relays) such that
45the referenced combination of public key and `d` tag can be found.
46
47The equivalent in `tags` to the `naddr` code is the tag `"a"`, comprised of `["a", "<kind>:<pubkey>:<d-identifier>", "<relay url>"]`.
48
49Client Behavior
50---------------
51
52Clients SHOULD use the `supported_nips` field to learn if a relay supports this NIP.
53Clients MAY send parameterized replaceable events to relays that may not support this NIP, and clients querying SHOULD be prepared for the relay to send multiple events and should use the latest one and are recommended to send a `#d` tag filter. Clients should account for the fact that missing `d` tags or ones with no value are not returned in tag filters, and are recommended to always include a `d` tag with a value.