clone

every nostr nip as a chapter of an illustrated, early-2000s printed game manual

main
nip.guide / source-nips / 40.md
40.md 2.0K rendered
1NIP-402======34Expiration Timestamp5--------------------67`draft` `optional` `relay`89The `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.1011#### Spec1213```14tag: expiration15values:16 - [UNIX timestamp in seconds]: required17```1819#### Example2021```json22{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```3334Note: 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.3536Client Behavior37---------------3839Clients 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.4041Clients SHOULD ignore events that have expired.4243Relay Behavior44--------------4546Relays MAY NOT delete expired messages 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.5051Suggested Use Cases52-------------------5354* 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.5657#### Warning58The 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.