fix: simplification

This commit is contained in:
_ 2025-03-25 13:52:50 +00:00
parent 60df7856c9
commit 2fad2b1dd6

@ -2,49 +2,50 @@
We need a flow that avoids any copy pasting of nsecs, and allows regular key rotation. The principle then is that all system nsecs are generated locally, and never leave the device.
Admin (bootstrap) flow:
```mermaid
sequenceDiagram
autoNumber
participant d as DVM
participant r as Relay
participant e as Electron App
actor u as User Signature
Note over d: Admin npubs +<br> secret + relays<br>are hardcoded
d->>r: Publish 001 <br> with secret
u->>e: Admin signs in
Note over e: Add new Organisation
Note over e: Add relay(s) <br>+ secret
r-->>e: Kind X1 rec'd
Note over e: DVM npub <br> known
Note over e: Prepare kind X2<br> event
u<<->>e: Sign 002
e->>r: Publish 002
r-->>d: Kind 002 rec'd
Note over d: Admin client app<br>registered in DB
d->>r: Publish 003
r-->>e: Kind 003 rec'd
Note over e: DVM npub <br> confirmed
e->>u: Notify User
Note over e: Prepare 004 <br> replaceable event<br>with DVM npub
u<<->>e: Sign 004
e->>r: Publish 004
```
## Kind Numbers
Kind numbers are all based on a "2029" root, which is the [BIP-39 word for "work"](https://github.com/bitcoin/bips/blob/master/bip-0039/english.txt#L2029).
|Kind|Type|Purpose|
|---|---|---|
|2029001|Encrypted to admin, ephemeral|Discovery of DVM npub by Admins|
|2029002|Encrypted to dvm, ephemeral|Register admin client|
|2029003|Encrypted to client, ephemeral|Confirm admin client registration|
|2029004|Public, Replaceable|Discovery of DVM npub by end users|
|Kind|Name|Type|Comments|
|---|---|---|---|
|2029000|POST Client|Gift-Wrapped|Register a POW client|
|2029001|Publish Instance|Public, replaceable|Announce POW instance|
## Admin (bootstrap) flow:
```mermaid
sequenceDiagram
autoNumber
participant d as DVM
participant e as Electron App
actor u as Administrator
Note over d: DVM started &<br>npub is written<br>to console
u->>e: Sign in
u->>e: "Add Org"
u->>e: Paste DVM <br>nprofile
u->>e: Sign 000
e->>d: Kind 000
Note over d: Update DB<br>with Client info
e->>d: GET CLIENTS Job
d->>e: Job Response
Note over e: Client registered<br>& DVM validated
Note over e: If org info <br>unpublished:
e->>u: Notify admin
u->>e: Sign 001
Note over e: 001 published
```