fix: create
All checks were successful
Release to Production / build_and_release (push) Successful in 27s

This commit is contained in:
_ 2025-03-06 18:32:24 +00:00
parent 32fbd5cddf
commit 30dcc722b1
3 changed files with 280 additions and 1 deletions

View File

@ -2,4 +2,16 @@
SIGit is an open source, encrypted document signing tool. Users can Create, Sign and Verify documents individually or in groups. SIGit is an open source, encrypted document signing tool. Users can Create, Sign and Verify documents individually or in groups.
## Kind Numbers
The baseline for our kind numbers is 1603 - because BIP-39 word 1603 is "SIGN".
Kind numbers therefore as follows:
- 160300 - Create
- 160301 - Keys event
- 1603 - Sign

116
approach.md Normal file
View File

@ -0,0 +1,116 @@
# SIGit
## Flow
- Create Event
- Sign Event
- COMPLETE EVENT
---
sigit is made up of:
- pointers, notifications, components (events)
- files (encrypted blobs)
- all events are private (giftwrapped)
## Create Event Component - kind X1
Signer should display:
```
You are signing an Agreement template for the following npubs:
- npub1
- npub2
Ensure this event is sourced from a trusted SIGit instance.
```
- Signed by Creator
- NOT published by default
- fileData{}
- counterpartyData{}
- markData{}
This data is all stored inside the X1 blob
Verifications take place on all the elements in X2 (todo: list them)
---
## File pointer
Signer should say: "You are verifying that the following files exist:"
And list the full urls (blossom url + hash)
- signed by sender
- NOT PUBLISHED by default
- points to encrypted blossom blob (BB)
```json
{"content":"",
"kind": XX, --tbd
"tags"[
["filehash","$(hash)"],
["blossomUrls","url1","blossom2"], --optional
["engine": "SIGIT"]
]
}
```
---
## Encrypted Blob from XX
Contains:
- Create Event
- Files
- OTS?
## Creation flow
```mermaid
sequenceDiagram
autoNumber
actor u as Creator
participant s as SIGit Website
participant b as Blossom Server
participant r as Relay
u->>s: Signs NIP-98 <br> AUTH event
Note over s: Prepare SIGit <br> pack (docs, marks,<br>counterparties)
u->>s: Signs <br>CREATE event
Note over s: ZIP and ENCRYPT <br> SIGit pack
s->>b: Upload to Blossom
u->>s: Signs POINTER event
Note over s: Gift wrap pointer <br>+ decryption key
s->>r: <br>DM each counterparty
```
## Sign flow
```mermaid
sequenceDiagram
autoNumber
actor u as Signer
participant s as SIGit Website
participant b as Blossom Server
participant r as Relay
u->>s: Signs NIP-98 <br> AUTH event
r->>s: Fetch NIP-17 DMs
Note over s: Prepare SIGit <br> pack (docs, marks,<br>counterparties)
u->>s: Signs <br>CREATE event
Note over s: ZIP and ENCRYPT <br> SIGit pack
s->>b: Upload to Blossom
u->>s: Signs POINTER event
Note over s: Gift wrap pointer <br>+ decryption key
s->>r: <br>DM each counterparty
```

153
create.md
View File

@ -1 +1,152 @@
# Create # Create
## Nostr Event
This event is designed to provide clarity (when signing) about the agreement being created. It is NOT published to a relay (instead, it is saved in an encrypted zip).
```json
{
"kind": 160300,
"content": "You are signing an Agreement Template for the following npubs:\n- npub1\n- npub2\n\nEnsure this event is sourced from a trusted SIGit instance.",
"created_at": 1716564780,
"id": "...",
"sig": "...",
"pubkey": "pubkey of CREATOR",
"tags":[
["signers","npub1d0csynr..","npub1nqulz.."],
["viewers","npub1viewer1"], // optional tag, only if there are viewers
["files","hash1:name1.csv","hash2:name2.pdf"], // extension determines the file type. Order determines index.
["meta","hash1"] // the hash of the meta.json file
]
}
```
## Metadata JSON
This contains the marks that should be applied to the files
## Encrypted Zip File
This file contains the following:
- "files" folder - the unmarked files, using original filenames (to make them easy to open)
- "events" folder - contains the create Event and OTS request event
- meta.json file - contains the marks information
## Keys
The keys.json looks like this:
```json
{
"kind": 160301,
"content": "",
"created_at": 1716564780,
"id": "...",
"sig": "",
"pubkey": "random pubkey",
"tags":[
["filehash",<optional list of blossom servers>],
["array of decryption keys", "encrypted to each recipient"]
]
}
```
## Online Communication
Once the zip file is created, encrypted, and uploaded to the blossom server(s) - the decryption key and file location(s) must be sent to each counterparty. This is done using a regular NIP-17 Chat Message.
The rumor would be the same for all recipients:
```json
{
"id": "<usual hash>",
  "pubkey": "<sender-pubkey>",
"created_at": "<current-time>",
  "kind": 14,
  "tags": [
    ["p", "<receiver-1-pubkey>", "<relay-url>"],
    ["p", "<receiver-2-pubkey>", "<relay-url>"],
    ["e", "<kind-14-id>", "<relay-url>", "reply"] // if this is a reply
["subject", "<conversation-title>"],
    // by including tags from the kind 160301 we avoid an additional lookup in SIGit
["filehash",<optional list of blossom servers>],
["array of decryption keys", "encrypted to each recipient"]
  ],
  "content": "A new SIGit has been created - please visit your preferred instance or click https://sigit.io/find/$(idOfKind160301)",
}
```
## Online Flow
* Create & sign kind 160300
* Zip this along with files and meta.json
* Push zip to blossom
* Publish kind 160301 with decryption keys
* Send DM with link to above (manual flow) and keys (automatic flow)
```mermaid
sequenceDiagram
autoNumber
actor u as Creator
participant b as browser
participant r as Relay
participant bl as Blossom
u->>b: Upload files
u->>b: Define marks & <br>counterparties
u->>b: Sign Kind 160300
Note over b: 160300 + files <br>+ meta.json<br> = encrypted zip
b->>bl: Upload encrypted zip
Note over b: Create kind 160301 event<br>with ephemeral key
b->>r: publish 160301<br> to relay
Note over b: Create NIP-17 DM<br> with link to SIGit<br> & 160301 npub
u->>b: Sign NIP-17<br> notification / DM<br> for each receiver
b->>r: send DM to <br>each counterparty
```
## Offline Communication
For offline, the encrypted zip PLUS the Kind 160301 are zipped together and downloaded.
```mermaid
sequenceDiagram
autoNumber
actor u as Creator
participant b as browser
u->>b: Upload files
u->>b: Define marks & <br>counterparties
u->>b: Sign Kind 160300
Note over b: Encrypted Zip =<br>Kind 160300 <br>+ files <br>+ meta.json
Note over b: Kind 160301 = <br> decryption key<br>+ location
Note over b: Final Zip =<br> Encrypted Zip<br> + Kind 160301
b->>u: Download Zip
```