Updates relationship status to use event sets.

This commit is contained in:
Vitor Pamplona 2024-05-10 20:01:11 -04:00
parent 89e812488d
commit bae459a771

18
81.md
View File

@ -12,7 +12,7 @@ Both kinds offer public and private tags to describe that relationship. Private
### Public Relationship Status ### 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. Event kind `30382` is used when the relationship itself is public. The `d` tag contains the target public key in hex.
```js ```js
{ {
@ -31,19 +31,21 @@ Event kind `30382` is used when the relationship itself is public, with the `d`
} }
``` ```
`petname` SHOULD be used instead of the person's display name in all interfaces. `petname` SHOULD be rendered instead of the person's display name in all interfaces when the signer of this event is logged in.
### Relationship Categories ### Relationship Categories
Optional `n` tags `["n", "<list code>"]` add the target key to unbound lists. This allows clients to query by `n` and download all members of a list. Optional `n` tags `["n", "<identifier>"]` add the target key to event sets. This allows clients to query by `n` and download all members of a set.
List `codes` can be human readable or not. A new event kind named "Unbound List Names" (`kind:10008`) uses `map` tags to display the list name. Clients SHOULD display the `name` instead of the `code` if the `code` is present in this list. Set `identifier` can be human readable and public or not.
For private cases, a new event kind named "Event Set Names" (`kind:10008`) uses `map` tags to store the set name. Clients SHOULD display the `name` instead of the `identifier` if the `identifier` is present in this event.
```js ```js
{ {
"kind": 10008, "kind": 10008,
"content": nip44Encrypt(JSON.stringify([ "content": nip44Encrypt(JSON.stringify([
["map", "<code>", "<name>"], ["map", "<identifier>", "<name>"],
["map", "bitcoiner", "bitcoiner"], ["map", "bitcoiner", "bitcoiner"],
["map", "6064460175057025", "debtor"] ["map", "6064460175057025", "debtor"]
])), ])),
@ -53,7 +55,7 @@ List `codes` can be human readable or not. A new event kind named "Unbound List
### Private Relationship Status ### Private Relationship Status
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. For relationships that must remain private (e.g private follows, client lists, etc), the event kind `30383` uses a similar structure but with a hashed `d` tag using [NIP-44](44.md)'s `hkdf` function.
```js ```js
{ {
@ -63,8 +65,8 @@ For relationships that MUST remain private, Event kind `30383` uses a similar st
["n", "6064460175057025"], ["n", "6064460175057025"],
], ],
"content": nip44Encrypt(JSON.stringify([ "content": nip44Encrypt(JSON.stringify([
["p", "<pubkey>", "relay"], ["p", "<pubkey>", "<relay url>"],
["n", "clients-list"], ["n", "client-list"],
["petname", "<My buddy>"], ["petname", "<My buddy>"],
["summary", "<Summary of the relationship>"], ["summary", "<Summary of the relationship>"],
])), ])),