Git Product home page Git Product logo

blockchainsim's Introduction

Introduction

Simulation

This is a system for creating an agent based simulation for the Blockchain network. The key features of this system is to create a random simulation which is also reproduceable. This is achieved by letting the user decide on the seed for RNG. Another objective of this system is to allow the user to define the behaviour of different types of nodes which participate in the blockchain.

Each node in the system inherits from the Entity class which defines the default behaviour of a random blockchain node. The system can be extended by creating additional functions after extending an Entity. For example, the included Miner class extends entity by implementing functions which give the Miner a block reward and adds new blocks to the chain. A Miner can be further extended by extending the Miner class.

Each Entity has an embedding vector which represents the habits of the node. These habits can be used to decide on how the nodes interact with each other. For example, an Entity with a particular habit is more likely to interact with a specific Merchant with a similar habit embedding.

Prerequisites

The following libraries were used while designing the simulator(they need to be installed before running the code):

numpy
matplotlib
networkx
bezier
fa2

Usage

Creating the simulation files:

python3 simulation.py

Creating the visualization:

mkdir plots
python3 visualize.py simulation.pkl

blockchainsim's People

Contributors

aniquetahir avatar

Stargazers

Roman avatar Gunther Schulz avatar  avatar

Watchers

James Cloos avatar  avatar

Forkers

dmml-asu

blockchainsim's Issues

Simulating Vendor Favoritism

Currently buyers select vendors at random based on their habits. There needs to be some favoritism for vendors since people tend to use some vendors more frequently than others

Move sanity checks to the miners

Currently sanity checks like looking at the balance for transaction are happening at the level of each entity. These need to be moved to the miners.

Block Rewards

There has to be some method defining how to reward the miners for adding to the chain

Implement Mining Fees

Currently mining fees is not being taken into consideration. This means that the simulation works as if the fee is zero.

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.