Beyond UnixFS: Extending IPFS for Edge Apps & Web3

A presentation at IPFS รพing in July 2022 in Reykjavรญk, Iceland by Brooklyn Zelenka

Slide 1

Slide 1

๐Ÿช WebNative File System ๐Ÿš€ Beyond UnixFS: Extending IPFS for Edge Apps & Web3 github.com/WebNativeFileSystem

Slide 2

Slide 2

Slide 3

Slide 3

BROOKLYN ZELENKA PHILIPP KRรœGER @expede CTO @ Fission @matheus23 Protocol Engineer @ Fission Wonโ€™t have time to cover everything in depth. Come talk to us after, weโ€™re friendly & happy to share what weโ€™ve learned along the way!

Slide 4

Slide 4

BROOKLYN ZELENKA PHILIPP KRรœGER @expede CTO @ Fission @matheus23 Protocol Engineer @ Fission H C TE Wonโ€™t have time to cover everything in depth. Come talk to us after, weโ€™re friendly & happy to share what weโ€™ve learned along the way!

Slide 5

Slide 5

Beyond UnixFS ๐Ÿš€ Requirements Diagram Web3 Apps Portable Data & Runtime Hostile Hosts e.g. Browsers Nonextractable Signing Keys Web 2.0 Feature Partity Access Control Authenticated Data Content Addressed Authorized Data Encryption at Rest Capability Auth Collaborative Extensible Multiuser Arbitrary Metadata Concurrent Kernel vs Userspace

Slide 6

Slide 6

Beyond UnixFS ๐Ÿš€ Drive (File Explorer)

Slide 7

Slide 7

Beyond UnixFS ๐Ÿš€ High-Level Layout

Slide 8

Slide 8

Beyond UnixFS ๐Ÿš€ High-Level Layout IPNS/DNSLink alice.fission.name

Slide 9

Slide 9

Beyond UnixFS ๐Ÿš€ High-Level Layout Public Photos Avatars Apps IPNS/DNSLink alice.fission.name

Slide 10

Slide 10

Beyond UnixFS ๐Ÿš€ High-Level Layout Public Photos Avatars IPNS/DNSLink alice.fission.name Secret Apps Photos Apps Family Photos My Gallery

Slide 11

Slide 11

Beyond UnixFS ๐Ÿš€ High-Level Layout Public Photos Avatars IPNS/DNSLink alice.fission.name Secret Apps Sharing Inbox Photos Apps Family Photos My Gallery Keys and Keys Keysand and Pointers Pointers Pointers

Slide 12

Slide 12

Beyond UnixFS ๐Ÿš€ High-Level Layout Public Photos Avatars IPNS/DNSLink alice.fission.name Secret Apps Sharing Inbox Photos Apps Family Photos My Gallery Keys and Keys Keysand and Pointers Pointers Pointers Sharing Outbox Keys and Pointers

Slide 13

Slide 13

Public Files ๐Ÿ“‚ General WNFS Data Model Public Photos Avatars Apps

Slide 14

Slide 14

Public Files ๐Ÿ“‚ Virtual Nodes

Slide 15

Slide 15

Public Files ๐Ÿ“‚ Virtual Nodes Raw IPLD Node

Slide 16

Slide 16

Public Files ๐Ÿ“‚ Virtual Nodes Raw IPLD Node File Node Raw Data Metadata

Slide 17

Slide 17

Public Files ๐Ÿ“‚ Virtual Nodes File Node Raw IPLD Node Virtual Node Raw Data Consistent interface Arbitrary metadata Tags, creators, MIME, sources, &c Metadata

Slide 18

Slide 18

Public Files ๐Ÿ“‚ Virtual Nodes File Node Raw IPLD Node Virtual Node Raw Data Consistent interface Arbitrary metadata Tags, creators, MIME, sources, &c Metadata Directory Node Index Metadata

Slide 19

Slide 19

Public Files ๐Ÿ“‚ Hard & Soft Links

Slide 20

Slide 20

Public Files ๐Ÿ“‚ Hard & Soft Links alice.fission.name

Slide 21

Slide 21

Public Files ๐Ÿ“‚ Hard & Soft Links alice.fission.name bob.fission.name

Slide 22

Slide 22

Public Files ๐Ÿ“‚ Hard Links Hard & Soft Links New for the web! Direct reference alice.fission.name 2 pointers ~ deduplicate bob.fission.name

Slide 23

Slide 23

Public Files ๐Ÿ“‚ Hard Links Hard & Soft Links New for the web! Direct reference alice.fission.name 2 pointers ~ deduplicate bob.fission.name

Slide 24

Slide 24

Public Files ๐Ÿ“‚ Hard Links Hard & Soft Links New for the web! Direct reference alice.fission.name 2 pointers ~ deduplicate bob.fission.name Soft Links Symlink or web link (URL) Pointer ~ latest Latest may break

Slide 25

Slide 25

Public Files ๐Ÿ“‚ Persistent Versioning

Slide 26

Slide 26

Public Files ๐Ÿ“‚ Persistent Versioning Photos@r0 Vacation Avatars@r0 beach.png caricature.jpg Revision 0

Slide 27

Slide 27

Public Files ๐Ÿ“‚ Persistent Versioning Photos@r0 Vacation Avatars@r0 beach.png caricature.jpg Revision 0 ๐Ÿ•™

Slide 28

Slide 28

Public Files ๐Ÿ“‚ Persistent Versioning Photos@r0 Photos@r1 Vacation Avatars@r0 Avatars@r1 beach.png caricature.jpg headshot.png Revision 0 Revision 1 ๐Ÿ•™

Slide 29

Slide 29

Public Files ๐Ÿ“‚ Persistent Versioning Photos@r0 ChildHasEvent Vacation Avatars@r0 beach.png caricature.jpg Photos@r1 InsertNew Revision 0 headshot.png Revision 1 ๐Ÿ•™ Avatars@r1

Slide 30

Slide 30

Public Files ๐Ÿ“‚ Persistent Versioning Photos@r0 ChildHasEvent Vacation Avatars@r0 beach.png caricature.jpg Photos@r1 InsertNew Revision 0 headshot.png Revision 1 ๐Ÿ•™ Avatars@r1

Slide 31

Slide 31

Public Files ๐Ÿ“‚ Rearranged Photos@r1 ChildHasEvent Avatars@r1 Photos@r0 InsertNew Vacation Avatars@r0 beach.png caricature.jpg headshot.png

Slide 32

Slide 32

Secret Files ๐Ÿฅท Confluence

Slide 33

Slide 33

Secret Files ๐Ÿฅท Confluence One of the first Merkle CRDT papers was from PL ๐Ÿ™Œ Persistent data structure Automatic file-level reconciliation Pluggable sub-file reconciliation (forthcoming) Basis of upcoming BFT Datalog โ€œat scaleโ€ work ๐Ÿ˜‰

Slide 34

Slide 34

Secret Files ๐Ÿฅท Confluence One of the first Merkle CRDT papers was from PL ๐Ÿ™Œ Persistent data structure Automatic file-level reconciliation Pluggable sub-file reconciliation (forthcoming) Basis of upcoming BFT Datalog โ€œat scaleโ€ work ๐Ÿ˜‰ Single File History / โ€œCausal Shadowโ€

Slide 35

Slide 35

Secret Files ๐Ÿฅท Confluence F B E One of the first Merkle CRDT papers was from PL ๐Ÿ™Œ Persistent data structure D Automatic file-level reconciliation Pluggable sub-file reconciliation (forthcoming) Basis of upcoming BFT Datalog โ€œat scaleโ€ work ๐Ÿ˜‰ A C Single File History / โ€œCausal Shadowโ€

Slide 36

Slide 36

Secret Files ๐Ÿฅท A Dark Forest of Data

Slide 37

Slide 37

Secret Files ๐Ÿฅท Private Nodes Binary CBOR Encrypted Node ๐Ÿ”’ AES256 Encrypted Node ๐Ÿ”’ Virtual Node ๐Ÿ”‘ Index Metadata Encrypted Node ๐Ÿ”’ ๐Ÿ”‘ ๐Ÿ”‘ ๐Ÿ”‘

Slide 38

Slide 38

Secret Files ๐Ÿฅท Read Window Virtual Node Virtual Node ๐Ÿ”‘ Index ๐Ÿ”‘ ๐Ÿ”‘ Metadata ๐Ÿ”‘ ๐Ÿ”‘ ๐Ÿ”‘ Index Metadata

Slide 39

Slide 39

Secret Files ๐Ÿฅท Read Window Virtual Node Virtual Node ๐Ÿ”‘ Index ๐Ÿ”‘ ๐Ÿ”‘ Metadata ๐Ÿ”‘ { ๐Ÿ”‘ ๐Ÿ”‘ name: โ€œbeach.jpgโ€, key: โ€œB374A26A71490437Aโ€ฆโ€, โ€ฆ } Index Metadata

Slide 40

Slide 40

Secret Files ๐Ÿฅท Subgraph Access

Slide 41

Slide 41

Secret Files ๐Ÿฅท Subgraph Access

Slide 42

Slide 42

Secret Files ๐Ÿฅท Subgraph Access ๐Ÿ—

Slide 43

Slide 43

Secret Files ๐Ÿฅท Subgraph Access ๐Ÿ— ๐Ÿ—

Slide 44

Slide 44

Secret Files ๐Ÿฅท Subgraph Access ๐Ÿ— ๐Ÿ— ๐Ÿ—

Slide 45

Slide 45

Secret Files ๐Ÿฅท Subgraph Access ๐Ÿ— ๐Ÿ— ๐Ÿ— ๐Ÿ”ฉโžก๐Ÿ—

Slide 46

Slide 46

Secret Files ๐Ÿฅท Progressive Fast Forward Rev 0

Slide 47

Slide 47

Secret Files ๐Ÿฅท Progressive Fast Forward Rev 0 Rev 1 (Partial)

Slide 48

Slide 48

Secret Files ๐Ÿฅท Progressive Fast Forward Rooting progress Rev 0 Rev 1 (Partial)

Slide 49

Slide 49

Secret Files ๐Ÿฅท Progressive Fast Forward Rooting progress Rev 0 Rev 1 (Partial) Rev 2 (Partial)

Slide 50

Slide 50

Secret Files ๐Ÿฅท Progressive Fast Forward Rooting progress Rev 3 (Complete) Rev 0 Rev 1 (Partial) Rev 2 (Partial)

Slide 51

Slide 51

Secret Files ๐Ÿฅท Progressive Fast Forward Rooting progress Rev 3 (Complete) Rev 0 Rev 1 (Partial) Rev 2 (Partial)

Slide 52

Slide 52

Secret Files ๐Ÿฅท Progressive Fast Forward Rev 3 (Complete) Rev 0 Rev 1 (Partial) Rev 2 (Partial)

Slide 53

Slide 53

Secret Files ๐Ÿฅท Progressive Fast Forward Rev 3 (Complete) Rev 0 Rev 1 (Partial) Rev 2 (Partial)

Slide 54

Slide 54

Secret Files ๐Ÿฅท Skip Ratchet

Slide 55

Slide 55

Secret Files ๐Ÿฅท Skip Ratchet Ratchet keys for future (backwards) secrecy Skip ratchet KDF for log-time fast forwards

Slide 56

Slide 56

Secret Files ๐Ÿฅท Skip Ratchet Ratchet keys for future (backwards) secrecy Skip ratchet KDF for log-time fast forwards

Slide 57

Slide 57

Secret Files ๐Ÿฅท Skip Ratchet Ratchet keys for future (backwards) secrecy Skip ratchet KDF for log-time fast forwards Inter e s ted in Ask the fu Brook ll pap lyn f er? or a p repri nt

Slide 58

Slide 58

Secret Files ๐Ÿฅท Write Access

Slide 59

Slide 59

Secret Files ๐Ÿฅท Write Access Bare Filter simple = Bloom.insert(element: iNumber, into: parentFilter) versioned = Bloom.insert(element: hash(aesKey), into: simple) Saturation nextStep = Bloom.insert(element: xof_hash(n++), into: prevStep) Repeat until threshold bits flipped โ€œOptimalโ€ threshold depends on Bloom configuration, but often ~49% of bits

Slide 60

Slide 60

Secret Files ๐Ÿฅท Dark Forest

Slide 61

Slide 61

Secret Files ๐Ÿฅท Dark Forest

Slide 62

Slide 62

Secret Files ๐Ÿฅท Dark Forest

Slide 63

Slide 63

Secret Files ๐Ÿฅท Dark Forest

Slide 64

Slide 64

Secret Files ๐Ÿฅท Reasonably Efficient Secret KV

Slide 65

Slide 65

Secret Files ๐Ÿฅท Reasonably Efficient Secret KV HAMT (weight 16)

Slide 66

Slide 66

Secret Files ๐Ÿฅท Reasonably Efficient Secret KV HAMT 163 = 4,096 buckets (weight 16) 164 = 65,536 buckets

Slide 67

Slide 67

Secret Files ๐Ÿฅท Reasonably Efficient Secret KV HAMT 163 = 4,096 buckets (weight 16) 164 = 65,536 buckets Append-only Quick Read/Write Merkleized Concurrency Friendly

Slide 68

Slide 68

{brooklyn,philipp}@fission.codes @expede & @matheus23 ๐ŸŽ‰ Thank You, IPFS รพing ๐Ÿ‡ฎ๐Ÿ‡ธ https://whitepaper.fission.codes โœจ github.com/WebNativeFileSystem(/spec) โœจ More in-depth at Strange Loop 2022 (or talk to us today)