Skip to content

A Bitcoin Mining Simulator in C++ that simulates the effect of different network topologies and mining strategies on the miner's revenue.

License

Notifications You must be signed in to change notification settings

ajainuary/bitcoin-strategic-deviations

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Bitcoin Strategic Deviations

A Project to simulate various strategies in Proof-of-Work Mining to explore the effects of strategic deviations.

Compiling

make

Usage

./simulator <number_of_nodes> <distance_matrix_csv> <number_of_rounds> <randomness_file_csv> <strategy_no_fast_nodes> <strategy_no_slow_nodes>

where

  1. Distance Matrix : A nxn matrix that contains the distance of each node to every other node, that is D[i][j] is the number of rounds taken for a message from node i to reach node j.
  2. Randomness File : A file that contains the lottery values for each node in each round, if this value is below a certain threshold the node gets to mine a block.
  3. Strategy No : This strategy number corresponds exactly to the strategies S1-4 used in the paper, the first number corresponds to the strategy for the first node and the second number corresponds to the strategy for the second node

In order to run an instance of the simulation used in generating the payoff matrix in Table 1 of the paper:

./simulator 100 data/Distance_Network_3_Asymmetric.csv 40 data/Randomness_1.csv 4 4

Replace Randomness_1.csv with Randomness_<1-100>.csv to try different random simulations.

Note: Randomness files are used to compare results between different strategies and network conditions, which would be difficult if different random numbers were used in every instance.

In addition, various different Distance Matrices are also provided:

  1. Distance_Network_3_Asymmetric.csv: Contains 50% slow nodes and 50% fast nodes
  2. Distance_Fair.csv: All nodes are fast nodes
  3. Distance_Farm.csv: A hypothetical scenario where 10% of the nodes are a part of a mining farm with negligible network delay among themselves

About

A Bitcoin Mining Simulator in C++ that simulates the effect of different network topologies and mining strategies on the miner's revenue.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published