diff --git a/51.md b/51.md index fb40b26..79161b0 100644 --- a/51.md +++ b/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", ]` 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 = [