<div dir="ltr"><span id="gmail-docs-internal-guid-aae4e658-a229-c5f4-59fd-a1a77ab0406f"><font face="arial, helvetica, sans-serif"><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:11pt;color:rgb(0,0,0);vertical-align:baseline;white-space:pre-wrap">Greetings bitcoin-dev, </span></p><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:11pt;color:rgb(0,0,0);vertical-align:baseline;white-space:pre-wrap">   We’re returning to this thread to give an update on the Dandelion project after several months of additional work. (Dandelion is a new privacy-preserving transaction propagation method, which we are proposing as a BIP. See the original post in this thread </span><a href="https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2017-June/014571.html" style="text-decoration-line:none"><span style="font-size:11pt;text-decoration-line:underline;vertical-align:baseline;white-space:pre-wrap">https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2017-June/014571.html</span></a><span style="font-size:11pt;color:rgb(0,0,0);vertical-align:baseline;white-space:pre-wrap"> for more background) The feedback on our initial BIP from Greg Maxwell in this thread touched on several important issues affecting the protocol design, which it has taken us until now to adequately address. </span></p><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt;text-indent:36pt"><span style="font-size:11pt;color:rgb(0,0,0);vertical-align:baseline;white-space:pre-wrap">The focus of this update is a new variant of the Dandelion++ mechanism presented earlier. The new variant is called “Per-Incoming-Edge” routing. In a nutshell, while the earlier Dandelion++ variant calls for routing *each* stem transaction through a randomly chosen path, Per-Incoming Edge routing causes each transaction from the same source to traverse the same pseudorandom path. The most important benefit of Per-Incoming-Edge is that it prevents “intersection attacks” that result if a client broadcasts multiple transactions over a short period of time. We validate this new variant with new analysis and simulation as explained below.</span></p><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt;text-indent:36pt"><span style="font-size:11pt;color:rgb(0,0,0);vertical-align:baseline;white-space:pre-wrap">Today’s update also includes an outline of our next development plans. We have not yet completed a reference implementation, so this update does not include a new BIP. Instead we’re just outlining the steps we plan to take before an updated BIP. The new approach also  impacts our implementation approach. Since Per-Incoming Edge routing simplifies the handling of orphan transactions, we’re now planning on adopting Greg Maxwell’s suggestion to bypass the txMempool for dandelion stem transactions.</span></p><br><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:11pt;color:rgb(0,0,0);vertical-align:baseline;white-space:pre-wrap">======</span></p><br><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:11pt;color:rgb(0,0,0);vertical-align:baseline;white-space:pre-wrap">The feedback on Dandelion from Greg Maxwell touched on a few important issues: (1) robustness to observations over time, aka “intersection attacks”, (2) protocol- or implementation-level data leaks, and (3) graph learning. </span></p><br><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:11pt;color:rgb(0,0,0);background-color:transparent;vertical-align:baseline;white-space:pre-wrap">(1) With time, the adversary may be able to observe many message trajectories, thereby eventually learning the underlying graph structure and/or improving its deanonymization estimate for a given estimate of the graph structure. In our original Dandelion BIP, we addressed this by changing the anonymity graph topology from a directed line to a directed 4-regular graph. (In short, instead of a single outgoing edge for Dandelion transactions, each node selects from  *two* such edges). This topology provides robustness to adversaries who are able to learn the graph, but those results still assume that each node generates only one transaction in each “epoch” (time between reshuffling the anonymity graph). Hence a big remaining question is to understand the effect of intersection attacks--an adversary observing multiple dependent transactions--on deanonymization precision and recall. </span></p><br><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:11pt;color:rgb(0,0,0);vertical-align:baseline;white-space:pre-wrap">(2) The second issue is protocol- or implementation-level behavior that would allow an adversary to actively probe Dandelion to learn more information than before. As you correctly note, we want to avoid the adversary using conflicting transactions to infer which nodes are in the stem. This issue is related to issue (1), in that our mechanism for addressing intersection attacks will determine what data structures we need in the implementation.</span></p><br><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:11pt;color:rgb(0,0,0);vertical-align:baseline;white-space:pre-wrap">(3) The third issue is that an adversary may be able to infer the structure of the graph by observing network traffic. We want to prevent this.</span></p><br><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:11pt;color:rgb(0,0,0);vertical-align:baseline;white-space:pre-wrap"><span style="color:rgb(34,34,34);font-size:small;white-space:normal">----------</span><br></span></p><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:11pt;color:rgb(0,0,0);vertical-align:baseline;white-space:pre-wrap">Intersection Attacks</span></p><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt">----------<br></p><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><br></p><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:11pt;color:rgb(0,0,0);vertical-align:baseline;white-space:pre-wrap">An adversary’s ability to launch intersection attacks depends on the internal Dandelion routing policy. Two natural ways to approach routing are the following:</span></p><br><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:11pt;color:rgb(0,0,0);vertical-align:baseline;white-space:pre-wrap">  1. Per-Hop: For each incoming stem transaction, make an independent random decision of (a) whether to transition to “fluff” phase, and (b) if “stem”, then which node should we relay to. This means that two transactions, even starting from the same source, take independent random walks through the anonymity graph. This is what our current implementation does.</span></p><br><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:11pt;color:rgb(0,0,0);vertical-align:baseline;white-space:pre-wrap">  2. Per-Inbound-Edge: For each inbound edge e, randomly select one outbound edge g, and relay all transactions arriving on edge e to edge g (assuming the transaction remains in stem phase). Each node uses this relay mapping for an entire epoch, which lasts about 10 min. Each source also randomly chooses one outbound edge g’ for its own transactions; so if a node generates 5 transactions, they will all get propagated over edge g’. This approach has the property that during an epoch, all transactions from a single source will take the same path through the stem graph.</span></p><br><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:11pt;color:rgb(0,0,0);vertical-align:baseline;white-space:pre-wrap">We have simulated and analyzed these two routing protocols, and find that per-inbound-edge routing seems to be more robust to intersection attacks. For our simulations we consider the “first-spy” estimator --- this means the rule where the attacker simply guesses that the first peer to relay a transaction to a spy node is the real source. Figure 1 (link below) illustrates the first-spy precision for per-incoming-edge routing and per-transaction routing when each node has *one* transaction. Higher precision means worse anonymity. For comparison, this figure includes diffusion, which is the spreading mechanism currently used. Here ‘p’ denotes the fraction of nodes in the network that are spies. (Recall that in our model, we treat the attacker has having control over some fraction of random nodes). The turquoise curve (labelled ‘p’) is shown for reference---it does not represent any routing protocol.</span></p><br><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><a href="https://github.com/gfanti/bips/blob/master/per-edge-vs-per-tx.jpg" style="text-decoration-line:none"><span style="font-size:11pt;text-decoration-line:underline;vertical-align:baseline;white-space:pre-wrap">https://github.com/gfanti/bips/blob/master/per-edge-vs-per-tx.jpg</span></a></p><br><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:11pt;color:rgb(0,0,0);vertical-align:baseline;white-space:pre-wrap">First, note that the first-spy estimator is thought to be significantly suboptimal for diffusion (red line). Prior literature has shown that on certain classes of graphs, there exist estimators that can detect diffusion sources with much higher probability than the first-spy estimator. While it’s unclear how to apply those algorithms to Bitcoin’s graph, it is likely that strong algorithms exist. Hence the first-spy estimator serves as a lower bound on precision for diffusion. </span><span style="font-size:11pt;color:rgb(0,0,0);background-color:transparent;vertical-align:baseline;white-space:pre-wrap">On the other hand, we can show theoretically that the first-spy precision for per-tx and per-incoming-edge routing is within a small constant factor of the optimal precision for per-incoming-edge routing. Thus, we expect that the green (per-edge) and blue (per-tx) lines reflect the near-optimal attack, whereas the red line (diffusion) could be much higher in practice.</span></p><br><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:11pt;color:rgb(0,0,0);vertical-align:baseline;white-space:pre-wrap">The second issue to note is that the blue line (per-tx forwarding) has the lowest precision of the three protocols for one tx per node. The green line (per-edge forwarding) has higher precision than per-tx forwarding when there are very few spies, but approaches per-tx forwarding as p increases. Moreover, it has lower precision than diffusion for p&gt;=0.05. </span></p><br><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:11pt;color:rgb(0,0,0);vertical-align:baseline;white-space:pre-wrap">However, the real benefits of per-edge forwarding emerge as nodes start to transmit multiple transactions. U</span><span style="font-size:11pt;color:rgb(0,0,0);background-color:transparent;vertical-align:baseline;white-space:pre-wrap">nder per-edge forwarding, even if nodes transmit multiple transactions each, those transactions will traverse the </span><span style="font-size:11pt;color:rgb(0,0,0);background-color:transparent;font-style:italic;vertical-align:baseline;white-space:pre-wrap">same</span><span style="font-size:11pt;color:rgb(0,0,0);background-color:transparent;vertical-align:baseline;white-space:pre-wrap"> path in the anonymity graph, thereby preventing the adversary from learning any new information from later transactions. Meanwhile, under per-tx routing, we find empirically that as nodes generate an increasing number of transactions, each source generates a unique signature of spy-node-observations (we are currently working on a more detailed exploration of this question). We expect that such signatures can be used to </span><span style="font-size:11pt;color:rgb(0,0,0);background-color:transparent;font-style:italic;vertical-align:baseline;white-space:pre-wrap">exactly</span><span style="font-size:11pt;color:rgb(0,0,0);background-color:transparent;vertical-align:baseline;white-space:pre-wrap"> deanonymize users in cases where the adversary learns the graph.</span><span style="font-size:11pt;color:rgb(0,0,0);background-color:transparent;vertical-align:baseline;white-space:pre-wrap"> </span><span style="font-size:11pt;color:rgb(0,0,0);background-color:transparent;vertical-align:baseline;white-space:pre-wrap">Hence per-tx forwarding is actually quite fragile to adversaries learning the graph, whereas per-incoming-edge is robust to intersection attacks. This is one key reason for adopting per-incoming-edge forwarding.</span></p><br><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:11pt;color:rgb(0,0,0);background-color:transparent;vertical-align:baseline;white-space:pre-wrap">Adopting per-incoming-edge forwarding has another important implication: it becomes easy to enforce the condition that child transactions never enter fluff mode before parent transactions. This significantly simplifies orphan handling, and means that adversaries cannot infer that a preceding transaction is still in stem mode just by passively listening to network traffic. We revisit this issue in the next section.</span></p><div><span><font face="arial, helvetica, sans-serif"><br></font></span></div>----------<br><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:11pt;color:rgb(0,0,0);vertical-align:baseline;white-space:pre-wrap">Implementation-Level Metadata Leaks</span></p><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:11pt;color:rgb(0,0,0);vertical-align:baseline;white-space:pre-wrap"><span style="color:rgb(34,34,34);font-size:small;white-space:normal">----------</span><br></span></p><br><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:11pt;color:rgb(0,0,0);vertical-align:baseline;white-space:pre-wrap">tl;dr: concept ACK for gmaxwell’s suggestion on a new per-peer data structure instead of mempool</span></p><br><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:11pt;color:rgb(0,0,0);vertical-align:baseline;white-space:pre-wrap">Regardless of which routing policy we choose, it is important that implementations do not leak more information about transactions than they do in our model. It’s especially important that spies do not get an “off-path” view of the nodes involved in the stem of a transaction. This practically means that implementations must be careful not to expose whether or not a stem transaction was received, to any node except the two randomly chosen ones. (i.e., not to supernodes that may make inbound connections to thousands of nodes).</span></p><br><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:11pt;color:rgb(0,0,0);vertical-align:baseline;white-space:pre-wrap">We are currently developing a reference implementation for Dandelion++, as a patch against Bitcoin Core. It requires thoughtful integration to make this patch, and the choice of routing policy informs our approach. We have so far considered two main integration approaches, whose main difference is whether or not they reuse the existing *txMempool* data structure to store stem mode transactions.</span></p><br><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:11pt;color:rgb(0,0,0);vertical-align:baseline;white-space:pre-wrap">A. Mempool embargo:</span></p><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:11pt;color:rgb(0,0,0);vertical-align:baseline;white-space:pre-wrap"><span class="gmail-Apple-tab-span" style="white-space:pre">        </span></span><span style="font-size:11pt;color:rgb(0,0,0);vertical-align:baseline;white-space:pre-wrap">This how is our current implementation works. Stem transactions are only relayed if they are accepted to mempool. Stem transactions are “embargoed” by suppressing them from MEMPOOL and INV messages sent from the node. This was the easiest to implement while preserving all of Bitcoin’s existing DoS prevention. In particular, it simplifies the handling of orphan transactions, because the AcceptToMempool routine already handles orphan transactions. However, this approach comes with a risk of indirect leakage, especially if some edge case is missed in implementation.</span></p><br><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:11pt;color:rgb(0,0,0);vertical-align:baseline;white-space:pre-wrap">B. Avoid modifying mempool (or any global structure) for stem transactions:</span></p><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:11pt;color:rgb(0,0,0);vertical-align:baseline;white-space:pre-wrap"><span class="gmail-Apple-tab-span" style="white-space:pre">        </span></span><span style="font-size:11pt;color:rgb(0,0,0);vertical-align:baseline;white-space:pre-wrap">This is the approach preferred by Greg Maxwell. The main benefit is that it is much more clear that there is no indirect leakage, although it makes it harder to argue there is no additional DoS concern. We have already taken a couple of steps towards implementing this here:  </span><a href="https://github.com/gfanti/bitcoin/commits/dandelion-nomempool" style="text-decoration-line:none"><span style="font-size:11pt;text-decoration-line:underline;vertical-align:baseline;white-space:pre-wrap">https://github.com/gfanti/bitcoin/commits/dandelion-nomempool</span></a><span style="font-size:11pt;color:rgb(0,0,0);vertical-align:baseline;white-space:pre-wrap"> The main idea is to avoid duplicating the rules for whether a transaction would be accepted into mempool or not, by adding a “dry run” option to the AcceptToMempool function. Our implementation of this approach is not yet finished; it still remains to develop the per-peer data structure.</span></p><br><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:11pt;color:rgb(0,0,0);vertical-align:baseline;white-space:pre-wrap">Orphan transactions are important for per-tx routing, because with per-tx routing, the child and the parent might travel along different stems. A burst of transactions from a single sender would have to be queued so they enter fluff mode sequentially. A lot of our testing (with the included test framework) involved ensuring such transactions were handled effectively. This was also the deciding factor for our choice of using Option B “Mempool Embargo” above. With Per-incoming Edge routing, however, orphan transaction handling can be simplified, since out-of-order transactions would not be sent along stems.</span></p><br><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:11pt;color:rgb(0,0,0);vertical-align:baseline;white-space:pre-wrap">We therefore plan to re-engineer a much of our reference implementation to:</span></p><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:11pt;color:rgb(0,0,0);vertical-align:baseline;white-space:pre-wrap">1) use per-incoming edge routing,</span></p><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:11pt;color:rgb(0,0,0);vertical-align:baseline;white-space:pre-wrap">2) simplify handling of orphan transactions,</span></p><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:11pt;color:rgb(0,0,0);vertical-align:baseline;white-space:pre-wrap">3) adopt the proposed approach of avoiding the mempool data structure for stem transactions.</span></p><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:11pt;color:rgb(0,0,0);vertical-align:baseline;white-space:pre-wrap">We’ll give an update soon on our development progress before updating the BIP.</span></p><div><span><font face="arial, helvetica, sans-serif"><br></font></span></div></font><span style="font-family:arial,helvetica,sans-serif">----------</span><font face="arial, helvetica, sans-serif"><br><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:11pt;color:rgb(0,0,0);vertical-align:baseline;white-space:pre-wrap">Graph Learning</span></p><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt">----------<br></p><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><br></p><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:11pt;color:rgb(0,0,0);vertical-align:baseline;white-space:pre-wrap">Greg Maxwell also asked:</span></p><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:10pt;color:rgb(0,0,255);vertical-align:baseline;white-space:pre-wrap">```</span></p><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:10pt;color:rgb(0,0,255);vertical-align:baseline;white-space:pre-wrap">Has any work been given to the fact that dandelion propagation</span><span style="font-size:10pt;color:rgb(0,0,255);vertical-align:baseline;white-space:pre-wrap"><br class="gmail-kix-line-break"></span><span style="font-size:10pt;color:rgb(0,0,255);vertical-align:baseline;white-space:pre-wrap">potentially making to measure properties of the inter-node connection</span><span style="font-size:10pt;color:rgb(0,0,255);vertical-align:baseline;white-space:pre-wrap"><br class="gmail-kix-line-break"></span><span style="font-size:10pt;color:rgb(0,0,255);vertical-align:baseline;white-space:pre-wrap">graph?  e.g.  Say I wish to partition node X by disconnecting all of</span><span style="font-size:10pt;color:rgb(0,0,255);vertical-align:baseline;white-space:pre-wrap"><br class="gmail-kix-line-break"></span><span style="font-size:10pt;color:rgb(0,0,255);vertical-align:baseline;white-space:pre-wrap">its outbound connections, to do that it would be useful to learn whom</span><span style="font-size:10pt;color:rgb(0,0,255);vertical-align:baseline;white-space:pre-wrap"><br class="gmail-kix-line-break"></span><span style="font-size:10pt;color:rgb(0,0,255);vertical-align:baseline;white-space:pre-wrap">is connected to X.  I forward a transaction to X, observe the first</span><span style="font-size:10pt;color:rgb(0,0,255);vertical-align:baseline;white-space:pre-wrap"><br class="gmail-kix-line-break"></span><span style="font-size:10pt;color:rgb(0,0,255);vertical-align:baseline;white-space:pre-wrap">node to fluff it,  then DOS attack that node to take it offline.  Will</span><span style="font-size:10pt;color:rgb(0,0,255);vertical-align:baseline;white-space:pre-wrap"><br class="gmail-kix-line-break"></span><span style="font-size:10pt;color:rgb(0,0,255);vertical-align:baseline;white-space:pre-wrap">I need to DOS attack fewer or more nodes  to get all of X&#39;s outbounds</span><span style="font-size:10pt;color:rgb(0,0,255);vertical-align:baseline;white-space:pre-wrap"><br class="gmail-kix-line-break"></span><span style="font-size:10pt;color:rgb(0,0,255);vertical-align:baseline;white-space:pre-wrap">if X supports rapid stem forwarding?</span></p><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:10pt;color:rgb(0,0,255);vertical-align:baseline;white-space:pre-wrap">```</span></p><br><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:11pt;color:rgb(0,0,0);vertical-align:baseline;white-space:pre-wrap">In terms of graph learning, there are two graphs to consider: the anonymity graph (i.e., the stem set of each node), and the main P2P graph. Dandelion has at least as good graph-hiding properties as diffusion for a natural class of attacks (which include the attack described in the comment above).  </span></p><br><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:11pt;color:rgb(0,0,0);vertical-align:baseline;white-space:pre-wrap">Consider the task of learning the main P2P graph in today’s network (under diffusion spreading). Suppose a supernode is connected to all nodes, and wants to learn the 1-hop neighbors of a given target node. The eavesdropper passes a transaction to the target, and waits to hear which nodes relay the transaction first. If the target has 8 outbound neighbors, then in each experiment, the supernode will receive 8 independent relay timestamps from the target’s 1-hop neighbors. By repeating this many times, the adversary can infer the 1-hop neighbors as the nodes who relay the transaction with the appropriate mean delay (taking into account the appropriate exponential parameters). Eventually, this set will be learned with high certainty. </span></p><br><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:11pt;color:rgb(0,0,0);vertical-align:baseline;white-space:pre-wrap">Now consider the same task if the target is a Dandelion node. Note that the supernode’s probe tx must be relayed as a Dandelion message to observe any difference with the prior experiment. First of all, the target will only pass the tx to one node in its stem set. Hence, in each experiment, the supernode can learn at most one timestamp from a relevant node, whereas previously it learned eight per experiment. This inherently reduces the adversary’s learning rate. Second, if the target’s relay is a Dandelion node and chooses to extend the stem, then the supernode will not receive </span><span style="font-size:11pt;color:rgb(0,0,0);font-style:italic;vertical-align:baseline;white-space:pre-wrap">any</span><span style="font-size:11pt;color:rgb(0,0,0);vertical-align:baseline;white-space:pre-wrap"> relevant timestamp (i.e. a timestamp from a 1-hop neighbor) unless the supernode lies in the relay’s stem set. This happens with a probability that depends on the level of deployment and the number of (seemingly) distinct nodes being run by the supernode, but is strictly smaller than 1. </span></p><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:11pt;color:rgb(0,0,0);vertical-align:baseline;white-space:pre-wrap">    _ </span><span style="font-size:11pt;color:rgb(0,0,0);vertical-align:baseline;white-space:pre-wrap">Hence, the rate at which an attacker can learn the main P2P graph is strictly higher under diffusion (as in Bitcoin Core today) compared to using Dandelion. _</span></p><br><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:11pt;color:rgb(0,0,0);vertical-align:baseline;white-space:pre-wrap">A similar argument can be made for the anonymity graph, which we currently implement as an overlay to the main P2P graph.</span></p><div><span><br></span></div>=====<br><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:11pt;color:rgb(0,0,0);vertical-align:baseline;white-space:pre-wrap">Responses to Other Miscellaneous Comments</span></p><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:11pt;color:rgb(0,0,0);vertical-align:baseline;white-space:pre-wrap">====</span></p><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:11pt;color:rgb(0,0,0);vertical-align:baseline;white-space:pre-wrap">```</span></p><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:10pt;color:rgb(0,0,255);vertical-align:baseline;white-space:pre-wrap">An alternative construction would be that when a stem transaction goes</span><span style="font-size:10pt;color:rgb(0,0,255);vertical-align:baseline;white-space:pre-wrap"><br class="gmail-kix-line-break"></span><span style="font-size:10pt;color:rgb(0,0,255);vertical-align:baseline;white-space:pre-wrap">out there is a random chance that the stem flag is not set (with</span><span style="font-size:10pt;color:rgb(0,0,255);vertical-align:baseline;white-space:pre-wrap"><br class="gmail-kix-line-break"></span><span style="font-size:10pt;color:rgb(0,0,255);vertical-align:baseline;white-space:pre-wrap">suitable adjustment to keep the same expected path length)</span><span style="font-size:10pt;color:rgb(0,0,255);vertical-align:baseline;white-space:pre-wrap"><br class="gmail-kix-line-break"></span><span style="font-size:10pt;color:rgb(0,0,255);vertical-align:baseline;white-space:pre-wrap"><br class="gmail-kix-line-break"></span><span style="font-size:10pt;color:rgb(0,0,255);vertical-align:baseline;white-space:pre-wrap">For some reason I believe this would be a superior construction, but I</span><span style="font-size:10pt;color:rgb(0,0,255);vertical-align:baseline;white-space:pre-wrap"><br class="gmail-kix-line-break"></span><span style="font-size:10pt;color:rgb(0,0,255);vertical-align:baseline;white-space:pre-wrap">am only able to articulate one clear benefit:  It allows non-dandelion</span><span style="font-size:10pt;color:rgb(0,0,255);vertical-align:baseline;white-space:pre-wrap"><br class="gmail-kix-line-break"></span><span style="font-size:10pt;color:rgb(0,0,255);vertical-align:baseline;white-space:pre-wrap">capable nodes to take on the role of the last stem hop, which I</span><span style="font-size:10pt;color:rgb(0,0,255);vertical-align:baseline;white-space:pre-wrap"><br class="gmail-kix-line-break"></span><span style="font-size:10pt;color:rgb(0,0,255);vertical-align:baseline;white-space:pre-wrap">believe would improve the anonymity set during the transition phase.</span></p><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:10pt;color:rgb(0,0,255);vertical-align:baseline;white-space:pre-wrap">```</span></p><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:11pt;color:rgb(0,0,0);vertical-align:baseline;white-space:pre-wrap">Agreed, this is actually what we have implemented. </span></p><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:11pt;color:rgb(0,0,0);vertical-align:baseline;white-space:pre-wrap"><br></span></p><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:11pt;color:rgb(0,0,0);vertical-align:baseline;white-space:pre-wrap">---------</span></p><p style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:11pt;color:rgb(0,0,0);vertical-align:baseline;white-space:pre-wrap">Thanks!</span></p><p style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:11pt;color:rgb(0,0,0);vertical-align:baseline;white-space:pre-wrap"><span style="color:rgb(34,34,34);font-size:small;white-space:normal">Giulia Fanti &lt;</span><a href="mailto:gfanti@andrew.cmu.edu" style="font-size:small;white-space:normal">gfanti@andrew.cmu.edu</a><span style="color:rgb(34,34,34);font-size:small;white-space:normal">&gt;</span><br style="color:rgb(34,34,34);font-size:small;white-space:normal"><span style="color:rgb(34,34,34);font-size:small;white-space:normal">Andrew Miller &lt;</span><a href="mailto:soc1024@illinois.edu" style="font-size:small;white-space:normal">soc1024@illinois.edu</a><span style="color:rgb(34,34,34);font-size:small;white-space:normal">&gt;</span><br style="color:rgb(34,34,34);font-size:small;white-space:normal"><span style="color:rgb(34,34,34);font-size:small;white-space:normal">Surya Bakshi &lt;</span><a href="mailto:sbakshi3@illinois.edu" style="font-size:small;white-space:normal">sbakshi3@illinois.edu</a><span style="color:rgb(34,34,34);font-size:small;white-space:normal">&gt;</span><br style="color:rgb(34,34,34);font-size:small;white-space:normal"><span style="color:rgb(34,34,34);font-size:small;white-space:normal">Shaileshh Bojja Venkatakrishnan &lt;</span><a href="mailto:bjjvnkt2@illinois.edu" style="font-size:small;white-space:normal">bjjvnkt2@illinois.edu</a><span style="color:rgb(34,34,34);font-size:small;white-space:normal">&gt;</span><br style="color:rgb(34,34,34);font-size:small;white-space:normal"><span style="color:rgb(34,34,34);font-size:small;white-space:normal">Pramod Viswanath &lt;</span><a href="mailto:pramodv@illinois.edu" style="font-size:small;white-space:normal">pramodv@illinois.edu</a><span style="color:rgb(34,34,34);font-size:small;white-space:normal">&gt;</span></span></p><p style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:11pt;color:rgb(0,0,0);vertical-align:baseline;white-space:pre-wrap"><span style="color:rgb(34,34,34);font-size:small;white-space:normal"><br></span></span></p><p style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:11pt;color:rgb(0,0,0);vertical-align:baseline;white-space:pre-wrap"><span style="color:rgb(34,34,34);font-size:small;white-space:normal"><br></span></span></p></font></span><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><font face="arial, helvetica, sans-serif">Date: Tue, 13 Jun 2017 01:00:50 +0000<br>
From: Gregory Maxwell &lt;<a href="mailto:greg@xiph.org">greg@xiph.org</a>&gt;<br>
To: Andrew Miller &lt;<a href="mailto:soc1024@illinois.edu">soc1024@illinois.edu</a>&gt;<br>
Cc: Bitcoin Dev &lt;<a href="mailto:bitcoin-dev@lists.linuxfoundation.org">bitcoin-dev@lists.<wbr>linuxfoundation.org</a>&gt;<br>
Subject: Re: [bitcoin-dev] BIP proposal - Dandelion: Privacy<br>
        Preserving Transaction Propagation<br>
Message-ID:<br>
        &lt;CAAS2fgRAnGMMxKPCaj1SL=<a href="mailto:z3O2wuGS8nyPrgtGhSpuGgAoVtKg@mail.gmail.com">z3O2wu<wbr>GS8nyPrgtGhSpuGgAoVtKg@mail.<wbr>gmail.com</a>&gt;<br>
Content-Type: text/plain; charset=&quot;UTF-8&quot;<br>
<br>
On Mon, Jun 12, 2017 at 2:46 PM, Andrew Miller via bitcoin-dev<br>
&lt;<a href="mailto:bitcoin-dev@lists.linuxfoundation.org">bitcoin-dev@lists.<wbr>linuxfoundation.org</a>&gt; wrote:<br>
&gt; Dear bitcoin-dev,<br>
&gt;    We&#39;ve put together a preliminary implementation and BIP for<br>
&gt; Dandelion, and would love to get your feedback on it. Dandelion is a<br>
&gt; privacy-enhancing modification to Bitcoin&#39;s transaction propagation<br>
&gt; mechanism. Its goal is to obscure the original source IP of each<br>
&gt; transaction.<br>
<br>
I&#39;m glad to see this out now, so I&#39;m not longer invading the git repo<br>
uninvited. :)<br>
<br>
&gt;  - Stronger attacker model: we defend against an attacker that<br>
&gt; actively tries to learn which nodes were involved in the stem phase.<br>
&gt; Our approach is called &quot;Mempool Embargo&quot;, meaning a node that receives<br>
&gt; a &quot;stem phase&quot; transaction behaves as though it never heard of it,<br>
&gt; until it receives it again from someone else (or until a random timer<br>
&gt; elapsess).<br>
<br>
<br>
The description in the BIP appears inadequate:<br>
<br>
<br>
&gt; That is, Alice will not include the embargoed transaction when responding to MEMPOOL requests, and will not respond to GETDATA requests from another node (Bob) unless Alice previously sent an INV to Bob. The embargo period ends as soon as Alice receives an INV advertising the transaction as being in fluff mode.<br>
<br>
For example, it&#39;s not clear if I can query for the existence of a<br>
transaction by sending a conflict.  If this doesn&#39;t seem problematic,<br>
consider the case where I, communicating with you over some private<br>
channel, send you a payment inside a payment protocol message. You<br>
announce it to the network and I concurrently send a double spend.<br>
Only nodes that were part of the stem will reject my double spend, so<br>
I just learned a lot about your network location.<br>
<br>
It&#39;s also appears clear that I can query by sending an inv and<br>
noticing that no getdata arrives.  An example attack in the latter is<br>
that when I get a stem transaction I rapidly INV interrogate the<br>
entire network and by observing who does and doesn&#39;t getdata I will<br>
likely learn the entire stem path upto permutation.<br>
<br>
The extra network capacity used by getdata-ing a transaction you<br>
already saw via dandelion would be pretty insignificant.<br>
<br>
I believe the text should be simplified and clarified so just say:<br>
<br>
&quot;With the exception of her behavior towards the peer sending in the<br>
stem transaction and the peer sending out the transaction Alice&#39;s<br>
behavior should be indistinguishable from a node which has not seen<br>
the transaction at all until she receives it via ordinary forwarding<br>
or until after the timeout.&quot; -- then its up to the implementation to<br>
achieve indistinguishably regardless of what other protocol features<br>
it uses.<br>
<br>
&gt; Are there other ways we haven&#39;t thought of? We think the alternative<br>
&gt; approach (bypassing mempool entirely) seems even harder to get right,<br>
&gt; and foregoes existing DoS protection.<br>
<br>
I think avoiding the is the most sensible way; and from a software<br>
maintenance perspective I expect that anything less will end up<br>
continually suffering from serious information leaks which are hard to<br>
avoid accidentally introducing via other changes.<br>
<br>
The primary functionality should be straightforward to implement,<br>
needing just a flag to determine if a transaction would be accepted to<br>
the mempool but for the flag, but which skips actually adding it.<br>
<br>
Handling chains of unconfirmed stem transactions is made more<br>
complicated by this and this deserves careful consideration. I&#39;m not<br>
sure if its possible to forward stem children of stem transactions<br>
except via the same stem path as the parent without leaking<br>
information, it seems unlikely.<br>
<br>
This approach would mostly take additional complexity from the need to<br>
limit the amplification of double spends. I believe this can be<br>
resolved by maintaining a per-peer map of the not yet expired vin&#39;s<br>
consumed by stem fowards sent out via that peer. E.g. vin-&gt;{timeout,<br>
feerate}.  Then any new forward via that stem-peer is tested against<br>
that map and suppressed if it it spends a non-timed-out input and<br>
doesn&#39;t meet the feerate epsilon for replacement.<br>
<br>
Use of the orphan map is not indistinguishable as it is used for block<br>
propagation, and itself also a maintenance burden to make sure<br>
unrelated code is not inadvertently leaking the stem transactions.<br>
<br>
&gt; After a random number of hops along the stem, the transaction enters the fluff phase,<br>
<br>
The BIP is a bit under-specified on this transition, I think-- but I<br>
know how it works from reading the prior implementation (I have not<br>
yet read the new implementation).<br>
<br>
The way it works (assuming I&#39;m not confused and it hasn&#39;t changed) is<br>
that when a new stem transaction comes in there is a chance that it is<br>
treated as coming in as a normal transaction.<br>
<br>
An alternative construction would be that when a stem transaction goes<br>
out there is a random chance that the stem flag is not set (with<br>
suitable adjustment to keep the same expected path length)<br>
<br>
For some reason I believe this would be a superior construction, but I<br>
am only able to articulate one clear benefit:  It allows non-dandelion<br>
capable nodes to take on the role of the last stem hop, which I<br>
believe would improve the anonymity set during the transition phase.<br>
<br>
Unrelated:<br>
<br>
Has any work been given to the fact that dandelion propagation<br>
potentially making to measure properties of the inter-node connection<br>
graph?  e.g.  Say I wish to partition node X by disconnecting all of<br>
its outbound connections, to do that it would be useful to learn whom<br>
is connected to X.  I forward a transaction to X, observe the first<br>
node to fluff it,  then DOS attack that node to take it offline.  Will<br>
I need to DOS attack fewer or more nodes  to get all of X&#39;s outbounds<br>
if X supports rapid stem forwarding?<br>
<br>
<br>
------------------------------<br>
<br>
______________________________<wbr>_________________<br>
bitcoin-dev mailing list<br>
<a href="mailto:bitcoin-dev@lists.linuxfoundation.org">bitcoin-dev@lists.<wbr>linuxfoundation.org</a><br>
<a href="https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev" rel="noreferrer" target="_blank">https://lists.linuxfoundation.<wbr>org/mailman/listinfo/bitcoin-<wbr>dev</a></font><br></blockquote></div></div></div>