From d1b6bdb18e522fa34ff7cfec3d56318da596fdff Mon Sep 17 00:00:00 2001 From: Jeff Thibault Date: Fri, 22 Jul 2022 12:53:54 -0400 Subject: [PATCH] add relay logic --- 22.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/22.md b/22.md index df5da822..0192307d 100644 --- a/22.md +++ b/22.md @@ -21,3 +21,11 @@ Motivation The motivation for this NIP is to prevent clients from saying they published an event *significantly* earlier than they actually did or saying they published an event in the future. The event `created_at` field is just a unix timestamp (integer) so one could set it to a time in the past or future. For example, the `created_at` field could be set to a time 10 years ago even though it was created today and it could still be a valid event. One could also set the `created_at` field to a time 10 years in the future and it could still be a valid event. This NIP aims to set a maximum amount of time elapsed between when an event was created and when it was *actually* published and prevent events from being from the future. + +Relay Logic +----------- + +``` +if time.now - event.created_at > limit OR event.created_at > time.now: + send NOTICE +```