From 0d06150f3fb2125083abddb74d9d696c0cec4184 Mon Sep 17 00:00:00 2001 From: Vitor Pamplona Date: Tue, 7 May 2024 18:49:10 -0400 Subject: [PATCH] Adds the view and edit groups --- 73.md | 87 ++++++++++++++++++++++++++++++++++++++++------------------- 1 file changed, 60 insertions(+), 27 deletions(-) diff --git a/73.md b/73.md index b06eed49..29ced048 100644 --- a/73.md +++ b/73.md @@ -50,9 +50,17 @@ As an example: TBD -## Private Spreadsheets +## Access Controls to Private Spreadsheets -A private spreadsheet has tags in a JSON-stringified and NIP-44-encrypted to the user's own pubkey `.content` +Private spreadsheets [NIP-44](44.md) encrypt the tag array and place it on the `.content` of the event and use `p` tags to pass rights to encrypt and decrypt to other users. + +This section explores the 4 modes of operation. + +### Author-only design + +In this version, the spreadsheet is signed by the main keys of an author and only the author can decrypt. It doesn't not include any `p` tag. + +The encryption in `.content` uses a NIP-44 conversation key between the author's private key and the author's public key. ```js { @@ -71,13 +79,13 @@ A private spreadsheet has tags in a JSON-stringified and NIP-44-encrypted to the } ``` -## Sharing Encrypted Spreadsheets with View-only permission to a Group +### Viewing permissions -Ready-only sharing is achieved by adding a `p` tag to each receiver with a shared secret to decrypt the `.content`. +Ready-only sharing is achieved by adding a `p` tag to each receiver with an encrypted private key that should be used to decrypt the `.content`. -The shared secret is a new Nostr Private Key in hex, NIP-44-encrypted to each `p` tag and placed as a 4th value in each tag. +The viewing private key is a new Nostr Private Key in hex, NIP-44-encrypted to each `p` tag and placed as a 4th value in each tag. -The `.content` is then encrypted by a conversation key between the new private and the public key. +The `.content` is then encrypted by a conversation key between the new author's private key and the viewing public key. ```js val keyPair = nostr.generateKeyPair() @@ -97,7 +105,7 @@ val keyPair = nostr.generateKeyPair() ["data", "", "", "", "", "