mirror of
https://github.com/nostr-protocol/nips.git
synced 2024-12-23 00:45:53 -05:00
Updates relationship status to use event sets.
This commit is contained in:
parent
89e812488d
commit
bae459a771
18
81.md
18
81.md
|
@ -12,7 +12,7 @@ Both kinds offer public and private tags to describe that relationship. Private
|
|||
|
||||
### 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
|
||||
{
|
||||
|
@ -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
|
||||
|
||||
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
|
||||
{
|
||||
"kind": 10008,
|
||||
"content": nip44Encrypt(JSON.stringify([
|
||||
["map", "<code>", "<name>"],
|
||||
["map", "<identifier>", "<name>"],
|
||||
["map", "bitcoiner", "bitcoiner"],
|
||||
["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
|
||||
|
||||
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
|
||||
{
|
||||
|
@ -63,8 +65,8 @@ For relationships that MUST remain private, Event kind `30383` uses a similar st
|
|||
["n", "6064460175057025"],
|
||||
],
|
||||
"content": nip44Encrypt(JSON.stringify([
|
||||
["p", "<pubkey>", "relay"],
|
||||
["n", "clients-list"],
|
||||
["p", "<pubkey>", "<relay url>"],
|
||||
["n", "client-list"],
|
||||
["petname", "<My buddy>"],
|
||||
["summary", "<Summary of the relationship>"],
|
||||
])),
|
||||
|
|
Loading…
Reference in New Issue
Block a user