From 91bb09d1d374afbb6d5cffa25f5e71b6c7ad2a10 Mon Sep 17 00:00:00 2001 From: Thomas <31560900+0xtlt@users.noreply.github.com> Date: Sun, 4 Dec 2022 16:14:31 +0100 Subject: [PATCH 01/15] Create 40.md --- 40.md | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 40.md diff --git a/40.md b/40.md new file mode 100644 index 0000000..bede758 --- /dev/null +++ b/40.md @@ -0,0 +1,47 @@ +NIP suggestion for nostr: +NIP-40 +====== + +Expiration Timestamp +----------------------------------- + +`draft` `optional` `author:0xtlt` + +The `expiration` tag enables users to specify a timestamp at which the message should be considered expired and deleted by relays. This helps ensure that messages are not retained by the network after they are no longer relevant, which helps maintain the privacy of the messages. This is especially useful in cases where a replacement event is not available or feasible. + +#### Spec + +``` +tag: expiration +options: + - [timestamp]: required +``` + +#### Example + +```json +{ + "pubkey": "", + "created_at": 1000000000, + "kind": 1, + "tags": [ + ["expiration", 1600000000] + ], + "content": "This message will expire at the specified timestamp and be deleted by relays.\n", + "id": "" +} +``` + +Note: 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. + +Client Behavior +--------------- + +Clients 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. + +Suggested Use Cases +------------------- + +* Temporary announcements - This tag can be used to make temporary announcements that are automatically deleted from the network after a certain amount of time. For example, an event organizer could use this tag to post announcements about an upcoming event, and the announcements will be automatically deleted once the event is over. +* 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, and the offer will be automatically deleted from the network once the time has passed. +* Ephemeral messages - This tag can be used by individuals to send ephemeral messages that are automatically deleted from the network after a certain amount of time. For example, someone could use this tag to send a message that is only visible to the recipient for a short time, and the message will be automatically deleted once the time has passed. This can be useful for sending sensitive information that should not be retained on the network indefinitely. From 1bbae4d66b279bafad7304ddc8386f23bbaf3604 Mon Sep 17 00:00:00 2001 From: Thomas <31560900+0xtlt@users.noreply.github.com> Date: Sun, 4 Dec 2022 16:16:00 +0100 Subject: [PATCH 02/15] Update 40.md --- 40.md | 1 - 1 file changed, 1 deletion(-) diff --git a/40.md b/40.md index bede758..f3fabd4 100644 --- a/40.md +++ b/40.md @@ -1,4 +1,3 @@ -NIP suggestion for nostr: NIP-40 ====== From 2cb5ddd910c88ad82e1a34deae3e9fbaec0ee645 Mon Sep 17 00:00:00 2001 From: Thomas <31560900+0xtlt@users.noreply.github.com> Date: Wed, 7 Dec 2022 08:53:52 +0100 Subject: [PATCH 03/15] [timestamp] Add UNIX timestamp in seconds Co-authored-by: Leo Wandersleb --- 40.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/40.md b/40.md index f3fabd4..6c5ecf4 100644 --- a/40.md +++ b/40.md @@ -13,7 +13,7 @@ The `expiration` tag enables users to specify a timestamp at which the message s ``` tag: expiration options: - - [timestamp]: required + - [UNIX timestamp in seconds]: required ``` #### Example From a8caa033738bf73a35fc0b7812f138a1f4bef6f1 Mon Sep 17 00:00:00 2001 From: Thomas <31560900+0xtlt@users.noreply.github.com> Date: Sat, 10 Dec 2022 23:49:59 +0100 Subject: [PATCH 04/15] =?UTF-8?q?=F0=9F=93=9D=20Updated=20NIP?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 40.md | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/40.md b/40.md index f3fabd4..153309a 100644 --- a/40.md +++ b/40.md @@ -6,14 +6,15 @@ Expiration Timestamp `draft` `optional` `author:0xtlt` -The `expiration` tag enables users to specify a timestamp at which the message should be considered expired and deleted by relays. This helps ensure that messages are not retained by the network after they are no longer relevant, which helps maintain the privacy of the messages. This is especially useful in cases where a replacement event is not available or feasible. +The `expiration` tag enables users to specify a timestamp at UTC-0 at which the message should be considered expired and deleted by relays (or just ignored by clients). This can be useful for making temporary announcements, making limited-time offers, or sending ephemeral messages but should not be seen as a security solution for the content of your messages. +So be careful when sharing confidential information. #### Spec ``` tag: expiration options: - - [timestamp]: required + - [timestamp UTC-0]: required ``` #### Example @@ -38,9 +39,15 @@ Client Behavior Clients 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. +Clients MUST ignore events that have expired. + Suggested Use Cases ------------------- * Temporary announcements - This tag can be used to make temporary announcements that are automatically deleted from the network after a certain amount of time. For example, an event organizer could use this tag to post announcements about an upcoming event, and the announcements will be automatically deleted once the event is over. * 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, and the offer will be automatically deleted from the network once the time has passed. -* Ephemeral messages - This tag can be used by individuals to send ephemeral messages that are automatically deleted from the network after a certain amount of time. For example, someone could use this tag to send a message that is only visible to the recipient for a short time, and the message will be automatically deleted once the time has passed. This can be useful for sending sensitive information that should not be retained on the network indefinitely. +* Ephemeral messages - This tag can be used by individuals to send ephemeral messages that are automatically deleted from the network after a certain amount of time. For example, someone could use this tag to send a message that is only visible to the recipient for a short time, and the message will be automatically deleted by relays or/and ignored by clients once the time has passed. This can be useful for sensitive information that should not be retained on the network indefinitely. + +#### One last time, be careful! +The events could be downloaded by third parties as they are publicly accessible all the time on the relays. +So don't consider ephemeral messages as a security for your conversations or other uses. From 512aba18db9a21c1cb70566bdbfb4b1c0fa9a86c Mon Sep 17 00:00:00 2001 From: Thomas <31560900+0xtlt@users.noreply.github.com> Date: Mon, 12 Dec 2022 08:55:57 +0100 Subject: [PATCH 05/15] Update 40.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Ricardo Arturo Cabral Mejía --- 40.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/40.md b/40.md index 5f67732..b814012 100644 --- a/40.md +++ b/40.md @@ -25,7 +25,7 @@ options: "created_at": 1000000000, "kind": 1, "tags": [ - ["expiration", 1600000000] + ["expiration", "1600000000"] ], "content": "This message will expire at the specified timestamp and be deleted by relays.\n", "id": "" From 07f13674f1f63c684cd75a3c4c72c3d81e26a732 Mon Sep 17 00:00:00 2001 From: Thomas <31560900+0xtlt@users.noreply.github.com> Date: Wed, 14 Dec 2022 09:11:49 +0100 Subject: [PATCH 06/15] Update 40.md Co-authored-by: ok300 <106775972+ok300@users.noreply.github.com> --- 40.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/40.md b/40.md index b814012..2091a37 100644 --- a/40.md +++ b/40.md @@ -50,4 +50,4 @@ Suggested Use Cases #### One last time, be careful! The events could be downloaded by third parties as they are publicly accessible all the time on the relays. -So don't consider ephemeral messages as a security for your conversations or other uses. +So don't consider expiring messages as a security feature for your conversations or other uses. From 7aad54ae7ad4e843a410cb01017eeb5608983d3d Mon Sep 17 00:00:00 2001 From: Thomas <31560900+0xtlt@users.noreply.github.com> Date: Wed, 14 Dec 2022 09:12:15 +0100 Subject: [PATCH 07/15] Update 40.md Co-authored-by: ok300 <106775972+ok300@users.noreply.github.com> --- 40.md | 1 - 1 file changed, 1 deletion(-) diff --git a/40.md b/40.md index 2091a37..4af538c 100644 --- a/40.md +++ b/40.md @@ -46,7 +46,6 @@ Suggested Use Cases * Temporary announcements - This tag can be used to make temporary announcements that are automatically deleted from the network after a certain amount of time. For example, an event organizer could use this tag to post announcements about an upcoming event, and the announcements will be automatically deleted once the event is over. * 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, and the offer will be automatically deleted from the network once the time has passed. -* Ephemeral messages - This tag can be used by individuals to send ephemeral messages that are automatically deleted from the network after a certain amount of time. For example, someone could use this tag to send a message that is only visible to the recipient for a short time, and the message will be automatically deleted by relays or/and ignored by clients once the time has passed. This can be useful for sensitive information that should not be retained on the network indefinitely. #### One last time, be careful! The events could be downloaded by third parties as they are publicly accessible all the time on the relays. From e9553eef4db686116b1e7b73eda7fcb229565d4c Mon Sep 17 00:00:00 2001 From: Thomas <31560900+0xtlt@users.noreply.github.com> Date: Wed, 14 Dec 2022 09:12:44 +0100 Subject: [PATCH 08/15] Update 40.md Co-authored-by: ok300 <106775972+ok300@users.noreply.github.com> --- 40.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/40.md b/40.md index 4af538c..2448b6e 100644 --- a/40.md +++ b/40.md @@ -45,7 +45,7 @@ Suggested Use Cases ------------------- * Temporary announcements - This tag can be used to make temporary announcements that are automatically deleted from the network after a certain amount of time. For example, an event organizer could use this tag to post announcements about an upcoming event, and the announcements will be automatically deleted once the event is over. -* 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, and the offer will be automatically deleted from the network once the time has passed. +* 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. #### One last time, be careful! The events could be downloaded by third parties as they are publicly accessible all the time on the relays. From 26e518da670b0ea827390de3cccda1644548b716 Mon Sep 17 00:00:00 2001 From: Thomas <31560900+0xtlt@users.noreply.github.com> Date: Wed, 14 Dec 2022 09:15:44 +0100 Subject: [PATCH 09/15] Update 40.md --- 40.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/40.md b/40.md index 2448b6e..232da49 100644 --- a/40.md +++ b/40.md @@ -44,7 +44,7 @@ Clients MUST ignore events that have expired. Suggested Use Cases ------------------- -* Temporary announcements - This tag can be used to make temporary announcements that are automatically deleted from the network after a certain amount of time. For example, an event organizer could use this tag to post announcements about an upcoming event, and the announcements will be automatically deleted once the event is over. +* 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. * 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. #### One last time, be careful! From b859ae589b740f41ba41dab1e4bb003225db3478 Mon Sep 17 00:00:00 2001 From: Thomas <31560900+0xtlt@users.noreply.github.com> Date: Wed, 14 Dec 2022 09:18:52 +0100 Subject: [PATCH 10/15] Update 40.md --- 40.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/40.md b/40.md index 232da49..8aa9538 100644 --- a/40.md +++ b/40.md @@ -41,6 +41,12 @@ Clients SHOULD use the `supported_nips` field to learn if a relay supports this Clients MUST ignore events that have expired. +Relay Behavior +-------------- + +Relays SHOULD NOT delete an expired message immediately on expiration. Relays that wish to purge expired messages from their DB should allow for a grace period before deletion. For example, this could be 24h after event expiration. +Relays MAY choose to not delete expired messages. + Suggested Use Cases ------------------- From 8d3f5c6e79cc25a59e8148b6a98c1cac8f960159 Mon Sep 17 00:00:00 2001 From: Thomas <31560900+0xtlt@users.noreply.github.com> Date: Wed, 14 Dec 2022 23:52:12 +0100 Subject: [PATCH 11/15] Update 40.md --- 40.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/40.md b/40.md index 8aa9538..d99aef5 100644 --- a/40.md +++ b/40.md @@ -6,8 +6,7 @@ Expiration Timestamp `draft` `optional` `author:0xtlt` -The `expiration` tag enables users to specify a timestamp at UTC-0 at which the message should be considered expired and deleted by relays (or just ignored by clients). This can be useful for making temporary announcements, making limited-time offers, or sending ephemeral messages but should not be seen as a security solution for the content of your messages. -So be careful when sharing confidential information. +The `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. #### Spec @@ -39,7 +38,7 @@ Client Behavior Clients 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. -Clients MUST ignore events that have expired. +Clients SHOULD ignore events that have expired. Relay Behavior -------------- From 0d93f3033ecdc7dd0fe7ff1d5082156fe0d06aa0 Mon Sep 17 00:00:00 2001 From: Thomas <31560900+0xtlt@users.noreply.github.com> Date: Thu, 15 Dec 2022 19:58:40 +0100 Subject: [PATCH 12/15] Update 40.md Co-authored-by: Semisol <45574030+Semisol@users.noreply.github.com> --- 40.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/40.md b/40.md index d99aef5..d0174ea 100644 --- a/40.md +++ b/40.md @@ -43,8 +43,10 @@ Clients SHOULD ignore events that have expired. Relay Behavior -------------- -Relays SHOULD NOT delete an expired message immediately on expiration. Relays that wish to purge expired messages from their DB should allow for a grace period before deletion. For example, this could be 24h after event expiration. -Relays MAY choose to not delete expired messages. +Relays MAY NOT delete an expired message immediately on expiration and MAY persist them indefinitely. +Relays SHOULD NOT send expired events to clients, even if they are stored. +Relays SHOULD drop any events that are published to them if they are expired. +Relays SHOULD persist ephemeral events until their expiration timestamp if an ephemeral event has one, and relays MAY limit the amount of time an ephemeral event is persisted. Suggested Use Cases ------------------- From 2561c2d1e611b972e19453d88c0aae629d41acf3 Mon Sep 17 00:00:00 2001 From: Thomas <31560900+0xtlt@users.noreply.github.com> Date: Thu, 15 Dec 2022 19:59:17 +0100 Subject: [PATCH 13/15] Update 40.md --- 40.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/40.md b/40.md index d0174ea..ce06d57 100644 --- a/40.md +++ b/40.md @@ -12,7 +12,7 @@ The `expiration` tag enables users to specify a unix timestamp at which the mess ``` tag: expiration -options: +values: - [UNIX timestamp in seconds]: required ``` From 7ad1812b46ea6fca461f17d52d9c349ef931adc7 Mon Sep 17 00:00:00 2001 From: Thomas <31560900+0xtlt@users.noreply.github.com> Date: Thu, 15 Dec 2022 20:00:22 +0100 Subject: [PATCH 14/15] Update 40.md --- 40.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/40.md b/40.md index ce06d57..ca9eb0b 100644 --- a/40.md +++ b/40.md @@ -54,6 +54,6 @@ Suggested Use Cases * 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. * 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. -#### One last time, be careful! +#### Warning The events could be downloaded by third parties as they are publicly accessible all the time on the relays. So don't consider expiring messages as a security feature for your conversations or other uses. From 04a84aa5453ddce1dadcefba331fb1657447d600 Mon Sep 17 00:00:00 2001 From: Thomas <31560900+0xtlt@users.noreply.github.com> Date: Fri, 16 Dec 2022 12:03:07 +0100 Subject: [PATCH 15/15] Update 40.md Co-authored-by: Leo Wandersleb --- 40.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/40.md b/40.md index ca9eb0b..274ee80 100644 --- a/40.md +++ b/40.md @@ -46,7 +46,7 @@ Relay Behavior Relays MAY NOT delete an expired message immediately on expiration and MAY persist them indefinitely. Relays SHOULD NOT send expired events to clients, even if they are stored. Relays SHOULD drop any events that are published to them if they are expired. -Relays SHOULD persist ephemeral events until their expiration timestamp if an ephemeral event has one, and relays MAY limit the amount of time an ephemeral event is persisted. +An expiration timestamp does not affect storage of ephemeral events. Suggested Use Cases -------------------