mirror of
https://github.com/vacp2p/vac.dev-experimental-old.git
synced 2025-02-21 09:38:20 +00:00
583 lines
30 KiB
HTML
583 lines
30 KiB
HTML
<!DOCTYPE html>
|
||
<html class="h-full" lang="en-US">
|
||
<head>
|
||
|
||
<title>Vac - Fixing Whisper with Waku</title>
|
||
|
||
|
||
<meta charset="utf-8" />
|
||
<meta http-equiv="x-ua-compatible" content="ie=edge" />
|
||
<title>Vac</title>
|
||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||
|
||
<script async defer src="https://cdn.simpleanalytics.io/hello.js"></script>
|
||
<noscript><img src="https://api.simpleanalytics.io/hello.gif" alt="" /></noscript>
|
||
|
||
<!-- Fathom - simple website analytics - https://github.com/usefathom/fathom -->
|
||
<script>
|
||
(function (f, a, t, h, o, m) {
|
||
a[h] =
|
||
a[h] ||
|
||
function () {
|
||
(a[h].q = a[h].q || []).push(arguments);
|
||
};
|
||
(o = f.createElement("script")), (m = f.getElementsByTagName("script")[0]);
|
||
o.async = 1;
|
||
o.src = t;
|
||
o.id = "fathom-script";
|
||
m.parentNode.insertBefore(o, m);
|
||
})(document, window, "//fathom.status.im/tracker.js", "fathom");
|
||
fathom("set", "siteId", "YELIA");
|
||
fathom("trackPageview");
|
||
</script>
|
||
<!-- / Fathom -->
|
||
|
||
<!-- Twitter cards -->
|
||
<meta name="twitter:site" content="@vacp2p" />
|
||
<meta name="twitter:creator" content="@oskarth" />
|
||
<meta name="twitter:title" content="Fixing Whisper with Waku" />
|
||
|
||
|
||
<meta name="twitter:description" content="A research log. Why Whisper doesn't scale and how to fix it." />
|
||
|
||
<meta name="twitter:card" content="summary_large_image" />
|
||
<meta name="twitter:image" content="https://vac.dev/assets/img/whisper_scalability.png" />
|
||
|
||
<!-- end of Twitter cards -->
|
||
|
||
<link rel="shortcut icon" href="/assets/img/favicon.png" type="image/png" />
|
||
<link rel="preload" href="/fonts/OpenSans-Regular.woff2" as="font" type="font/woff2" crossorigin />
|
||
<link rel="preload" href="/fonts/OpenSans-SemiBold.woff2" as="font" type="font/woff2" crossorigin />
|
||
<link rel="preload" href="/fonts/OpenSans-SemiBoldItalic.woff2" as="font" type="font/woff2" crossorigin />
|
||
<link rel="stylesheet" href="/assets/css/style.css" />
|
||
</head>
|
||
|
||
<body class="h-full flex flex-col font-body">
|
||
<div class="flex-grow container max-w-screen-xl mx-auto px-5 md:px-12 lg:pt-6">
|
||
<header class="sm:sticky sm:top-0 bg-white z-50">
|
||
<div class="container max-w-screen-xl sm:border-b">
|
||
<div class="nav-section flex justify-between items-center py-3 md:py-5 lg:py-10">
|
||
<div class="logo md:pr-8 l:p-0">
|
||
<a href="/"><img src="/assets/img/logo.png" alt="Vac logo" class="w-9 h-11" /></a>
|
||
</div>
|
||
<div class="flex justify-between items-center w-9/12">
|
||
<div class="burger block sm:hidden z-50">
|
||
<button class="burger__button burger__button--open fixed top-2 right-5 w-12 h-12" type="button" aria-label="Mobile menu button">
|
||
<img class="burger__icon" src="/assets/img/burger.svg" alt="Open menu button" />
|
||
</button>
|
||
<button class="burger__button burger__button--close hidden fixed top-2 right-5 w-12 h-12" type="button" aria-label="Close mobile menu button">
|
||
<img class="burger__icon burger__icon--close" src="/assets/img/close.svg" alt="Close menu button" />
|
||
</button>
|
||
</div>
|
||
|
||
<nav class="nav max-w-screen-xm md:max-w-screen-sl container">
|
||
<ul class="nav__list hidden sm:flex justify-between container text-xs font-semibold md:pr-8 l:p-0">
|
||
<li class="hover:opacity-50">
|
||
|
||
<a class="nav__link" href="/#work">Work</a>
|
||
|
||
</li>
|
||
<li class="hover:opacity-50">
|
||
|
||
<a class="nav__link" href="/#about">About</a>
|
||
|
||
</li>
|
||
<li class="hover:opacity-50">
|
||
|
||
<a class="nav__link" href="/#join">Join Vac</a>
|
||
|
||
</li>
|
||
<li class="hover:opacity-50">
|
||
|
||
<a class="nav__link" href="/research-log">Research log</a>
|
||
|
||
</li>
|
||
<li class="hover:opacity-50">
|
||
|
||
<a class="nav__link" href="/media">Media</a>
|
||
|
||
</li>
|
||
<li class="hover:opacity-50">
|
||
|
||
<a href="https://rfc.vac.dev/" target="_blank" rel="noopener noreferrer">Specs</a>
|
||
|
||
</li>
|
||
<li class="hover:opacity-50">
|
||
|
||
<a href="https://forum.vac.dev/" target="_blank" rel="noopener noreferrer">Forum</a>
|
||
|
||
</li>
|
||
|
||
</ul>
|
||
</nav>
|
||
|
||
<ul class="social items-center hidden md:flex">
|
||
<li class="pr-5">
|
||
<a href="https://twitter.com/vacp2p" target="_blank" rel="noopener noreferrer">
|
||
<svg width="25" height="21" viewBox="0 0 25 21" fill="none" xmlns="http://www.w3.org/2000/svg" class="hover:opacity-50">
|
||
<path
|
||
d="M24.8872 3.04499C23.9872 3.43499 23.0572 3.70498 22.0672 3.82499C23.0872 3.22498 23.8672 2.26499 24.2272 1.09499C23.2672 1.66499 22.2172 2.05499 21.1072 2.29499C20.2072 1.33499 18.9172 0.734985 17.5072 0.734985C14.7772 0.734985 12.5872 2.95499 12.5872 5.65499C12.5872 6.04499 12.6172 6.40498 12.7072 6.76498C8.62721 6.58498 5.02721 4.60498 2.59721 1.63499C0.857207 4.75498 2.80721 7.33499 4.09721 8.20499C3.31721 8.20499 2.53721 7.96499 1.87721 7.60499C1.87721 10.035 3.58721 12.045 5.80721 12.495C5.32721 12.645 4.24721 12.735 3.58721 12.585C4.21721 14.535 6.04721 15.975 8.17721 16.005C6.49721 17.325 4.03721 18.375 0.887207 18.045C3.07721 19.455 5.65721 20.265 8.44721 20.265C17.5072 20.265 22.4272 12.765 22.4272 6.28499C22.4272 6.07499 22.4272 5.86499 22.3972 5.65499C23.4172 4.90499 24.2572 4.03499 24.8872 3.04499Z"
|
||
fill="#151512"
|
||
/>
|
||
</svg>
|
||
</a>
|
||
</li>
|
||
<li class="pr-5">
|
||
<a href="https://github.com/vacp2p" target="_blank" rel="noopener noreferrer">
|
||
<svg width="26" height="25" viewBox="0 0 26 25" fill="none" xmlns="http://www.w3.org/2000/svg" class="hover:opacity-50">
|
||
<path
|
||
d="M12.8857 0.856567C6.26021 0.856567 0.915339 6.20154 0.950043 12.7951C0.9778 18.0687 4.43935 22.5427 9.21766 24.1227C9.81824 24.2327 10.0353 23.864 10.0336 23.5474C10.0321 23.2635 10.0177 22.5129 10.0065 21.5171C6.67274 22.238 5.95552 19.9163 5.95552 19.9163C5.40376 18.5369 4.61433 18.1698 4.61433 18.1698C3.51994 17.4296 4.69151 17.4444 4.69151 17.4444C5.89646 17.5291 6.53549 18.6751 6.53549 18.6751C7.61609 20.4989 9.35182 19.9727 10.0342 19.6665C10.1382 18.8951 10.4459 18.3689 10.7878 18.0702C8.12222 17.7684 5.31483 16.7443 5.29076 12.1708C5.2839 10.8672 5.74629 9.80152 6.50989 8.96619C6.3838 8.66445 5.96641 7.45009 6.61027 5.80766C6.61027 5.80766 7.61658 5.4866 9.9167 7.03094C10.8723 6.76636 11.8976 6.63408 12.9191 6.62962C13.9376 6.63556 14.9658 6.76636 15.9257 7.03242C18.2081 5.48809 19.2163 5.80914 19.2163 5.80914C19.8789 7.45306 19.4743 8.66594 19.3529 8.96767C20.1268 9.80301 20.5959 10.8687 20.6028 12.1723C20.6269 16.7577 17.8272 17.767 15.1558 18.0628C15.5882 18.4314 15.976 19.1597 15.9819 20.273C15.9903 21.8693 15.9821 23.1565 15.9841 23.5474C15.9858 23.867 16.2038 24.2386 16.8122 24.1212C21.5663 22.5397 24.9778 18.0672 24.95 12.7951C24.9153 6.20154 19.5142 0.856567 12.8857 0.856567Z"
|
||
fill="#151512"
|
||
/>
|
||
</svg>
|
||
</a>
|
||
</li>
|
||
<li>
|
||
<a href="https://discord.gg/PQFdubGt6d" target="_blank" rel="noopener noreferrer">
|
||
<svg width="25" height="21" viewBox="0 0 25 21" fill="none" xmlns="http://www.w3.org/2000/svg" class="hover:opacity-50">
|
||
<path
|
||
d="M22.7861 9.04256C21.8482 5.74455 20.7799 4.04048 20.7627 4.00991C20.7017 3.93459 19.189 2.104 15.5271 0.75L15.0353 2.0764C16.7774 2.72057 18.0116 3.50643 18.6899 4.01419C16.6599 3.40408 14.2431 3.03041 12.1008 3.03041C9.95851 3.03041 7.53775 3.40408 5.50128 4.01419C6.18496 3.50648 7.42744 2.72057 9.17631 2.0764L8.69846 0.75C5.02238 2.104 3.49044 3.93459 3.42863 4.00991C3.41108 4.04048 2.32479 5.74455 1.35221 9.04256C0.414855 12.2208 0.0415214 16.7045 0.027872 16.8843C0.109225 17.0131 1.97891 20.25 7.12077 20.25L8.43406 18.3536C6.97595 17.964 5.58693 17.3357 4.31689 16.4832L5.10228 15.3069C7.15122 16.6822 9.54509 17.4092 12.0251 17.4092C14.5051 17.4092 16.9067 16.6822 18.9701 15.3069L19.7431 16.4832C18.4641 17.3357 17.0684 17.964 15.6062 18.3536L16.8995 20.25C22.0414 20.25 23.9452 17.0131 24.0279 16.8843C24.0161 16.7045 23.69 12.2208 22.7861 9.04256ZM8.79853 12.7392H7.39228L7.40468 10.3841H8.81093L8.79853 12.7392ZM16.7071 12.7392H15.3008L15.3132 10.3841H16.7195L16.7071 12.7392Z"
|
||
fill="#151512"
|
||
/>
|
||
</svg>
|
||
</a>
|
||
</li>
|
||
|
||
</ul>
|
||
</div>
|
||
|
||
<div class="overlay container max-w-screen-sm w-full hidden sm:hidden fixed top-0 right-0 h-screen bg-black bg-opacity-40 z-30">
|
||
<nav class="nav-mobile hidden fixed top-0 right-0 flex flex-col justify-between items-center pt-14 px-12 pb-5 bg-white w-9/12 h-3/4 z-40">
|
||
<ul class="nav__list flex flex-col flex-1 justify-between items-center container box-content w-32 h-auto max-h-nav text-xs font-normal">
|
||
<li class="hover:opacity-50">
|
||
|
||
<a class="nav__link" href="/#work">Work</a>
|
||
|
||
</li>
|
||
<li class="hover:opacity-50">
|
||
|
||
<a class="nav__link" href="/#about">About</a>
|
||
|
||
</li>
|
||
<li class="hover:opacity-50">
|
||
|
||
<a class="nav__link" href="/#join">Join Vac</a>
|
||
|
||
</li>
|
||
<li class="hover:opacity-50">
|
||
|
||
<a class="nav__link" href="/research-log">Research log</a>
|
||
|
||
</li>
|
||
<li class="hover:opacity-50">
|
||
|
||
<a class="nav__link" href="/media">Media</a>
|
||
|
||
</li>
|
||
<li class="hover:opacity-50">
|
||
|
||
<a href="https://rfc.vac.dev/" target="_blank" rel="noopener noreferrer">Specs</a>
|
||
|
||
</li>
|
||
<li class="hover:opacity-50">
|
||
|
||
<a href="https://forum.vac.dev/" target="_blank" rel="noopener noreferrer">Forum</a>
|
||
|
||
</li>
|
||
|
||
</ul>
|
||
<ul class="social items-center flex mt-8">
|
||
<li class="pr-5">
|
||
<a href="https://twitter.com/vacp2p" target="_blank" rel="noopener noreferrer">
|
||
<svg width="25" height="21" viewBox="0 0 25 21" fill="none" xmlns="http://www.w3.org/2000/svg" class="hover:opacity-50">
|
||
<path
|
||
d="M24.8872 3.04499C23.9872 3.43499 23.0572 3.70498 22.0672 3.82499C23.0872 3.22498 23.8672 2.26499 24.2272 1.09499C23.2672 1.66499 22.2172 2.05499 21.1072 2.29499C20.2072 1.33499 18.9172 0.734985 17.5072 0.734985C14.7772 0.734985 12.5872 2.95499 12.5872 5.65499C12.5872 6.04499 12.6172 6.40498 12.7072 6.76498C8.62721 6.58498 5.02721 4.60498 2.59721 1.63499C0.857207 4.75498 2.80721 7.33499 4.09721 8.20499C3.31721 8.20499 2.53721 7.96499 1.87721 7.60499C1.87721 10.035 3.58721 12.045 5.80721 12.495C5.32721 12.645 4.24721 12.735 3.58721 12.585C4.21721 14.535 6.04721 15.975 8.17721 16.005C6.49721 17.325 4.03721 18.375 0.887207 18.045C3.07721 19.455 5.65721 20.265 8.44721 20.265C17.5072 20.265 22.4272 12.765 22.4272 6.28499C22.4272 6.07499 22.4272 5.86499 22.3972 5.65499C23.4172 4.90499 24.2572 4.03499 24.8872 3.04499Z"
|
||
fill="#151512"
|
||
/>
|
||
</svg>
|
||
</a>
|
||
</li>
|
||
<li class="pr-5">
|
||
<a href="https://github.com/vacp2p" target="_blank" rel="noopener noreferrer">
|
||
<svg width="26" height="25" viewBox="0 0 26 25" fill="none" xmlns="http://www.w3.org/2000/svg" class="hover:opacity-50">
|
||
<path
|
||
d="M12.8857 0.856567C6.26021 0.856567 0.915339 6.20154 0.950043 12.7951C0.9778 18.0687 4.43935 22.5427 9.21766 24.1227C9.81824 24.2327 10.0353 23.864 10.0336 23.5474C10.0321 23.2635 10.0177 22.5129 10.0065 21.5171C6.67274 22.238 5.95552 19.9163 5.95552 19.9163C5.40376 18.5369 4.61433 18.1698 4.61433 18.1698C3.51994 17.4296 4.69151 17.4444 4.69151 17.4444C5.89646 17.5291 6.53549 18.6751 6.53549 18.6751C7.61609 20.4989 9.35182 19.9727 10.0342 19.6665C10.1382 18.8951 10.4459 18.3689 10.7878 18.0702C8.12222 17.7684 5.31483 16.7443 5.29076 12.1708C5.2839 10.8672 5.74629 9.80152 6.50989 8.96619C6.3838 8.66445 5.96641 7.45009 6.61027 5.80766C6.61027 5.80766 7.61658 5.4866 9.9167 7.03094C10.8723 6.76636 11.8976 6.63408 12.9191 6.62962C13.9376 6.63556 14.9658 6.76636 15.9257 7.03242C18.2081 5.48809 19.2163 5.80914 19.2163 5.80914C19.8789 7.45306 19.4743 8.66594 19.3529 8.96767C20.1268 9.80301 20.5959 10.8687 20.6028 12.1723C20.6269 16.7577 17.8272 17.767 15.1558 18.0628C15.5882 18.4314 15.976 19.1597 15.9819 20.273C15.9903 21.8693 15.9821 23.1565 15.9841 23.5474C15.9858 23.867 16.2038 24.2386 16.8122 24.1212C21.5663 22.5397 24.9778 18.0672 24.95 12.7951C24.9153 6.20154 19.5142 0.856567 12.8857 0.856567Z"
|
||
fill="#151512"
|
||
/>
|
||
</svg>
|
||
</a>
|
||
</li>
|
||
<li>
|
||
<a href="https://discord.gg/PQFdubGt6d" target="_blank" rel="noopener noreferrer">
|
||
<svg width="25" height="21" viewBox="0 0 25 21" fill="none" xmlns="http://www.w3.org/2000/svg" class="hover:opacity-50">
|
||
<path
|
||
d="M22.7861 9.04256C21.8482 5.74455 20.7799 4.04048 20.7627 4.00991C20.7017 3.93459 19.189 2.104 15.5271 0.75L15.0353 2.0764C16.7774 2.72057 18.0116 3.50643 18.6899 4.01419C16.6599 3.40408 14.2431 3.03041 12.1008 3.03041C9.95851 3.03041 7.53775 3.40408 5.50128 4.01419C6.18496 3.50648 7.42744 2.72057 9.17631 2.0764L8.69846 0.75C5.02238 2.104 3.49044 3.93459 3.42863 4.00991C3.41108 4.04048 2.32479 5.74455 1.35221 9.04256C0.414855 12.2208 0.0415214 16.7045 0.027872 16.8843C0.109225 17.0131 1.97891 20.25 7.12077 20.25L8.43406 18.3536C6.97595 17.964 5.58693 17.3357 4.31689 16.4832L5.10228 15.3069C7.15122 16.6822 9.54509 17.4092 12.0251 17.4092C14.5051 17.4092 16.9067 16.6822 18.9701 15.3069L19.7431 16.4832C18.4641 17.3357 17.0684 17.964 15.6062 18.3536L16.8995 20.25C22.0414 20.25 23.9452 17.0131 24.0279 16.8843C24.0161 16.7045 23.69 12.2208 22.7861 9.04256ZM8.79853 12.7392H7.39228L7.40468 10.3841H8.81093L8.79853 12.7392ZM16.7071 12.7392H15.3008L15.3132 10.3841H16.7195L16.7071 12.7392Z"
|
||
fill="#151512"
|
||
/>
|
||
</svg>
|
||
</a>
|
||
</li>
|
||
|
||
</ul>
|
||
</nav>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</header>
|
||
|
||
|
||
<main class="bg-white text-black flex flex-col"><section class="container max-w-screen-xl flex flex-col items-center pt-10 pb-0 md:pb-10 lg:pb-0">
|
||
<div class="info-block max-w-680 pb-5 sm:pb-10 overflow-hidden">
|
||
<div class="post mb-10">
|
||
<h1 class="text-xl md:text-xxl mb-5 sm:max-w-md lg:max-w-2xl">Fixing Whisper with Waku</h1>
|
||
<div>
|
||
<span class="text-s lg:text-base"> 03 Dec 2019 • by </span>
|
||
<a href="/authors/oskarth" class="text-s lg:text-base font-bold hover:underline">oskarth</a>
|
||
</div>
|
||
</div>
|
||
<div class="post__content"><p>This post will introduce Waku. Waku is a fork of Whisper that attempts to
|
||
addresses some of Whisper’s shortcomings in an iterative fashion. We will also
|
||
introduce a theoretical scaling model for Whisper that shows why it doesn’t
|
||
scale, and what can be done about it.</p>
|
||
|
||
<h2 id="introduction">Introduction</h2>
|
||
|
||
<p>Whisper is a gossip-based communication protocol or an ephemeral key-value store
|
||
depending on which way you look at it. Historically speaking, it is the
|
||
messaging pilllar of <a href="http://gavwood.com/dappsweb3.html">Web3</a>, together with
|
||
Ethereum for consensus and Swarm for storage.</p>
|
||
|
||
<p>Whisper, being a somewhat esoteric protocol and with some fundamental issues,
|
||
hasn’t seen a lot of usage. However, applications such as Status are using it,
|
||
and have been making minor ad hoc modifications to it to make it run on mobile
|
||
devices.</p>
|
||
|
||
<p>What are these fundamental issues? In short:</p>
|
||
|
||
<ol>
|
||
<li>scalability, most immediately when it comes to bandwidth usage</li>
|
||
<li>spam-resistance, proof of work is a poor mechanism for heterogeneous nodes</li>
|
||
<li>no incentivized infrastructure, leading to centralized choke points</li>
|
||
<li>lack of formal and unambiguous specification makes it hard to analyze and implement</li>
|
||
<li>running over devp2p, which limits where it can run and how</li>
|
||
</ol>
|
||
|
||
<p>In this post, we’ll focus on the first problem, which is scalability through bandwidth usage.</p>
|
||
|
||
<h2 id="whisper-theoretical-scalability-model">Whisper theoretical scalability model</h2>
|
||
|
||
<p><em>(Feel free to skip this section if you want to get right to the results).</em></p>
|
||
|
||
<p>There’s widespread implicit knowledge that Whisper “doesn’t scale”, but it is less understood exactly why. This theoretical model attempts to encode some characteristics of it. Specifically for use case such as one by Status (see <a href="https://specs.status.im/spec/3">Status Whisper usage
|
||
spec</a>).</p>
|
||
|
||
<h3 id="caveats">Caveats</h3>
|
||
|
||
<p>First, some caveats: this model likely contains bugs, has wrong assumptions, or completely misses certain dimensions. However, it acts as a form of existence proof for unscalability, with clear reasons.</p>
|
||
|
||
<p>If certain assumptions are wrong, then we can challenge them and reason about them in isolation. It doesn’t mean things will definitely work as the model predicts, and that there aren’t unknown unknowns.</p>
|
||
|
||
<p>The model also only deals with receiving bandwidth for end nodes, uses mostly static assumptions of averages, and doesn’t deal with spam resistance, privacy guarantees, accounting, intermediate node or network wide failures.</p>
|
||
|
||
<h3 id="goals">Goals</h3>
|
||
|
||
<ol>
|
||
<li>Ensure network scales by being user or usage bound, as opposed to bandwidth growing in proportion to network size.</li>
|
||
<li>Staying with in a reasonable bandwidth limit for limited data plans.</li>
|
||
<li>Do the above without materially impacting existing nodes.</li>
|
||
</ol>
|
||
|
||
<p>It proceeds through various case with clear assumptions behind them, starting from the most naive assumptions. It shows results for 100 users, 10k users and 1m users.</p>
|
||
|
||
<h3 id="model">Model</h3>
|
||
|
||
<div class="highlighter-rouge"><div class="highlight"><pre class="highlight"><code>Case 1. Only receiving messages meant for you [naive case]
|
||
|
||
Assumptions:
|
||
- A1. Envelope size (static): 1024kb
|
||
- A2. Envelopes / message (static): 10
|
||
- A3. Received messages / day (static): 100
|
||
- A4. Only receiving messages meant for you.
|
||
|
||
For 100 users, receiving bandwidth is 1000.0KB/day
|
||
For 10k users, receiving bandwidth is 1000.0KB/day
|
||
For 1m users, receiving bandwidth is 1000.0KB/day
|
||
|
||
------------------------------------------------------------
|
||
|
||
Case 2. Receiving messages for everyone [naive case]
|
||
|
||
Assumptions:
|
||
- A1. Envelope size (static): 1024kb
|
||
- A2. Envelopes / message (static): 10
|
||
- A3. Received messages / day (static): 100
|
||
- A5. Received messages for everyone.
|
||
|
||
For 100 users, receiving bandwidth is 97.7MB/day
|
||
For 10k users, receiving bandwidth is 9.5GB/day
|
||
For 1m users, receiving bandwidth is 953.7GB/day
|
||
|
||
------------------------------------------------------------
|
||
|
||
Case 3. All private messages go over one discovery topic [naive case]
|
||
|
||
Assumptions:
|
||
- A1. Envelope size (static): 1024kb
|
||
- A2. Envelopes / message (static): 10
|
||
- A3. Received messages / day (static): 100
|
||
- A6. Proportion of private messages (static): 0.5
|
||
- A7. Public messages only received by relevant recipients (static).
|
||
- A8. All private messages are received by everyone (same topic) (static).
|
||
|
||
For 100 users, receiving bandwidth is 49.3MB/day
|
||
For 10k users, receiving bandwidth is 4.8GB/day
|
||
For 1m users, receiving bandwidth is 476.8GB/day
|
||
|
||
------------------------------------------------------------
|
||
|
||
Case 4. All private messages are partitioned into shards [naive case]
|
||
|
||
Assumptions:
|
||
- A1. Envelope size (static): 1024kb
|
||
- A2. Envelopes / message (static): 10
|
||
- A3. Received messages / day (static): 100
|
||
- A6. Proportion of private messages (static): 0.5
|
||
- A7. Public messages only received by relevant recipients (static).
|
||
- A9. Private messages partitioned across partition shards (static), n=5000
|
||
|
||
For 100 users, receiving bandwidth is 1000.0KB/day
|
||
For 10k users, receiving bandwidth is 1.5MB/day
|
||
For 1m users, receiving bandwidth is 98.1MB/day
|
||
|
||
------------------------------------------------------------
|
||
|
||
Case 5. 4 + Bloom filter with false positive rate
|
||
|
||
Assumptions:
|
||
- A1. Envelope size (static): 1024kb
|
||
- A2. Envelopes / message (static): 10
|
||
- A3. Received messages / day (static): 100
|
||
- A6. Proportion of private messages (static): 0.5
|
||
- A7. Public messages only received by relevant recipients (static).
|
||
- A9. Private messages partitioned across partition shards (static), n=5000
|
||
- A10. Bloom filter size (m) (static): 512
|
||
- A11. Bloom filter hash functions (k) (static): 3
|
||
- A12. Bloom filter elements, i.e. topics, (n) (static): 100
|
||
- A13. Bloom filter assuming optimal k choice (sensitive to m, n).
|
||
- A14. Bloom filter false positive proportion of full traffic, p=0.1
|
||
|
||
For 100 users, receiving bandwidth is 10.7MB/day
|
||
For 10k users, receiving bandwidth is 978.0MB/day
|
||
For 1m users, receiving bandwidth is 95.5GB/day
|
||
|
||
NOTE: Traffic extremely sensitive to bloom false positives
|
||
This completely dominates network traffic at scale.
|
||
With p=1% we get 10k users ~100MB/day and 1m users ~10gb/day)
|
||
|
||
------------------------------------------------------------
|
||
|
||
Case 6. Case 5 + Benign duplicate receives
|
||
|
||
Assumptions:
|
||
- A1. Envelope size (static): 1024kb
|
||
- A2. Envelopes / message (static): 10
|
||
- A3. Received messages / day (static): 100
|
||
- A6. Proportion of private messages (static): 0.5
|
||
- A7. Public messages only received by relevant recipients (static).
|
||
- A9. Private messages partitioned across partition shards (static), n=5000
|
||
- A10. Bloom filter size (m) (static): 512
|
||
- A11. Bloom filter hash functions (k) (static): 3
|
||
- A12. Bloom filter elements, i.e. topics, (n) (static): 100
|
||
- A13. Bloom filter assuming optimal k choice (sensitive to m, n).
|
||
- A14. Bloom filter false positive proportion of full traffic, p=0.1
|
||
- A15. Benign duplicate receives factor (static): 2
|
||
- A16. No bad envelopes, bad PoW, expired, etc (static).
|
||
|
||
For 100 users, receiving bandwidth is 21.5MB/day
|
||
For 10k users, receiving bandwidth is 1.9GB/day
|
||
For 1m users, receiving bandwidth is 190.9GB/day
|
||
|
||
------------------------------------------------------------
|
||
|
||
Case 7. 6 + Mailserver under good conditions; small bloom fp; mostly offline
|
||
|
||
Assumptions:
|
||
- A1. Envelope size (static): 1024kb
|
||
- A2. Envelopes / message (static): 10
|
||
- A3. Received messages / day (static): 100
|
||
- A6. Proportion of private messages (static): 0.5
|
||
- A7. Public messages only received by relevant recipients (static).
|
||
- A9. Private messages partitioned across partition shards (static), n=5000
|
||
- A10. Bloom filter size (m) (static): 512
|
||
- A11. Bloom filter hash functions (k) (static): 3
|
||
- A12. Bloom filter elements, i.e. topics, (n) (static): 100
|
||
- A13. Bloom filter assuming optimal k choice (sensitive to m, n).
|
||
- A14. Bloom filter false positive proportion of full traffic, p=0.1
|
||
- A15. Benign duplicate receives factor (static): 2
|
||
- A16. No bad envelopes, bad PoW, expired, etc (static).
|
||
- A17. User is offline p% of the time (static) p=0.9
|
||
- A18. No bad request, dup messages for mailservers; overlap perfect (static).
|
||
- A19. Mailserver requests can change false positive rate to be p=0.01
|
||
|
||
For 100 users, receiving bandwidth is 3.9MB/day
|
||
For 10k users, receiving bandwidth is 284.8MB/day
|
||
For 1m users, receiving bandwidth is 27.8GB/day
|
||
|
||
------------------------------------------------------------
|
||
|
||
Case 8. No metadata protection w bloom filter; 1 node connected; static shard
|
||
|
||
Aka waku mode.
|
||
|
||
Next step up is to either only use contact code, or shard more aggressively.
|
||
Note that this requires change of other nodes behavior, not just local node.
|
||
|
||
Assumptions:
|
||
- A1. Envelope size (static): 1024kb
|
||
- A2. Envelopes / message (static): 10
|
||
- A3. Received messages / day (static): 100
|
||
- A6. Proportion of private messages (static): 0.5
|
||
- A7. Public messages only received by relevant recipients (static).
|
||
- A9. Private messages partitioned across partition shards (static), n=5000
|
||
|
||
For 100 users, receiving bandwidth is 1000.0KB/day
|
||
For 10k users, receiving bandwidth is 1.5MB/day
|
||
For 1m users, receiving bandwidth is 98.1MB/day
|
||
|
||
------------------------------------------------------------
|
||
</code></pre></div></div>
|
||
|
||
<p>See <a href="https://github.com/vacp2p/research/tree/master/whisper_scalability">source</a>
|
||
for more detail on the model and its assumptions.</p>
|
||
|
||
<h3 id="takeaways">Takeaways</h3>
|
||
|
||
<ol>
|
||
<li>Whisper as it currently works doesn’t scale, and we quickly run into unacceptable bandwidth usage.</li>
|
||
<li>There are a few factors of this, but largely it boils down to noisy topics usage and use of bloom filters. Duplicate (e.g. see <a href="https://our.status.im/whisper-pss-comparison/">Whisper vs PSS</a>) and bad envelopes are also factors, but this depends a bit more on specific deployment configurations.</li>
|
||
<li>Waku mode (case 8) is an additional capability that doesn’t require other nodes to change, for nodes that put a premium on performance.</li>
|
||
<li>The next bottleneck after this is the partitioned topics (app/network specific), which either needs to gracefully (and potentially quickly) grow, or an alternative way of consuming those messages needs to be deviced.</li>
|
||
</ol>
|
||
|
||
<p><img src="assets/img/whisper_scalability.png" alt="" /></p>
|
||
|
||
<p>The results are summarized in the graph above. Notice the log-log scale. The
|
||
colored backgrounds correspond to the following bandwidth usage:</p>
|
||
|
||
<ul>
|
||
<li>Blue: <10mb/d (<~300mb/month)</li>
|
||
<li>Green: <30mb/d (<~1gb/month)</li>
|
||
<li>Yellow: <100mb/d (<~3gb/month)</li>
|
||
<li>Red: >100mb/d (>3gb/month)</li>
|
||
</ul>
|
||
|
||
<p>These ranges are somewhat arbitrary, but are based on <a href="https://github.com/status-im/status-react/issues/9081">user
|
||
requirements</a> for users
|
||
on a limited data plan, with comparable usage for other messaging apps.</p>
|
||
|
||
<h2 id="introducing-waku">Introducing Waku</h2>
|
||
|
||
<h3 id="motivation-for-a-new-protocol">Motivation for a new protocol</h3>
|
||
|
||
<p>Apps such as Status will likely use something like Whisper for the forseeable
|
||
future, and we want to enable them to use it with more users on mobile devices
|
||
without bandwidth exploding with minimal changes.</p>
|
||
|
||
<p>Additionally, there’s not a clear cut alternative that maps cleanly to the
|
||
desired use cases (p2p, multicast, privacy-preserving, open, etc).</p>
|
||
|
||
<p>We are actively researching, developing and collaborating with more greenfield
|
||
approaches. It is likely that Waku will either converge to those, or Waku will
|
||
lay the groundwork (clear specs, common issues/components) necessary to make
|
||
switching to another protocol easier. In this project we want to emphasize
|
||
iterative work with results on the order of weeks.</p>
|
||
|
||
<h3 id="briefly-on-waku-mode">Briefly on Waku mode</h3>
|
||
|
||
<ul>
|
||
<li>Doesn’t impact existing clients, it’s just a separate node and capability.</li>
|
||
<li>Other nodes can still use Whisper as is, like a full node.</li>
|
||
<li>Sacrifices metadata protection and incurs higher connectivity/availability requirements for scalbility</li>
|
||
</ul>
|
||
|
||
<p><strong>Requirements:</strong></p>
|
||
|
||
<ul>
|
||
<li>Exposes API to get messages from a set of list of topics (no bloom filter)</li>
|
||
<li>Way of being identified as a Waku node (e.g. through version string)</li>
|
||
<li>Option to statically encode this node in app, e.g. similar to custom bootnodes/mailserver</li>
|
||
<li>Only node that needs to be connected to, possibly as Whisper relay / mailserver hybrid</li>
|
||
</ul>
|
||
|
||
<p><strong>Provides:</strong></p>
|
||
|
||
<ul>
|
||
<li>likely provides scalability of up to 10k users and beyond</li>
|
||
<li>with some enhancements to partition topic logic, can possibly scale up to 1m users (app/network specific)</li>
|
||
</ul>
|
||
|
||
<p><strong>Caveats:</strong></p>
|
||
|
||
<ul>
|
||
<li>hasn’t been tested in a large-scale simulation</li>
|
||
<li>other network and intermediate node bottlenecks might become apparent (e.g. full bloom filter and private cluster capacity; can likely be dealt with in isolation using known techniques, e.g. load balancing) (deployment specific)</li>
|
||
</ul>
|
||
|
||
<h3 id="progress-so-far">Progress so far</h3>
|
||
|
||
<p>In short, we have a <a href="https://rfc.vac.dev/spec/5">Waku version 0 spec up</a> as well as a <a href="https://github.com/status-im/nim-eth/pull/120">PoC</a> for backwards compatibility. In the coming weeks, we are going to solidify the specs, get a more fully featured PoC for <a href="https://github.com/status-im/nim-eth/pull/114">Waku mode</a>. See <a href="https://github.com/vacp2p/pm/issues/5">rough roadmap</a>, project board [link deprecated] and progress thread on the <a href="https://forum.vac.dev/t/waku-project-and-progress/24">Vac forum</a>.</p>
|
||
|
||
<p>The spec has been rewrittten for clarity, with ABNF grammar and less ambiguous language. The spec also incorporates several previously <a href="https://rfc.vac.dev/spec/6/#additional-capabilities">ad hoc implemented features</a>, such as light nodes and mailserver/client support. This has already caught a few incompatibilities between the <code class="highlighter-rouge">geth</code> (Go), <code class="highlighter-rouge">status/whisper</code> (Go) and <code class="highlighter-rouge">nim-eth</code> (Nim) versions, specifically around light node usage and the handshake.</p>
|
||
|
||
<p>If you are interested in this effort, please check out <a href="https://forum.vac.dev/">our forum</a> for questions, comments and proposals. We already have some discussion for better <a href="https://forum.vac.dev/t/stake-priority-based-queuing/26">spam protection</a> (see <a href="https://vac.dev/feasibility-semaphore-rate-limiting-zksnarks">previous post</a> for a more complex but privacy-preserving proposal), something that is likely going to be addressed in future versions of Waku, along with many other fixes and enhancement.</p>
|
||
</div>
|
||
</div>
|
||
</section>
|
||
</main>
|
||
</div>
|
||
<footer class="footer bg-black flex flex-shrink-0 justify-center">
|
||
<div class="container max-w-screen-xl flex sl:justify-between lm:justify-start p-5 md:px-12 md:pt-5 lg:py-10">
|
||
<div class="logo mr-10 sm:mr-0 sm:w-2/12 lg:w-3/12">
|
||
<a href="/"><img src="/assets/img/logo.png" alt="Vac logo" class="w-9 h-11" /></a>
|
||
</div>
|
||
|
||
<div class="flex flex-col xm:flex-row xm:justify-between sm:w-10/12 lg:w-9/12">
|
||
<p class="hidden sl:inline-block sl:mr-10 text-xxs lg:text-base text-white opacity-75">Vac researches peer-to-peer, private, censorship resistant communication</p>
|
||
<nav class="flex max-w-xs mr-0 xm:mr-5 l:mr-32 mb-5 sm:mb-0">
|
||
<div class="flex">
|
||
<div class="flex flex-col mr-5 sm:mr-10 sl:mr-14">
|
||
<p class="text-xxs lg:text-base text-white opacity-75 mb-5 lg:mb-8">Research</p>
|
||
<ul>
|
||
<li class="text-xxs lg:text-base text-white hover:opacity-50 mb-5">
|
||
<a href="/research-log" target="_blank" rel="noopener noreferrer">Log</a>
|
||
</li>
|
||
<li class="text-xxs lg:text-base text-white hover:opacity-50 mb-5">
|
||
<a href="https://rfc.vac.dev/" target="_blank" rel="noopener noreferrer">Specs</a>
|
||
</li>
|
||
|
||
</ul>
|
||
</div>
|
||
<div class="flex flex-col sl:mr-14">
|
||
<p class="text-xxs lg:text-base text-white opacity-75 mb-5 lg:mb-8">Socials</p>
|
||
<ul>
|
||
<li class="text-xxs lg:text-base text-white hover:opacity-50 mb-5">
|
||
<a href="https://twitter.com/vacp2p" target="_blank" rel="noopener noreferrer">Twitter</a>
|
||
</li>
|
||
<li class="text-xxs lg:text-base text-white hover:opacity-50 mb-5">
|
||
<a href="https://discord.gg/PQFdubGt6d" target="_blank" rel="noopener noreferrer">Discord</a>
|
||
</li>
|
||
<li class="text-xxs lg:text-base text-white hover:opacity-50 mb-5">
|
||
<a href="https://t.me/vacp2p" target="_blank" rel="noopener noreferrer">Telegram</a>
|
||
</li>
|
||
|
||
</ul>
|
||
</div>
|
||
</div></nav></div>
|
||
</div>
|
||
</footer>
|
||
<script src="/assets/js/main.min.js"></script>
|
||
<script src="/assets/js/smooth-scroll.min.js"></script>
|
||
|
||
</body>
|
||
</html>
|