mirror of
https://github.com/nostr-protocol/nips.git
synced 2024-12-23 00:45:53 -05:00
formatting
This commit is contained in:
parent
c31a5043a3
commit
6868e029f9
24
81.md
24
81.md
|
@ -6,17 +6,13 @@ Relationship Status
|
|||
|
||||
`draft` `optional`
|
||||
|
||||
Event `kind:30382` documents a "Relationship Status" between two pubkeys and uses private and public tags to enhance the description of that relationship.
|
||||
Event `kind:30382` documents a "Relationship Status" between two pubkeys and uses private and public tags to enhance the description of that relationship. Since statuses change over time, this event is defined as a _parameterized replaceable event_ with a single `d` tag that identifies each pair of keys.
|
||||
|
||||
Since statuses change over time, this event is defined as a _parameterized replaceable event_ with a single `d` tag as a random UUID per pubkey.
|
||||
Optional `n` tags add the target key to unbound lists.
|
||||
|
||||
Optional `n` tags add the target key to an unbound list.
|
||||
The private tags are JSON Stringified, [NIP-44](44.md)-encrypted and placed inside the `.content` of the event.
|
||||
|
||||
The private tags are stringified, NIP-44-encrypted and placed inside the `.content` of the event.
|
||||
|
||||
Examples:
|
||||
|
||||
Public Status
|
||||
Example of public Status
|
||||
|
||||
```js
|
||||
{
|
||||
|
@ -35,7 +31,7 @@ Public Status
|
|||
}
|
||||
```
|
||||
|
||||
Private Status
|
||||
Example of private Status
|
||||
|
||||
```js
|
||||
{
|
||||
|
@ -70,18 +66,18 @@ Clients MAY hide human readable `n`-tags behind a code and list their code maps
|
|||
"content": nip44Encrypt(JSON.stringify([
|
||||
["n_name", "<Code used in other events>", "<Name>"],
|
||||
["n_name", "Clients", "Clients"] // public list of my Clients
|
||||
["n_name", "6064460175057025", "Idiot"] // private list of idiots
|
||||
["n_name", "6064460175057025", "Idiots"] // private list of idiots
|
||||
])),
|
||||
// ...other fields
|
||||
}
|
||||
```
|
||||
|
||||
### Deterministic `d`-Tag.
|
||||
### Deterministic `d`-Tags.
|
||||
|
||||
For private use cases that must contain deterministic d-Tags, the recommendation is to use NIP-44's `hkdf` function and use a hash between the user's private key and the pubkey of the `p` tag.
|
||||
For private use cases that must contain deterministic d-Tags, the recommendation is to use [NIP-44](44.md)'s `hkdf` function and use a hash between the user's private key and the pubkey of the `p` tag.
|
||||
|
||||
```
|
||||
nip81_key = hkdf(private_key, salt: 'nip81')
|
||||
bobs_tag = sha256(nip81_key || bobs_pub)
|
||||
kates_tag = sha256(nip81_key || kates_pub)
|
||||
bobs_d_tag = sha256(nip81_key || bobs_pub)
|
||||
kates_d_tag = sha256(nip81_key || kates_pub)
|
||||
```
|
Loading…
Reference in New Issue
Block a user