From 018c45966e4fbd21f26718e4ca17a9e16f36bb31 Mon Sep 17 00:00:00 2001 From: Semisol <45574030+Semisol@users.noreply.github.com> Date: Wed, 4 Jan 2023 16:20:27 +0300 Subject: [PATCH] Add NIP-33 Parameterized replaceable events (#54) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Semisol <45574030+Semisol@users.noreply.github.com> Co-authored-by: Ricardo Arturo Cabral Mejía --- 33.md | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 33.md diff --git a/33.md b/33.md new file mode 100644 index 00000000..feb62a6c --- /dev/null +++ b/33.md @@ -0,0 +1,32 @@ +NIP-33 +====== + +Parameterized Replaceable Events +-------------------------------- + +`draft` `optional` `author:Semisol` `author:Kukks` `author:Cameri` `author:fiatjaf` + +This 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. + +Implementation +-------------- +A *parameterized replaceable event* is defined as an event with a kind `30000 <= n < 40000`. +Upon a parameterized replaceable event with a newer timestamp than the currently known latest +replaceable event with the same kind and first `d` tag value being received, the old event +SHOULD be discarded and replaced with the newer event. +A missing or a `d` tag with no value should be interpreted equivalent to a `d` tag with the +value as an empty string. Events from the same author with any of the following `tags` +replace each other: + +* `"tags":[["d",""]]` +* `"tags":[]`: implicit `d` tag with empty value +* `"tags":[["d"]]`: implicit empty value `""` +* `"tags":[["d",""],["d","not empty"]]`: only first `d` tag is considered +* `"tags":[["d"],["d","some value"]]`: only first `d` tag is considered +* `"tags":[["e"]]`: same as no tags + +Client Behavior +--------------- + +Clients SHOULD use the `supported_nips` field to learn if a relay supports this NIP. +Clients 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.