upleb.uk

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

summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSemisol <hi@semisol.dev>2022-05-26 21:16:49 +0300
committerSemisol <hi@semisol.dev>2022-05-26 21:17:27 +0300
commit62fde6c098efa4fcbf57eae4321b346c21fc6687 (patch)
tree5a958b73b8e079f87f4324fd45229aca715f0394
parentc3d3a706881e7a733cc8373737b02aafa38a5024 (diff)
nip16: create draft
-rw-r--r--16.md33
1 files changed, 33 insertions, 0 deletions
diff --git a/16.md b/16.md
new file mode 100644
index 0000000..dd62aba
--- /dev/null
+++ b/16.md
@@ -0,0 +1,33 @@
1NIP-16
2======
3
4Event Treatment
5---------------
6
7`draft` `optional` `author:Semisol`
8
9Relays may decide to allow replaceable and/or ephemeral events.
10
11Replaceable Events
12------------------
13A *replaceable event* is defined as an event with a `replaceable` tag with value `1`. Relays SHOULD treat unknown types as if the event is not replaceable.
14Upon a replaceable event with a newer timestamp than the currently known latest replaceable event with the same kind, the old event SHOULD be discarded and replaced with the newer event.
15
16Ephemeral Events
17----------------
18An *ephemeral event* is defined as an event with an `ephemeral` tag with value `1`. Relays are RECOMMENDED to reject unknown types for future extensions.
19Upon an ephemeral event being received, the relay SHOULD send it to all clients with a matching filter, and MUST NOT store it.
20
21Client Behavior
22---------------
23
24Clients SHOULD use the `supported_nips` field to learn if a relay supports generic tag queries. Clients SHOULD NOT send ephemeral events to relays that do not support this NIP; they will be persisted. Clients MAY send 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.
25
26Clients are RECOMMENDED to ignore events without replaceability when requesting replaceable events.
27
28Suggested Use Cases
29-------------------
30
31* States: An application may create a state event that is replaced every time a new state is set (such as statuses)
32* Typing indicators: A chat application may use ephemeral events as a typing indicator.
33* Messaging: Two pubkeys can message over nostr using ephemeral events.