upleb.uk

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

summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfiatjaf <fiatjaf@gmail.com>2022-05-29 10:55:31 -0300
committerGitHub <noreply@github.com>2022-05-29 10:55:31 -0300
commit7536d44e9fdd4ed864213d9d2b9f65a20c791d3a (patch)
treea4326a076d3f28eccef8d0e717851ae38c738f43
parentc120b1746f63d2b70a0ce59873a460d77cada909 (diff)
parent501fd5ce2286e7e7f5e3d7d8b14697486309e7a8 (diff)
Merge pull request #11 from Semisol/nip16
NIP16: Event Treatment
-rw-r--r--16.md31
1 files changed, 31 insertions, 0 deletions
diff --git a/16.md b/16.md
new file mode 100644
index 0000000..dba1b9c
--- /dev/null
+++ b/16.md
@@ -0,0 +1,31 @@
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 kind `10000 <= n < 20000`.
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 a kind `20000 <= n < 30000`.
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 most likely 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
26Suggested Use Cases
27-------------------
28
29* States: An application may create a state event that is replaced every time a new state is set (such as statuses)
30* Typing indicators: A chat application may use ephemeral events as a typing indicator.
31* Messaging: Two pubkeys can message over nostr using ephemeral events.