Giter Site home page Giter Site logo

blockchain_simulator's Introduction

Blockchain_Simulator

A blockchain simulator in Python and Flask.

Introduction & Goal

Blockchain is a digital ledger that is distributed among the nodes of a peer-to-peer network. This solution to Byzantine Failures requires maintaining a global public append-only log. Each block in the blockchain contains a cryptographic hash of the previous block, a timestamp, and transaction data (generally represented as a Merkle tree, where data nodes are represented by leaves).

This project implemented my own version of blockchain. This goal required implementing a basic abstract representation of blockchain and basic algorithms and operations in blockchain. This goal is broke down into the following smaller goals:

  1. Construct representation of blockchain
  2. Implement basic operations, Proof of Work algorithm and Consensus algorithm
  3. Map endpoints to functions via Flask for testing using HTTP requests (using Postman)

Project Structure

The specific structure of a block in the project is:

Here each block is connected via the previous_hash field, and the proof field is the nouce computed by a node that solves the hashing problem.

The project includes the following parts:

  • blockchain.py -- the abstract representation of our blockchain, contains fields of a blockchain and the basic operations and algorithms(e.g. Proof of Work Algorithm, Consensus Algorithm)
  • app.py -- all the end points in the Flask application, for running and testing the application
  • server.py -- attempt for DNS server in the blockchain

blockchain_simulator's People

Contributors

tianhao-li avatar

Stargazers

Jidong Li 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.