WebNative File System

A presentation at Fission Thursday Talks in August 2020 in by Brooklyn Zelenka

Slide 1

Slide 1

Fission Web Native File System (WNFS)

Slide 2

Slide 2

Web Native File System Brooklyn Zelenka, @expede

Slide 3

Slide 3

Web Native File System Brooklyn Zelenka, @expede • Cofounder/CTO at Fission • PLT, VMs, FP, Distributed Systems • Previously an Ethereum Core Dev • FOSS — Witchcraft, Exceptional, &c

Slide 4

Slide 4

Web Native 🚀

Slide 5

Slide 5

Web Native Web Apps are Too Hard — Shrink the Development Cycle

Slide 6

Slide 6

Web Native Web Apps are Too Hard — Shrink the Development Cycle Users 👨🏫👩🏭🧑⚕👷 Developer 👩💻

Slide 7

Slide 7

Web Native Web Apps are Too Hard — Shrink the Development Cycle Users 👨🏫👩🏭🧑⚕👷 Browser 🖥 API / GQL ↕ Server ⚙ Data Store 🗃 DevOps 📤 Developer 👩💻

Slide 8

Slide 8

Web Native Web Apps are Too Hard — Shrink the Development Cycle Users 👨🏫👩🏭🧑⚕👷 Browser 🖥 API / GQL ↕ Server ⚙ Data Store 🗃 DevOps 📤 Developer 👩💻 Users 👨🏫👩🏭🧑⚕👷 Browser 🖥 Developer 👩💻 Fission ⚛

Slide 9

Slide 9

Web Native Web Apps are Too Hard — Shrink the Development Cycle Users 👨🏫👩🏭🧑⚕👷 Browser 🖥 API / GQL ↕ Current Server ⚙ Data Store 🗃 DevOps 📤 Developer 👩💻 Users 👨🏫👩🏭🧑⚕👷 Browser 🖥 Developer 👩💻 Fission ⚛

Slide 10

Slide 10

Web Native Web Apps are Too Hard — Shrink the Development Cycle Users 👨🏫👩🏭🧑⚕👷 Browser 🖥 API / GQL ↕ Current Server ⚙ Data Store 🗃 DevOps 📤 Developer 👩💻 Users 👨🏫👩🏭🧑⚕👷 Browser 🖥 Developer 👩💻 Fission ⚛ New

Slide 11

Slide 11

Web Native Web Apps are Too Hard — Shrink the Development Cycle Users 👨🏫👩🏭🧑⚕👷 Browser 🖥 Current Users 👨🏫👩🏭🧑⚕👷 Browser 🖥 Fission ⚛ API / GQL ↕ Developer 👩💻 Server ⚙ Quick iteration 🔄 Data Store 🗃 DevOps 📤 Developer 👩💻 Focus on end users 💁 Lower barrier to entry 👨🎨 New

Slide 12

Slide 12

Web Native New assumptions ~ new approach • Different world from web’s beginnings • Don’t need to rely on client/server • New features naturally fall out of the architecture • Location independent data • Client side encryption • Networked machines → networked data

Slide 13

Slide 13

Web Native Abstraction Layers

Slide 14

Slide 14

Web Native Abstraction Layers 🎮 Application Layer Business Logic 🛠 Platform Layer WebNative File System 🌐 Protocol Layer IPFS

Slide 15

Slide 15

Web Native Components

Slide 16

Slide 16

Web Native Components Write Access UCAN AuthN & AuthZ Read Access OCAP Identity did:key

Slide 17

Slide 17

Web Native Components Write Access UCAN Networking Stack DNS, IPFS, PubSub AuthN & AuthZ Read Access OCAP Identity did:key

Slide 18

Slide 18

Web Native Components Durable Store WebNative File System Data Layer Write Access UCAN Networking Stack DNS, IPFS, PubSub AuthN & AuthZ Read Access OCAP Identity did:key

Slide 19

Slide 19

Web Native Components Multi Device / User Offline & Async Sharing Exchange Store Soft Realtime Multiuser Automerge CRDT Durable Store WebNative File System Data Layer Write Access UCAN Networking Stack DNS, IPFS, PubSub AuthN & AuthZ Read Access OCAP Identity did:key

Slide 20

Slide 20

Web Native Components App Abstractions Fission SDK Multi Device / User Offline & Async Sharing Exchange Store Soft Realtime Multiuser Automerge CRDT Durable Store WebNative File System Data Layer Write Access UCAN Networking Stack DNS, IPFS, PubSub AuthN & AuthZ Read Access OCAP Identity did:key

Slide 21

Slide 21

Web Native Dev’s App Business Logic & View Components App Abstractions Fission SDK Multi Device / User Offline & Async Sharing Exchange Store Soft Realtime Multiuser Automerge CRDT Durable Store WebNative File System Data Layer Write Access UCAN Networking Stack DNS, IPFS, PubSub AuthN & AuthZ Read Access OCAP Identity did:key

Slide 22

Slide 22

Web Native File System 🗂🚀

Slide 23

Slide 23

File System 🛠 High Level Layout

Slide 24

Slide 24

File System 🛠 High Level Layout boris.fission.name

Slide 25

Slide 25

File System 🛠 High Level Layout Public Photos Avatars Apps boris.fission.name

Slide 26

Slide 26

File System boris.fission.name 🛠 High Level Layout Public Photos Avatars Private Apps Photos Apps Family Photos My Gallery

Slide 27

Slide 27

File System boris.fission.name 🛠 High Level Layout Public Photos Avatars Private Apps Shared By Me Photos Apps Family Photos My Gallery Keys and Keys Keysand and Pointers Pointers Pointers

Slide 28

Slide 28

File System boris.fission.name 🛠 High Level Layout Public Photos Avatars Private Apps Shared By Me Photos Apps Family Photos My Gallery Keys and Keys Keysand and Pointers Pointers Pointers Shared w/ Me Keys and Pointers

Slide 29

Slide 29

File System Quick Demo 📺

Slide 30

Slide 30

Common Concepts 🤝

Slide 31

Slide 31

Common Concepts 🛠🌐 Virtual Nodes

Slide 32

Slide 32

Common Concepts 🛠🌐 Virtual Nodes Raw Node

Slide 33

Slide 33

Common Concepts 🛠🌐 Virtual Nodes Raw Node File Node Raw Data Metadata

Slide 34

Slide 34

Common Concepts 🛠🌐 Virtual Nodes Raw Node File Node Raw Data Metadata Directory Node Index Metadata

Slide 35

Slide 35

Common Concepts 🛠🌐 Virtual Nodes Raw Node • Virtual Node • Consistent interface • Arbitrary metadata • More than POSIX • Tags, creators, MIME, sources, &c File Node Raw Data Metadata Directory Node Index Metadata

Slide 36

Slide 36

Common Concepts 🛠 Hard vs Soft Links

Slide 37

Slide 37

Common Concepts 🛠 Hard vs Soft Links • Hard links • Direct reference • 2 pointers ~ duplicate

Slide 38

Slide 38

Common Concepts 🛠 Hard vs Soft Links • Hard links • Direct reference • 2 pointers ~ duplicate • Soft links • Like a symlink or web link • 2 pointers ~ latest • May break • Always some version available

Slide 39

Slide 39

Common Concepts 🛠 Hard vs Soft Links • Hard links • Direct reference • 2 pointers ~ duplicate • Soft links • Like a symlink or web link • 2 pointers ~ latest • May break • Always some version available

Slide 40

Slide 40

Common Concepts 🛠 Hard vs Soft Links • Hard links • Direct reference • 2 pointers ~ duplicate • Soft links • Like a symlink or web link • 2 pointers ~ latest • May break • Always some version available

Slide 41

Slide 41

Common Concepts 🛠 Hard vs Soft Links • Hard links • Direct reference • 2 pointers ~ duplicate • Soft links • Like a symlink or web link • 2 pointers ~ latest • May break • Always some version available

Slide 42

Slide 42

Common Concepts 🛠 Hard vs Soft Links • Hard links • Direct reference • 2 pointers ~ duplicate • Soft links • Like a symlink or web link • 2 pointers ~ latest • May break • Always some version available

Slide 43

Slide 43

File System 🛠 The z-dimension: versioning & events

Slide 44

Slide 44

File System 🛠 The z-dimension: versioning & events Photos@r0 Vacation Avatars@r0 beach.png caricature.jpg Revision 0

Slide 45

Slide 45

File System 🛠 The z-dimension: versioning & events Photos@r0 Vacation Avatars@r0 beach.png caricature.jpg Revision 0 🕙

Slide 46

Slide 46

File System 🛠 The z-dimension: versioning & events Photos@r0 Photos@r1 Vacation Avatars@r0 Avatars@r1 beach.png caricature.jpg headshot.png Revision 0 Revision 1 🕙

Slide 47

Slide 47

File System 🛠 The z-dimension: versioning & events Photos@r0 ChildEvent Vacation Avatars@r0 beach.png caricature.jpg Photos@r1 InsertNew Revision 0 headshot.png Revision 1 🕙 Avatars@r1

Slide 48

Slide 48

File System 🛠 The z-dimension: versioning & events Photos@r0 ChildEvent Vacation Avatars@r0 beach.png caricature.jpg Photos@r1 InsertNew Revision 0 headshot.png Revision 1 🕙 Avatars@r1

Slide 49

Slide 49

File System Generation 0 🛠 The z-dimension: versioning & events Photos@r0 ChildEvent Vacation Avatars@r0 beach.png caricature.jpg Photos@r1 InsertNew Revision 0 headshot.png Revision 1 🕙 Avatars@r1

Slide 50

Slide 50

File System Generation 0 🛠 The z-dimension: versioning & events Photos@r0 ChildEvent Vacation Avatars@r0 beach.png caricature.jpg Generation 1 Photos@r1 InsertNew Revision 0 headshot.png Revision 1 🕙 Avatars@r1

Slide 51

Slide 51

File System 🛠 Same — Rooted DAG Photos@r1 Photos@r0 Merkle Root Avatars@r1 Vacation beach.png Avatars@r0 caricature.jpg headshot.png

Slide 52

Slide 52

Private Nodes 🤫

Slide 53

Slide 53

Private Nodes 🛠 Components CBOR Binary Encrypted Node 🔒 AES256 + 🔑 Virtual Node = Index 🔑 🔑 Metadata 🔑

Slide 54

Slide 54

Private Nodes 🛠 Cryptree Virtual Node Virtual Node 🔑 Index 🔑 🔑 Metadata 🔑 🔑 🔑 Index Metadata

Slide 55

Slide 55

Private Nodes 🛠 Cryptree Virtual Node Virtual Node 🔑 Index 🔑 🔑 Metadata 🔑 { 🔑 name: “beach.jpg”, revision: 42, key: “B374A26A71490437A…” 🔑 } Index Metadata

Slide 56

Slide 56

🔑 Private Nodes 🛠 Cryptree Virtual Node Virtual Node 🔑 Index 🔑 🔑 Metadata 🔑 { 🔑 name: “beach.jpg”, revision: 42, key: “B374A26A71490437A…” 🔑 } Index Metadata

Slide 57

Slide 57

🔑 Private Nodes 🛠 Cryptree Virtual Node Virtual Node 🔑 Index 🔑 🔑 Metadata 🔑 { 🔑 name: “beach.jpg”, revision: 42, key: “B374A26A71490437A…” 🔑 } Index Metadata

Slide 58

Slide 58

Private Nodes 🌐 Private Data Store

Slide 59

Slide 59

Private Nodes 🌐 Private Data Store MMPT (weight 16)

Slide 60

Slide 60

Private Nodes 🌐 Private Data Store MMPT 16^3 = 4,096 items (weight 16) 16^4 = 65,536 items

Slide 61

Slide 61

Private Nodes 🌐 Private Data Store MMPT 16^3 = 4,096 items (weight 16) 16^4 = 65,536 items Append-only Quick Read/Write Merkleized Concurrency Friendly

Slide 62

Slide 62

Private Nodes 🌐 Private Data Store MMPT 16^3 = 4,096 items (weight 16) 16^4 = 65,536 items Append-only Quick Read/Write Merkleized Concurrency Friendly 🔑

Slide 63

Slide 63

Private Nodes Namefilters

Slide 64

Slide 64

Private Nodes Namefilters • Constraints: • Deterministic • Versioned • Addressable • Prove subpath for UCAN • Minimal knowledge • AES keys ~ path segments but secret

Slide 65

Slide 65

Private Nodes Namefilters • Constraints: • Deterministic • Versioned • Addressable • Prove subpath for UCAN • Minimal knowledge • AES keys ~ path segments but secret • bareFilter • parentFilter • AND bloom(SHA(aesKey)) • AND bloom(SHA(aesKey ++ revision)) • Saturation • nameFilter AND bloom(SHA(nameFilter)) • Repeat until threshold bits flipped

Slide 66

Slide 66

Private Nodes 🛠 Writing as Much as UCAN

Slide 67

Slide 67

Private Nodes 🛠 Writing as Much as UCAN Rev 0

Slide 68

Slide 68

Private Nodes 🛠 Writing as Much as UCAN Rev 0

Slide 69

Slide 69

Private Nodes 🛠 Writing as Much as UCAN Rev 0 Rev 1 (Partial)

Slide 70

Slide 70

Private Nodes 🛠 Writing as Much as UCAN Rooting progress Rev 0 Rev 1 (Partial)

Slide 71

Slide 71

Private Nodes 🛠 Writing as Much as UCAN Rooting progress Rev 0 Rev 1 (Partial)

Slide 72

Slide 72

Private Nodes 🛠 Writing as Much as UCAN Rooting progress No common root at this layer! Attached via MMPT Rev 0 Rev 1 (Partial)

Slide 73

Slide 73

Private Nodes 🛠 Progressive Fast Forward Rev 0 Rev 1 (Partial)

Slide 74

Slide 74

Private Nodes 🛠 Progressive Fast Forward Rev 0 Rev 1 (Partial) Rev 2 (Partial)

Slide 75

Slide 75

Private Nodes 🛠 Progressive Fast Forward Rev 3 (Complete) Rev 0 Rev 1 (Partial) Rev 2 (Partial)

Slide 76

Slide 76

Private Nodes 🛠 Progressive Fast Forward Rev 3 (Complete) Rev 0 Rev 1 (Partial) Rev 2 (Partial)

Slide 77

Slide 77

Private Nodes 🛠 Progressive Fast Forward Rev 3 (Complete) Rev 0 Rev 1 (Partial) Rev 2 (Partial)

Slide 78

Slide 78

Private Nodes 🛠 Progressive Fast Forward Rev 3 (Complete) Rev 0 Rev 1 (Partial) Rev 2 (Partial)

Slide 79

Slide 79

Private Nodes current rev + 2n 🛠 Progressive Fast Forward Rev 3 (Complete) Rev 0 Rev 1 (Partial) Rev 2 (Partial)

Slide 80

Slide 80

Private Nodes current rev + 2n 🛠 Progressive Fast Forward Rev 3 (Complete) Rev 0 Rev 1 (Partial) Rev 2 (Partial)

Slide 81

Slide 81

Private Nodes current rev + 2n —2m current rev + 2n 🛠 Progressive Fast Forward Rev 3 (Complete) Rev 0 Rev 1 (Partial) Rev 2 (Partial)

Slide 82

Slide 82

Private Nodes current rev + 2n —2m current rev + 2n 🛠 Progressive Fast Forward Rev 3 (Complete) Rev 0 Rev 1 (Partial) Rev 2 (Partial)

Slide 83

Slide 83

Private Nodes current rev + 2n —2m current rev + 2n 🛠 Progressive Fast Forward Rev 3 (Complete) Rev 0 Rev 1 (Partial) Rev 2 (Partial)

Slide 84

Slide 84

Private Nodes current rev + 2n —2m current rev + 2n 🛠 Progressive Fast Forward O(2 * log n) Rev 3 (Complete) Rev 0 Rev 1 (Partial) Rev 2 (Partial)

Slide 85

Slide 85

File Sharing 🎁

Slide 86

Slide 86

File Sharing Shared by/with Me

Slide 87

Slide 87

File Sharing Shared by/with Me Shared by Me

Slide 88

Slide 88

File Sharing Shared by Me Shared by/with Me did:key:zStEksDrxkwYmpzqB did:key:zStEksDrxkwYmpzqB did:key:zStEksDrxkwYmpzqB dAQjjx1PRbHG3fq4ChGeJcYU dAQjjx1PRbHG3fq4ChGeJcYU dAQjjx1PRbHG3fq4ChGeJcYU YU44a4CBUExTTjeCbop6Uur YU44a4CBUExTTjeCbop6Uur YU44a4CBUExTTjeCbop6Uur

Slide 89

Slide 89

File Sharing Shared by Me Shared by/with Me did:key:zStEksDrxkwYmpzqB did:key:zStEksDrxkwYmpzqB did:key:zStEksDrxkwYmpzqB dAQjjx1PRbHG3fq4ChGeJcYU dAQjjx1PRbHG3fq4ChGeJcYU dAQjjx1PRbHG3fq4ChGeJcYU YU44a4CBUExTTjeCbop6Uur YU44a4CBUExTTjeCbop6Uur YU44a4CBUExTTjeCbop6Uur Human Readable Name 🔑 Symlink

Slide 90

Slide 90

File Sharing Shared by Me Shared by/with Me did:key:zStEksDrxkwYmpzqB did:key:zStEksDrxkwYmpzqB did:key:zStEksDrxkwYmpzqB dAQjjx1PRbHG3fq4ChGeJcYU dAQjjx1PRbHG3fq4ChGeJcYU dAQjjx1PRbHG3fq4ChGeJcYU YU44a4CBUExTTjeCbop6Uur YU44a4CBUExTTjeCbop6Uur YU44a4CBUExTTjeCbop6Uur Human Readable Name 🔑 Symlink

Slide 91

Slide 91

File Sharing Shared by Me Shared by/with Me did:key:zStEksDrxkwYmpzqB did:key:zStEksDrxkwYmpzqB did:key:zStEksDrxkwYmpzqB dAQjjx1PRbHG3fq4ChGeJcYU dAQjjx1PRbHG3fq4ChGeJcYU dAQjjx1PRbHG3fq4ChGeJcYU YU44a4CBUExTTjeCbop6Uur YU44a4CBUExTTjeCbop6Uur YU44a4CBUExTTjeCbop6Uur Human Readable Name 🔑 Symlink

Slide 92

Slide 92

File Sharing Shared by Me Shared by/with Me Shared with Me did:key:zStEksDrxkwYmpzqB did:key:zStEksDrxkwYmpzqB did:key:zStEksDrxkwYmpzqB dAQjjx1PRbHG3fq4ChGeJcYU dAQjjx1PRbHG3fq4ChGeJcYU dAQjjx1PRbHG3fq4ChGeJcYU YU44a4CBUExTTjeCbop6Uur YU44a4CBUExTTjeCbop6Uur YU44a4CBUExTTjeCbop6Uur Human Readable Name 🔑 Symlink

Slide 93

Slide 93

Recap 🔁

Slide 94

Slide 94

Recap boris.fission.name Public Photos Avatars Private Apps Shared By Me Photos Apps Family Photos My Gallery Keys and Keys Keysand and Pointers Pointers Pointers Shared w/ Me Keys and Pointers

Slide 95

Slide 95

https://fission.codes https://talk .fission.codes h t t p s : / /d i s c o r d . g g / z A Q B D E q 😁 THANK YOU 🎉 brooklyn@fission.codes g i t h u b . c o m /e x p e d e @expede

Slide 96

Slide 96

https://fission.codes https://talk .fission.codes h t t p s : / /d i s c o r d . g g / z A Q B D E q 😁 THANK YOU 🎉 brooklyn@fission.codes g i t h u b . c o m /e x p e d e @expede