Giter Site home page Giter Site logo

mining_simulator's Introduction

Bitcoin Mining Simulator

This is a simulator intended for testing non-default bitcoin mining strategies.

Installation

The Bitcoin Mining Simulator has been developed and tested on Mac OS X 10.11.4. This software is currently setup to be run using Apple's Xcode IDE.

The code is dependent on the GNU Scientific Library (https://www.gnu.org/software/gsl/). The xcode project file expects the headers to be located at /usr/local/include and the library files to be located at /usr/local/lib so these must be updated if your configuration differs.

The code for the mining simulator is written in standard C++14. In the future we will release this code with a makefile so that it is easily compilable in a cross-platform manner.

Usage

main.cpp inside of the StratSim folder is the main code example for usage of this simulator.

The code is generally designed around the idea of mining strategies. Each mining strategy prescribes set behaviors for a mining. We then create a set of miners with configurable hash rate, cost per hash, and network latency. These miners then compete to mine on a simulated blockchain with configurable block reward and transaction fee accumulation rate.

In the future we will release more documentation and code examples for usage of this software.

Output of Example Code

StratSim produces a folder which includes a file for each miner that is competing to mine blocks. This simulation works by running a series of simulations where miners choose to use the strategy that they believe to be most effective. Each output file gives a list of the percentage of miners who used the given strategy in each round. This demonstrates the idea that miners will either all converge to an optimal strategy or oscillate between strategies when there is no equilibrium.

SelfishSim evalutates the effectiveness of the selfish mining strategy. It produces a single file which contains the percentage profit earned by the selfish miner given the percentage of hash power which it controls.

Disclaimer

Note that the Bitcoin Mining Simulator is under active development, and should be considered experimental software.

Although the Bitcoin Mining Simulator is actively used by our group for research studies, it is still possible there are unknown bugs in the simulator. We plan on writing comprehensive tests to verify the results of all included components. Prior to using the Bitcoin Mining Simulator for your own research we encourage you to write tests (and submit pull requests!) for any testing that isn't currently included in our test scripts.

License

Bitcoin Mining Simulator is licensed under GNU GPLv3. Additional code has been included from arithmetic_type which is licensed Boost Software License Version 1.0.

mining_simulator's People

Contributors

hkalodner avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.