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
This commit is contained in:
fiatjaf 2022-06-09 15:29:46 -03:00
parent f367d820d4
commit 4d19ef128e
2 changed files with 5 additions and 5 deletions

2
01.md
View File

@ -38,7 +38,7 @@ To obtain the `event.id`, we `sha256` the serialized event. The serialization is
<pubkey, as a (lowercase) hex string>,
<created_at, as a number>,
<kind, as a number>,
<tags, as an array of arrays of strings>,
<tags, as an array of arrays of non-null strings>,
<content, as a string>
]
```

8
02.md
View File

@ -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>, <main relay URL>, <petname>]`. 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>, <main relay URL>, <petname>]`. 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"]
]
```