From 4d19ef128e9e1bacc7ea102dd314afd41e20fc69 Mon Sep 17 00:00:00 2001 From: fiatjaf Date: Thu, 9 Jun 2022 15:29:46 -0300 Subject: [PATCH] update nip-02 to disallow `null`, only allow strings in tags. fixes https://github.com/nostr-protocol/nips/pull/15 fixes https://github.com/fiatjaf/nostr-army-knife/issues/2 fixes https://github.com/fiatjaf/relayer/issues/3 --- 01.md | 2 +- 02.md | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/01.md b/01.md index 8bf7fc3..3fd1cdc 100644 --- a/01.md +++ b/01.md @@ -38,7 +38,7 @@ To obtain the `event.id`, we `sha256` the serialized event. The serialization is , , , - , + , ] ``` diff --git a/02.md b/02.md index ae3afb8..7309dd5 100644 --- a/02.md +++ b/02.md @@ -8,7 +8,7 @@ Contact List and Petnames A special event with kind `3`, meaning "contact list" is defined as having a list of `p` tags, one for each of the followed/known profiles one is following. -Each tag entry should contain the key for the profile, a relay URL where events from that key can be found (can be set to `null` or a invalid string if not needed), and a local name (or "petname") for that profile (can also be set to `null`), i.e., `["p", <32-bytes hex key>,
, ]`. The `content` can be anything and should be ignored. +Each tag entry should contain the key for the profile, a relay URL where events from that key can be found (can be set to an empty string if not needed), and a local name (or "petname") for that profile (can also be set to an empty string or not provided), i.e., `["p", <32-bytes hex key>,
, ]`. The `content` can be anything and should be ignored. For example: @@ -48,7 +48,7 @@ A user has an internal contact list that says ```json [ - ["p", "21df6d143fb96c2ec9d63726bf9edc71", null, "erin"] + ["p", "21df6d143fb96c2ec9d63726bf9edc71", "", "erin"] ] ``` @@ -56,7 +56,7 @@ And receives two contact lists, one from `21df6d143fb96c2ec9d63726bf9edc71` that ```json [ - ["p", "a8bb3d884d5d90b413d9891fe4c4e46d", null, "david"] + ["p", "a8bb3d884d5d90b413d9891fe4c4e46d", "", "david"] ] ``` @@ -64,7 +64,7 @@ and another from `a8bb3d884d5d90b413d9891fe4c4e46d` that says ```json [ - ["p", "f57f54057d2a7af0efecc8b0b66f5708", null, "frank"] + ["p", "f57f54057d2a7af0efecc8b0b66f5708", "", "frank"] ] ```