gossipsub: add SPREAD extension spec - #726
Conversation
SPREAD extends GossipSub with intra-cluster random walks for sender anonymity and topology-aware inter-cluster dissemination; reference implementation in go-libp2p-pubsub#717.
|
Thank you, @MatheusFranco99, for this excellent contribution. SPREAD tackles one of the key challenges in peer-to-peer networking, improving resistance to sender deanonymization while maintaining the low latency and efficiency required by production systems. The combination of intra-cluster cobra walks for anonymity and topology-aware inter-cluster dissemination is a thoughtful approach, and it is great to see it backed by both a detailed specification and a reference implementation. The opt-in, backwards-compatible design also makes incremental adoption practical, which is especially valuable for the libp2p ecosystem. One question we would be interested in discussing is whether SPREAD can be viewed as two complementary improvements to GossipSub 1.1, 1.2 and 1.3: (1) topology-aware clustering for dissemination efficiency and (2) cobra walks for publisher anonymity. If so, how much of the dissemination improvement comes from the clustering mechanism alone, and what additional performance tradeoffs are incurred to achieve the stronger anonymity guarantees? Understanding that separation would be particularly valuable for initiatives like Lean Ethereum, Ethereum Consensus clients, where both efficient propagation and stronger privacy are important. This is indeed an exciting direction for GossipSub and a great example of research translating into practical networking improvements. Looking forward to the discussion and experimentation across the broader libp2p community. CCing @dozyio, @tabcat, @acul71, @johannamoran, @sumanjeet0012 and @Winter-Soren on this thread. |
|
Hey @seetadev ! Thanks for your comment.
Good question about the numbers, would definitely be interesting to see. About the numbers, I’m running now the experiments for it and will report here as soon as I have it :) |
|
Hey @seetadev, following up with some numbers:
I ran these simulations overnight, but I plan to run these for a few more days to try to find even better configurations and increase the sample size. |
Thanks a lot, @MatheusFranco99. This is very much valuable, and I appreciate how quickly you followed up with concrete numbers. This is fantastic. The results are quite encouraging. What stood out to me most is that the "same or better anonymity than GossipSub" configuration still improves latency and stretch across the board while reducing attacker accuracy. That is a very compelling point on the tradeoff curve and suggests there may be practical deployment configurations that provide meaningful privacy improvements without sacrificing network performance. We will definitely experiment with SPREAD in py-libp2p and js-libp2p. It will be interesting to compare behavior across implementations and see how the results translate beyond the current reference implementation. A few questions came to mind while reading the latest results:
Impressive work overall. It is great to see a proposal that combines a thoughtful design, a reference implementation, and quantitative evaluation. Looking forward to seeing the larger experimental dataset, and we are excited to continue the discussion as we begin experimenting with it in the other libp2p implementations too. CCing @johannamoran, @Winter-Soren and @sumanjeet0012. |
gmelodie
left a comment
There was a problem hiding this comment.
There's some nitpicking, so feel free to ignore where you see fit, but I found a lot of the wording to be excessively long and convoluted. Treid to make it more to the point.
Also, consider using the following structure instead:
- Overview
- Motivation
- Terms and definitions
- Design rationale
- Protocol specification (incl. extension negotiation, coordinate maintenance)
- Security considerations
- Evaluation
|
|
||
| ## Overview / Summary | ||
|
|
||
| GossipSub is the key communication infrastructure underlying societal-critical protocols in ecosystems such as Ethereum. Several characteristics of gossip protocols make this an interesting communication substrate, namely robustness, scalability, and simplicity. However, the important property of anonymity (hiding the true source of a message), is one that is sometimes cited as being desirable to avoid targeted attacks against the sender, but is in practice well-known that it cannot be attained by GossipSub. |
There was a problem hiding this comment.
| GossipSub is the key communication infrastructure underlying societal-critical protocols in ecosystems such as Ethereum. Several characteristics of gossip protocols make this an interesting communication substrate, namely robustness, scalability, and simplicity. However, the important property of anonymity (hiding the true source of a message), is one that is sometimes cited as being desirable to avoid targeted attacks against the sender, but is in practice well-known that it cannot be attained by GossipSub. |
| In this proposal we describe a protocol extension to GossipSub named SPREAD (Secure Peer-to-Peer Relay for Efficient Anonymous Dissemination), which aims for the best of both worlds: raising the bar against sender deanonymization while, at the same time, improving the efficiency of dissemination in geodistributed settings (i.e., the ability to reach nodes across the globe with low latency). Note that our goal is to raise the bar rather than to fully prevent deanonymization, since source indistinguishability is a quantitative property that depends on the adversary's observation power, rather than an absolute guarantee. These two properties are particularly important for the use of gossip protocols in systems like Ethereum, where targeted attacks can prevent nodes from meeting a certain deadline, such as fulfilling a duty in a given slot, and also where efficient, low-latency transmission is important for the protocols that layer on top of gossip as a communication substrate. | ||
|
|
||
| SPREAD consists of two components: a local random walk to preserve anonymity, and a geographically directed propagation for efficient global dissemination, which gives preference to using nearby nodes as a stepping stone, to avoid costly long-distance hops. We are implementing SPREAD as a protocol extension on top of the go-libp2p-pubsub infrastructure. This document presents this proposal, detailing SPREAD's motivation, rationale, and protocol design. |
There was a problem hiding this comment.
| In this proposal we describe a protocol extension to GossipSub named SPREAD (Secure Peer-to-Peer Relay for Efficient Anonymous Dissemination), which aims for the best of both worlds: raising the bar against sender deanonymization while, at the same time, improving the efficiency of dissemination in geodistributed settings (i.e., the ability to reach nodes across the globe with low latency). Note that our goal is to raise the bar rather than to fully prevent deanonymization, since source indistinguishability is a quantitative property that depends on the adversary's observation power, rather than an absolute guarantee. These two properties are particularly important for the use of gossip protocols in systems like Ethereum, where targeted attacks can prevent nodes from meeting a certain deadline, such as fulfilling a duty in a given slot, and also where efficient, low-latency transmission is important for the protocols that layer on top of gossip as a communication substrate. | |
| SPREAD consists of two components: a local random walk to preserve anonymity, and a geographically directed propagation for efficient global dissemination, which gives preference to using nearby nodes as a stepping stone, to avoid costly long-distance hops. We are implementing SPREAD as a protocol extension on top of the go-libp2p-pubsub infrastructure. This document presents this proposal, detailing SPREAD's motivation, rationale, and protocol design. | |
| This document specifies SPREAD (Secure Peer-to-Peer Relay for Efficient Anonymous Dissemination), an extension to the GossipSub protocol. SPREAD raises the cost of sender deanonymization while improving dissemination efficiency in geo-distributed deployments. Both properties are relevant to systems such as Ethereum, where targeted attacks may prevent a node from meeting time-bound duties (e.g., fulfilling a duty within its assigned slot), and where low-latency delivery is required by protocols layered on top of the gossip substrate. SPREAD does not provide an absolute guarantee of source indistinguishability: sender anonymity is a quantitative property dependent on the adversary's observation capabilities, and the goal is therefore to raise the bar against deanonymization rather than to prevent it entirely. | |
| SPREAD consists of two mechanisms: | |
| 1. a local random walk, which obscures the message origin prior to broad propagation; and | |
| 2. geographically directed propagation, which prefers nearby peers as relay hops in order to avoid costly long-distance transmissions during global dissemination. | |
| SPREAD is implemented as a protocol extension on top of the go-libp2p-pubsub library. The remainder of this document details SPREAD's motivation, rationale, and protocol design. |
|
|
||
| ## Terms and definitions | ||
|
|
||
| Gossip Protocol - A distributed communication protocol in which nodes repeatedly forward information to a subset of neighboring peers, leading to probabilistic but eventually broadcast of a given message. |
There was a problem hiding this comment.
| Gossip Protocol - A distributed communication protocol in which nodes repeatedly forward information to a subset of neighboring peers, leading to probabilistic but eventually broadcast of a given message. | |
| Gossip Protocol - A distributed communication protocol in which nodes repeatedly forward information to a subset of neighboring peers, resulting in probabilistic, eventual delivery to all nodes. |
|
|
||
| Fanout - The number of peers to which a node forwards a message during a dissemination step. | ||
|
|
||
| Random Walk - A forwarding strategy in which each node forwards a message to a single randomly selected peer (possibly with probabilistic branching). |
There was a problem hiding this comment.
the propabilistic branching is already explained in "Cobra Walk"
| Random Walk - A forwarding strategy in which each node forwards a message to a single randomly selected peer (possibly with probabilistic branching). | |
| Random Walk - A forwarding strategy in which each node forwards a message to a single randomly selected peer. |
|
|
||
| Virtual Coordinates - Latency-estimated coordinates assigned to nodes in a synthetic geometric space, allowing estimation of network distance without direct measurement. | ||
|
|
||
| Bernoulli Trial - A probabilistic decision mechanism with two outcomes (success/failure), parameterized by the respective probability value. |
There was a problem hiding this comment.
| Bernoulli Trial - A probabilistic decision mechanism with two outcomes (success/failure), parameterized by the respective probability value. | |
| Bernoulli Trial - A random experiment with exactly two outcomes (success/failure), where success occurs with a fixed probability `p`. |
|
|
||
| However, this raises the problem that, during the random walk phase, where messages are sent to at most one peer per time step, there is a chance that an individual step can be unlucky and cross a slow or distant path. This is problematic since a single slow hop is sufficient to noticeably hurt the average end-to-end performance (as measured by the stretch, or the ratio between the overlay and a direct message connection). This problem is then amplified by the fact that blockchains such as Ethereum layer their multi-step protocols on top of the gossip substrate. Furthermore, the countermeasures to improve the performance, namely to anticipate the switch to the more efficient mode where messages are sent to multiple peers in parallel, are not only still vulnerable to a single long hop in the initial phase, but are also in direct tension with the intended anonymity guarantees. | ||
|
|
||
| To navigate this tradeoff effectively, we leverage the insight that the geographic distribution of nodes tends to naturally form clusters corresponding to the world’s most densely populated and economically developed regions (e.g., US East and West Coasts, Europe, Asia, etc.) This allows the design of SPREAD to organize nodes into clusters with the characteristic that the network latency between nodes in the same cluster is low, thus allowing for fast multi-hop dissemination inside a cluster. With this design decision in place, we can then leverage the intra-cluster communication to conduct random walks that allow for building privacy without a significant performance penalty, while occasionally turning to inter-cluster communication for global dissemination. |
There was a problem hiding this comment.
| To navigate this tradeoff effectively, we leverage the insight that the geographic distribution of nodes tends to naturally form clusters corresponding to the world’s most densely populated and economically developed regions (e.g., US East and West Coasts, Europe, Asia, etc.) This allows the design of SPREAD to organize nodes into clusters with the characteristic that the network latency between nodes in the same cluster is low, thus allowing for fast multi-hop dissemination inside a cluster. With this design decision in place, we can then leverage the intra-cluster communication to conduct random walks that allow for building privacy without a significant performance penalty, while occasionally turning to inter-cluster communication for global dissemination. | |
| SPREAD navigates this tradeoff by exploiting the fact that nodes naturally cluster in some regions (e.g., the US coasts, Europe, Asia). Since latency within such a cluster is low, random walks can be confined to it, providing anonymity at little performance cost, while occasional inter-cluster hops handle global dissemination. |
|
|
||
| To navigate this tradeoff effectively, we leverage the insight that the geographic distribution of nodes tends to naturally form clusters corresponding to the world’s most densely populated and economically developed regions (e.g., US East and West Coasts, Europe, Asia, etc.) This allows the design of SPREAD to organize nodes into clusters with the characteristic that the network latency between nodes in the same cluster is low, thus allowing for fast multi-hop dissemination inside a cluster. With this design decision in place, we can then leverage the intra-cluster communication to conduct random walks that allow for building privacy without a significant performance penalty, while occasionally turning to inter-cluster communication for global dissemination. | ||
|
|
||
| A second challenge is that the inter-cluster message steps can also be very penalizing for the end-to-end performance if not managed carefully. For instance, we would like to avoid having to send a message from Europe to the East Coast of the US via an overlay hop through Asia or the Middle East. To avoid this, we need to devise an efficient wide area dissemination, since this step is so crucial for performance, and our protocols already achieve anonymity through the intra-cluster communication. To this end, SPREAD attempts that inter-cluster message hops are conducted with nodes in adjacent clusters, so that they can be used as a stepping stone to reach more distant ones. In an idealized routing scenario, there is a single global view of the clusters and how they connect to each other through a high level overlay, which corresponds to a Dirichlet tessellation, dividing the space into regions according to the set of centroids of the clusters. This allows the idealized routing to only send inter-cluster messages to overlay peers in neighboring clusters according to the Dirichlet tessellation. |
There was a problem hiding this comment.
| A second challenge is that the inter-cluster message steps can also be very penalizing for the end-to-end performance if not managed carefully. For instance, we would like to avoid having to send a message from Europe to the East Coast of the US via an overlay hop through Asia or the Middle East. To avoid this, we need to devise an efficient wide area dissemination, since this step is so crucial for performance, and our protocols already achieve anonymity through the intra-cluster communication. To this end, SPREAD attempts that inter-cluster message hops are conducted with nodes in adjacent clusters, so that they can be used as a stepping stone to reach more distant ones. In an idealized routing scenario, there is a single global view of the clusters and how they connect to each other through a high level overlay, which corresponds to a Dirichlet tessellation, dividing the space into regions according to the set of centroids of the clusters. This allows the idealized routing to only send inter-cluster messages to overlay peers in neighboring clusters according to the Dirichlet tessellation. | |
| Inter-cluster hops pose a second challenge: chosen carelessly, they are just as penalizing, e.g., routing a message from Europe to the US East Coast via an overlay hop through Asia. Since anonymity is already provided by the intra-cluster walks, wide-area dissemination can be optimized purely for efficiency. SPREAD therefore directs inter-cluster hops toward adjacent clusters, using them as stepping stones to reach more distant ones. Ideally, with a global view, each cluster would be represented by its center, the space would be divided into regions according to which center is closest (a Voronoi diagram, as shown in Figure 1), and messages would cross cluster boundaries only between neighboring regions. |
|
|
||
| Authors: Diogo Cardoso, Matheus Franco, Rodrigo Rodrigues | ||
|
|
||
| ## Overview / Summary |
There was a problem hiding this comment.
| ## Overview / Summary | |
| ## Overview |
|
|
||
| ## Protocol overview | ||
|
|
||
| The protocol has two components that run in parallel: an algorithm for maintaining a set of overlay peers (or neighbors) and their respective secure virtual coordinates, and the main protocol for sending and propagating gossip messages. The overlay neighbors of node i are automatically partitioned into three subsets: cluster_i, occluded_remote_i, and unobstructed_remote_i, according to the criteria described before. |
There was a problem hiding this comment.
| The protocol has two components that run in parallel: an algorithm for maintaining a set of overlay peers (or neighbors) and their respective secure virtual coordinates, and the main protocol for sending and propagating gossip messages. The overlay neighbors of node i are automatically partitioned into three subsets: cluster_i, occluded_remote_i, and unobstructed_remote_i, according to the criteria described before. | |
| SPREAD comprises two components running in parallel: a maintenance algorithm that manages a node's overlay peers (neighbors) and their secure virtual coordinates, and the dissemination protocol that publishes and propagates gossip messages. Using the criteria described above, the maintenance algorithm partitions the neighbors of node i into three subsets: cluster_i, occluded_remote_i, and unobstructed_remote_i. |
|
|
||
| The protocol has two components that run in parallel: an algorithm for maintaining a set of overlay peers (or neighbors) and their respective secure virtual coordinates, and the main protocol for sending and propagating gossip messages. The overlay neighbors of node i are automatically partitioned into three subsets: cluster_i, occluded_remote_i, and unobstructed_remote_i, according to the criteria described before. | ||
|
|
||
| With this overlay state in place, we can now define the protocol for broadcasting messages in a simple manner, based on the intuition of combining intra-cluster random walks for ensuring anonymity with inter-cluster efficient dissemination through the unobstructed remote neighbors. The decision to incur in each of these two alternatives is made upon receiving a message to be propagated, simply by flipping a coin that is biased according to a system parameter. The pseudocode of the protocol is explained next, focusing on how to broadcast a message once the cluster information and overlay neighbor formation is in place. |
There was a problem hiding this comment.
| With this overlay state in place, we can now define the protocol for broadcasting messages in a simple manner, based on the intuition of combining intra-cluster random walks for ensuring anonymity with inter-cluster efficient dissemination through the unobstructed remote neighbors. The decision to incur in each of these two alternatives is made upon receiving a message to be propagated, simply by flipping a coin that is biased according to a system parameter. The pseudocode of the protocol is explained next, focusing on how to broadcast a message once the cluster information and overlay neighbor formation is in place. | |
| Given this overlay state, the dissemination protocol combines intra-cluster random walks, which provide anonymity, with inter-cluster forwarding through unobstructed remote neighbors, which provides efficient global dissemination. Upon receiving or publishing a message, a node decides between these two behaviors by biased coin flips, with biases set by system parameters. The pseudocode below specifies how a message is broadcast once the overlay state is established. |
|
|
||
| ## Using protocol extensions and coexistence with GossipSub peers | ||
|
|
||
| We implement SPREAD as an extension of GossipSub rather than as a separate protocol. In this case, it's an optional feature that a node may choose to support, without requiring agreement from the rest of the network. Each node advertises the extensions it supports through dedicated control fields that are already exchanged when two peers connect, and SPREAD becomes active on a given connection only when both endpoints advertise support for it. Nodes that do not support the extension, or that pair with a peer that does not, simply continue to use standard GossipSub. |
There was a problem hiding this comment.
The usage of this extension would require StrictNoSign, right? Should this be mentioned?
|
|
||
| ## Using protocol extensions and coexistence with GossipSub peers | ||
|
|
||
| We implement SPREAD as an extension of GossipSub rather than as a separate protocol. In this case, it's an optional feature that a node may choose to support, without requiring agreement from the rest of the network. Each node advertises the extensions it supports through dedicated control fields that are already exchanged when two peers connect, and SPREAD becomes active on a given connection only when both endpoints advertise support for it. Nodes that do not support the extension, or that pair with a peer that does not, simply continue to use standard GossipSub. |
There was a problem hiding this comment.
If this is meant to be included as an extension to gossipsub , this PR should extend the protobuffer defined in https://github.com/libp2p/specs/blob/master/pubsub/gossipsub/extensions/extensions.proto similar to how it was done with the partial messages extension.
|
|
||
| We implement SPREAD as an extension of GossipSub rather than as a separate protocol. In this case, it's an optional feature that a node may choose to support, without requiring agreement from the rest of the network. Each node advertises the extensions it supports through dedicated control fields that are already exchanged when two peers connect, and SPREAD becomes active on a given connection only when both endpoints advertise support for it. Nodes that do not support the extension, or that pair with a peer that does not, simply continue to use standard GossipSub. | ||
|
|
||
| To keep its footprint minimal, SPREAD triggers its dissemination without introducing a new message type. A published message uses the standard GossipSub envelope, with an additional field that marks it as a SPREAD message. When a SPREAD-capable node receives such a message, it applies the SPREAD propagation rules and copies the marker onto the messages it relays, so that SPREAD behavior is preserved along the path; a node that does not support the extension simply ignores the marker and forwards the message using standard GossipSub. This forward compatibility is what enables mixed deployments and a smooth, incremental adoption path: a SPREAD message benefits from its privacy-enhancing and efficient dissemination until it reaches a node that does not support the extension, which means that partial anonymity and performance gains are already possible before network-wide adoption. |
There was a problem hiding this comment.
If it's not meant to use extensions, the additional field the protobuffer field used for SPREAD messages should be defined. (otherwise at the moment the spec is not clear enough on how should this field be added to the message)
However i think it makes sense to use a new gossipsub extension (with the message type specific for the extension) instead of a new field due to semantics (as well as the advantage of extension negotiation being a mechanism that already exists in implementations), I'd structure roughly like this
message ControlExtensions {
optional bool spread = 123456; // number to be defined
}
message RPC {
repeated Message publish = 2;
optional SpreadExtension spread = 123456; // number to be defined
}
message SpreadExtension {
repeated uint32 publish_indices = 1;
}
with publish_indices identifying to which entries in RPC.publish does SPREAD apply.
Summary
Acknowledgement: This work was supported by a grant from the SSV Network DAO awarded to the University of Lisbon.
This PR adds SPREAD (Secure Peer-to-Peer Relay for Efficient Anonymous Dissemination) as a GossipSub extension spec, under
pubsub/gossipsub/spread/.SPREAD extends GossipSub to raise the bar against sender deanonymization while, at the same time, improving dissemination efficiency in geo-distributed networks. It is motivated by the well-documented result that GossipSub leaks enough timing and structural information for a small set of passive listeners to map validators to their network identities, and by the fact that existing anonymity proposals (e.g. Dandelion++) have been considered infeasible for latency-sensitive settings such as Ethereum's consensus layer.
Design
SPREAD combines two mechanisms. First, an intra-cluster random walk (a cobra walk) restricted to a node's nearby peers provides sender anonymity without a large performance penalty. Second, a topology-aware inter-cluster dissemination provides efficient global reach, using virtual coordinates (Vivaldi, secured by Newton checks) to avoid redundant long-distance hops. Clusters are formed locally — each node treats the closest
t%of its neighbors as its cluster — so the protocol stays fully decentralized.Extension Choice
SPREAD is opt-in and backwards compatible. It is advertised through the existing GossipSub control/handshake fields and becomes active on a connection only when both peers support it. SPREAD messages carry a marker in the standard RPC envelope (no new message type); peers that do not support the extension ignore the marker and fall back to standard GossipSub. This enables mixed deployments and an incremental adoption path, with partial anonymity and performance gains possible before network-wide adoption.
Evaluation highlights
SPREAD is evaluated by running the real
go-libp2p-pubsubimplementation over thesimnetpacket simulator with real-world Internet latencies, against GossipSub and Dandelion++ configured for equal expected per-node bandwidth:Reference implementation
A reference implementation is available as an opt-in extension in
go-libp2p-pubsub: libp2p/go-libp2p-pubsub#717.EthResearch post: https://ethresear.ch/t/spread-extending-gossipsub-with-efficient-anonymous-dissemination/25343