{"id":671,"date":"2020-02-18T20:43:05","date_gmt":"2020-02-18T19:43:05","guid":{"rendered":"http:\/\/people.iola.dk\/arj\/?p=671"},"modified":"2020-02-18T20:43:05","modified_gmt":"2020-02-18T19:43:05","slug":"secure-scuttlebutt-in-a-browser","status":"publish","type":"post","link":"https:\/\/people.iola.dk\/arj\/2020\/02\/18\/secure-scuttlebutt-in-a-browser\/","title":{"rendered":"Secure scuttlebutt in a browser"},"content":{"rendered":"\n<p>For roughly the last year I have been working on bringing <a href=\"https:\/\/github.com\/ssbc\/ssb-db\">secure scuttlebutt<\/a> to the browser. The result of this is <a href=\"https:\/\/github.com\/arj03\/ssb-browser-core\">ssb-browser-core<\/a>.<\/p>\n\n\n\n<p>Secure scuttlebutt allows one to write an unforgeable append-only log of messages and to exchange these messages between nodes in a p2p network without a central authority. With this, one can build <a href=\"https:\/\/martinfowler.com\/eaaDev\/EventSourcing.html\">event sourcing<\/a> systems.<\/p>\n\n\n\n<p>The first secure scuttlebutt implementation (there are also <a href=\"https:\/\/github.com\/cryptoscope\/ssb\">Go<\/a> and <a href=\"https:\/\/github.com\/sunrise-choir\/\">rust<\/a> implementations now) is a normal node application and thus requires a lot of things that are not readily available in a browser such as a filesystem and crypto.  Filesystem api is provides by <a href=\"https:\/\/github.com\/random-access-storage\/random-access-web\">random-access-web<\/a> that for chrome uses the file system api which is quite fast. Crypto is provided by <a href=\"https:\/\/github.com\/jedisct1\/libsodium.js\">libsodium.js<\/a> which uses wasm and is roughly 90% the speed of running it natively. The last part is network, he we rely on web sockets which gives us a long running connection to a server somewhere.  With <a href=\"https:\/\/github.com\/ssbc\/ssb-ebt\">epidemic broadcast trees<\/a> to exchange messages, one can get the latest messages for several hundred feeds (probably also thousands) in a reliable and low latency manor.<\/p>\n\n\n\n<p>With this, one is able to run secure scuttlebutt in any environment where the browser works. This includes Chrome, Firefox, Safari and on android and iOS. By running as a progressive web app it is possible to side step the normal walled garden of the dominant mobile operating systems. Jacob also managed to get it running as a <a href=\"https:\/\/github.com\/powersource\/ssb-webextension-demo\/\">web extension<\/a>.<\/p>\n\n\n\n<p>The main application for showing what can be built on top of these primitives is a social network called <a href=\"https:\/\/scuttlebutt.nz\/\">scuttlebutt<\/a>. In order to test the functionality of the core, I wrote a <a href=\"https:\/\/github.com\/arj03\/ssb-browser-demo\">demo application<\/a> with most of the basic functionality for having conversations. Other applications that has been built on top of the protocol includes gatherings, chess, git, books.<\/p>\n\n\n\n<p>I did a walkthrough of how it works for a few people in the SSB community. You can watch the video below.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><a href=\"https:\/\/hooktube.com\/watch?v=E8pnc2N1XHo&amp;feature=youtu.be\"><img loading=\"lazy\" decoding=\"async\" width=\"800\" height=\"437\" src=\"https:\/\/people.iola.dk\/arj\/wp-content\/uploads\/ssb-browser-demo-video.jpg\" alt=\"\" class=\"wp-image-672\" srcset=\"https:\/\/people.iola.dk\/arj\/wp-content\/uploads\/ssb-browser-demo-video.jpg 800w, https:\/\/people.iola.dk\/arj\/wp-content\/uploads\/ssb-browser-demo-video-300x164.jpg 300w, https:\/\/people.iola.dk\/arj\/wp-content\/uploads\/ssb-browser-demo-video-768x420.jpg 768w\" sizes=\"auto, (max-width: 800px) 100vw, 800px\" \/><\/a><\/figure>\n\n\n\n<p>This weekend I&#8217;ll be at the University in Basel to discuss SSB and related p2p technologies.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>For roughly the last year I have been working on bringing secure scuttlebutt to the browser. The result of this is ssb-browser-core. Secure scuttlebutt allows one to write an unforgeable append-only log of messages and to exchange these messages between nodes in a p2p network without a central authority. With this, one can build event [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[308],"tags":[],"class_list":["post-671","post","type-post","status-publish","format-standard","hentry","category-blog"],"_links":{"self":[{"href":"https:\/\/people.iola.dk\/arj\/wp-json\/wp\/v2\/posts\/671","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/people.iola.dk\/arj\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/people.iola.dk\/arj\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/people.iola.dk\/arj\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/people.iola.dk\/arj\/wp-json\/wp\/v2\/comments?post=671"}],"version-history":[{"count":13,"href":"https:\/\/people.iola.dk\/arj\/wp-json\/wp\/v2\/posts\/671\/revisions"}],"predecessor-version":[{"id":685,"href":"https:\/\/people.iola.dk\/arj\/wp-json\/wp\/v2\/posts\/671\/revisions\/685"}],"wp:attachment":[{"href":"https:\/\/people.iola.dk\/arj\/wp-json\/wp\/v2\/media?parent=671"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/people.iola.dk\/arj\/wp-json\/wp\/v2\/categories?post=671"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/people.iola.dk\/arj\/wp-json\/wp\/v2\/tags?post=671"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}