This commit is contained in:
Vitor Pamplona 2024-05-09 16:02:03 -04:00 committed by GitHub
parent e458d30234
commit 439dd577c4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

12
68.md
View File

@ -6,9 +6,9 @@ Shared Replaceables
`draft` `optional`
This NIP creates replaceable events that can be changed by any public key in the list of editors. Editors can also add and remove new editors.
This NIP creates replaceable events that any public key in the list of editors can change. Editors can also add and remove new editors.
Every shared replaceable event MUST be signed with it's own private key. The event owns itself.
Every shared replaceable MUST be signed with its own private key. The event owns itself.
The event's private key MUST be shared with all editors through `p` tags. The key is [NIP-44](44.md)-encrypted to each editor and placed as the 4th element in a regular `p` tag.
@ -38,11 +38,11 @@ To update the event, receivers MUST:
## Encrypted Shared Replaceables
Some use cases require separate editting and viewing permissions: the `.content` can be encrypted so that only users with viewing permissions can see the information.
Some use cases require separate editing and viewing permissions: the `.content` can be encrypted so that only users with viewing permissions can see the information.
To achieve this dynamic, the replaceable event MUST own two shared private keys: one for editting and one for viewing.
To achieve this dynamic, the replaceable event MUST own two shared private keys: one for editing and one for viewing.
Both keys are shared as encrypted `p` tags between the editting key and each user's public key.
Both keys are shared as encrypted `p` tags between the editing key and each user's public key.
The `.content` is then encrypted from the editing private key to the viewing public key.
@ -98,4 +98,4 @@ Similarly, when decrypting the `.content`, if the receiver client can't find a v
## Final Considerations
If any of the event's private keys are lost due to an encrypting bug or if there is a failure to add the ciphertext in the p-tags before signing, and if relays don't have previous versions of this event, the event might become permanentely unmodifiable and undecryptable, which can also be a feature in some use cases.
If any of the event's private keys are lost due to an encrypting bug or if there is a failure to add the ciphertext in the p-tags before signing, and if relays don't have previous versions of this event, the event might become permanently unmodifiable and undecryptable, which can also be a feature in some use cases.