From 4482a41d903de21e298bf727ee80ffba47223108 Mon Sep 17 00:00:00 2001 From: Vitor Pamplona Date: Tue, 19 Mar 2024 16:16:00 -0400 Subject: [PATCH] Creating two event kinds. --- 81.md | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/81.md b/81.md index eecca707..faf81c31 100644 --- a/81.md +++ b/81.md @@ -6,21 +6,22 @@ Relationship Status `draft` `optional` -Event `kind:30382` documents a "Relationship Status" between two keys and uses private and public tags to describe that relationship. +This NIP defines two new event kinds (`30382` and `30383`) to document the relationship between two keys. -Since statuses change over time, this event is defined as a _parameterized replaceable event_ with a single `d` tag that identifies the target key. +Both kinds offer public and private tags to describe that relationship. Private tags are JSON Stringified, [NIP-44](44.md)-encrypted to the signer's keys and placed inside the `.content` of the event. -When the relationship is public, the `d` tag is the same as the `p`-tag. +### Public Relationship Status + +Event kind `30382` is used when the relationship itself is public, with the `d` tag receiving the public key each target key. ```js { "kind": 30382, "tags": [ ["d", "e88a691e98d9987c964521dff60025f60700378a4879180dcbbb4a5027850411"], - ["n", "Follow"], + ["n", "Follows"], ["n", "Bitcoiners"], ["n", "6064460175057025"] - ["p", "e88a691e98d9987c964521dff60025f60700378a4879180dcbbb4a5027850411", ""], ], "content": nip44Encrypt(JSON.stringify([ ["petname", "NVK (Coldcard)"], @@ -30,9 +31,7 @@ When the relationship is public, the `d` tag is the same as the `p`-tag. } ``` -The private tags are JSON Stringified, [NIP-44](44.md)-encrypted to the signer's keys and placed inside the `.content` of the event. - -`petname` SHOULD be used instead of the person's display name in all interfaces +`petname` SHOULD be used instead of the person's display name in all interfaces. ### Relationship Categories @@ -54,13 +53,14 @@ List `codes` can be human readable or not. A new event kind named "Unbound List ### Private Relationship Status -For relationships that MUST remain private, a deterministic `d`-Tag is calculated using [NIP-44](44.md)'s `hkdf` function and a `sha256` hash between the signer's private key and the pubkey of the `p` tag. +For relationships that MUST remain private, Event kind `30383` uses a similar structure but with a hashed `d` tag using [NIP-44](44.md)'s `hkdf` function. ```js { - "kind": 30382, + "kind": 30383, "tags": [ ["d", sha256(hkdf(private_key, salt: 'nip81') || "")], + ["n", "6064460175057025"], ], "content": nip44Encrypt(JSON.stringify([ ["p", "", "relay"],