Giter VIP home page Giter VIP logo

blockchain's Introduction

Project to build some of the basic concepts of blockchain.

First references should be: How to timestamp a Digital Document and Bitcoin.pdf which recyclyed the timestamp idea and helped explode the popularity of blockchain.

Also a good read, albeit a mix of bitcoin and blockchain, is the bitcoin developer guide

The project can be run by calling runnable.py

The 3 main processes can be run separately by running:

  1. /transactionqueue/txn_server.py
  2. /blocklogic/currentBlock.py
  3. /tests/grpcservertest.py

Implemented:

  • main block class
  • transaction queue to hold incoming transactions to be processed by the block
  • Global block list queue that will later be used with consensus
  • grpc server for listening for incoming transactions and serving transactions from the queue to the block
  • implementation of merkle tree persisted with each block
  • hashing methods to hash the blocks theoretically implementing a proof of work
  • processing and verifying the blocks are chained together as expected

The txn_server will manage the transaction queue. The grpcservertest will generate fake transactions to send into the transaction queue via the txn_server. The currentBlock is responsible for pulling transactions off the queue from the txn_server and adding them to the current block. Once the block is full (in this example we are using max 20 txns, bitcoin max is 1MB) it is sent to be processed. Processing first verifies the connection to the blockchain by checking the previous hash against the last blockfile, then hashes the current block and persists it to disk (assuming the chain is verified.) Then a new block is created with the previous hash value set to the hash of the block just hashed. And the process repeats indefinitely.

To be added: Validate txn in block via merkle tree Swap to config file for global variables Rollback and better handling if errors - txns in the queue Change Proof of work to increase difficulty Different block size handling Tests distributed

blockchain's People

Contributors

gastanek avatar

Watchers

James Cloos 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.