mirror of
https://github.com/nostr-protocol/nips.git
synced 2024-09-19 22:35:50 -04:00
NIP-51: add "encrypted" tag
This commit is contained in:
parent
d3b47d1982
commit
02e6757c61
15
51.md
15
51.md
|
@ -8,7 +8,7 @@ Lists
|
|||
|
||||
This NIP defines lists of things that users can create. Lists can contain references to anything, and these references can be **public** or **private**.
|
||||
|
||||
Public items in a list are specified in the event `tags` array, while private items are specified in a JSON array that mimics the structure of the event `tags` array, but stringified and encrypted using the same scheme from [NIP-04](04.md) (the shared key is computed using the author's public and private key) and stored in the `.content`.
|
||||
Public items in a list are specified in the event `tags` array, while private items are specified in a JSON array that mimics the structure of the event `tags` array, but stringified and encrypted (see the "Encryption" section below) and stored in the `.content`.
|
||||
|
||||
When new items are added to an existing list, clients SHOULD append them to the end of the list, so they are stored in chronological order.
|
||||
|
||||
|
@ -131,7 +131,18 @@ Some clients have used these lists in the past, but they should work on transiti
|
|||
}
|
||||
```
|
||||
|
||||
## Encryption process pseudocode
|
||||
## Encryption
|
||||
|
||||
If the event content is non-empty, the list content is an encrypted JSON tag array. The data is encrypted using the author's public and private keys.
|
||||
|
||||
An optional `["encrypted", <encryption>]` tag may be included, where encryption is one of:
|
||||
|
||||
- `nip04` - NIP-04 encryption
|
||||
- `nip44` - NIP-44 encryption
|
||||
|
||||
If the tag is not included, the encryption method is assumed to be NIP-04 for backwards-compatibility.
|
||||
|
||||
### Pseudocode
|
||||
|
||||
```scala
|
||||
val private_items = [
|
||||
|
|
Loading…
Reference in New Issue
Block a user