mirror of
https://github.com/vacp2p/rfc-index.git
synced 2026-01-09 15:48:03 -05:00
467 lines
41 KiB
HTML
467 lines
41 KiB
HTML
<!DOCTYPE HTML>
|
|
<html lang="en" class="ayu" dir="ltr">
|
|
<head>
|
|
<!-- Book generated using mdBook -->
|
|
<meta charset="UTF-8">
|
|
<title>18/Swap - Vac RFC</title>
|
|
|
|
|
|
<!-- Custom HTML head -->
|
|
|
|
<meta name="description" content="">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
<meta name="theme-color" content="#ffffff">
|
|
|
|
<link rel="icon" href="../../../favicon.svg">
|
|
<link rel="shortcut icon" href="../../../favicon.png">
|
|
<link rel="stylesheet" href="../../../css/variables.css">
|
|
<link rel="stylesheet" href="../../../css/general.css">
|
|
<link rel="stylesheet" href="../../../css/chrome.css">
|
|
<link rel="stylesheet" href="../../../css/print.css" media="print">
|
|
|
|
<!-- Fonts -->
|
|
<link rel="stylesheet" href="../../../FontAwesome/css/font-awesome.css">
|
|
<link rel="stylesheet" href="../../../fonts/fonts.css">
|
|
|
|
<!-- Highlight.js Stylesheets -->
|
|
<link rel="stylesheet" href="../../../highlight.css">
|
|
<link rel="stylesheet" href="../../../tomorrow-night.css">
|
|
<link rel="stylesheet" href="../../../ayu-highlight.css">
|
|
|
|
<!-- Custom theme stylesheets -->
|
|
<link rel="stylesheet" href="../../../custom.css">
|
|
|
|
</head>
|
|
<body class="sidebar-visible no-js">
|
|
<div id="body-container">
|
|
<!-- Provide site root to javascript -->
|
|
<script>
|
|
var path_to_root = "../../../";
|
|
var default_theme = window.matchMedia("(prefers-color-scheme: dark)").matches ? "navy" : "ayu";
|
|
</script>
|
|
|
|
<!-- Work around some values being stored in localStorage wrapped in quotes -->
|
|
<script>
|
|
try {
|
|
var theme = localStorage.getItem('mdbook-theme');
|
|
var sidebar = localStorage.getItem('mdbook-sidebar');
|
|
|
|
if (theme.startsWith('"') && theme.endsWith('"')) {
|
|
localStorage.setItem('mdbook-theme', theme.slice(1, theme.length - 1));
|
|
}
|
|
|
|
if (sidebar.startsWith('"') && sidebar.endsWith('"')) {
|
|
localStorage.setItem('mdbook-sidebar', sidebar.slice(1, sidebar.length - 1));
|
|
}
|
|
} catch (e) { }
|
|
</script>
|
|
|
|
<!-- Set the theme before any content is loaded, prevents flash -->
|
|
<script>
|
|
var theme;
|
|
try { theme = localStorage.getItem('mdbook-theme'); } catch(e) { }
|
|
if (theme === null || theme === undefined) { theme = default_theme; }
|
|
var html = document.querySelector('html');
|
|
html.classList.remove('ayu')
|
|
html.classList.add(theme);
|
|
var body = document.querySelector('body');
|
|
body.classList.remove('no-js')
|
|
body.classList.add('js');
|
|
</script>
|
|
|
|
<input type="checkbox" id="sidebar-toggle-anchor" class="hidden">
|
|
|
|
<!-- Hide / unhide sidebar before it is displayed -->
|
|
<script>
|
|
var body = document.querySelector('body');
|
|
var sidebar = null;
|
|
var sidebar_toggle = document.getElementById("sidebar-toggle-anchor");
|
|
if (document.body.clientWidth >= 1080) {
|
|
try { sidebar = localStorage.getItem('mdbook-sidebar'); } catch(e) { }
|
|
sidebar = sidebar || 'visible';
|
|
} else {
|
|
sidebar = 'hidden';
|
|
}
|
|
sidebar_toggle.checked = sidebar === 'visible';
|
|
body.classList.remove('sidebar-visible');
|
|
body.classList.add("sidebar-" + sidebar);
|
|
</script>
|
|
|
|
<nav id="sidebar" class="sidebar" aria-label="Table of contents">
|
|
<div class="sidebar-scrollbox">
|
|
<ol class="chapter"><li class="chapter-item expanded affix "><a href="../../../index.html">Introduction</a></li><li class="chapter-item expanded "><a href="../../../vac/index.html"><strong aria-hidden="true">1.</strong> Vac</a></li><li><ol class="section"><li class="chapter-item expanded "><a href="../../../vac/1/coss.html"><strong aria-hidden="true">1.1.</strong> 1/COSS</a></li><li class="chapter-item expanded "><a href="../../../vac/2/mvds.html"><strong aria-hidden="true">1.2.</strong> 2/MVDS</a></li><li class="chapter-item expanded "><a href="../../../vac/3/remote-log.html"><strong aria-hidden="true">1.3.</strong> 3/Remote Log</a></li><li class="chapter-item expanded "><a href="../../../vac/4/mvds-meta.html"><strong aria-hidden="true">1.4.</strong> 4/MVDS Meta</a></li><li class="chapter-item expanded "><a href="../../../vac/25/libp2p-dns-discovery.html"><strong aria-hidden="true">1.5.</strong> 25/Libp2p DNS Discovery</a></li><li class="chapter-item expanded "><a href="../../../vac/32/rln-v1.html"><strong aria-hidden="true">1.6.</strong> 32/RLN-V1</a></li><li class="chapter-item expanded "><a href="../../../vac/raw/index.html"><strong aria-hidden="true">1.7.</strong> Raw</a></li><li><ol class="section"><li class="chapter-item expanded "><a href="../../../vac/raw/consensus-hashgraphlike.html"><strong aria-hidden="true">1.7.1.</strong> Consensus Hashgraphlike</a></li><li class="chapter-item expanded "><a href="../../../vac/raw/decentralized-messaging-ethereum.html"><strong aria-hidden="true">1.7.2.</strong> Decentralized Messaging Ethereum</a></li><li class="chapter-item expanded "><a href="../../../vac/raw/eth-mls-offchain.html"><strong aria-hidden="true">1.7.3.</strong> ETH MLS Offchain</a></li><li class="chapter-item expanded "><a href="../../../vac/raw/eth-mls-onchain.html"><strong aria-hidden="true">1.7.4.</strong> ETH MLS Onchain</a></li><li class="chapter-item expanded "><a href="../../../vac/raw/deleted/eth-secpm.html"><strong aria-hidden="true">1.7.5.</strong> ETH SecPM</a></li><li class="chapter-item expanded "><a href="../../../vac/raw/gossipsub-tor-push.html"><strong aria-hidden="true">1.7.6.</strong> Gossipsub Tor Push</a></li><li class="chapter-item expanded "><a href="../../../vac/raw/logos-capability-discovery.html"><strong aria-hidden="true">1.7.7.</strong> Logos Capability Discovery</a></li><li class="chapter-item expanded "><a href="../../../vac/raw/mix.html"><strong aria-hidden="true">1.7.8.</strong> Mix</a></li><li class="chapter-item expanded "><a href="../../../vac/raw/noise-x3dh-double-ratchet.html"><strong aria-hidden="true">1.7.9.</strong> Noise X3DH Double Ratchet</a></li><li class="chapter-item expanded "><a href="../../../vac/raw/rln-interep-spec.html"><strong aria-hidden="true">1.7.10.</strong> RLN Interep Spec</a></li><li class="chapter-item expanded "><a href="../../../vac/raw/rln-stealth-commitments.html"><strong aria-hidden="true">1.7.11.</strong> RLN Stealth Commitments</a></li><li class="chapter-item expanded "><a href="../../../vac/raw/rln-v2.html"><strong aria-hidden="true">1.7.12.</strong> RLN-V2</a></li><li class="chapter-item expanded "><a href="../../../vac/raw/sds.html"><strong aria-hidden="true">1.7.13.</strong> SDS</a></li></ol></li><li class="chapter-item expanded "><a href="../../../vac/template.html"><strong aria-hidden="true">1.8.</strong> Template</a></li></ol></li><li class="chapter-item expanded "><a href="../../../waku/index.html"><strong aria-hidden="true">2.</strong> Waku</a></li><li><ol class="section"><li class="chapter-item expanded "><a href="../../../waku/standards/core/index.html"><strong aria-hidden="true">2.1.</strong> Standards - Core</a></li><li><ol class="section"><li class="chapter-item expanded "><a href="../../../waku/standards/core/10/waku2.html"><strong aria-hidden="true">2.1.1.</strong> 10/Waku2</a></li><li class="chapter-item expanded "><a href="../../../waku/standards/core/11/relay.html"><strong aria-hidden="true">2.1.2.</strong> 11/Relay</a></li><li class="chapter-item expanded "><a href="../../../waku/standards/core/12/filter.html"><strong aria-hidden="true">2.1.3.</strong> 12/Filter</a></li><li class="chapter-item expanded "><a href="../../../waku/standards/core/13/store.html"><strong aria-hidden="true">2.1.4.</strong> 13/Store</a></li><li class="chapter-item expanded "><a href="../../../waku/standards/core/14/message.html"><strong aria-hidden="true">2.1.5.</strong> 14/Message</a></li><li class="chapter-item expanded "><a href="../../../waku/standards/core/15/bridge.html"><strong aria-hidden="true">2.1.6.</strong> 15/Bridge</a></li><li class="chapter-item expanded "><a href="../../../waku/standards/core/17/rln-relay.html"><strong aria-hidden="true">2.1.7.</strong> 17/RLN Relay</a></li><li class="chapter-item expanded "><a href="../../../waku/standards/core/19/lightpush.html"><strong aria-hidden="true">2.1.8.</strong> 19/Lightpush</a></li><li class="chapter-item expanded "><a href="../../../waku/standards/core/31/enr.html"><strong aria-hidden="true">2.1.9.</strong> 31/ENR</a></li><li class="chapter-item expanded "><a href="../../../waku/standards/core/33/discv5.html"><strong aria-hidden="true">2.1.10.</strong> 33/Discv5</a></li><li class="chapter-item expanded "><a href="../../../waku/standards/core/34/peer-exchange.html"><strong aria-hidden="true">2.1.11.</strong> 34/Peer Exchange</a></li><li class="chapter-item expanded "><a href="../../../waku/standards/core/36/bindings-api.html"><strong aria-hidden="true">2.1.12.</strong> 36/Bindings API</a></li><li class="chapter-item expanded "><a href="../../../waku/standards/core/64/network.html"><strong aria-hidden="true">2.1.13.</strong> 64/Network</a></li><li class="chapter-item expanded "><a href="../../../waku/standards/core/66/metadata.html"><strong aria-hidden="true">2.1.14.</strong> 66/Metadata</a></li></ol></li><li class="chapter-item expanded "><a href="../../../waku/standards/application/index.html"><strong aria-hidden="true">2.2.</strong> Standards - Application</a></li><li><ol class="section"><li class="chapter-item expanded "><a href="../../../waku/standards/application/20/toy-eth-pm.html"><strong aria-hidden="true">2.2.1.</strong> 20/Toy ETH PM</a></li><li class="chapter-item expanded "><a href="../../../waku/standards/application/26/payload.html"><strong aria-hidden="true">2.2.2.</strong> 26/Payload</a></li><li class="chapter-item expanded "><a href="../../../waku/standards/application/53/x3dh.html"><strong aria-hidden="true">2.2.3.</strong> 53/X3DH</a></li><li class="chapter-item expanded "><a href="../../../waku/standards/application/54/x3dh-sessions.html"><strong aria-hidden="true">2.2.4.</strong> 54/X3DH Sessions</a></li></ol></li><li class="chapter-item expanded "><a href="../../../waku/standards/legacy/index.html"><strong aria-hidden="true">2.3.</strong> Standards - Legacy</a></li><li><ol class="section"><li class="chapter-item expanded "><a href="../../../waku/standards/legacy/6/waku1.html"><strong aria-hidden="true">2.3.1.</strong> 6/Waku1</a></li><li class="chapter-item expanded "><a href="../../../waku/standards/legacy/7/data.html"><strong aria-hidden="true">2.3.2.</strong> 7/Data</a></li><li class="chapter-item expanded "><a href="../../../waku/standards/legacy/8/mail.html"><strong aria-hidden="true">2.3.3.</strong> 8/Mail</a></li><li class="chapter-item expanded "><a href="../../../waku/standards/legacy/9/rpc.html"><strong aria-hidden="true">2.3.4.</strong> 9/RPC</a></li></ol></li><li class="chapter-item expanded "><a href="../../../waku/informational/index.html"><strong aria-hidden="true">2.4.</strong> Informational</a></li><li><ol class="section"><li class="chapter-item expanded "><a href="../../../waku/informational/22/toy-chat.html"><strong aria-hidden="true">2.4.1.</strong> 22/Toy Chat</a></li><li class="chapter-item expanded "><a href="../../../waku/informational/23/topics.html"><strong aria-hidden="true">2.4.2.</strong> 23/Topics</a></li><li class="chapter-item expanded "><a href="../../../waku/informational/27/peers.html"><strong aria-hidden="true">2.4.3.</strong> 27/Peers</a></li><li class="chapter-item expanded "><a href="../../../waku/informational/29/config.html"><strong aria-hidden="true">2.4.4.</strong> 29/Config</a></li><li class="chapter-item expanded "><a href="../../../waku/informational/30/adaptive-nodes.html"><strong aria-hidden="true">2.4.5.</strong> 30/Adaptive Nodes</a></li></ol></li><li class="chapter-item expanded "><a href="../../../waku/deprecated/index.html"><strong aria-hidden="true">2.5.</strong> Deprecated</a></li><li><ol class="section"><li class="chapter-item expanded "><a href="../../../waku/deprecated/5/waku0.html"><strong aria-hidden="true">2.5.1.</strong> 5/Waku0</a></li><li class="chapter-item expanded "><a href="../../../waku/deprecated/16/rpc.html"><strong aria-hidden="true">2.5.2.</strong> 16/RPC</a></li><li class="chapter-item expanded "><a href="../../../waku/deprecated/18/swap.html" class="active"><strong aria-hidden="true">2.5.3.</strong> 18/Swap</a></li><li class="chapter-item expanded "><a href="../../../waku/deprecated/fault-tolerant-store.html"><strong aria-hidden="true">2.5.4.</strong> Fault Tolerant Store</a></li></ol></li></ol></li><li class="chapter-item expanded "><a href="../../../nomos/index.html"><strong aria-hidden="true">3.</strong> Nomos</a></li><li><ol class="section"><li class="chapter-item expanded "><a href="../../../nomos/raw/index.html"><strong aria-hidden="true">3.1.</strong> Raw</a></li><li><ol class="section"><li class="chapter-item expanded "><a href="../../../nomos/raw/nomosda-encoding.html"><strong aria-hidden="true">3.1.1.</strong> NomosDA Encoding</a></li><li class="chapter-item expanded "><a href="../../../nomos/raw/nomosda-network.html"><strong aria-hidden="true">3.1.2.</strong> NomosDA Network</a></li><li class="chapter-item expanded "><a href="../../../nomos/raw/p2p-hardware-requirements.html"><strong aria-hidden="true">3.1.3.</strong> P2P Hardware Requirements</a></li><li class="chapter-item expanded "><a href="../../../nomos/raw/p2p-nat-solution.html"><strong aria-hidden="true">3.1.4.</strong> P2P NAT Solution</a></li><li class="chapter-item expanded "><a href="../../../nomos/raw/p2p-network-bootstrapping.html"><strong aria-hidden="true">3.1.5.</strong> P2P Network Bootstrapping</a></li><li class="chapter-item expanded "><a href="../../../nomos/raw/p2p-network.html"><strong aria-hidden="true">3.1.6.</strong> P2P Network</a></li><li class="chapter-item expanded "><a href="../../../nomos/raw/sdp.html"><strong aria-hidden="true">3.1.7.</strong> SDP</a></li></ol></li><li class="chapter-item expanded "><a href="../../../nomos/deprecated/index.html"><strong aria-hidden="true">3.2.</strong> Deprecated</a></li><li><ol class="section"><li class="chapter-item expanded "><a href="../../../nomos/deprecated/claro.html"><strong aria-hidden="true">3.2.1.</strong> Claro</a></li></ol></li></ol></li><li class="chapter-item expanded "><a href="../../../codex/index.html"><strong aria-hidden="true">4.</strong> Codex</a></li><li><ol class="section"><li class="chapter-item expanded "><a href="../../../codex/raw/index.html"><strong aria-hidden="true">4.1.</strong> Raw</a></li><li><ol class="section"><li class="chapter-item expanded "><a href="../../../codex/raw/codex-block-exchange.html"><strong aria-hidden="true">4.1.1.</strong> Block Exchange</a></li><li class="chapter-item expanded "><a href="../../../codex/raw/codex-marketplace.html"><strong aria-hidden="true">4.1.2.</strong> Marketplace</a></li></ol></li></ol></li><li class="chapter-item expanded "><a href="../../../status/index.html"><strong aria-hidden="true">5.</strong> Status</a></li><li><ol class="section"><li class="chapter-item expanded "><a href="../../../status/24/curation.html"><strong aria-hidden="true">5.1.</strong> 24/Curation</a></li><li class="chapter-item expanded "><a href="../../../status/28/featuring.html"><strong aria-hidden="true">5.2.</strong> 28/Featuring</a></li><li class="chapter-item expanded "><a href="../../../status/55/1to1-chat.html"><strong aria-hidden="true">5.3.</strong> 55/1-to-1 Chat</a></li><li class="chapter-item expanded "><a href="../../../status/56/communities.html"><strong aria-hidden="true">5.4.</strong> 56/Communities</a></li><li class="chapter-item expanded "><a href="../../../status/61/community-history-service.html"><strong aria-hidden="true">5.5.</strong> 61/Community History Service</a></li><li class="chapter-item expanded "><a href="../../../status/62/payloads.html"><strong aria-hidden="true">5.6.</strong> 62/Payloads</a></li><li class="chapter-item expanded "><a href="../../../status/63/keycard-usage.html"><strong aria-hidden="true">5.7.</strong> 63/Keycard Usage</a></li><li class="chapter-item expanded "><a href="../../../status/65/account-address.html"><strong aria-hidden="true">5.8.</strong> 65/Account Address</a></li><li class="chapter-item expanded "><a href="../../../status/71/push-notification-server.html"><strong aria-hidden="true">5.9.</strong> 71/Push Notification Server</a></li><li class="chapter-item expanded "><a href="../../../status/raw/index.html"><strong aria-hidden="true">5.10.</strong> Raw</a></li><li><ol class="section"><li class="chapter-item expanded "><a href="../../../status/raw/simple-scaling.html"><strong aria-hidden="true">5.10.1.</strong> Simple Scaling</a></li><li class="chapter-item expanded "><a href="../../../status/raw/status-app-protocols.html"><strong aria-hidden="true">5.10.2.</strong> Status App Protocols</a></li><li class="chapter-item expanded "><a href="../../../status/raw/status-mvds.html"><strong aria-hidden="true">5.10.3.</strong> Status MVDS</a></li><li class="chapter-item expanded "><a href="../../../status/raw/url-data.html"><strong aria-hidden="true">5.10.4.</strong> URL Data</a></li><li class="chapter-item expanded "><a href="../../../status/raw/url-scheme.html"><strong aria-hidden="true">5.10.5.</strong> URL Scheme</a></li></ol></li><li class="chapter-item expanded "><a href="../../../status/deprecated/index.html"><strong aria-hidden="true">5.11.</strong> Deprecated</a></li><li><ol class="section"><li class="chapter-item expanded "><a href="../../../status/deprecated/3rd-party.html"><strong aria-hidden="true">5.11.1.</strong> 3rd Party</a></li><li class="chapter-item expanded "><a href="../../../status/deprecated/account.html"><strong aria-hidden="true">5.11.2.</strong> Account</a></li><li class="chapter-item expanded "><a href="../../../status/deprecated/client.html"><strong aria-hidden="true">5.11.3.</strong> Client</a></li><li class="chapter-item expanded "><a href="../../../status/deprecated/dapp-browser-API-usage.html"><strong aria-hidden="true">5.11.4.</strong> Dapp Browser API Usage</a></li><li class="chapter-item expanded "><a href="../../../status/deprecated/eips.html"><strong aria-hidden="true">5.11.5.</strong> EIPs</a></li><li class="chapter-item expanded "><a href="../../../status/deprecated/ethereum-usage.html"><strong aria-hidden="true">5.11.6.</strong> Ethereum Usage</a></li><li class="chapter-item expanded "><a href="../../../status/deprecated/group-chat.html"><strong aria-hidden="true">5.11.7.</strong> Group Chat</a></li><li class="chapter-item expanded "><a href="../../../status/deprecated/IPFS-gateway-for-sticker-Pack.html"><strong aria-hidden="true">5.11.8.</strong> IPFS Gateway for Sticker Pack</a></li><li class="chapter-item expanded "><a href="../../../status/deprecated/keycard-usage-for-wallet-and-chat-keys.html"><strong aria-hidden="true">5.11.9.</strong> Keycard Usage for Wallet and Chat Keys</a></li><li class="chapter-item expanded "><a href="../../../status/deprecated/notifications.html"><strong aria-hidden="true">5.11.10.</strong> Notifications</a></li><li class="chapter-item expanded "><a href="../../../status/deprecated/payloads.html"><strong aria-hidden="true">5.11.11.</strong> Payloads</a></li><li class="chapter-item expanded "><a href="../../../status/deprecated/push-notification-server.html"><strong aria-hidden="true">5.11.12.</strong> Push Notification Server</a></li><li class="chapter-item expanded "><a href="../../../status/deprecated/secure-transport.html"><strong aria-hidden="true">5.11.13.</strong> Secure Transport</a></li><li class="chapter-item expanded "><a href="../../../status/deprecated/waku-mailserver.html"><strong aria-hidden="true">5.11.14.</strong> Waku Mailserver</a></li><li class="chapter-item expanded "><a href="../../../status/deprecated/waku-usage.html"><strong aria-hidden="true">5.11.15.</strong> Waku Usage</a></li><li class="chapter-item expanded "><a href="../../../status/deprecated/whisper-mailserver.html"><strong aria-hidden="true">5.11.16.</strong> Whisper Mailserver</a></li><li class="chapter-item expanded "><a href="../../../status/deprecated/whisper-usage.html"><strong aria-hidden="true">5.11.17.</strong> Whisper Usage</a></li></ol></li></ol></li></ol>
|
|
</div>
|
|
<div id="sidebar-resize-handle" class="sidebar-resize-handle">
|
|
<div class="sidebar-resize-indicator"></div>
|
|
</div>
|
|
</nav>
|
|
|
|
<!-- Track and set sidebar scroll position -->
|
|
<script>
|
|
var sidebarScrollbox = document.querySelector('#sidebar .sidebar-scrollbox');
|
|
sidebarScrollbox.addEventListener('click', function(e) {
|
|
if (e.target.tagName === 'A') {
|
|
sessionStorage.setItem('sidebar-scroll', sidebarScrollbox.scrollTop);
|
|
}
|
|
}, { passive: true });
|
|
var sidebarScrollTop = sessionStorage.getItem('sidebar-scroll');
|
|
sessionStorage.removeItem('sidebar-scroll');
|
|
if (sidebarScrollTop) {
|
|
// preserve sidebar scroll position when navigating via links within sidebar
|
|
sidebarScrollbox.scrollTop = sidebarScrollTop;
|
|
} else {
|
|
// scroll sidebar to current active section when navigating via "next/previous chapter" buttons
|
|
var activeSection = document.querySelector('#sidebar .active');
|
|
if (activeSection) {
|
|
activeSection.scrollIntoView({ block: 'center' });
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<div id="page-wrapper" class="page-wrapper">
|
|
|
|
<div class="page">
|
|
<div id="menu-bar-hover-placeholder"></div>
|
|
<div id="menu-bar" class="menu-bar sticky">
|
|
<div class="left-buttons">
|
|
<label id="sidebar-toggle" class="icon-button" for="sidebar-toggle-anchor" title="Toggle Table of Contents" aria-label="Toggle Table of Contents" aria-controls="sidebar">
|
|
<i class="fa fa-bars"></i>
|
|
</label>
|
|
<button id="theme-toggle" class="icon-button" type="button" title="Change theme" aria-label="Change theme" aria-haspopup="true" aria-expanded="false" aria-controls="theme-list">
|
|
<i class="fa fa-paint-brush"></i>
|
|
</button>
|
|
<ul id="theme-list" class="theme-popup" aria-label="Themes" role="menu">
|
|
<li role="none"><button role="menuitem" class="theme" id="light">Light</button></li>
|
|
<li role="none"><button role="menuitem" class="theme" id="rust">Rust</button></li>
|
|
<li role="none"><button role="menuitem" class="theme" id="coal">Coal</button></li>
|
|
<li role="none"><button role="menuitem" class="theme" id="navy">Navy</button></li>
|
|
<li role="none"><button role="menuitem" class="theme" id="ayu">Ayu</button></li>
|
|
</ul>
|
|
<button id="search-toggle" class="icon-button" type="button" title="Search. (Shortkey: s)" aria-label="Toggle Searchbar" aria-expanded="false" aria-keyshortcuts="S" aria-controls="searchbar">
|
|
<i class="fa fa-search"></i>
|
|
</button>
|
|
</div>
|
|
|
|
<h1 class="menu-title">Vac RFC</h1>
|
|
|
|
<div class="right-buttons">
|
|
<a href="../../../print.html" title="Print this book" aria-label="Print this book">
|
|
<i id="print-button" class="fa fa-print"></i>
|
|
</a>
|
|
<a href="https://github.com/vacp2p/rfc-index" title="Git repository" aria-label="Git repository">
|
|
<i id="git-repository-button" class="fa fa-github"></i>
|
|
</a>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
<div id="search-wrapper" class="hidden">
|
|
<form id="searchbar-outer" class="searchbar-outer">
|
|
<input type="search" id="searchbar" name="searchbar" placeholder="Search this book ..." aria-controls="searchresults-outer" aria-describedby="searchresults-header">
|
|
</form>
|
|
<div id="searchresults-outer" class="searchresults-outer hidden">
|
|
<div id="searchresults-header" class="searchresults-header"></div>
|
|
<ul id="searchresults">
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Apply ARIA attributes after the sidebar and the sidebar toggle button are added to the DOM -->
|
|
<script>
|
|
document.getElementById('sidebar-toggle').setAttribute('aria-expanded', sidebar === 'visible');
|
|
document.getElementById('sidebar').setAttribute('aria-hidden', sidebar !== 'visible');
|
|
Array.from(document.querySelectorAll('#sidebar a')).forEach(function(link) {
|
|
link.setAttribute('tabIndex', sidebar === 'visible' ? 0 : -1);
|
|
});
|
|
</script>
|
|
|
|
<div id="content" class="content">
|
|
<main>
|
|
<h1 id="18waku2-swap"><a class="header" href="#18waku2-swap">18/WAKU2-SWAP</a></h1>
|
|
<div class="table-wrapper"><table><thead><tr><th>Field</th><th>Value</th></tr></thead><tbody>
|
|
<tr><td>Name</td><td>Waku SWAP Accounting</td></tr>
|
|
<tr><td>Slug</td><td>18</td></tr>
|
|
<tr><td>Status</td><td>deprecated</td></tr>
|
|
<tr><td>Editor</td><td>Oskar Thorén <a href="mailto:oskarth@titanproxy.com">oskarth@titanproxy.com</a></td></tr>
|
|
</tbody></table>
|
|
</div><!-- timeline:start -->
|
|
<h2 id="timeline"><a class="header" href="#timeline">Timeline</a></h2>
|
|
<ul>
|
|
<li><strong>2025-12-22</strong> — <a href="https://github.com/vacp2p/rfc-index/blob/0f1855edcf68ef982c4ce478b67d660809aa9830/docs/waku/deprecated/18/swap.md"><code>0f1855e</code></a> — Chore/fix headers (#239)</li>
|
|
<li><strong>2025-12-22</strong> — <a href="https://github.com/vacp2p/rfc-index/blob/b1a578393edf8487ccc97a5f25b25af9bf41efb3/docs/waku/deprecated/18/swap.md"><code>b1a5783</code></a> — Chore/mdbook updates (#237)</li>
|
|
<li><strong>2025-12-18</strong> — <a href="https://github.com/vacp2p/rfc-index/blob/d03e699084774ebecef9c6d4662498907c5e2080/docs/waku/deprecated/18/swap.md"><code>d03e699</code></a> — ci: add mdBook configuration (#233)</li>
|
|
<li><strong>2024-09-13</strong> — <a href="https://github.com/vacp2p/rfc-index/blob/3ab314d87d4525ff1296bf3d9ec634d570777b91/waku/deprecated/18/swap.md"><code>3ab314d</code></a> — Fix Files for Linting (#94)</li>
|
|
<li><strong>2024-04-18</strong> — <a href="https://github.com/vacp2p/rfc-index/blob/8f94e97cf299697f30b2a2e5887e18845712cad3/waku/deprecated/18/swap.md"><code>8f94e97</code></a> — docs: deprecate swap protocol (#31)</li>
|
|
<li><strong>2024-03-21</strong> — <a href="https://github.com/vacp2p/rfc-index/blob/2eaa7949c4abe7d14e2b9560e8c045bf2e937c9a/waku/standards/application/18/swap.md"><code>2eaa794</code></a> — Broken Links + Change Editors (#26)</li>
|
|
<li><strong>2024-01-31</strong> — <a href="https://github.com/vacp2p/rfc-index/blob/0d8ad0822259fe8961764dc82975eaaf42c3a837/waku/standards/application/18/swap.md"><code>0d8ad08</code></a> — Update and rename SWAP.md to swap.md</li>
|
|
<li><strong>2024-01-31</strong> — <a href="https://github.com/vacp2p/rfc-index/blob/3c8410c8d8702d0bae07fce4285133579fd8589f/waku/standards/application/18/SWAP.md"><code>3c8410c</code></a> — Create SWAP.md</li>
|
|
</ul>
|
|
<!-- timeline:end -->
|
|
<h2 id="abstract"><a class="header" href="#abstract">Abstract</a></h2>
|
|
<p>This specification outlines how we do accounting and settlement based on the provision
|
|
and usage of resources, most immediately bandwidth usage and/or
|
|
storing and retrieving of Waku message.
|
|
This enables nodes to cooperate and efficiently share resources,
|
|
and in the case of unequal nodes to settle the difference
|
|
through a relaxed payment mechanism in the form of sending cheques.</p>
|
|
<p><strong>Protocol identifier</strong>*: <code>/vac/waku/swap/2.0.0-beta1</code></p>
|
|
<h2 id="motivation"><a class="header" href="#motivation">Motivation</a></h2>
|
|
<p>The Waku network makes up a service network, and
|
|
some nodes provide a useful service to other nodes.
|
|
We want to account for that, and when imbalances arise, settle this.
|
|
The core of this approach has some theoretical backing in game theory, and
|
|
variants of it have practically been proven to work in systems such as Bittorrent.
|
|
The specific model use was developed by the Swarm project
|
|
(previously part of Ethereum), and
|
|
we re-use contracts that were written for this purpose.</p>
|
|
<p>By using a delayed payment mechanism in the form of cheques,
|
|
a barter-like mechanism can arise, and
|
|
nodes can decide on their own policy
|
|
as opposed to be strictly tied to a specific payment scheme.
|
|
Additionally, this delayed settlement eases requirements
|
|
on the underlying network in terms of transaction speed or costs.</p>
|
|
<p>Theoretically, nodes providing and using resources over a long,
|
|
indefinite, period of time can be seen as an iterated form of
|
|
<a href="https://en.wikipedia.org/wiki/Prisoner%27s_dilemma">Prisoner's Dilemma (PD)</a>.
|
|
Specifically, and more intuitively,
|
|
since we have a cost and benefit profile for each provision/usage
|
|
(of Waku Message's, e.g.), and
|
|
the pricing can be set such that mutual cooperation is incentivized,
|
|
this can be analyzed as a form of donations game.</p>
|
|
<h2 id="game-theory---iterated-prisoners-dilemma--donation-game"><a class="header" href="#game-theory---iterated-prisoners-dilemma--donation-game">Game Theory - Iterated prisoner's dilemma / donation game</a></h2>
|
|
<p>What follows is a sketch of what the game looks like between two nodes.
|
|
We can look at it as a special case of iterated prisoner's dilemma called a
|
|
<a href="https://en.wikipedia.org/wiki/Prisoner%27s_dilemma#Special_case:_donation_game">Donation game</a>
|
|
where each node can cooperate with some benefit <code>b</code> at a personal cost <code>c</code>,
|
|
where <code>b>c</code>.</p>
|
|
<p>From A's point of view:</p>
|
|
<div class="table-wrapper"><table><thead><tr><th>A/B</th><th>Cooperate</th><th>Defect</th></tr></thead><tbody>
|
|
<tr><td>Cooperate</td><td>b-c</td><td>-c</td></tr>
|
|
<tr><td>Defect</td><td>b</td><td>0</td></tr>
|
|
</tbody></table>
|
|
</div>
|
|
<p>What this means is that if A and B cooperates,
|
|
A gets some benefit <code>b</code> minus a cost <code>c</code>.
|
|
If A cooperates and B defects she only gets the cost,
|
|
and if she defects and B cooperates A only gets the benefit.
|
|
If both defect they get neither benefit nor cost.</p>
|
|
<p>The generalized form of PD is:</p>
|
|
<div class="table-wrapper"><table><thead><tr><th>A/B</th><th>Cooperate</th><th>Defect</th></tr></thead><tbody>
|
|
<tr><td>Cooperate</td><td>R</td><td>S</td></tr>
|
|
<tr><td>Defect</td><td>T</td><td>P</td></tr>
|
|
</tbody></table>
|
|
</div>
|
|
<p>With R=reward, S=Sucker's payoff, T=temptation, P=punishment</p>
|
|
<p>And the following holds:</p>
|
|
<ul>
|
|
<li><code>T>R>P>S</code></li>
|
|
<li><code>2R>T+S</code></li>
|
|
</ul>
|
|
<p>In our case, this means <code>b>b-c>0>-c</code> and <code>2(b-c)> b-c</code> which is trivially true.</p>
|
|
<p>As this is an iterated game with no clear finishing point in most circumstances,
|
|
a tit-for-tat strategy is simple, elegant and functional.
|
|
To be more theoretically precise,
|
|
this also requires reasonable assumptions on error rate and discount parameter.
|
|
This captures notions such as
|
|
"does the perceived action reflect the intended action" and
|
|
"how much do you value future (uncertain) actions compared to previous actions".
|
|
See <a href="https://en.wikipedia.org/wiki/The_Evolution_of_Cooperation">Axelrod - Evolution of Cooperation (book)</a>
|
|
for more details.
|
|
In specific circumstances,
|
|
nodes can choose slightly different policies if there's a strong need for it.
|
|
A policy is simply how a node chooses to act given a set of circumstances.</p>
|
|
<p>A tit-for-tat strategy basically means:</p>
|
|
<ul>
|
|
<li>cooperate first (perform service/beneficial action to other node)</li>
|
|
<li>defect when node stops cooperating (disconnect and similar actions),
|
|
i.e. when it stops performing according to set parameters re settlement</li>
|
|
<li>resume cooperation if other node does so</li>
|
|
</ul>
|
|
<p>This can be complemented with node selection mechanisms.</p>
|
|
<h2 id="swap-protocol-overview"><a class="header" href="#swap-protocol-overview">SWAP protocol overview</a></h2>
|
|
<p>We use SWAP for accounting and
|
|
settlement in conjunction with other request/reply protocols in Waku v2,
|
|
where accounting is done in a pairwise manner.
|
|
It is an acronym with several possible meanings (as defined in the Book
|
|
of Swarm), for example:</p>
|
|
<ul>
|
|
<li>service wanted and provided</li>
|
|
<li>settle with automated payments</li>
|
|
<li>send waiver as payment</li>
|
|
<li>start without a penny</li>
|
|
</ul>
|
|
<p>This approach is based on communicating payment thresholds and
|
|
sending cheques as indications of later payments.
|
|
Communicating payment thresholds MAY be done out-of-band or as part of the handshake.
|
|
Sending cheques is done once payment threshold is hit.</p>
|
|
<p>See <a href="https://web.archive.org/web/20210126130038/https://gateway.ethswarm.org/bzz/latest.bookofswarm.eth">Book of Swarm</a>
|
|
section 3.2. on Peer-to-peer accounting etc., for more context and details.</p>
|
|
<h3 id="accounting"><a class="header" href="#accounting">Accounting</a></h3>
|
|
<p>Nodes perform their own accounting for each relevant peer
|
|
based on some "volume"/bandwidth metric.
|
|
For now we take this to mean the number of <code>WakuMessage</code>s exchanged.</p>
|
|
<p>Additionally, a price is attached to each unit.
|
|
Currently, this is simply a "karma counter" and equal to 1 per message.</p>
|
|
<p>Each accounting balance SHOULD be w.r.t. to a given protocol it is accounting for.</p>
|
|
<p>NOTE: This may later be complemented with other metrics,
|
|
either as part of SWAP or more likely outside of it.
|
|
For example, online time can be communicated and
|
|
attested to as a form of enhanced quality of service to inform peer selection.</p>
|
|
<h3 id="flow"><a class="header" href="#flow">Flow</a></h3>
|
|
<p>Assuming we have two store nodes,
|
|
one operating mostly as a client (A) and another as server (B).</p>
|
|
<ol>
|
|
<li>Node A performs a handshake with B node.
|
|
B node responds and both nodes communicate their payment threshold.</li>
|
|
<li>Node A and B creates an accounting entry for the other peer,
|
|
keep track of peer and current balance.</li>
|
|
<li>Node A issues a <code>HistoryRequest</code>, and B responds with a <code>HistoryResponse</code>.
|
|
Based on the number of WakuMessages in the response,
|
|
both nodes update their accounting records.</li>
|
|
<li>When payment threshold is reached,
|
|
Node A sends over a cheque to reach a neutral balance.
|
|
Settlement of this is currently out of scope,
|
|
but would occur through a SWAP contract (to be specified).
|
|
(mock and hard phase).</li>
|
|
<li>If disconnect threshold is reached, Node B disconnects Node A (mock and hard phase).</li>
|
|
</ol>
|
|
<p>Note that not all of these steps are mandatory in initial stages,
|
|
see below for more details.
|
|
For example, the payment threshold MAY initially be set out of bounds,
|
|
and policy is only activated in the mock and hard phase.</p>
|
|
<h3 id="protobufs"><a class="header" href="#protobufs">Protobufs</a></h3>
|
|
<p>We use protobuf to specify the handshake and signature.
|
|
This current protobuf is a work in progress.
|
|
This is needed for mock and hard phase.</p>
|
|
<p>A handshake gives initial information about payment thresholds and
|
|
possibly other information.
|
|
A cheque is best thought of as a promise to pay at a later date.</p>
|
|
<pre><code class="language-protobuf">
|
|
message Handshake {
|
|
bytes payment_threshold = 1;
|
|
}
|
|
|
|
// TODO Signature?
|
|
// Should probably be over the whole Cheque type
|
|
message Cheque {
|
|
bytes beneficiary = 1;
|
|
// TODO epoch time or block time?
|
|
uint32 date = 2;
|
|
// TODO ERC20 extension?
|
|
// For now karma counter
|
|
uint32 amount = 3;
|
|
}
|
|
|
|
</code></pre>
|
|
<h2 id="incremental-integration-and-roll-out"><a class="header" href="#incremental-integration-and-roll-out">Incremental integration and roll-out</a></h2>
|
|
<p>To incrementally integrate this into Waku v2,
|
|
we have divided up the roll-out into three phases:</p>
|
|
<ul>
|
|
<li>Soft - accounting only</li>
|
|
<li>Mock - send mock cheques and take word for it</li>
|
|
<li>Hard Test - blockchain integration and deployed to public testnet
|
|
(Goerli, Optimism testnet or similar)</li>
|
|
<li>Hard Main - deployed to a public mainnet</li>
|
|
</ul>
|
|
<p>An implementation MAY support any of these phases.</p>
|
|
<h3 id="soft-phase"><a class="header" href="#soft-phase">Soft phase</a></h3>
|
|
<p>In the soft phase only accounting is performed, without consequence for the
|
|
peers. No disconnect or sending of cheques is performed at this tage.</p>
|
|
<p>SWAP protocol is performed in conjunction with another request-reply protocol
|
|
to account for its usage.
|
|
It SHOULD be done for <a href="../../core/13/store.html">13/WAKU2-STORE</a>
|
|
and it MAY be done for other request/reply protocols.</p>
|
|
<p>A client SHOULD log accounting state per peer
|
|
and SHOULD indicate when a peer is out of bounds (either of its thresholds met).</p>
|
|
<h3 id="mock-phase"><a class="header" href="#mock-phase">Mock phase</a></h3>
|
|
<p>In the mock phase, we send mock cheques and send cheques/disconnect peers as appropriate.</p>
|
|
<ul>
|
|
<li>If a node reaches a disconnect threshold,
|
|
which MUST be outside the payment threshold, it SHOULD disconnect the other peer.</li>
|
|
<li>If a node is within payment balance, the other node SHOULD stay connected to it.</li>
|
|
<li>If a node receives a valid Cheque it SHOULD update its internal accounting records.</li>
|
|
<li>If any node behaves badly, the other node is free to disconnect and
|
|
pick another node.
|
|
<ul>
|
|
<li>Peer rating is out of scope of this specification.</li>
|
|
</ul>
|
|
</li>
|
|
</ul>
|
|
<h3 id="hard-phase"><a class="header" href="#hard-phase">Hard phase</a></h3>
|
|
<p>In the hard phase, in addition to sending cheques and activating policy, this is
|
|
done with blockchain integration on a public testnet. More details TBD.</p>
|
|
<p>This also includes settlements where cheques can be redeemed.</p>
|
|
<h2 id="copyright"><a class="header" href="#copyright">Copyright</a></h2>
|
|
<p>Copyright and related rights waived via <a href="https://creativecommons.org/publicdomain/zero/1.0/">CC0</a>.</p>
|
|
<h2 id="references"><a class="header" href="#references">References</a></h2>
|
|
<ol>
|
|
<li><a href="https://en.wikipedia.org/wiki/Prisoner%27s_dilemma">Prisoner's Dilemma</a></li>
|
|
<li><a href="https://en.wikipedia.org/wiki/The_Evolution_of_Cooperation">Axelrod - Evolution of Cooperation (book)</a></li>
|
|
<li><a href="https://web.archive.org/web/20210126130038/https://gateway.ethswarm.org/bzz/latest.bookofswarm.eth">Book of Swarm</a></li>
|
|
<li><a href="../../core/13/store.html">13/WAKU2-STORE</a></li>
|
|
</ol>
|
|
<!--
|
|
|
|
General TODOs:
|
|
|
|
- Find new link for book of swarm
|
|
- Illustrate payment and disconnection thresholds (mscgen not great for this?)
|
|
- Elaborate on how accounting works with amount in the context of e.g. store
|
|
- Illustrate flow
|
|
- Specify chequeboo
|
|
|
|
-->
|
|
|
|
</main>
|
|
|
|
<nav class="nav-wrapper" aria-label="Page navigation">
|
|
<!-- Mobile navigation buttons -->
|
|
<a rel="prev" href="../../../waku/deprecated/16/rpc.html" class="mobile-nav-chapters previous" title="Previous chapter" aria-label="Previous chapter" aria-keyshortcuts="Left">
|
|
<i class="fa fa-angle-left"></i>
|
|
</a>
|
|
|
|
<a rel="next prefetch" href="../../../waku/deprecated/fault-tolerant-store.html" class="mobile-nav-chapters next" title="Next chapter" aria-label="Next chapter" aria-keyshortcuts="Right">
|
|
<i class="fa fa-angle-right"></i>
|
|
</a>
|
|
|
|
<div style="clear: both"></div>
|
|
</nav>
|
|
</div>
|
|
</div>
|
|
|
|
<nav class="nav-wide-wrapper" aria-label="Page navigation">
|
|
<a rel="prev" href="../../../waku/deprecated/16/rpc.html" class="nav-chapters previous" title="Previous chapter" aria-label="Previous chapter" aria-keyshortcuts="Left">
|
|
<i class="fa fa-angle-left"></i>
|
|
</a>
|
|
|
|
<a rel="next prefetch" href="../../../waku/deprecated/fault-tolerant-store.html" class="nav-chapters next" title="Next chapter" aria-label="Next chapter" aria-keyshortcuts="Right">
|
|
<i class="fa fa-angle-right"></i>
|
|
</a>
|
|
</nav>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<script>
|
|
window.playground_copyable = true;
|
|
</script>
|
|
|
|
|
|
<script src="../../../elasticlunr.min.js"></script>
|
|
<script src="../../../mark.min.js"></script>
|
|
<script src="../../../searcher.js"></script>
|
|
|
|
<script src="../../../clipboard.min.js"></script>
|
|
<script src="../../../highlight.js"></script>
|
|
<script src="../../../book.js"></script>
|
|
|
|
<!-- Custom JS scripts -->
|
|
<script src="../../../scripts/rfc-index.js"></script>
|
|
|
|
|
|
</div>
|
|
</body>
|
|
</html>
|