A presentation at Strange Loop 2022 in September 2022 in St. Louis, MO, USA by Brooklyn Zelenka
! The Dark Forest ” A Distributed File System for Secure P2P Applications github.com/wnfs-wg github.com/fission-codes
Brooklyn Zelenka @expede
Brooklyn Zelenka @expede • Cofounder & CTO at Fission • @FissionCodes • https://fission.codes • Infra & SDK for edge apps • Standards: UCAN, EIPs, FVM, Multiformats, CAR Pool, WNFS,&c
Meta WNFS
Meta WNFS WN FS
Meta WNFS First principles, flipped tradeoffs “Can’t be done” → super hard but works & scales! Sharp corners Under explored design space Databases, blind busses, nym servers, etc Novel ways to recombine a few ideas WN FS
Meta WNFS First principles, flipped tradeoffs “Can’t be done” → super hard but works & scales! Sharp corners Under explored design space Databases, blind busses, nym servers, etc Novel ways to recombine a few ideas ) e l i F ( H C TE WN FS
Meta WNFS First principles, flipped tradeoffs “Can’t be done” → super hard but works & scales! Sharp corners Under explored design space Databases, blind busses, nym servers, etc Novel ways to recombine a few ideas ) e l i F ( ⅔ H C TE Secret Filesystem WN FS ⅓ Public Filesystem
Video Killed the Radio Star A New Environment #
A New Environment # New Environment, Who Dis?
A New Environment # New Environment, Who Dis? Then $ Now “
A New Environment # New Environment, Who Dis? Need Then $ Now ” Convenient % Critical &
A New Environment # New Environment, Who Dis? Then $ Now ” Need Convenient % Critical & Location Data Centre ’ Powerful Clients (M1, IoT) ⌚)*
A New Environment # New Environment, Who Dis? Then $ Now ” Need Convenient % Critical & Location Data Centre ’ Powerful Clients (M1, IoT) ⌚)* + , Access
A New Environment # New Environment, Who Dis? Then $ Now ” Need Convenient % Critical & Location Data Centre ’ Powerful Clients (M1, IoT) ⌚)* + , Bandwidth - Latency ⏲ Access Bottleneck
A New Environment # New Environment, Who Dis? Then $ Now ” Need Convenient % Critical & Location Data Centre ’ Powerful Clients (M1, IoT) ⌚)* + , Bandwidth - Latency ⏲ /0 123 … 4 Access Bottleneck Market
A New Environment # Toxic Data • 2005: Credit card data in DB • 2015: Personal info in DB • 2025: Nothing in DB
A New Environment # What LAMP Has Wrought
A New Environment # What LAMP Has Wrought Users 5678 Developer 9
A New Environment # What LAMP Has Wrought Users 5678 Browser + REST / JSON-RPC / GraphQL ↕ Server ⚙ Data Store < DevOps = Developer 9
A New Environment # Federate Data, Not Apps
A New Environment # Federate Data, Not Apps Alice’s Stuff Bob’s Stuff Carol’s Stuff
A New Environment # Federate Data, Not Apps Photo Gallery
Alice’s Stuff Bob’s Stuff Carol’s Stuff
Alice’s Stuff Bob’s Stuff Carol’s Stuff Social Media ?
Alice’s Stuff Bob’s Stuff Music Player @ Carol’s Stuff Social Media ?
A New Environment # Common Needs
A New Environment # Ideally Invisible & General
A New Environment # Ideally Invisible & General Web Apps e.g. Fission Drive, Diffuse Music
A New Environment # Ideally Invisible & General Web Apps e.g. Fission Drive, Diffuse Music Tools for Thought e.g. TiddlyWiki
A New Environment # Ideally Invisible & General Web Apps e.g. Fission Drive, Diffuse Music Tools for Thought e.g. TiddlyWiki Data Science e.g. Qri
A New Environment # Ideally Invisible & General Web Apps e.g. Fission Drive, Diffuse Music Tools for Thought e.g. TiddlyWiki Data Science e.g. Qri Storage Networks WIP
A New Environment # WNFS API
A New Environment # WNFS API add cat ls mkdir rm mv write
A New Environment # WNFS API add cat ls mkdir rm mv write https://guide.fission.codes/developers/webnative/file-system-wnfs
Content Addressing Primer From a File System Perspective E
Content Addressing E
Content Addressing E The limitation of local knowledge is the fundamental fact about the setting in which we work, and it is a very powerful limitation – Nancy Lynch, A Hundred Impossibility Proofs for Distributed Computing
Content Addressing E Addressing Stack
Content Addressing E Addressing Stack Virtual (Machine) Location E (42.123.45.6/path)@t0 = content1 (42.123.45.6/path)@t1 = content2
Content Addressing E Addressing Stack Named Location F Virtual (Machine) Location E {DNS → IP} (42.123.45.6/path)@t0 = content1 (42.123.45.6/path)@t1 = content2
Content Addressing E Addressing Stack Universal Content ID {hash(content) → content} Named Location F {DNS → IP} Virtual (Machine) Location E (42.123.45.6/path)@t0 = content1 (42.123.45.6/path)@t1 = content2
Content Addressing E IPLD Node
Content Addressing E IPLD Node Bytes 0101000101001001010
Content Addressing E IPLD Node Bytes 0101000101001001010 Links Foo Bar
Content Addressing E Raw IPLD Node IPLD Node Bytes 0101000101001001010 Links bafy12345 Foo Bar
Content Addressing E Raw IPLD Node IPLD Node Bytes 0101000101001001010 Links bafy12345 Foo bafyABCDE Bar bafyVWXYZ
Content Addressing E Mutability
Content Addressing E Mutability TXT _dnslink.akiko.example.com
Content Addressing E Mutability TXT _dnslink.akiko.example.com bafy12345
Content Addressing E Mutability TXT _dnslink.akiko.example.com bafyABCDE bafy12345
Content Addressing E Mutability TXT _dnslink.akiko.example.com bafyABCDE bafy12345 Decoupled: atomic, reductions, etc
Content Addressing E Hard & Soft Links
Content Addressing E Hard & Soft Links akiko.example.com
Content Addressing E Hard & Soft Links akiko.example.com boris.example.com
Content Addressing E Hard & Soft Links akiko.example.com Hard Links New for the web! Direct reference 2 pointers ~ deduplicate boris.example.com
Content Addressing E Hard & Soft Links akiko.example.com Hard Links New for the web! Direct reference 2 pointers ~ deduplicate boris.example.com Soft Links Symlink or web link (URL) Pointer ~ latest Latest may break
Content Addressing E Data Partitioning & Selective Replication
Content Addressing E Data Partitioning & Selective Replication ,
Content Addressing E Layout
Content Addressing E Layout WNFS Root
Content Addressing E Layout WNFS Root Owner DID G
Content Addressing E Layout WNFS Root Public H Photos Avatars Owner DID G Apps
Content Addressing E Layout WNFS Root Public H Photos Avatars Owner DID G Apps Secret I Photos Apps Family Photos My Gallery
Content Addressing E Layout WNFS Root Public H Photos Avatars Owner DID G Apps Photos Family Photos Secret I Apps My Gallery Sharing Out = Keys & Pointers
Content Addressing E Layout WNFS Root Public H Photos Avatars Owner DID G Apps Photos Family Photos Secret I Apps My Gallery Sharing In J Sharing Out = Keys and Keys and Keys & Pointers Pointers Pointers Keys & Pointers
Content Addressing Primer E Semantic Layers
Content Addressing Primer E Semantic Layers Noun Files Data
Content Addressing Primer E Semantic Layers Noun Visibility Decrypted Files Encrypted Data
Content Addressing Primer E Semantic Layers Noun Visibility Decrypted → Files → Encrypted Data →
Content Addressing Primer E Semantic Layers Noun Visibility Decrypted Example → Paths & Content → Headers & Node Layout → Merkle Set Files Encrypted Data
Public Files K WNFS Data Model Public Photos Avatars Apps
Public Files K Virtual Nodes
Public Files K Virtual Nodes Raw Content (Hash Linked Binary Data)
Public Files K Virtual Nodes Raw Content (Hash Linked Binary Data) File Node
Public Files K Virtual Nodes Raw Content (Hash Linked Binary Data) File Node Kernel Header
Public Files K Virtual Nodes Raw Content (Hash Linked Binary Data) File Node Kernel Header Userland Raw Data
Public Files K Virtual Nodes Raw Content (Hash Linked Binary Data) File Node Kernel Header Userland Raw Data Userland Metadata
Public Files K Virtual Nodes Raw Content (Hash Linked Binary Data) Virtual Node File Node Kernel Header Userland Raw Data Consistent interface Arbitrary metadata Tags, creators, MIME, sources, &c Userland Metadata
Public Files K Virtual Nodes Raw Content (Hash Linked Binary Data) Virtual Node File Node Kernel Header Userland Raw Data Consistent interface Arbitrary metadata Tags, creators, MIME, sources, &c Userland Metadata Directory Node Kernel Header Index Metadata
Public Files K Hash-Linked Layout
Public Files K Hash-Linked Layout bafyVWXYZ beach.png
Public Files K Hash-Linked Layout bafy12345 Vacation bafyVWXYZ beach.png
Public Files K Hash-Linked Layout bafy12345 Vacation bafyVWXYZ beach.png caricature.jpg bafyLMNOP
Public Files K Hash-Linked Layout bafy12345 Vacation Avatars@r0 bafyABCDE bafyVWXYZ beach.png caricature.jpg bafyLMNOP
Public Files K Hash-Linked Layout bafy0000 Photos@r0 bafy12345 Vacation Avatars@r0 bafyABCDE bafyVWXYZ beach.png caricature.jpg bafyLMNOP
Public Files K Hash-Linked Layout Photos@r0 Vacation Avatars@r0 beach.png caricature.jpg
Public Files K Persistent Versioning Photos@r0 Vacation Avatars@r0 beach.png caricature.jpg
Public Files K Persistent Versioning Photos@r0 Vacation Avatars@r0 beach.png caricature.jpg Revision 0
Public Files K Persistent Versioning Photos@r0 Vacation Avatars@r0 beach.png caricature.jpg Revision 0 L
Public Files K Persistent Versioning Photos@r0 Vacation Avatars@r0 beach.png caricature.jpg Revision 0 Revision 1 L
Public Files K Persistent Versioning Photos@r0 Vacation Avatars@r0 beach.png caricature.jpg Revision 0 smiling.png Revision 1 L
Public Files K Persistent Versioning Photos@r0 Vacation Avatars@r0 Avatars@r1 beach.png caricature.jpg smiling.png Revision 0 Revision 1 L
Public Files K Persistent Versioning Photos@r0 Photos@r1 Vacation Avatars@r0 Avatars@r1 beach.png caricature.jpg smiling.png Revision 0 Revision 1 L
Public Files K Persistent Versioning Photos@r0 ChildHasEvent Vacation Avatars@r0 beach.png caricature.jpg Photos@r1 InsertNew Revision 0 smiling.png Revision 1 L Avatars@r1
Public Files K Rearranged Photos@r1 ChildHasEvent Avatars@r1 Photos@r0 InsertNew Vacation Avatars@r0 beach.png caricature.jpg headshot.png
Public Files K Rearranged Photos@r1 M ChildHasEvent Avatars@r1 Photos@r0 InsertNew Vacation Avatars@r0 beach.png caricature.jpg headshot.png
Public Files K It’s All Just Maps
Public Files K It’s All Just Maps Multiple?! (More on this later)
Public Files K Single Public File History
Public Files K Single Public File History Single File History / “Causal Shadow”
Public Files K Single Public File History A Single File History / “Causal Shadow”
Public Files K Single Public File History A B Single File History / “Causal Shadow”
Public Files K Single Public File History A B Single File History / “Causal Shadow” C
Public Files K Single Public File Confluence B C A Single File History / “Causal Shadow”
Public Files K Single Public File Confluence B C A X W Single File History / “Causal Shadow” Y
Public Files K Single Public File Confluence B C ≠ A X W Single File History / “Causal Shadow” Y
Public Files K Single Public File Confluence B C Z A X W Single File History / “Causal Shadow” Y
Public Files K Single Public File Confluence B C A Z W X Y
Public Files K Directory History B C A Z W X Y
Public Files K Directory History PB PC PA PZ PW PX B PY C A Z W X Y
Public Files K Directory History + Extra Updates PB + 1 PB PC + 1 PC PA PZ PW PX + 1 PX B PY C A Z W X Y
Public Files K Diff Checkpointing
Public Files K Diff Checkpointing bafyZYX bafyY00 bafyABC
Public Files K Diff Checkpointing bafy123 bafyZYX bafyY00 bafyABC bafy789 bafyhai
Public Files K Diff Checkpointing bafy123 bafyZYX bafyY00 bafy789 bafyABC bafyX00 bafy456 bafyhai
Public Files K Diff Checkpointing bafy123 bafyZYX bafyY00 bafy789 bafyhai bafyABC bafyX00 bafy456 bafy0Y2
Public Files K Diff Checkpointing Skip to nodes ending in “00” bafy123 bafyZYX bafyY00 bafy789 bafyhai bafyABC bafyX00 bafy456 bafy0Y2
Public Files K …Moving On…
㊙ Secret Files O Distributed Storage When The Pipes Are Broken P
Cryptography is a tool for turning lots of different problems into key management problems Dr. Lea Kissner, Google’s Global Lead of Privacy Technologies
Secret Files O Dark Forest
Secret Files O Dark Forest CHAMP (weight 16)
Secret Files O Dark Forest 163 > 4k buckets CHAMP 164 > 65k buckets (weight 16) 165 > 1M buckets
Secret Files O Dark Forest Append-only Quick Read/Write Merkleized Concurrency Friendly 163 > 4k buckets CHAMP 164 > 65k buckets (weight 16) 165 > 1M buckets
Secret Files O Dark Forest One Pointer Machine Many (Secret) Roots
Secret Files O Useful: Arbitrary Merge
Secret Files O Useful: Arbitrary Merge ∪
Secret Files O Useful: Arbitrary Merge ∪ Common
Secret Files O Multivalues
Secret Files O Multivalues bafy123
Secret Files O Multivalues bafy123 Header
Secret Files O Multivalues bafy123 Header Content 1 Content 2 Content 3 Content 4
Secret Files O Multivalues bafy123 Header Content 1 Content 2 Content 3 Content 4 Witness 1 Witness 2 Witness 3 Witness 4
Secret Files O Single Private Node
Secret Files O Single Private Node Binary Encrypted Node Q
Secret Files O Single Private Node Binary AES-256 (file) Encrypted Node Q R File Kernel Header Raw Data Metadata
Secret Files O Single Private Node Directory Kernel Header Index Binary AES-256 (file) Encrypted Node Q R Metadata File Kernel Header Raw Data Metadata
Secret Files O Single Private Node Binary AES-256 (dir) Encrypted Node Q R Binary AES-256 (file) Encrypted Node Q R Directory Kernel Header Index Metadata File Kernel Header Raw Data Metadata
Secret Files O Single Private Node Binary AES-256 (dir) Encrypted Node Q R Binary Encrypted Node Q ??? AES-256 (file) R Directory Kernel Header Index Metadata ??? File Kernel Header Raw Data Metadata
Secret Files O Keys… Lots of Keys Encrypted Node Q R Encrypted Node Q R Encrypted Node Q R Encrypted Node Q R
Secret Files O Keys… Lots of Keys Encrypted Node Q Encrypted Node Q Encrypted Node Q Encrypted Node Q R
Secret Files O Dark Forest R
Secret Files O Cryptree
Secret Files O Cryptree Binary Encrypted Node Q Encrypted Node Q Encrypted Node Q
Secret Files O Cryptree Binary CBOR Encrypted Node Q Directory Kernel Header Encrypted Node Q Index Encrypted Node Q R R Metadata
Secret Files O Cryptree Binary CBOR Encrypted Node Q AES256 Encrypted Node Q Directory Kernel Header R Index Encrypted Node Q R R Metadata
Secret Files O Read Window Directory Kernel Header Directory Kernel Header R Index R R Metadata R R R Index Metadata
Secret Files O Offline Access Control / Photos/ SL/ food.jpg Iceland/ stage.png Docs/ notes.md harpa.svg
Secret Files O Offline Access Control / S Photos/ SL/ food.jpg Iceland/ stage.png Docs/ notes.md harpa.svg
Secret Files O Offline Access Control / S Photos/ SL/ Iceland/ Docs/ notes.md S food.jpg stage.png harpa.svg
Secret Files O Offline Access Control / S Photos/ Docs/ S SL/ Iceland/ notes.md S food.jpg stage.png harpa.svg
Secret Files O Offline Access Control / S Photos/ Docs/ S SL/ ⚙➡S Iceland/ notes.md S food.jpg stage.png harpa.svg notes.md @rev2
Temporal Cryptree ⏱ Secrets in Space & Time “
Temporal Cryptree ⏱ Access Control in Space & Time V
Temporal Cryptree ⏱ Access Control in Space & Time V / Header
Temporal Cryptree ⏱ Access Control in Space & Time V / Header /Docs/ Header
Temporal Cryptree ⏱ Access Control in Space & Time V / Header / Header /Docs/ Header /Docs/ Header
Temporal Cryptree ⏱ Access Control in Space & Time V / Header / Header /Docs/ Header /Docs/ Header /sl.md Header
Temporal Cryptree ⏱ Access Control in Space & Time V / Header / Header /Docs/ Header /Docs/ Header /sl.md Header Revision X Revision X+1
Temporal Cryptree ⏱ Access Control in Space & Time V / Header /Docs/ Header ⚙ ⚙ / Header /Docs/ Header /sl.md Header Revision X Revision X+1
Temporal Cryptree ⏱ Access Control in Space & Time V / Header / Header / Header /Docs/ Header /Docs/ Header /Docs/ Header /sl.md Header /sl.md Header Revision X Revision X+1 Revision X+2
Temporal Cryptree ⏱ Access Control in Space & Time V / Header / Header / Header /Docs/ Header /Docs/ Header /sl.md Header /sl.md Header / Content /Docs/ Header Revision X Revision X+1 Revision X+2
Temporal Cryptree ⏱ Access Control in Space & Time V / Header / Header / Header /Docs/ Header /Docs/ Header /sl.md Header /sl.md Header / Content /Docs/ Header /Docs/ Content Revision X Revision X+1 Revision X+2
Temporal Cryptree ⏱ Access Control in Space & Time V / Header / Header / Content /Docs/ Header / Header / Content /Docs/ Header /Docs/ Content /Docs/ Header /Docs/ Content /sl.md Header Revision X Revision X+1 /sl.md Header /sl.md Content Revision X+2
Temporal Cryptree ⏱ Access Control in Space & Time V / Header / Header / Content /Docs/ Header / Header / Content /Docs/ Header /Docs/ Content /Docs/ Header /Docs/ Content /sl.md Header Revision X / Content Revision X+1 /Docs/ Content /sl.md Header /sl.md Content Revision X+2 /sl.md Content
Temporal Cryptree ⏱ Access Control in Space & Time V / Header / Header / Content /Docs/ Header / Header / Content /Docs/ Header /Docs/ Content / Content /Docs/ Header /Docs/ Content /sl.md Header /Docs/ Content /sl.md Header /sl.md Content /sl.md Content
Temporal Cryptree ⏱ Access Control in Space & Time V / Header / Header / Content / Header / Content /Docs/ Header /Docs/ Header /Docs/ Content / Content /Docs/ Header /Docs/ Content /sl.md Header /Docs/ Content /sl.md Header /sl.md Content /sl.md Content
Temporal Cryptree ⏱ Lazy Rooting
Temporal Cryptree ⏱ Lazy Rooting Rev 0
Temporal Cryptree ⏱ Lazy Rooting Rev 0 Rev 1 (Partial)
Temporal Cryptree ⏱ Lazy Rooting Attachment progress Unrooted?! W Rev 0 Rev 1 (Partial)
Temporal Cryptree ⏱ Lazy Rooting Rev 0 Rev 1 (Partial) Rev 2 (Partial)
Temporal Cryptree ⏱ Lazy Rooting Rev 3 (Complete) Rev 0 Rev 1 (Partial) Rev 2 (Partial)
What’s In a Name? I Hiding Paths In Plain Sight X
What’s In a Name? I Why Hidden Paths? • TL;DR correlation is bad • File hierarchy (space) • File history (time)
What’s In a Name? I Quasi-Commutative Hash
What’s In a Name? I Quasi-Commutative Hash X
What’s In a Name? I Quasi-Commutative Hash X Y1
What’s In a Name? I Quasi-Commutative Hash Hash X Y1
What’s In a Name? I Quasi-Commutative Hash Hash X Y1 Y2
What’s In a Name? I Quasi-Commutative Hash Hash Hash X Y1 Y2
What’s In a Name? I Quasi-Commutative Hash Hash Hash Hash X Hash Y1 Y2 X
What’s In a Name? I Quasi-Commutative Hash Hash Hash Hash X Hash Y1 Y2 X Y2 Y1
What’s In a Name? I Quasi-Commutative Hash Hash Hash Hash X Y1 Y2 ↔ Hash X Y2 Y1
What’s In a Name? I Cryptographic Accumulator
What’s In a Name? I Cryptographic Accumulator / root i-number /Strange Loop/ SL i-number /Photos/ Photos i-number /stage.png stage.png i-number stage.png@42 hash(AES Key)
What’s In a Name? I Cryptographic Accumulator / root i-number /Strange Loop/ SL i-number /Photos/ Photos i-number stage.png@42 hash(AES Key) /stage.png stage.png i-number
What’s In a Name? I Cryptographic Accumulator / root i-number /Strange Loop/ SL i-number /Photos/ Photos i-number Parent Accumulator stage.png@42 hash(AES Key) /stage.png stage.png i-number
What’s In a Name? I Cryptographic Accumulator / root i-number /Strange Loop/ SL i-number /Photos/ Photos i-number Parent Accumulator Witness (Encrypted Component) stage.png@42 hash(AES Key) /stage.png stage.png i-number
What’s In a Name? I Cryptographic Accumulator / root i-number /Strange Loop/ SL i-number /Photos/ Photos i-number Parent Accumulator Witness (Encrypted Component) stage.png@42 hash(AES Key) /stage.png stage.png i-number Commitment (Encrypted Path)
What’s In a Name? I Cryptographic Accumulator / root i-number /Photos/ Photos i-number /Strange Loop/ SL i-number stage.png@42 hash(AES Key) /stage.png stage.png i-number
What’s In a Name? I Cryptographic Accumulator / root i-number stage.png@42 hash(AES Key) /Strange Loop/ SL i-number /stage.png stage.png i-number /Photos/ Photos i-number
What’s In a Name? I Cryptographic Accumulator / root i-number Parent Accumuator stage.png@42 hash(AES Key) /Strange Loop/ SL i-number /stage.png stage.png i-number /Photos/ Photos i-number
What’s In a Name? I Cryptographic Accumulator / root i-number Parent Accumuator Witness 1/2 (Secret Component) stage.png@42 hash(AES Key) /Strange Loop/ SL i-number /stage.png stage.png i-number /Photos/ Photos i-number
What’s In a Name? I Cryptographic Accumulator / root i-number Parent Accumuator Witness 1/2 (Secret Component) stage.png@42 hash(AES Key) /Strange Loop/ SL i-number /stage.png stage.png i-number Witness 2/2 (Revealed Component) /Photos/ Photos i-number
What’s In a Name? I Cryptographic Accumulator / root i-number Parent Accumuator Witness 1/2 (Secret Component) stage.png@42 hash(AES Key) /Strange Loop/ SL i-number Commitment (Encrypted Path) /stage.png stage.png i-number Witness 2/2 (Revealed Component) /Photos/ Photos i-number
Wrap Up Y
Wrap Up Y Is That All? • Hash linked files • Privacy-preserving paths • Cryptrees: one key per entrypoint • Temporal access control • History & fork/merge on public and private data
Wrap Up Y Future Work • Wasm & native SDKs based on rs-wnfs — soon! • Local-first, encrypted-at-rest, collaborative datalog • Faster, more reliable networking • ZK-ify private tree certificates • FUSE support
Wrap Up Y Where To Get Started guide.fission.codes github.com/wnfs-wg/spec github.com/wnfs-wg/rs-wnfs
The Difficult is that which can be done immediately; the Impossible that which takes a little longer. — George Santayana
WN FS Z Thank You, Strange Loop @expede brooklyn@fission.codes https://fission.codes discord.gg/fissioncodes ✨ github.com/wnfs-wg(/spec) ✨
View The Dark Forest: A Distributed File System for P2P Applications on Notist.
Dismiss
The following resources were mentioned during the presentation or are useful additional information.