From 1a13871566d9d45c7b95b75ca7b7b9adab2c518f Mon Sep 17 00:00:00 2001 From: arthurfranca Date: Fri, 9 Feb 2024 19:06:02 -0300 Subject: [PATCH] Add access control upgrade --- 00.md | 63 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 00.md diff --git a/00.md b/00.md new file mode 100644 index 00000000..a4892f10 --- /dev/null +++ b/00.md @@ -0,0 +1,63 @@ +NIP-XX +====== + +Access Control Upgrade +---------------------- + +`draft` `optional` + +This NIP defines how to upgrade a public event with the property of limiting access to itself. + +## Upgrading a Public Event + +A public event (with no access control), such as of `kind:1`, +must be published or updated with a `full_event` tag pointing to a +`kind:30042` event address. + +It may include one of the following tags holding a preview of the full event content: +`summary`, `image`, `audio`, `video`. The first holds a text excerpt while the others an URL. + +Example: + +```json +{ + "kind": 1063, + "tags": [ + ["full_event", "30042:<32-bytes lowercase hex of a pubkey>:abc", ""], + ["image", ""], + ["dim", "800x600"] + ], + "content": "", + ... +} +``` + +## Full Event + +A "Full Event" is of `kind:30042`. It has [NIP-42](42.md) `A` tags the author +can update at will with the pubkeys allowed to access it. + +It uses the custom NIP-42 event serialization for events that require `AUTH`. + +The `.content` and other tags aren't fixed. The structure depends on the +kind of the public event it is protecting. For example, if it is +protecting a `kind:30023`, it should have the structure defined on [NIP-23](23.md). + +Example: + +```json +{ + "kind": 30042, + "pubkey": "", + "tags": [ + ["d", ""], + ["A", ""], // important to keep author access right + ["A", ""], + ["A", ""], + ["url", "https://some.place/file.webp"], + ["dim", "800x600"] + ], + "content": "Happy New Year, my dear supporters!!", + ... +} +```