  In this paper we describe LUNES-Blockchain, an agent-based simulator of
blockchains that relies on Parallel and Distributed Simulation (PADS)
techniques to obtain high scalability. The software is organized as a
multi-level simulator that permits to simulate a virtual environment, made of
many nodes running the protocol of a specific Distributed Ledger Technology
(DLT), such as the Bitcoin or the Ethereum blockchains. This virtual
environment is executed on top of a lower-level Peer-to-Peer (P2P) network
overlay, which can be structured based on different topologies and with a given
number of nodes and edges. Functionalities at different levels of abstraction
are managed separately, by different software modules and with different time
granularity. This allows for accurate simulations, where (and when) it is
needed, and enhances the simulation performance. Using LUNES-Blockchain, it is
possible to simulate different types of attacks on the DLT. In this paper, we
specifically focus on the P2P layer, considering the selfish mining, the 51%
attack and the Sybil attack. For which concerns selfish mining and the 51%
attack, our aim is to understand how much the hash-rate (i.e. a general measure
of the processing power in the blockchain network) of the attacker can
influence the outcome of the misbehaviour. On the other hand, in the filtering
denial of service (i.e. Sybil Attack), we investigate which dissemination
protocol in the underlying P2P network makes the system more resilient to a
varying number of nodes that drop the messages. The results confirm the
viability of the simulation-based techniques for the investigation of security
aspects of DLTs.
