Giter Site home page Giter Site logo

blockchain-pos's Introduction

Proof-of-Stake Blockchain

Introduction

This is a prototype of Blockchain using Proof-of-Stake Consensus mechanism. It was written in Python and actually based on a Udemy course.

  • Cryptographic Signatures
  • RSA Public Key Cryptography
  • SHA-256 Hashes
  • Transactions - The purpose of Transactions in a Blockchain Systems.
  • Blocks - The most essential building block.
  • Blockchains - Whats going on behind the scenes.
  • P2P Network - How to find and communicate with other Nodes.
  • REST API - How to communicate with your Blockchain System.
  • Proof-of-Stake: Finding Consensus in a Network of mutually untrusted Nodes
  • Threading & Parallelization

Suggested improvements

  • Currently, all data is stored in process' memory. We can improve it by storing data in a persistent storage e.g. LevelDB
  • Shorten the addresses of sender and receiver. So far, we're using public keys
  • What if a staker is selected to be the next forger but is offline?

High level Components

High level Components

UML Diagram

UML Diagram

Getting started

  • Install requirements.txt
  • In case of error, run
pip3 uninstall PyCrypto
pip3 install -U PyCryptodome
  • start P2P nodes
python3 Main.py localhost 10001
  • Start API server
python3 Main.py localhost 10001 5001
  • Query Blockchain and Transaction Pool status via API
http://localhost:5001/blockchain
http://localhost:5001/transactionPool

Blockchain status

  • Create and submit a transaction via API
python3 TestCreateTransaction.py

blockchain-pos's People

Stargazers

 avatar  avatar  avatar Tanguyen avatar

Watchers

Tanguyen 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.