  Cryptocurrency systems can be subject to deanonimization attacks by
exploiting the network-level communication on their peer-to-peer network.
Adversaries who control a set of colluding node(s) within the peer-to-peer
network can observe transactions being exchanged and infer the parties
involved. Thus, various network anonymity schemes have been proposed to
mitigate this problem, with some solutions providing theoretical anonymity
guarantees.
  In this work, we model such peer-to-peer network anonymity solutions and
evaluate their anonymity guarantees. To do so, we propose a novel framework
that uses Bayesian inference to obtain the probability distributions linking
transactions to their possible originators. We characterize transaction
anonymity with those distributions, using entropy as metric of adversarial
uncertainty on the originator's identity. In particular, we model Dandelion,
Dandelion++ and Lightning Network. We study different configurations and
demonstrate that none of them offers acceptable anonymity to their users. For
instance, our analysis reveals that in the widely deployed Lightning Network,
with 1% strategically chosen colluding nodes the adversary can uniquely
determine the originator for about 50% of the total transactions in the
network. In Dandelion, an adversary that controls 15% of the nodes has on
average uncertainty among only 8 possible originators. Moreover, we observe
that due to the way Dandelion and Dandelion++ are designed, increasing the
network size does not correspond to an increase in the anonymity set of
potential originators. Alarmingly, our longitudinal analysis of Lightning
Network reveals rather an inverse trend -- with the growth of the network the
overall anonymity decreases.
