Partitions
WNFS required top-level links

Base Layout

1
${username}.fission.codes
2
|
3
+——public
4
|
5
+——p[retty]
6
|
7
+——private
8
|
9
+--revoked
Copied!
  • /public
    • Unencrypted data, visible by anyone
    • History encoded directly in the hash-linked structure
  • /p
    • A cached reduction of the /public tree
    • Exists to make short, friendly relative links
      • Relative is relative to some root
      • Permalinked if the root is a CID
      • Latest link if the root is a mutable pointer such as DNSLink
  • /private
    • Encrypted data, with contents fully encrypted
    • Includes:
      • Private files
      • Key sharing

Common Structure

The public and private subtrees have an identical API:
1
root
2
- tags
3
- important
4
- Kansai Tip # Directory pointer
5
- Harlem Shake # File pointer
6
- todo
7
- Workout 2020
8
- collections
9
- playlists
10
- Workout 2020
11
- Born To Be Wild
12
- Harlem Shake
13
- You Shook Me All Night Long
14
- albums
15
- Kansai Trip
16
- IMG_1234.png
17
- IMG_5678.png
18
- IMG_9ABC.png
19
- formats # indices primarily for lookup
20
- music
21
- 3gp
22
- aac
23
- mp3
24
# and so on
25
- images
26
- tiff
27
- jpg
28
- gif
29
- raw
30
- png
31
- event_streams
32
- filesystem
33
- [FFS events]
34
- app
35
- diffuse
36
- preferences
37
- workspace # unstructured userland
38
- inbox # AKA saved or downloads
39
- foo.pdf
40
- bar.png
41
- work
42
- My Cool Project
43
- README.md
44
- app.js
Copied!
Standard WNFS are named in the plural and snake case. All names MUST be URL safe(!)
Files (leaves) do not have a canonical path. This is a DAG, not a tree. They DO have a canonical hash (content addressing).

Internal Structure

1
-- Fission FileSystem Rough Schema
2
3
newtype Raw = Raw ByteString
4
newtype FileName = FileName Text
5
6
data Version = Version
7
{ current :: Natural -- Just an increasing counter of chain length... maybe just calculate at runtime?
8
, comment :: Text
9
, previous :: Maybe File
10
}
11
12
type File = File
13
{ raw :: Raw
14
, metadata :: Map Text Text
15
, version :: Version
16
}
17
18
Type Directory = Directory
19
{ files :: Map Text Content
20
, metadata :: Map Symbol Text
21
, version :: Version
22
, events :: [Event]
23
, public :: Maybe Directory
24
, tags :: Tags -- Aggregates child tags. What to do in case of conflict? I guess fully qualify them?
25
}
26
27
type Content =
28
= FileContent (Maybe AES) File
29
| Subdirectory (Maybe AES) Directory
30
31
type MetaData
32
= OrderedList MetaData
33
| Set MetaData
34
| Map Symbol MetaTree
35
| Text
36
| Natural
37
| Integer
38
| Float
39
40
data MetadataEvent
41
= AddMeta { key :: Symbol
42
, value :: Text
43
}
44
| RemoveMeta { key :: Symbol }
45
46
data FileEvent
47
= AttachFile { name :: Text
48
, content :: CID
49
}
50
| DetachFile { target :: Text }
51
| NewFileVersion { from :: Text
52
, parent :: CID
53
, new_data :: CID }
54
| RevertFileVersion { from :: Text
55
, tagret_version :: Natural
56
} -- Or should this just be a new pointer to the old file? Does “revert” need a special place in the ontology?
57
58
data DirectoryEvent
59
= AttachDirectory { name :: Text
60
, content :: CID
61
}
62
| DetachDirectory { target :: Text }
63
| UpdateDirContents { target :: Text
64
, new_cid :: CID
65
, update :: Event
66
}
67
| RenameLink { from :: Text
68
, to :: Text
69
}
70
71
data TagEvent
72
= AddTag { tag :: Symbol, content :: Text }
73
| RemoveTag { tag :: Symbol, from :: Text }
74
75
data CollectionEvent
76
= AddToCollection { collection :: Symbol, content :: Text }
77
| RemoveFromCollection { collection :: Symbol, content :: Text }
78
79
data Event
80
= Metadata MetadataEvent
81
| File FileEvent
82
| Directory DirectoryEvent
83
| Tag TagEvent
84
| Collection CollectionEvent
85
86
type TagData = Map Symbol (File | Dir | Tags | Collections)
87
88
type Tag = TagsSymbol TagData
89
90
type CollectionData = [Map FileName (File | Dir | Tag | Collection)]
91
92
type Collection = Collection Symbol CollectionData
93
Copied!
Last modified 5mo ago
Export as PDF
Copy link