Michiel Degruytere
    • Create new note
    • Create a note from template
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights New
    • Engagement control
    • Make a copy
    • Transfer ownership
    • Delete this note
    • Save as template
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Note Insights Versions and GitHub Sync Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Engagement control Make a copy Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       Owned this note    Owned this note      
    Published Linked with GitHub
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    # Scaling Waku: A Progress Update As we move forward into the last months 2023, our primary goal has been to solidify the scalability of Waku protocols, focusing on [Status Communities](https://status.im/get-involved/community-groups/). We have [set and reached](https://github.com/waku-org/pm/issues/12) our milestone of providing a Waku network that can scale to approximately 10K _active_ users in Status Communities. While continuing to provide [Status](https://status.im) the required network services to make such a community viable, we believe that the research, protocols, tools, and solutions we are working on will allow the overall Waku network to scale to [1 million+](https://github.com/waku-org/pm/issues/31) nodes. To meet Status's timeline for the Communities feature, the Waku team made some tough decisions that required tradeoffs in terms of decentralization and other design goals. However, this approach has allowed us to demonstrate the core stability and scalability of Waku's protocols, while continuously working towards long-term solutions that provide better anonymity, robustness, and decentralization features. This article will continue diving deeper into what we did and where you can learn more about these topics. If you're already keen to get your hands dirty, we have recently published our upgraded [Waku documentation](https://docs.waku.org), allowing us to build faster, [together](https://docs.waku.org/community/). ## Overview - [ **Theoretical: Laying the groundwork**](#Laying-the-theoretical-groundwork) - Theoretical Analysis of Scaling Gossipsub. - Static Sharding - [**Bridging theory to practice**](#Bridging-theory-to-practice) - Simulations - Status Telemetry Analysis - [**Hands-on achievements**](#Hands-on-achievements) - Status MVP Delivery (Scaled Waku Communities to 10k) - Protocol Service Improvements - PostgreSQL transition - Waku Peer Exchange - Filter Protocol Redesign - Status DoS mitigation mechanism - Building for builders - Waku Docs upgrade - C API - [**Contribute to the decentralisation of communication**](#Contribute-to-the-decentralisation-of-communication) --- ## Laying the theoretical groundwork ### Theoretical Analysis of Scaling gossipsub We started in Q1 by doing a [theoretical analysis (mathematical modelling)](https://hackmd.io/IYmyyUIdSEuRZ7WbYd6dng?view) of GossipSub scaling under certain conditions. The numbers for our message rates and sizes chosen for the model come from the telemetric analyses of typical traffic on significantly sizable Discord servers and existing Status Communities. From this, we conclude that the Waku Relay network can scale to 10,000 nodes per shard. Suppose we further assume that each Status Community operates on a separate shard. In that case, each community can scale to 10,000 _active_ relay-only users while bandwidth usage remains within a reasonable range for each user. Realistically most community nodes are not active simultaneously, so this approach could scale to ~100,000 nodes per community if roughly 1/10th of users are active at any time. ### Static sharding Based on the analyses above, we published [an RFC](https://rfc.vac.dev/spec/57/), bringing together an integrated strategy to scale Status Communities based on static sharding. This requires manually selecting and configuring static shard(s) per community, with no sharing of shards between communities. Static sharding provides a simple way to achieve scalability with reasonable Denial of Service (DoS) protection (more on that below) but also requires some trade-offs in decentralisation and anonymity. Therefore, our longer-term strategy is to provide a way to auto-scale the Waku network with "autosharding" - this allows multiple applications and communities to share the same set of shards without intervening manually in the underlying message routing strategies. [This Github issue](https://github.com/waku-org/research/issues/3) provides more information on our network strategy as we advance. In the near future you can expect an elaborated post on our strategy & roadmap. --- ## Bridging theory to practice --- ### Simulations To test our theoretical conclusions, the Distributed Systems Testing (DST) team ran extensive simulations using a Waku simulation tool built on the Kurtosis framework, [Wakurtosis](https://github.com/vacp2p/wakurtosis). The DST team has recently published a [summary report](https://docs.google.com/document/d/1U3bzlbk_Z3ZxN9tPAnORfYdPRWyskMuShXbdxCj4xOM/edit) detailing these conclusions about scalability, matching our theoretical expectations while showing that the nwaku client can deal with the resource overhead in a growing network. While achieving full-scale simulations of 10,000 nodes posed challenges, initial simulations of up to 1000 nodes aligned with our mathematical models. This gave us confidence in the viability of our approach. ### Status telemetry analysis Having drawn theoretical conclusions under which a Waku Relay network would scale, we then experimented to verify our conclusions. Afterwards we performed a [telemetric analysis](https://github.com/vacp2p/vac-book/blob/main/scratch/status-scaling/status-telemetry-analysis.md) of current Status Community traffic. This allowed us to discover potential bottlenecks when sending large messages over Waku, determine major bandwith usage, and propose strategies to help Status Communities reasonably use Waku without compromising its scalability. --- ## Hands-on achievements --- ### Protocol service improvements To cater to the needs of a growing network of users on diverse platforms, the team improved (and in some cases wholly redesigned) our existing protocols based on the lessons we have learned from dogfooding the Waku network. Of these, the changes to the store and filter protocols were the most significant. #### - PostgresSQL transition To be able to retrieve an increasing amount of large history queries & messages from our store protocol, we have [transitioned](https://github.com/waku-org/pm/issues/4 ) from a simple SQLite backend to a more robust PostgreSQL archive. This allows store nodes to serve multiple queries in parallel while improving message reliability through redundancy. #### - Filter protocol redesign The filter protocol allows resource-restricted devices to receive only a subset of messages routed in the network. We have redesigned [the entire filter protocol](https://rfc.vac.dev/spec/12/) to be more robust and provide features requested by Waku-based applications, such as refreshing existing subscriptions. This new filter protocol version is currently being dogfooded within both mobile and desktop production environment, and the initial feedback is prominently positive. #### - **Waku peer exchange** We have designed and then created a discovery mechanism suitable for resource-restricted nodes called [Waku peer exchange](https://rfc.vac.dev/spec/34/). Work on all these protocols empowers nodes, including resource-restricted devices, to participate seamlessly, ensuring that the network remains accessible to all. ### Connectivity: discovering and managing peers A Waku network can only function well if we make it efficient for nodes to connect and interact. During the first half of 2023, we spent significant effort improving how a node discovers peers and manages its connectivity to those peers. We have boosted a node's ability to differentiate between "good" and "bad" connections, including integrating [gossipsub peer scoring](https://github.com/libp2p/specs/blob/master/pubsub/gossipsub/gossipsub-v1.1.md#peer-scoring). Thanks to the introduction of [libp2p rendezvous discovery](https://rfc.vac.dev/spec/57/#libp2p-rendezvous-and-circuit-relay), nodes behind restrictive NATs can now make themselves discoverable and connect to other nodes by coordinating a NAT hole punch via a [circuit-relay connection](https://rfc.vac.dev/spec/57/#libp2p-rendezvous-and-circuit-relay). We have also modified [discovery](https://rfc.vac.dev/spec/51/#discovery) methods such as [discv5](https://github.com/ethereum/devp2p/blob/master/discv5/discv5.md), to consider static sharding when filtering discovered nodes. ### DoS protection One of the most important considerations of any Waku network deployment is protecting the network against spam and DOS attacks. While we are still working on productising a [privacy-preserving spam protection mechanism based on rate-limiting nullifiers](https://rfc.vac.dev/spec/17/), we focused in H1 on developing a simple DoS mitigation mechanism for Status Communities. This requires all messages belonging to a community to be signed with a key distributed to all community members. Since static sharding ensures messages are only routed within a community, each relayer in the Waku network can validate that each routed message truly originated from within the community and discard those that did not. ### Building for builders #### - Docs We are continuing to make building on Waku more accessible than ever. We have redesigned and improved our [docs website](https://docs.waku.org/), making it easier for you to get acquainted with our work. #### - C API The nwaku client has recently seen the introduction of [a C API](https://github.com/waku-org/nwaku/tree/b9d5d28af5afcc2589357a132c9b5beb57202828/examples/cbindings) that can be seamlessly wrapped in multiple programming languages (see the [Python wrapper](https://github.com/waku-org/nwaku/tree/b9d5d28af5afcc2589357a132c9b5beb57202828/examples/python) as an example), an efficient [addition](https://docs.waku.org/guides/nodes-and-sdks/) to our existing languages and frameworks support. By simplifying the process of integrating nwaku as a service node into other applications, we are fostering an environment where more projects can actively build on Waku and contribute to the Waku network. ## Setting the stage for growth This post provides a glimpse into the Waku Team's progress in the first half of 2023. Our sights are currently set on taking what we have learned and building a [viable public Waku Network](https://github.com/waku-org/research/issues/1) that can scale to even larger numbers while maintaining our core [principles](https://status.im/about/#our-principles) of open-access, privacy-preservation, decentralisation, and transparency about trade-offs. Conquering those research & development challenges will not only scale Waku, but will play a significant role in growing and scaling Status Communities. Where we now have made certain trade-offs, our end-goal and principles are alligned in our end-goals, you'll soon read more about our goals and milestones in our upcoming Roadmap. As a team, we remain dedicated to this mandate while acknowledging the vast involvement of community members and collaborators who contribute to our journey. ## **Contribute to the decentralisation of communication.** Help us ensure that we are staying decentralised by [running your own Waku Node!](https://docs.waku.org/guides/run-nwaku-node) | | Integrate Waku in your application | | --- | --- | | nwaku | https://github.com/waku-org/nwaku | | Browser (JS/TS) | https://github.com/waku-org/js-waku | | Go | https://github.com/waku-org/go-waku | | Rust | https://github.com/waku-org/waku-rust-bindings | | More… | https://docs.waku.org/guides/nodes-and-sdks | Soon we will also release our upcoming roadmap. Stay tuned, and follow our [Twitter](https://twitter.com/Waku_org) to keep yourself updated on new launches. Say hello to us on [Discord](https://discord.gg/GdJJh38sZR), [join our team](https://jobs.status.im/), or crack some of our [bounties](https://github.org/waku-org/bounties) --- No need to remain shy! ------------ *`Written by Mf & Hanno 09/2023`*

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password

    or

    By clicking below, you agree to our terms of service.

    Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully