-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhow.html
More file actions
154 lines (149 loc) · 13 KB
/
Copy pathhow.html
File metadata and controls
154 lines (149 loc) · 13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
<!DOCTYPE html>
<!-- This site was created in Webflow. http://www.webflow.com -->
<!-- Last Published: Fri Jun 12 2020 19:35:59 GMT+0000 (Coordinated Universal Time) -->
<html data-wf-page="5eda8c73415d3a26f9d2c1ab" data-wf-site="5eda64bd77a8dc6e05ed8a12">
<head>
<meta charset="utf-8">
<title>How it works</title>
<meta content="How it works" property="og:title">
<meta content="How it works" propert y="twitter:title">
<meta content="width=device-width, initial-scale=1" name="viewport">
<meta content="Webflow" name="generator">
<link href="css/normalize.css" rel="stylesheet" type="text/css">
<link href="css/webflow.css" rel="stylesheet" type="text/css">
<link href="new-draft/css/zbay-v2.webflow.css" rel="stylesheet" type="text/css">
<script src="https://ajax.googleapis.com/ajax/libs/webfont/1.6.26/webfont.js" type="text/javascript"></script>
<script type="text/javascript">WebFont.load({ google: { families: ["Rubik:300,regular,700,900"] }});</script>
<!-- [if lt IE 9]><script src="https://cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv.min.js" type="text/javascript"></script><![endif] -->
<script type="text/javascript">!function(o,c){var n=c.documentElement,t=" w-mod-";n.className+=t+"js",("ontouchstart"in o||o.DocumentTouch&&c instanceof DocumentTouch)&&(n.className+=t+"touch")}(window,document);</script>
<link href="images/favicon.png" rel="shortcut icon" type="image/x-icon">
<link href="images/webclip.png" rel="apple-touch-icon">
<style type="text/css">
<!--
@media screen and (min-width: 1200px) {
.w-container {
max-width: 1170px;
}
}
-->
html {
-webkit-appearance: none;
}
html {
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}
</style>
</head>
<body>
<div data-collapse="medium" data-animation="default" data-duration="400" role="banner" class="zb-navbar w-nav"><a href="index.html" class="brand w-nav-brand"><img src="images/logo-lockup--circle.svg" width="142.5" alt="" class="image-2"></a>
<div class="spacer"></div>
<nav role="navigation" class="nav-menu w-nav-menu"><a href="how.html" aria-current="page" class="zb-nav-text-link w-nav-link w--current">How it works</a><a href="why.html" class="zb-nav-text-link w-nav-link">Why Zbay?</a><a href="faq.html" class="zb-nav-text-link w-nav-link">FAQ</a><a href="https://twitter.com/try_quiet" class="zb-flex-nav-link w-inline-block"><img src="images/twitter--black.svg" alt="" class="zb-nav-icon"><div class="zb-nav-text">Twitter</div></a><a href="https://github.com/ZbayApp/ZbayLite" class="zb-flex-nav-link w-inline-block"><img src="images/github--black.svg" alt="" class="zb-nav-icon"><div class="zb-nav-text">Github</div></a></nav>
<div class="menu-button w-nav-button"></div>
</div>
<div id="how" class="zb-how-section">
<div class="zb-section-container">
<p>
⚠️ Zbay is no longer maintained. We are now building <a href="https://tryquiet.org">Quiet</a>, a Tor-based alternative to Slack & Discord that doesn't rely on servers.
</p>
<br>
<h2
data-w-id="2bf1c4bc-d4f2-8c4a-1195-281e50e43eba"
class="zb-section-heading"
>
How Zbay works
</h2>
<p class="zb-p w-clearfix">
<span class="zb-drop-cap">Z</span>bay is a Mac, Windows, and GNU/Linux
desktop app that uses a peer-to-peer network built on <a href="https://www.torproject.org/">Tor</a>, <a href="https://libp2p.io/">libp2p</a>, and <a href="https://github.com/orbitdb/orbit-db">OrbitDB</a> to
offer a team chat experience like Slack, Telegram, or Discord. You
can register a username, join public group chats, message other users, and send or receive money, without depending too much on centralized infrastructure.
</p>
<h3 class="zb-h3">
Zbay makes minimal use of centralized infrastructure
</h3>
<p class="zb-p">
Zbay's use of centralized infrastructure is already minimal and we're working on reducing it even further. First, to enable Zcash payments without a 20+ GB storage requirement for each user, we connect directly (not via Tor) to a centralized <a href="https://github.com/adityapk00/lightwalletd">Zcash lightwallet server</a> run by the <a href="https://www.zecwallet.co/">Zecwallet</a> project. We hope to connect to this infrastructure via Tor in the future, but it is not supported yet.
</p>
<p class="zb-p">
For username registration and peer discovery on startup, we currently rely on centralized infrastructure (both our own, and the lightwallet infrastructure run by Zecwallet), but our goal is to remove these dependencies in the next major release. At that point, an invite link from a community owner will be sufficient to discover peers, register a username, and join a community.
</p>
<p class="zb-p">
Finally, we rely on the Tor network, though this seems perfectly prudent and brings many benefits, including metadata privacy against a wide range of attackers, addresses for peers that are both permanent and unguessable, and the ability to connect any two peers regardless of NATs or firewalls.
</p>
<h3 class="zb-h3">
Zbay uses libp2p, Websockets, and Tor to connect peers
</h3>
<p class="zb-p">
<a href="https://libp2p.io/">Libp2p</a> is the underlying p2p network layer for a growing family of well-funded projects, <a href="https://blog.ipfs.io/2020-06-09-libp2p-in-2020/">including Filecoin and Ethereum 2</a>. It lets peers connect over multiple kinds of transports, including WebSockets, which <a href="https://blog.torproject.org/secure-messaging-onion-services-how">work well</a> when used with Tor. To use libp2p with Tor, we create a Tor <a href="https://gitlab.torproject.org/legacy/trac/-/wikis/doc/NextGenOnions">v3 onion service</a> for each peer, and then use a modified WebSocket transport to connect to the onion addresses of other peers.
</p>
<p class="zb-p">
In simple terms, each peer runs a simple webserver behind an onion address on the Tor network, and peers connect to each others' servers.<br />
</p>
<p class="zb-p">
Right now, Zbay only operates on one network whose entry node is hardcoded into the app itself, so all messages are public. But this will change soon as we add the ability to create new private communities, each running on their own separate libp2p network.<br />
</p>
<h3 class="zb-h3">Zbay uses IPFS and OrbitDB to sync messages</h3>
<p class="zb-p">
We could use libp2p <a href="https://github.com/ipfs-shipyard/ipfs-pubsub-room">pubsub</a> for broadcasting a message to all online peers in a given network. But what about peers who are offline? The magic of modern messaging apps like Slack, Discord, Telegram, and Signal (in contrast to older approaches like IRC and Pidgin/OTR) is that users don't miss messages sent while they were offline; in modern messaging apps, these messages appear almost instantly once users come back online. How do we achieve <em>that</em>, without a central server?<br />
</p>
<p class="zb-p">
<a href="https://scuttlebutt.nz/">Secure Scuttlebutt</a> addresses this problem, but it does so in a way that is very specific to a "social network feed with a single publisher" use-case (think: decentralized Twitter) and would require a lot of awkward stretching to use for a conversation with a mix of participants. The "sync all changes" functionality that Git provides is closer to what we need, and we even used Git in our prototypes! But this was a hack, and bundling Git with Zbay for several different OSes and device types would have been a massive headache.<br />
</p>
<p class="zb-p">
<a href="https://github.com/orbitdb/orbit-db">OrbitDB</a> ended up being pretty much exactly what we needed, and while it's still somewhat experimental and maintained by a small team, it builds on libp2p and <a href="https://ipfs.io/">IPFS</a> tools that are used more widely. OrbitDB gives us an easy way for offline peers to return and fetch what they missed. We also get some limited guarantees around the integrity of messages and message ordering.<br />
</p>
<p class="zb-p">
There's no way to delete data from an OrbitDB, yet. But we should be able to make messages deletable someday by <em>linking</em> to message content from OrbitDB (and then deleting <em>that</em>) or by deleting entire OrbitDBs and recreating them without the deleted messages. The details get messy, and like almost any deletion scheme it requires trusting recipients, but it is possible.<br />
</p>
<h3 class="zb-h3">
Zbay broadcasts private messages to all community members, encrypted to the recipients.
</h3>
<p class="zb-p">
A requirement for any team chat app is the ability to start private conversations with one or more other team members. We want these messages to be eventually visible to offline peers too, since that's what users have come to expect from modern, centralized messaging apps. As sometimes happens with peer-to-peer approaches, the needs of privacy and availability pull in different directions. We believe the best balance is to broadcast private messages to all members of a community, but encrypt them to their intended recipients.<br />
</p>
<p class="zb-p">
This leaves the problem of metadata privacy within the community. Currently, any member of the community can learn who is talking to whom, and when, and that is not desirable! We plan to addres this in the future by using Tor to deliver messages to the peer-to-peer network anonymously.<br />
</p>
<h3 class="zb-h3">
Zbay can use Android apps (we think) to provide always-on peers.
</h3>
<p class="zb-p">
Our approach to "syncing missed messages" still requires that at least one peer has been online since those messages were sent. It doesn't have to the be <em>same</em> peer; peers can sync messages from one to the next, like relay racers passing a baton. But if no peers are online, or if there was a gap, returning users won't see those messages until a peer who <em>did</em> see them comes back online. That's not great! There will be an invisible gap in the conversation, with a weird UX issue once those old messages resurface again.<br />
</p>
<p class="zb-p">
Our current plan for this is to build a decent Android app that can remain connected to the peer-to-peer network for as long as the phone is turned on and has service. We're currently building a prototype for Android and it's promising, but we don't know how practical this is yet. We've heard that the battery life impact of running Tor onion services in the background is manageable on new phones.<br />
</p>
<p class="zb-p">
The hope is that if everyone joins the network with all of their devices, even small communities of 5-10 members will have enough always-on peers to minimize these kinds of gaps.<br />
</p>
<p class="zb-p">
If this doesn't work, another approach would be to let communities add an altruistic (or perhaps a compensated) always-on peer <em>without</em> giving them the keys needed to decrypt messages.<br />
</p>
</div>
</div>
<div class="zb-footer">
<div class="zb-footer__logo-container"><a href="/" class="zb-footer__logo-link-block w-inline-block"><img src="images/logo-lockup--circle--watermark.svg" alt="" class="zb-footer__logo"></a></div>
<ul role="list" class="zb-footer__pri-btns-list">
<li class="zb-footer__pri-btn-item">
<a href="how.html" aria-current="page" class="zb-footer__pri-btn w-inline-block w--current">
<div class="zb-footer__pri-btn-text">How it works</div>
</a>
<a href="why.html" class="zb-footer__pri-btn w-inline-block">
<div class="zb-footer__pri-btn-text">Why?</div>
</a>
<a href="faq.html" class="zb-footer__pri-btn w-inline-block">
<div class="zb-footer__pri-btn-text">FAQ</div>
</a>
</li>
</ul>
<ul role="list" class="zb-footer__sec-btns-list">
<li class="zb-footer__sec-btn-item"><a href="https://twitter.com/try_quiet" class="zb-footer__sec-btn w-inline-block"><img src="images/twitter--white.svg" alt="" class="zb-footer__sec-btn-image"></a></li>
<li class="zb-footer__sec-btn-item"><a href="https://github.com/ZbayApp/ZbayLite" class="zb-footer__sec-btn w-inline-block"><img src="images/github--white.svg" alt="" class="zb-footer__sec-btn-image"></a></li>
</ul>
<div class="zb-footer__copyright-text"><span class="copy-left">©</span> Copyleft Zbay 2020</div>
</div>
<script src="https://d3e54v103j8qbb.cloudfront.net/js/jquery-3.4.1.min.220afd743d.js?site=5eda64bd77a8dc6e05ed8a12" type="text/javascript" integrity="sha256-CSXorXvZcTkaix6Yvo6HppcZGetbYMGWSFlBw8HfCJo=" crossorigin="anonymous"></script>
<script src="js/webflow.js" type="text/javascript"></script>
<!-- [if lte IE 9]><script src="https://cdnjs.cloudflare.com/ajax/libs/placeholders/3.0.2/placeholders.min.js"></script><![endif] -->
</body>
</html>