Update documentation

This commit is contained in:
status-im-auto 2023-09-18 14:43:16 +00:00
parent 3a25faa976
commit 06f4c17580
5 changed files with 114 additions and 4222 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1 +0,0 @@
"use strict";(function(){const e=document.querySelector("#book-search-input"),t=document.querySelector("#book-search-results");if(!e)return;e.addEventListener("focus",n),e.addEventListener("keyup",s),document.addEventListener("keypress",i);function i(t){if(e===document.activeElement)return;const n=String.fromCharCode(t.charCode);if(!a(n))return;e.focus(),t.preventDefault()}function a(t){const n=e.getAttribute("data-hotkeys")||"";return n.indexOf(t)>=0}function n(){e.removeEventListener("focus",n),e.required=!0,o("/flexsearch.min.js"),o("/en.search-data.min.7f21e4a2afd95e8fb07f62c3d52cf69f5b6d7d245dc8375e1f472d24a44b3912.js",function(){e.required=!1,s()})}function s(){for(;t.firstChild;)t.removeChild(t.firstChild);if(!e.value)return;const n=window.bookSearchIndex.search(e.value,10);n.forEach(function(e){const n=r("<li><a href></a><small></small></li>"),s=n.querySelector("a"),o=n.querySelector("small");s.href=e.href,s.textContent=e.title,o.textContent=e.section,t.appendChild(n)})}function o(e,t){const n=document.createElement("script");n.defer=!0,n.async=!1,n.src=e,n.onload=t,document.head.appendChild(n)}function r(e){const t=document.createElement("div");return t.innerHTML=e,t.firstChild}})()

View File

@ -1 +0,0 @@
"use strict";(function(){const e=document.querySelector("#book-search-input"),t=document.querySelector("#book-search-results");if(!e)return;e.addEventListener("focus",n),e.addEventListener("keyup",s),document.addEventListener("keypress",i);function i(t){if(e===document.activeElement)return;const n=String.fromCharCode(t.charCode);if(!a(n))return;e.focus(),t.preventDefault()}function a(t){const n=e.getAttribute("data-hotkeys")||"";return n.indexOf(t)>=0}function n(){e.removeEventListener("focus",n),e.required=!0,o("/flexsearch.min.js"),o("/en.search-data.min.66ef33edcefbdf82323473e0dfdc9ce9761d217244af45005eae85099c8610a0.js",function(){e.required=!1,s()})}function s(){for(;t.firstChild;)t.removeChild(t.firstChild);if(!e.value)return;const n=window.bookSearchIndex.search(e.value,10);n.forEach(function(e){const n=r("<li><a href></a><small></small></li>"),s=n.querySelector("a"),o=n.querySelector("small");s.href=e.href,s.textContent=e.title,o.textContent=e.section,t.appendChild(n)})}function o(e,t){const n=document.createElement("script");n.defer=!0,n.async=!1,n.src=e,n.onload=t,document.head.appendChild(n)}function r(e){const t=document.createElement("div");return t.innerHTML=e,t.firstChild}})()

View File

@ -5,13 +5,15 @@
<meta name="generator" content="Hugo 0.106.0"> <meta name="generator" content="Hugo 0.106.0">
<meta charset="UTF-8"> <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="WakuFilter is a protocol that enables subscribing to messages that a peer receives. This is a more lightweight version of WakuRelay specifically designed for bandwidth restricted devices. This is due to the fact that light nodes subscribe to full-nodes and only receive the messages they desire. <meta name="description" content="previous versions: 00
Content filtering # Protocol identifier*: /vac/waku/filter/2.0.0-beta1 WakuFilter is a protocol that enables subscribing to messages that a peer receives. This is a more lightweight version of WakuRelay specifically designed for bandwidth restricted devices. This is due to the fact that light nodes subscribe to full-nodes and only receive the messages they desire.
Content filtering is a way to do message-based filtering. Currently the only content filter being applied is on contentTopic."> Content filtering # Protocol identifiers:
filter-subscribe: /vac/waku/filter-subscribe/2.0.0-beta1 filter-push: /vac/waku/filter-push/2.0.0-beta1 Content filtering is a way to do message-based filtering. Currently the only content filter being applied is on contentTopic.">
<meta name="theme-color" content="#FFFFFF"><meta property="og:title" content="12/WAKU2-FILTER" /> <meta name="theme-color" content="#FFFFFF"><meta property="og:title" content="12/WAKU2-FILTER" />
<meta property="og:description" content="WakuFilter is a protocol that enables subscribing to messages that a peer receives. This is a more lightweight version of WakuRelay specifically designed for bandwidth restricted devices. This is due to the fact that light nodes subscribe to full-nodes and only receive the messages they desire. <meta property="og:description" content="previous versions: 00
Content filtering # Protocol identifier*: /vac/waku/filter/2.0.0-beta1 WakuFilter is a protocol that enables subscribing to messages that a peer receives. This is a more lightweight version of WakuRelay specifically designed for bandwidth restricted devices. This is due to the fact that light nodes subscribe to full-nodes and only receive the messages they desire.
Content filtering is a way to do message-based filtering. Currently the only content filter being applied is on contentTopic." /> Content filtering # Protocol identifiers:
filter-subscribe: /vac/waku/filter-subscribe/2.0.0-beta1 filter-push: /vac/waku/filter-push/2.0.0-beta1 Content filtering is a way to do message-based filtering. Currently the only content filter being applied is on contentTopic." />
<meta property="og:type" content="article" /> <meta property="og:type" content="article" />
<meta property="og:url" content="https://rfc.vac.dev/spec/12/" /><meta property="article:section" content="docs" /> <meta property="og:url" content="https://rfc.vac.dev/spec/12/" /><meta property="article:section" content="docs" />
@ -191,9 +193,18 @@ https://github.com/alex-shpak/hugo-book
</li> </li>
<li><a href="#adversarial-model">Adversarial Model</a> <li><a href="#adversarial-model">Adversarial Model</a>
<ul> <ul>
<li><a href="#protobuf">Protobuf</a> <li><a href="#protobuf">Protobuf</a></li>
<li><a href="#filter-subscribe">Filter-Subscribe</a>
<ul> <ul>
<li></li> <li><a href="#filter-subscribe-request">Filter Subscribe Request</a></li>
<li><a href="#filter-subscribe-response">Filter Subscribe Response</a></li>
<li><a href="#filter-matching">Filter matching</a></li>
<li><a href="#filter-subscribe-types">Filter Subscribe Types</a></li>
</ul>
</li>
<li><a href="#filter-push">Filter-Push</a>
<ul>
<li><a href="#message-push">Message Push</a></li>
</ul> </ul>
</li> </li>
</ul> </ul>
@ -266,12 +277,18 @@ https://github.com/alex-shpak/hugo-book
</li> </li>
</ul><p><code>WakuFilter</code> is a protocol that enables subscribing to messages that a peer receives. This is a more lightweight version of <code>WakuRelay</code> specifically designed for bandwidth restricted devices. This is due to the fact that light nodes subscribe to full-nodes and only receive the messages they desire.</p> </ul><p>previous versions: <a href="/spec/12/previous-versions/00/">00</a></p>
<hr>
<p><code>WakuFilter</code> is a protocol that enables subscribing to messages that a peer receives. This is a more lightweight version of <code>WakuRelay</code> specifically designed for bandwidth restricted devices. This is due to the fact that light nodes subscribe to full-nodes and only receive the messages they desire.</p>
<h1 id="content-filtering"> <h1 id="content-filtering">
Content filtering Content filtering
<a class="anchor" href="#content-filtering">#</a> <a class="anchor" href="#content-filtering">#</a>
</h1> </h1>
<p><strong>Protocol identifier</strong>*: <code>/vac/waku/filter/2.0.0-beta1</code></p> <p><strong>Protocol identifiers</strong>:</p>
<ul>
<li><em>filter-subscribe</em>: <code>/vac/waku/filter-subscribe/2.0.0-beta1</code></li>
<li><em>filter-push</em>: <code>/vac/waku/filter-push/2.0.0-beta1</code></li>
</ul>
<p>Content filtering is a way to do <a href="https://en.wikipedia.org/wiki/Publish%E2%80%93subscribe_pattern#Message_filtering">message-based <p>Content filtering is a way to do <a href="https://en.wikipedia.org/wiki/Publish%E2%80%93subscribe_pattern#Message_filtering">message-based
filtering</a>. filtering</a>.
Currently the only content filter being applied is on <code>contentTopic</code>. This Currently the only content filter being applied is on <code>contentTopic</code>. This
@ -320,223 +337,103 @@ frequent polling.</p>
Protobuf Protobuf
<a class="anchor" href="#protobuf">#</a> <a class="anchor" href="#protobuf">#</a>
</h2> </h2>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-protobuf" data-lang="protobuf"><span style="display:flex;"><span><span style="color:#66d9ef">message</span> <span style="color:#a6e22e">FilterRequest</span> {<span style="color:#960050;background-color:#1e0010"> <div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-protobuf" data-lang="protobuf"><span style="display:flex;"><span>syntax <span style="color:#f92672">=</span> <span style="color:#e6db74">&#34;proto3&#34;</span>;<span style="color:#960050;background-color:#1e0010">
</span></span></span><span style="display:flex;"><span><span style="color:#960050;background-color:#1e0010"></span> <span style="color:#66d9ef">bool</span> subscribe <span style="color:#f92672">=</span> <span style="color:#ae81ff">1</span>;<span style="color:#960050;background-color:#1e0010">
</span></span></span><span style="display:flex;"><span><span style="color:#960050;background-color:#1e0010"></span> <span style="color:#66d9ef">string</span> topic <span style="color:#f92672">=</span> <span style="color:#ae81ff">2</span>;<span style="color:#960050;background-color:#1e0010">
</span></span></span><span style="display:flex;"><span><span style="color:#960050;background-color:#1e0010"></span> <span style="color:#66d9ef">repeated</span> ContentFilter contentFilters <span style="color:#f92672">=</span> <span style="color:#ae81ff">3</span>;<span style="color:#960050;background-color:#1e0010">
</span></span></span><span style="display:flex;"><span><span style="color:#960050;background-color:#1e0010"> </span></span></span><span style="display:flex;"><span><span style="color:#960050;background-color:#1e0010">
</span></span></span><span style="display:flex;"><span><span style="color:#960050;background-color:#1e0010"></span> <span style="color:#66d9ef">message</span> <span style="color:#a6e22e">ContentFilter</span> {<span style="color:#960050;background-color:#1e0010"> </span></span></span><span style="display:flex;"><span><span style="color:#960050;background-color:#1e0010"></span><span style="color:#75715e">// 12/WAKU2-FILTER rfc: https://rfc.vac.dev/spec/12/
</span></span></span><span style="display:flex;"><span><span style="color:#960050;background-color:#1e0010"></span> <span style="color:#66d9ef">string</span> contentTopic <span style="color:#f92672">=</span> <span style="color:#ae81ff">1</span>;<span style="color:#960050;background-color:#1e0010"> </span></span></span><span style="display:flex;"><span><span style="color:#75715e"></span><span style="color:#f92672">package</span> waku<span style="color:#f92672">.</span>filter.v2;<span style="color:#960050;background-color:#1e0010">
</span></span></span><span style="display:flex;"><span><span style="color:#960050;background-color:#1e0010">
</span></span></span><span style="display:flex;"><span><span style="color:#960050;background-color:#1e0010"></span><span style="color:#75715e">// Protocol identifier: /vac/waku/filter-subscribe/2.0.0-beta1
</span></span></span><span style="display:flex;"><span><span style="color:#75715e"></span><span style="color:#66d9ef">message</span> <span style="color:#a6e22e">FilterSubscribeRequest</span> {<span style="color:#960050;background-color:#1e0010">
</span></span></span><span style="display:flex;"><span><span style="color:#960050;background-color:#1e0010"></span> <span style="color:#66d9ef">enum</span> FilterSubscribeType {<span style="color:#960050;background-color:#1e0010">
</span></span></span><span style="display:flex;"><span><span style="color:#960050;background-color:#1e0010"></span> SUBSCRIBER_PING <span style="color:#f92672">=</span> <span style="color:#ae81ff">0</span>;<span style="color:#960050;background-color:#1e0010">
</span></span></span><span style="display:flex;"><span><span style="color:#960050;background-color:#1e0010"></span> SUBSCRIBE <span style="color:#f92672">=</span> <span style="color:#ae81ff">1</span>;<span style="color:#960050;background-color:#1e0010">
</span></span></span><span style="display:flex;"><span><span style="color:#960050;background-color:#1e0010"></span> UNSUBSCRIBE <span style="color:#f92672">=</span> <span style="color:#ae81ff">2</span>;<span style="color:#960050;background-color:#1e0010">
</span></span></span><span style="display:flex;"><span><span style="color:#960050;background-color:#1e0010"></span> UNSUBSCRIBE_ALL <span style="color:#f92672">=</span> <span style="color:#ae81ff">3</span>;<span style="color:#960050;background-color:#1e0010">
</span></span></span><span style="display:flex;"><span><span style="color:#960050;background-color:#1e0010"></span> }<span style="color:#960050;background-color:#1e0010"> </span></span></span><span style="display:flex;"><span><span style="color:#960050;background-color:#1e0010"></span> }<span style="color:#960050;background-color:#1e0010">
</span></span></span><span style="display:flex;"><span><span style="color:#960050;background-color:#1e0010">
</span></span></span><span style="display:flex;"><span><span style="color:#960050;background-color:#1e0010"></span> <span style="color:#66d9ef">string</span> request_id <span style="color:#f92672">=</span> <span style="color:#ae81ff">1</span>;<span style="color:#960050;background-color:#1e0010">
</span></span></span><span style="display:flex;"><span><span style="color:#960050;background-color:#1e0010"></span> FilterSubscribeType filter_subscribe_type <span style="color:#f92672">=</span> <span style="color:#ae81ff">2</span>;<span style="color:#960050;background-color:#1e0010">
</span></span></span><span style="display:flex;"><span><span style="color:#960050;background-color:#1e0010">
</span></span></span><span style="display:flex;"><span><span style="color:#960050;background-color:#1e0010"></span> <span style="color:#75715e">// Filter criteria
</span></span></span><span style="display:flex;"><span><span style="color:#75715e"></span> <span style="color:#66d9ef">optional</span> <span style="color:#66d9ef">string</span> pubsub_topic <span style="color:#f92672">=</span> <span style="color:#ae81ff">10</span>;<span style="color:#960050;background-color:#1e0010">
</span></span></span><span style="display:flex;"><span><span style="color:#960050;background-color:#1e0010"></span> <span style="color:#66d9ef">repeated</span> <span style="color:#66d9ef">string</span> content_topics <span style="color:#f92672">=</span> <span style="color:#ae81ff">11</span>;<span style="color:#960050;background-color:#1e0010">
</span></span></span><span style="display:flex;"><span><span style="color:#960050;background-color:#1e0010"></span>}<span style="color:#960050;background-color:#1e0010"> </span></span></span><span style="display:flex;"><span><span style="color:#960050;background-color:#1e0010"></span>}<span style="color:#960050;background-color:#1e0010">
</span></span></span><span style="display:flex;"><span><span style="color:#960050;background-color:#1e0010"> </span></span></span><span style="display:flex;"><span><span style="color:#960050;background-color:#1e0010">
</span></span></span><span style="display:flex;"><span><span style="color:#960050;background-color:#1e0010"></span><span style="color:#66d9ef">message</span> <span style="color:#a6e22e">MessagePush</span> {<span style="color:#960050;background-color:#1e0010"> </span></span></span><span style="display:flex;"><span><span style="color:#960050;background-color:#1e0010"></span><span style="color:#66d9ef">message</span> <span style="color:#a6e22e">FilterSubscribeResponse</span> {<span style="color:#960050;background-color:#1e0010">
</span></span></span><span style="display:flex;"><span><span style="color:#960050;background-color:#1e0010"></span> <span style="color:#66d9ef">repeated</span> WakuMessage messages <span style="color:#f92672">=</span> <span style="color:#ae81ff">1</span>;<span style="color:#960050;background-color:#1e0010"> </span></span></span><span style="display:flex;"><span><span style="color:#960050;background-color:#1e0010"></span> <span style="color:#66d9ef">string</span> request_id <span style="color:#f92672">=</span> <span style="color:#ae81ff">1</span>;<span style="color:#960050;background-color:#1e0010">
</span></span></span><span style="display:flex;"><span><span style="color:#960050;background-color:#1e0010"></span> <span style="color:#66d9ef">uint32</span> status_code <span style="color:#f92672">=</span> <span style="color:#ae81ff">10</span>;<span style="color:#960050;background-color:#1e0010">
</span></span></span><span style="display:flex;"><span><span style="color:#960050;background-color:#1e0010"></span> <span style="color:#66d9ef">optional</span> <span style="color:#66d9ef">string</span> status_desc <span style="color:#f92672">=</span> <span style="color:#ae81ff">11</span>;<span style="color:#960050;background-color:#1e0010">
</span></span></span><span style="display:flex;"><span><span style="color:#960050;background-color:#1e0010"></span>}<span style="color:#960050;background-color:#1e0010"> </span></span></span><span style="display:flex;"><span><span style="color:#960050;background-color:#1e0010"></span>}<span style="color:#960050;background-color:#1e0010">
</span></span></span><span style="display:flex;"><span><span style="color:#960050;background-color:#1e0010"> </span></span></span><span style="display:flex;"><span><span style="color:#960050;background-color:#1e0010">
</span></span></span><span style="display:flex;"><span><span style="color:#960050;background-color:#1e0010"></span><span style="color:#66d9ef">message</span> <span style="color:#a6e22e">FilterRPC</span> {<span style="color:#960050;background-color:#1e0010"> </span></span></span><span style="display:flex;"><span><span style="color:#960050;background-color:#1e0010"></span><span style="color:#75715e">// Protocol identifier: /vac/waku/filter-push/2.0.0-beta1
</span></span></span><span style="display:flex;"><span><span style="color:#960050;background-color:#1e0010"></span> <span style="color:#66d9ef">string</span> requestId <span style="color:#f92672">=</span> <span style="color:#ae81ff">1</span>;<span style="color:#960050;background-color:#1e0010"> </span></span></span><span style="display:flex;"><span><span style="color:#75715e"></span><span style="color:#66d9ef">message</span> <span style="color:#a6e22e">MessagePush</span> {<span style="color:#960050;background-color:#1e0010">
</span></span></span><span style="display:flex;"><span><span style="color:#960050;background-color:#1e0010"></span> FilterRequest request <span style="color:#f92672">=</span> <span style="color:#ae81ff">2</span>;<span style="color:#960050;background-color:#1e0010"> </span></span></span><span style="display:flex;"><span><span style="color:#960050;background-color:#1e0010"></span> WakuMessage waku_message <span style="color:#f92672">=</span> <span style="color:#ae81ff">1</span>;<span style="color:#960050;background-color:#1e0010">
</span></span></span><span style="display:flex;"><span><span style="color:#960050;background-color:#1e0010"></span> MessagePush push <span style="color:#f92672">=</span> <span style="color:#ae81ff">3</span>;<span style="color:#960050;background-color:#1e0010"> </span></span></span><span style="display:flex;"><span><span style="color:#960050;background-color:#1e0010"></span> <span style="color:#66d9ef">optional</span> <span style="color:#66d9ef">string</span> pubsub_topic <span style="color:#f92672">=</span> <span style="color:#ae81ff">2</span>;<span style="color:#960050;background-color:#1e0010">
</span></span></span><span style="display:flex;"><span><span style="color:#960050;background-color:#1e0010"></span>}<span style="color:#960050;background-color:#1e0010"> </span></span></span><span style="display:flex;"><span><span style="color:#960050;background-color:#1e0010"></span>}<span style="color:#960050;background-color:#1e0010">
</span></span></span></code></pre></div><h4 id="filterrpc"> </span></span></span></code></pre></div><h2 id="filter-subscribe">
FilterRPC Filter-Subscribe
<a class="anchor" href="#filterrpc">#</a> <a class="anchor" href="#filter-subscribe">#</a>
</h4> </h2>
<p>A node MUST send all Filter messages (<code>FilterRequest</code>, <code>MessagePush</code>) wrapped inside a <p>A filter service node MUST support the <em>filter-subscribe</em> protocol
<code>FilterRPC</code> this allows the node handler to determine how to handle a message as the Waku to allow filter clients to subscribe, modify, refresh and unsubscribe a desired set of filter criteria.
Filter protocol is not a request response based protocol but instead a push based system.</p> The combination of different filter criteria for a specific filter client node is termed a &ldquo;subscription&rdquo;.
<p>The <code>requestId</code> MUST be a uniquely generated string. When a <code>MessagePush</code> is sent A filter client is interested in receiving messages matching the filter criteria in its registered subscriptions.</p>
the <code>requestId</code> MUST match the <code>requestId</code> of the subscribing <code>FilterRequest</code> whose filters <p>Since a filter service node is consuming resources to provide this service,
matched the message causing it to be pushed.</p> it MAY account for usage and adapt its service provision to certain clients.
<h4 id="filterrequest"> An incentive mechanism is currently planned but underspecified.</p>
FilterRequest <h3 id="filter-subscribe-request">
<a class="anchor" href="#filterrequest">#</a> Filter Subscribe Request
</h4> <a class="anchor" href="#filter-subscribe-request">#</a>
<p>A <code>FilterRequest</code> contains an optional topic, zero or more content filters and
a boolean signifying whether to subscribe or unsubscribe to the given filters.
True signifies &lsquo;subscribe&rsquo; and false signifies &lsquo;unsubscribe&rsquo;.</p>
<p>A node that sends the RPC with a filter request and <code>subscribe</code> set to &rsquo;true&rsquo;
requests that the filter node SHOULD notify the light requesting node of messages
matching this filter.</p>
<p>A node that sends the RPC with a filter request and <code>subscribe</code> set to &lsquo;false&rsquo;
requests that the filter node SHOULD stop notifying the light requesting node
of messages matching this filter if it is currently doing so.</p>
<p>The filter matches when content filter and, optionally, a topic is matched.
Content filter is matched when a <code>WakuMessage</code> <code>contentTopic</code> field is the same.</p>
<p>A filter node SHOULD honor this request, though it MAY choose not to do so. If
it chooses not to do so it MAY tell the light why. The mechanism for doing this
is currently not specified. For notifying the light node a filter node sends a
MessagePush message.</p>
<p>Since such a filter node is doing extra work for a light node, it MAY also
account for usage and be selective in how much service it provides. This
mechanism is currently planned but underspecified.</p>
<h4 id="messagepush">
MessagePush
<a class="anchor" href="#messagepush">#</a>
</h4>
<p>A filter node that has received a filter request SHOULD push all messages that
match this filter to a light node. These <a href="./waku-message.md"><code>WakuMessage</code>&rsquo;s</a> are likely to come from the
<code>relay</code> protocol and be kept at the Node, but there MAY be other sources or
protocols where this comes from. This is up to the consumer of the protocol.</p>
<p>A filter node MUST NOT send a push message for messages that have not been
requested via a FilterRequest.</p>
<p>If a specific light node isn&rsquo;t connected to a filter node for some specific
period of time (e.g. a TTL), then the filter node MAY choose to not push these
messages to the node. This period is up to the consumer of the protocol and node
implementation, though a reasonable default is one minute.</p>
<hr>
<h1 id="future-work">
Future Work
<a class="anchor" href="#future-work">#</a>
</h1>
<!-- raw HTML omitted -->
<p><strong>Anonymous filter subscription</strong>: This feature guarantees that nodes can anonymously subscribe for a message filter (i.e., without revealing their exact content filter). As such, no adversary in the <code>WakuFilter</code> protocol would be able to link nodes to their subscribed content filers. The current version of the <code>WakuFilter</code> protocol does not provide anonymity as the subscribing node has a direct connection to the full node and explicitly submits its content filter to be notified about the matching messages. However, one can consider preserving anonymity through one of the following ways:</p>
<ul>
<li>By hiding the source of the subscription i.e., anonymous communication. That is the subscribing node shall hide all its PII in its filter request e.g., its IP address. This can happen by the utilization of a proxy server or by using Tor<!-- raw HTML omitted -->.
Note that the current structure of filter requests i.e., <code>FilterRPC</code> does not embody any piece of PII, otherwise, such data fields must be treated carefully to achieve anonymity.</li>
<li>By deploying secure 2-party computations in which the subscribing node obtains the messages matching a content filter whereas the full node learns nothing about the content filter as well as the messages pushed to the subscribing node. Examples of such 2PC protocols are <a href="https://link.springer.com/referenceworkentry/10.1007%2F978-1-4419-5906-5_9#:~:text=Oblivious%20transfer%20%28OT%29%20is%20a,information%20the%20receiver%20actually%20obtains.">Oblivious Transfers</a> and one-way Private Set Intersections (PSI).</li>
</ul>
<h1 id="changelog">
Changelog
<a class="anchor" href="#changelog">#</a>
</h1>
<h3 id="next">
Next
<a class="anchor" href="#next">#</a>
</h3> </h3>
<ul> <p>A client node MUST send all filter requests in a <code>FilterSubscribeRequest</code> message.
<li>Added initial threat model and security analysis.</li> This request MUST contain a <code>request_id</code>.
</ul> The <code>request_id</code> MUST be a uniquely generated string.
<h3 id="200-beta2"> Each request MUST include a <code>filter_subscribe_type</code>, indicating the type of request.</p>
2.0.0-beta2 <h3 id="filter-subscribe-response">
<a class="anchor" href="#200-beta2">#</a> Filter Subscribe Response
<a class="anchor" href="#filter-subscribe-response">#</a>
</h3> </h3>
<p>Initial draft version. Released <a href="https://github.com/vacp2p/specs/commit/5ceeb88cee7b918bb58f38e7c4de5d581ff31e68">2020-10-28</a></p> <p>In return to any <code>FilterSubscribeRequest</code>,
<ul> a filter service node SHOULD respond with a <code>FilterSubscribeResponse</code> with a <code>requestId</code> matching that of the request.
<li>Fix: Ensure contentFilter is a repeated field, on implementation</li> This response MUST contain a <code>status_code</code> indicating if the request was successful or not.
<li>Change: Add ability to unsubscribe from filters. Make <code>subscribe</code> an explicit boolean indication. Edit protobuf field order to be consistent with libp2p.</li> Successful status codes are in the <code>2xx</code> range.
</ul> Client nodes SHOULD consider all other status codes as error codes and assume that the requested operation had failed.
<h3 id="200-beta1"> In addition, the filter service node MAY choose to provide a more detailed status description in the <code>status_desc</code> field.</p>
2.0.0-beta1 <h3 id="filter-matching">
<a class="anchor" href="#200-beta1">#</a> Filter matching
<a class="anchor" href="#filter-matching">#</a>
</h3> </h3>
<p>Initial draft version. Released <a href="https://github.com/vacp2p/specs/commit/31857c7434fa17efc00e3cd648d90448797d107b">2020-10-05</a></p> <p>In the description of each request type below,
<h1 id="copyright"> the term &ldquo;filter criteria&rdquo; refers to the combination of <code>pubsub_topic</code> and a set of <code>content_topics</code>.
Copyright The request MAY include filter criteria, conditional to the selected <code>filter_subscribe_type</code>.
<a class="anchor" href="#copyright">#</a> If the request contains filter criteria,
</h1> it MUST contain a <code>pubsub_topic</code>
<p>Copyright and related rights waived via and the <code>content_topics</code> set MUST NOT be empty.
<a href="https://creativecommons.org/publicdomain/zero/1.0/">CC0</a>.</p> A <code>WakuMessage</code> matches filter criteria when its <code>content_topic</code> is in the <code>content_topics</code> set
<h1 id="references"> and it was published on a matching <code>pubsub_topic</code>.</p>
References <h3 id="filter-subscribe-types">
<a class="anchor" href="#references">#</a> Filter Subscribe Types
</h1> <a class="anchor" href="#filter-subscribe-types">#</a>
<ol> </h3>
<li> <p>The following filter subscribe types are defined:</p>
<p><a href="https://en.wikipedia.org/wiki/Publish%E2%80%93subscribe_pattern#Message_filtering">Message Filtering (Wikipedia)</a></p> <h4 id="subscriber_ping">
</li> SUBSCRIBER_PING
<li> <a class="anchor" href="#subscriber_ping">#</a>
<p><a href="https://github.com/libp2p/specs/tree/master/pubsub#topic-validation">Libp2p PubSub spec - topic validation</a></p> </h4>
</li> <p>A filter client that sends a <code>FilterSubscribeRequest</code> with <code>filter_subscribe_type</code> set to <code>SUBSCRIBER_PING</code>
</ol> requests that the service node SHOULD indicate if it has any active subscriptions for this client.
</article> The filter client SHOULD exclude any filter criteria from the request.
The filter service node SHOULD respond with a success code if it has any active subscriptions for this client
or an error code if not.
The filter service node SHOULD ignore any filter criteria in the request.</p>
<footer class="book-footer"> <h4 id="subscribe">
SUBSCRIBE
<div class="flex flex-wrap justify-between"> <a class="anchor" href="#subscribe">#</a>
</h4>
<p>A filter client that sends a <code>FilterSubscribeRequest</code> with <code>filter_subscribe_type</code> set to <code>SUBSCRIBE</code>
requests that the service node SHOULD push messages matching this filter to the client.
The filter client MUST include the desired filter criteria in the request.
A client MAY use this request type to <em>modify</em> an existing subscription
</div>
</footer>
<div class="book-comments">
</div>
<label for="menu-control" class="hidden book-menu-overlay"></label>
</div>
<aside class="book-toc">
<div class="book-toc-content">
<nav id="TableOfContents">
<ul>
<li><a href="#content-filtering">Content filtering</a>
<ul>
<li><a href="#rationale">Rationale</a></li>
</ul>
</li>
<li><a href="#design-requirements">Design Requirements</a></li>
<li><a href="#security-consideration">Security Consideration</a>
<ul>
<li><a href="#terminology">Terminology</a></li>
</ul>
</li>
<li><a href="#adversarial-model">Adversarial Model</a>
<ul>
<li><a href="#protobuf">Protobuf</a>
<ul>
<li></li>
</ul>
</li>
</ul>
</li>
<li><a href="#future-work">Future Work</a></li>
<li><a href="#changelog">Changelog</a>
<ul>
<li>
<ul>
<li><a href="#next">Next</a></li>
<li><a href="#200-beta2">2.0.0-beta2</a></li>
<li><a href="#200-beta1">2.0.0-beta1</a></li>
</ul>
</li>
</ul>
</li>
<li><a href="#copyright">Copyright</a></li>
<li><a href="#references">References</a></li>
</ul>
</nav>
</div>
</aside>
</main>
</body>
</html>
t MAY use this request type to <em>modify</em> an existing subscription
by providing <em>additional</em> filter criteria in a new request. by providing <em>additional</em> filter criteria in a new request.
A client MAY use this request type to <em>refresh</em> an existing subscription A client MAY use this request type to <em>refresh</em> an existing subscription
by providing <em>the same</em> filter criteria in a new request. by providing <em>the same</em> filter criteria in a new request.