upleb.uk

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

summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--40.md59
1 files changed, 59 insertions, 0 deletions
diff --git a/40.md b/40.md
new file mode 100644
index 0000000..274ee80
--- /dev/null
+++ b/40.md
@@ -0,0 +1,59 @@
1NIP-40
2======
3
4Expiration Timestamp
5-----------------------------------
6
7`draft` `optional` `author:0xtlt`
8
9The `expiration` tag enables users to specify a unix timestamp at which the message SHOULD be considered expired (by relays and clients) and SHOULD be deleted by relays.
10
11#### Spec
12
13```
14tag: expiration
15values:
16 - [UNIX timestamp in seconds]: required
17```
18
19#### Example
20
21```json
22{
23 "pubkey": "<pub-key>",
24 "created_at": 1000000000,
25 "kind": 1,
26 "tags": [
27 ["expiration", "1600000000"]
28 ],
29 "content": "This message will expire at the specified timestamp and be deleted by relays.\n",
30 "id": "<event-id>"
31}
32```
33
34Note: The timestamp should be in the same format as the created_at timestamp and should be interpreted as the time at which the message should be deleted by relays.
35
36Client Behavior
37---------------
38
39Clients SHOULD use the `supported_nips` field to learn if a relay supports this NIP. Clients SHOULD NOT send expiration events to relays that do not support this NIP.
40
41Clients SHOULD ignore events that have expired.
42
43Relay Behavior
44--------------
45
46Relays MAY NOT delete an expired message immediately on expiration and MAY persist them indefinitely.
47Relays SHOULD NOT send expired events to clients, even if they are stored.
48Relays SHOULD drop any events that are published to them if they are expired.
49An expiration timestamp does not affect storage of ephemeral events.
50
51Suggested Use Cases
52-------------------
53
54* Temporary announcements - This tag can be used to make temporary announcements. For example, an event organizer could use this tag to post announcements about an upcoming event.
55* Limited-time offers - This tag can be used by businesses to make limited-time offers that expire after a certain amount of time. For example, a business could use this tag to make a special offer that is only available for a limited time.
56
57#### Warning
58The events could be downloaded by third parties as they are publicly accessible all the time on the relays.
59So don't consider expiring messages as a security feature for your conversations or other uses.