git ssb

1+

kieran / horcrux-schemas-and-thoughts



Commit 77cc88e93406723a3e5a75c81ec5ed4225471eee

First sketch data structures

Kieran committed on 3/22/2018, 12:27:49 PM
Parent: 927451e856b500986bc948d2c13b10925d06bf4e

Files changed

README.mdchanged
schemas/invite.jsonchanged
schemas/response.jsonchanged
schemas/root.jsonchanged
schemas/secret.jsonchanged
schemas/request.jsondeleted
schemas/trustees.jsonadded
README.mdView
@@ -3,8 +3,9 @@
33 ![Abaddon the Despoiler](./assets/abaddon.jpg)
44
55 ## Important
66 * Abaddon's soul is never committed to the database. It is sharded, and discarded. At no stage is it compromised.
7 +* All messages are private and encrypted either between the individuals involved or between the group.
78
89 ## Event Flow
910
1011 | Invitee | Response | Secret Shard |
@@ -34,16 +35,18 @@
3435 - Abaddon can still send out more invitations if he likes.
3536
3637 All of Abaddon's different secret sharing `root` events can be summoned using:
3738
39 +```javascript
40 +api.secrets.root.get()
41 +api.secrets.root.stream(callback)
3842 ```
39-api.secrets.all.get(callback)
40-```
4143
4244 Invites can be viewed through the API and a FlumeView... something along the lines of:
4345
4446 ```
45-api.secrets.invites.get(rootId, callback)
47 +api.secrets.invites.get(rootId)
48 +api.secrets.invites.stream(rootId, callback)
4649 ```
4750
4851 ### 2. Responses
4952
@@ -54,12 +57,13 @@
5457 - A response writes a [`secret_response`](./schemas/response.json) that indicates whether they accepted the invite or not
5558 - References the rootId so can be easily filtered through the API / a FlumeView
5659
5760 ```
58-api.secrets.responses.get(rootId, callback)
61 +api.secrets.responses.get(rootId)
62 +api.secrets.responses.stream(rootId, callback)
5963 ```
6064
61-### 3. Participants
65 +### 3. Trustees
6266
6367 Abaddon decides its time to proceed with his super evil plan and shard his soul...
6468
6569 > I now have enough super evil allies.
@@ -76,33 +80,35 @@
7680 - Abaddon can now select the ones he _really trusts_, his inner circle.
7781 - Abaddon can now set a `quorum` of cosigners required to combine his sharded soul and make him mortal again.
7882 - Abaddon can now select whether he wants the final cosigners to know who eachother are. Does he trust them enough not to conspire against his evil plans for immortality?
7983 - Abaddon then hits send, his soul is sharded as he screams into the abyss.
80-- Generates a [`secret_participants`](./schemas/participants.json) event which includes:
84 +- Generates a [`secret_trustees`](./schemas/trustees.json) event which includes:
8185 - IDs of the _final_ cosigners
8286 - The required number of cosigners to release his secret
8387
8488 - If Abaddon enabled it, those within that group of final cosigners can now see who eachother are.
8589 - Immediately triggers the [Secrets event](#4-secrets)
8690
87- ```
88- api.secrets.participants.get(rootId, callback)
89- ```
91 +```
92 +api.secrets.trustees.get(rootId)
93 +api.secrets.trustees.stream(rootId, callback)
94 +```
9095
9196 **Questions**
9297 * Does having a secretive or non-secretive sharding require two different types of event? Or is it just a boolean flag? Needs clarification as it depends how the data is scuttled...
9398
9499 ### 4. Secrets
95-Immediately after Abaddon has confirmed the sharding of his soul, and the participants log has been created, each member of the participants will be gossiped a private message detailing their own shard.
100 +Immediately after Abaddon has confirmed the sharding of his soul, and the trustees log has been created, each member of the trustees will be gossiped a private message detailing their own shard. The author is Abaddon and the recipient
96101
97102 **What does this do?**
98103 - Each trustee receives a shard of Abaddon's soul.
99104
100105 ```
101-api.secrets.pieces.get(callback)
106 +api.secrets.pieces.get(rootId)
107 +api.secrets.pieces.stream(rootId, callback)
102108 ```
103109
104-// Needs more thought... Should the participants know the rootId? Do they need to?
110 +// Needs more thought... Should the trustees know the rootId? Do they need to?
105111
106112
107113 ## Note:
108114 - `secret_invite` and `secret_response` looks a lot like Patchbay's `ssb-chess`: `chess_invite` and `chess_accept`.
schemas/invite.jsonView
@@ -1,21 +1,26 @@
11 {
2- "type": "secret_invite",
3- "text": "[@Kieran](@MpDd66GPXgN1+eMNrZInHkWq1THMurWwLdMx8BZ1ncw=.ed25519) invites you to secure his secret...",
4- "recipients": [
5- {
6- "link": "@ye+QM09iPcDJD6YvQYjoQc7sLF/IFhmNbEqgdzQo3lQ=.ed25519",
7- "name": "mix"
8- },
9- {
10- "link": "@NeB4q4Hy9IiMxs5L08oevEhivxW+/aDu/s/0SkNayi0=.ed25519",
11- "name": "Dan Hassan"
2 + "key": "%kQL0FcDYPJYVfT6qxV0H7d5ChiCJbdIkdv1yGYKYd8E=.sha256",
3 + "value": {
4 + "previous": "...",
5 + "author": "@MpDd66GPXgN1+eMNrZInHkWq1THMurWwLdMx8BZ1ncw=.ed25519",
6 + "sequence": "...",
7 + "timestamp": "...",
8 + "hash": "sha256",
9 + "content": {
10 + "type": "secret_invite",
11 + "root": "%qHZCXd0spsGVlEvMrvkZHVtndgYNOHxZFiVZm1+tplA=.sha256",
12 + "text": "[@Kieran](@MpDd66GPXgN1+eMNrZInHkWq1THMurWwLdMx8BZ1ncw=.ed25519) invites you to secure his secret...",
13 + "recipient": {
14 + "link": "@NeB4q4Hy9IiMxs5L08oevEhivxW+/aDu/s/0SkNayi0=.ed25519",
15 + "name": "Dan Hassan"
16 + },
17 + "mentions": [
18 + {
19 + "link": "@MpDd66GPXgN1+eMNrZInHkWq1THMurWwLdMx8BZ1ncw=.ed25519",
20 + "name": "Kieran"
21 + }
22 + ]
1223 }
13- ],
14- "mentions": [
15- {
16- "link": "@MpDd66GPXgN1+eMNrZInHkWq1THMurWwLdMx8BZ1ncw=.ed25519",
17- "name": "Kieran"
18- }
19- ],
20- "private": true
24 +
25 + }
2126 }
schemas/response.jsonView
@@ -1,14 +1,26 @@
11 {
2- "type": "accept_secret",
3- "text": "[@Kieran](@MpDd66GPXgN1+eMNrZInHkWq1THMurWwLdMx8BZ1ncw=.ed25519) wants to share a secret with you...",
4- "mentions": [
5- {
6- "link": "@ye+QM09iPcDJD6YvQYjoQc7sLF/IFhmNbEqgdzQo3lQ=.ed25519",
7- "name": "mix"
8- },
9- {
10- "link": "@NeB4q4Hy9IiMxs5L08oevEhivxW+/aDu/s/0SkNayi0=.ed25519",
11- "name": "Dan Hassan"
2 + "key": "%rBpGhzSwvhToQJU7cTJfK+qQlMqT//GmLMaAQi0xGKc=.sha256",
3 + "value": {
4 + "previous": "...",
5 + "author": "@NeB4q4Hy9IiMxs5L08oevEhivxW+/aDu/s/0SkNayi0=.ed25519",
6 + "sequence": "...",
7 + "timestamp": "...",
8 + "hash": "sha256",
9 + "content": {
10 + "type": "secret_response",
11 + "root": "%qHZCXd0spsGVlEvMrvkZHVtndgYNOHxZFiVZm1+tplA=.sha256",
12 + "invite": "%kQL0FcDYPJYVfT6qxV0H7d5ChiCJbdIkdv1yGYKYd8E=.sha256",
13 + "accept": true,
14 + "text": "I am the soul harvester ... I will harvest your soul [@Kieran](@MpDd66GPXgN1+eMNrZInHkWq1THMurWwLdMx8BZ1ncw=.ed25519)",
15 + "mentions": [
16 + {
17 + "link": "@MpDd66GPXgN1+eMNrZInHkWq1THMurWwLdMx8BZ1ncw=.ed25519",
18 + "name": "Kieran"
19 + }
20 + ]
1221 }
13- ]
22 + }
1423 }
24 +
25 +// Should it include the id of the secret splitter?
26 +// Rather than having to stream through to search for the invite based on the inviteId?
schemas/root.jsonView
@@ -1,0 +1,24 @@
1 +{
2 + "key": "%qHZCXd0spsGVlEvMrvkZHVtndgYNOHxZFiVZm1+tplA=.sha256",
3 + "value": {
4 + "previous": "...",
5 + "author": "@MpDd66GPXgN1+eMNrZInHkWq1THMurWwLdMx8BZ1ncw=.ed25519",
6 + "sequence": "...",
7 + "timestamp": "...",
8 + "hash": "sha256",
9 + "content": {
10 + "type": "secret_root"
11 + }
12 + }
13 +}
14 +
15 +// Root needs contain little to no information about events after it exists
16 +
17 +// Exists purely as a means to allow for a many to many relationship
18 +// for an "author" to it's secrets.
19 +
20 +// If we were to have an secret sharding stream of events tied to their id / key, it
21 +// would permit only one per person
22 +
23 +// Invites, Responses, Trustees and Secrets can all
24 +// be queried and found using this root
schemas/secret.jsonView
@@ -1,11 +1,37 @@
11 {
2- "type": "secret",
3- "text": "80171f51d1f9cf6f6a8f3b08dee2ca5575cec57f32d02ed9f4435e940f1888637e1005e43232048fee13dd8804628",
4- "mentions": [
5- {
6- "link": "@MpDd66GPXgN1+eMNrZInHkWq1THMurWwLdMx8BZ1ncw=.ed25519",
7- "name": "Kieran"
2 + "key": "",
3 + "value": {
4 + "previous": "...",
5 + "author": "@MpDd66GPXgN1+eMNrZInHkWq1THMurWwLdMx8BZ1ncw=.ed25519",
6 + "sequence": "...",
7 + "timestamp": "...",
8 + "hash": "sha256",
9 + "content": {
10 + "type": "secret",
11 + "root": "%qHZCXd0spsGVlEvMrvkZHVtndgYNOHxZFiVZm1+tplA=.sha256",
12 + "response": "%rBpGhzSwvhToQJU7cTJfK+qQlMqT//GmLMaAQi0xGKc=.sha256",
13 + "secret": "80171f51d1f9cf6f6a8f3b08dee2ca5575cec57f32d02ed9f4435e940f1888637e1005e43232048fee13dd8804628",
14 + "trustee": {
15 + "link": "@NeB4q4Hy9IiMxs5L08oevEhivxW+/aDu/s/0SkNayi0=.ed25519",
16 + "name": "Dan Hassan"
17 + }
818 }
9- ],
10- "private": true
19 + }
1120 }
21 +
22 +// Perhaps "response" is unnecessary?
23 +
24 +// A secret is in effect a private message between:
25 +// - the author (the holder of the secret)
26 +// - the trustee (the holder of the secret shard)
27 +
28 +// From the perspective of the person who has sharded their key,
29 +// They're the sender of the secret, they can see this message...
30 +// Makes sense.. can't be gotten around.. should it be anyway?
31 +// Not sure if this is a problem... An issue for a compromised computer...?
32 +
33 +// Private messages can be decrypted and therefore the secret can be revealed
34 +// at any point because the sharer still has the shards...
35 +
36 +// Encrypt with the public key of the trustee, they become the only one to can decrypt it
37 +// Secret shard is no longer compromised to the author of the secret sharing process...
schemas/request.jsonView
schemas/trustees.jsonView
@@ -1,0 +1,39 @@
1 +{
2 + "key": "...",
3 + "value": {
4 + "previous": "...",
5 + "author": "@MpDd66GPXgN1+eMNrZInHkWq1THMurWwLdMx8BZ1ncw=.ed25519",
6 + "sequence": "...",
7 + "timestamp": "...",
8 + "hash": "sha256",
9 + "content": {
10 + "type": "secret_trustees",
11 + "root": "%qHZCXd0spsGVlEvMrvkZHVtndgYNOHxZFiVZm1+tplA=.sha256",
12 + "shared": true,
13 + "quorum": "2",
14 + "trustees": [
15 + {
16 + "link": "@NeB4q4Hy9IiMxs5L08oevEhivxW+/aDu/s/0SkNayi0=.ed25519",
17 + "name": "Dan Hassan"
18 + },
19 + {
20 + "link": "@ye+QM09iPcDJD6YvQYjoQc7sLF/IFhmNbEqgdzQo3lQ=.ed25519",
21 + "name": "mix"
22 + },
23 + {
24 + "link": "@DQ1HPdrTi6iUUlU22CRqZlEnbxWm6XjjdFQs+4fy+HY=.ed25519",
25 + "name": "Nikolai"
26 + }
27 + ]
28 + }
29 +
30 + }
31 +}
32 +
33 +// The original idea for this being here was to ensure a cutoff point from which to distinguish
34 +// the real participants who received a secret and those who replied late.
35 +// Also acts as a contract of sorts - contains the details for the @author who was included in the
36 +// final secret sharing and how to reassemble
37 +
38 +// { shared: true } indicates whether other participants and quorum is visible to trustees.
39 +// If it is, this information gets copied over into the secret

Built with git-ssb-web