This directory contains the source code for the experimental results presented in the following paper submitted to IEEE/ACM Transactions on Networking:
[1] Robust and Low-degree Overlay for Secure Flooding Against Resource-bounded AdversariesThe source code is available here. The remainder of this page provides step-by-step instructions on how to reproduce all our experimental results.
All input data files are stored in the subdirectory ./data/. In the subdirectory, files named XXX_histo_100k.txt are the stake distributions for n=100000 of the six cryptocurrencies.
The source code to regenerate results in Figure 1 and 2 in [1] is in the subdirectory ./figure1-2/.
For Figure 1, one can obtain the maximum node degree in Liu's and Coretti's design for different stake distributions by running:
chmod 700 *.sh
./liu.sh
./coretti.sh
The results for our design's degree in Figure 1 can be generated following instructions for Figure 4-6, see next section.
For Figure 2, one can obtain v_max in Liu's and Coretti's design for different stake distributions by running:
python3 v_max.py
The source code for the results presented in Figure 4-6 in [1] is in the subdirectory ./figure4-6/.
We implemented the algorithm for constructing our LoR topology in tga.cpp, whose input is a stake distribution, and topology parameters. The program constructs our LoR topology and also outputs metrics such as maximum out/in degree and the diameter. These results are presented in Figure 4-6. One can run it by:
g++ -o a.out tga.cpp -std=c++11
./a.out distribution_data_path n f g k l
For example, one can run the command:
./a.out ../data/bitcoin_histo_100k.txt 100000 0.2 8 414 90
to obtain the LoR topology (along with its max out-degree, max in-degree, and diameter) for the bitcoin distribution with n=100000 nodes under f=0.2, with parameter g = 8, k = 414, l = 90.
The parameters used in our LoR topology, as presented in Table III in [1], should pass Algorithm1 in [1]. We implemented Algorithm1 in the subdirectory ./algorithm1/. The main program is named pta.cpp. (We note that pta.cpp actually provides more functionalities than Algorithm1.)
To run Algorithm1, one can do:
g++ -std=c++11 pta.cpp generate_gcc_table.cpp generators.cpp -o pta.out
./pta.out n f epsilon delta g k l
to get the output of Algorithm1(n, f, epsilon, delta, g, k, l). One can use this to verify the parameters in Table III. For example, one can run:
./pta.out 100000 0.2 0.1 1e-10 8 414 90
and Algorithm1 will output the following after it finishes:
Algorithm1 passes with n=100000, f=0.2, epsilon=0.1, delta=1e-10, g=8, k=414, l=90