Open urbien opened 4 years ago
While I am a newb when it comes to low-level p2p, I imagine that the cloudflare workers stack (workers kv for persistent, durable objects for ephemeral) could be used to facilitate a peer discovery service, and multiple workers from different accounts could sync data to facilitate a multi-owner DHT (akin to bittorrent trackers, or scuttlebutt pubs), which could use some form of cryptography to verify what the worker says who is who is actually who is who. Such operating on the edge with cloudflare power would solve a lot of the current performance issues with DHT technology. So clients could specify several of these worker locations to replace the oldschool dht, or supplement it, and update their listing as time goes on.
seems zeronet are somewhat doing this: https://github.com/HelloZeroNet/ZeroNet/issues/1913#issuecomment-466756674
Problem
See the issue for this. Summary:
No UDP in browsers.
Corporate firewalls may block UDP. Need to bridge to DHT over WebSockets or WebRTC.
No peer discovery on Cell Phone networks. Cellphone networks run symmetric firewalls. So mobile apps or PCs on HotSpot can't establish direct connections (although UDP works, NAT hole punching does not).
DHT state needs stability. Peers that come and go lose DHT state and need to recreate it (although this can be overcome with caching). Peers that change their IP address too often, destabilize DHT.
This solution uses 2 servers for signaling.
Note that WebTorrent works in the browser. Need to investigate how they do it. They have been discussing "DHT over WebRTC" for a long time.
See a number of issues still pending resolution to make Hyperswarm and Hypercore work in react-native
Fallback using Personal Cloud
Notes
Future research
To increase privacy, especially for applications like COVID-19 Contact Tracing, we need to add encryption to DHT traffic.