A place to cache linked articles (think custom and personal wayback machine)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

index.md 6.7KB

4 yıl önce
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. title: Why bother with P2P when you still need to guarantee uptime?
  2. url: https://pfrazee.hashbase.io/blog/why-bother-with-p2p
  3. hash_url: 1c4afad2d73e0c0309069520213f2f09
  4. <p><a href="https://beakerbrowser.com">Beaker browser</a> uses a peer-to-peer protocol (<a href="https://datproject.org">dat://</a>) to serve websites.
  5. With p2p, you can create and host websites from the browser.</p>
  6. <p>However, people have observed that peer-to-peer does not guarantee uptime.
  7. You still need a computer to keep your dats online, or else your visitors will get a 404.</p>
  8. <blockquote class="twitter-tweet" data-lang="en"><p lang="en" dir="ltr">publish a p2p website on my computer -&gt; oh no I want my friends to see my blog even when my computer is sleeping, better keep it on all the time -&gt; my computer is now a server <br />??? what am I missing</p>&mdash; daiyi! ✨ (chris) (@daiyitastic) <a href="https://twitter.com/daiyitastic/status/1053766549922705408?ref_src=twsrc%5Etfw">October 20, 2018</a></blockquote>
  9. <p>In the <a href="https://github.com/beakerbrowser/beaker/releases/tag/0.8.0">most recent version of Beaker</a>, we’ve added a new feature called the “Watchlist” because peer-to-peer sites go down when users go offline.
  10. The watchlist lets you know when a site comes back.</p>
  11. <p><img src="/assets/img/add-to-watchlist.png" alt="add-to-watchlist.png" /></p>
  12. <p><a href="https://datproject.org">Dat</a> works to improve uptime, but it doesn’t <em>guarantee</em> uptime.
  13. Dat is a lot like BitTorrent; if there aren’t any peers online and you haven’t visited the site before, then you can’t download the site.</p>
  14. <p><img src="/assets/img/seed-menu.png" class="centered bordered" style="margin: 40px auto" /></p>
  15. <p>Like the tweet above mentions, you can use a “peer service” like <a href="https://hashbase.io/">Hashbase</a> to keep your site online.
  16. This is a pretty straight-forward solution: you’re asking a service to be the peer of last resort.
  17. You can also <a href="https://github.com/beakerbrowser/hashbase">self-host Hashbase</a>.</p>
  18. <p>I believe that home servers will someday be common enough to solve this problem, but it raises a good question:
  19. If uptime isn’t guaranteed by the network, then what’s the benefit of p2p?</p>
  20. <h2 id="why-bother-its-cheaper">Why bother: It’s cheaper</h2>
  21. <p>Peer-to-peer hosting may not guarantee uptime, but it does solve costs.</p>
  22. <p>In traditional client/server hosting, the server has to pay the full cost of bandwidth.
  23. You’re going to shoulder all the cost, which is pretty intense when a self-hosted video goes viral.
  24. The bandwidth bill adds up.</p>
  25. <p class="center" style="margin: 40px auto"><img src="/assets/img/aws-bandwidth-bill.png" class="bordered" /><br /><small>1 million downloads of a 10MB video gets you a $900 bill. (<a href="https://aws.amazon.com/ec2/pricing/on-demand/">source</a>)</small></p>
  26. <p>The idea of spending anything more than $5 to share a video of your cat wearing a pirate costume is, frankly, not very realistic.</p>
  27. <p class="center" style="margin: 40px auto"><img src="/assets/img/pirate-cat.jpg" class="bordered" /><br /><small>Yarrr I hope that shit was worth it. (<a href="https://www.meowingtons.com/products/pirate-cat-costume-1">source</a>)</small></p>
  28. <p>Peer-to-peer hosting solves that by distributing cost through the network.
  29. Visitors seed the files, effectively giving resources back to the creators and to the other visitors.
  30. As a result, creators don’t have to shoulder the costs – going viral on p2p doesn’t break the bank.</p>
  31. <p>If we ever want to stop depending on services like YouTube to host our content, we really need cost-sharing in order to make it feasible.</p>
  32. <h2 id="why-bother-its-disintermediating">Why bother: It’s disintermediating</h2>
  33. <p>Creating an HTTP/S website is a chore.
  34. You need to setup a server on Google Cloud or AWS, configure and buy a domain name, and then acquire an SSL certificate.
  35. That’s all <em>on top</em> of just building the site.</p>
  36. <p>The premise of the Web is to make publishing and connection available to everyone.
  37. Depending on services to solve these problems is why we have a centralization problem.</p>
  38. <p><img src="/assets/img/create-website.png" class="centered bordered" style="margin: 40px auto" /></p>
  39. <p>A peer-to-peer protocol replaces the server/DNS/SSL stack.
  40. Domains are allocated as public keys, which is free and instant and works offline.
  41. Files are published by signing and sharing them.
  42. This is all a few clicks in the browser, so literally anybody can create a website.</p>
  43. <p><img src="/assets/img/builtin-editor.png" class="centered bordered" style="margin: 40px auto" /></p>
  44. <p>There’s a second-order benefit to this: P2P apps don’t use servers to store user-data.
  45. Apps manage user data by <a href="https://beakerbrowser.com/docs/guides/read-site-files">reading</a> and <a href="https://beakerbrowser.com/docs/guides/write-site-files">writing</a> files on the visitor’s own p2p sites.
  46. This means storing user-data is free and instant and works offline.
  47. That’s why it’s possible to <a href="https://beakerbrowser.com/docs/tour/#forking-or-copying-a-website">“fork” dat websites</a>: there’s no server hiding the code.</p>
  48. <p>Peer services (<a href="https://hashbase.io/">Hashbase</a>) are not ideal, but they have one key advantage: they’re dumb.
  49. They don’t encode business logic.
  50. P2P apps put the business logic into the client instead, where it’s in the users’ hands and can be modified.</p>
  51. <p>This inverts the power structure – even if you’re using a peer service, you’re only using it for its resources, not to define your application.
  52. Ideally this should mean that the services live in the background, and can be swapped with no impact on the user.</p>
  53. <h2 id="closing">Closing</h2>
  54. <p>Why bother with peer-to-peer?</p>
  55. <p>Because we’re wasting the world’s talents by saying that only corporations can modify our software.
  56. The world is full of hackers who want to improve the world.
  57. Doing so should not require an API key.</p>
  58. <p>Disintermediation matters because it inverts the control structure of the network, but cost-cutting matters too.
  59. Cost-cutting matters because the society of computers isn’t going to work if participation costs money.
  60. That’s how wealth translates into power.
  61. Coders should not have to front the cost of hosting their own work – the network should.</p>
  62. <p>Maybe someday a peer-to-peer protocol will guarantee uptime.
  63. That would be really useful!
  64. The community is watching <a href="https://filecoin.io/">Filecoin’s</a> launch with a lot interest.
  65. But even if it doesn’t, peer-to-peer can have a powerful effect on the Web.</p>
  66. <p><a href="https://beakerbrowser.com">» Learn more about Beaker browser.</a></p>