The Nomos Mix simulator:
git clone <https://github.com/logos-co/nomos-specs.git> -b mixnet-v2-sim-fin
cd nomos-specs
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
Before running simulations with realistic parameters, this section describes how the simulation works and how to configure it, by running it with simple parameters.
This is a setting to produce the base result (i.e. control group) that will be compared to other results later.
simulation:
# Desired duration of the simulation in seconds
# Since the simulation uses discrete time steps, the actual duration may be longer or shorter.
duration_sec: 1000
network:
# Total number of nodes in the entire network.
num_nodes: 5
latency:
# Maximum network latency between nodes in seconds.
# A constant latency will be chosen randomly for each connection within the range [0, max_latency_sec].
max_latency_sec: 0.1
# Seed for the random number generator used to determine the network latencies.
seed: 0
peering:
# Target number of peers each node can connect to (both inbound and outbound).
degree: 6
mix:
# Global constant transmission rate of each connection in messages per second.
transmission_rate_per_sec: 10
mix_path:
# Maximum number of mix nodes to be chosen for a Sphinx packet.
max_length: 3
# Seed for the random number generator used to determine the mix path.
seed: 3
logic:
sender_lottery:
# Interval between lottery draws in seconds.
interval_sec: 1
# Probability of a node being selected as a sender in each lottery draw.
probability: 0.000
# Seed for the random number generator used to determine the lottery winners.
seed: 10
duration_sec * 1000
discrete time steps, i.e. the time precision is “milliseconds”.duration_sec
if computations are not heavy.
duration_sec
if computations are heavy.[0, network.max_latency_sec
].To build a peer-to-peer network, each node establishes connections with the target number of peers (peering.degree
).
In other words, all connections are duplex (bidirectional) in order to simulation the real networking as similar as possible.
For simplicity, nodes are connected as a “ring” topology for now (regardless of peering.degree
).
(node-3) --> node-0 <--> node-1 <--> node-2 <--> node-3 <-- (node-0)