store-sigits and update working flow #116

Merged
b merged 18 commits from store-sigits into staging 2024-07-11 11:42:19 +00:00
Owner

Updated create flow

The uploaded files are zipped, and this files.zip file is then encrypted and uploaded to Blossom.

The Creator prepares an Agreement by creating and signing (but NOT publishing) a Kind 938 event. The content field contains an object with the following information:

  • title (string)
  • signers (array) - list of npubs which can sign the Agreement
  • viewers (array) - list of npubs which can view the Agreement
  • filehashes (array) - series of objects containing the file name and file hash
  • zipUrl (string) - the location of the encrypted zip file (blossom server)

Once the creator has signed, the meta.json file will contain the createObject (above) and a keys object that contains the decryption key for the zip file, NIP-44 encrypted to each counterparty.

This meta.json file is now sealed (using unsigned Kind 938 to differentiate from DMs and speed up decryptions) and gift wrapped (with some PoW) per NIP-59, for each recipient, and the gift wrap is broadcast to each recipients relays.

Storing App Data

App data (list of all sigits) is stored as an encrypted file on Blossom. The file also contains a list of 'processed' id's from Kind 1059 events (to avoid having to continually decrypt when logging in, as well as enabling notifications).

A Kind 30078 is also created, which contains a link to the blossom server, and an ephemeral key pair that can be used to sign the blossom requests.

NIP-78 (event kind 30078) requires a d-tag to provide some application context. To avoid revealing metadata, the d tag will be the sha256 hash of the string "938" plus the users npub.

### Updated create flow The uploaded files are zipped, and this files.zip file is then encrypted and uploaded to Blossom. The Creator prepares an Agreement by creating and signing (but NOT publishing) a Kind 938 event. The content field contains an object with the following information: * title (string) * signers (array) - list of npubs which can sign the Agreement * viewers (array) - list of npubs which can view the Agreement * filehashes (array) - series of objects containing the file name and file hash * zipUrl (string) - the location of the encrypted zip file (blossom server) Once the creator has signed, the meta.json file will contain the createObject (above) and a keys object that contains the decryption key for the zip file, NIP-44 encrypted to each counterparty. This meta.json file is now sealed (using unsigned Kind 938 to differentiate from DMs and speed up decryptions) and gift wrapped (with some PoW) per NIP-59, for each recipient, and the gift wrap is broadcast to each recipients relays. ### Storing App Data App data (list of all sigits) is stored as an encrypted file on Blossom. The file also contains a list of 'processed' id's from Kind 1059 events (to avoid having to continually decrypt when logging in, as well as enabling notifications). A Kind 30078 is also created, which contains a link to the blossom server, and an ephemeral key pair that can be used to sign the blossom requests. NIP-78 (event kind 30078) requires a d-tag to provide some application context. To avoid revealing metadata, the d tag will be the sha256 hash of the string "938" plus the users npub.
s added 4 commits 2024-07-05 08:39:37 +00:00
s added 4 commits 2024-07-05 09:18:06 +00:00
s added 1 commit 2024-07-05 09:19:42 +00:00
s added 5 commits 2024-07-08 11:50:48 +00:00
s added 1 commit 2024-07-08 19:01:09 +00:00
s added 1 commit 2024-07-08 20:16:54 +00:00
s added 1 commit 2024-07-09 12:18:22 +00:00
s changed title from WIP: store-sigits to WIP: store-sigits and update working flow 2024-07-09 12:23:44 +00:00
s changed title from WIP: store-sigits and update working flow to store-sigits and update working flow 2024-07-09 17:30:30 +00:00
s added 1 commit 2024-07-10 09:30:23 +00:00
m approved these changes 2024-07-11 09:57:44 +00:00
b merged commit 70262bd5d2 into staging 2024-07-11 11:42:19 +00:00
b deleted branch store-sigits 2024-07-11 11:42:19 +00:00
Sign in to join this conversation.
No reviewers
m
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: sigit/sigit.io#116
No description provided.