Giter Club home page Giter Club logo

python_blockchain_app's Introduction

Python Blockchain

Used as a backend in blockchat

See the original for the tutorial on this.

Changes made from original

  • Supports conversation between two people (instead of a common chat room)
  • Added coins
  • Encryption of messages using RSA Public-Private Key pairs
  • Transactions are stored to a file instead of using only memory
  • Transactions file is asynchronously uploaded to a Firebase Storage container
  • Tried to eliminate race condition when two users send a message simulatenously
  • Ready to be deployed to Heroku

python_blockchain_app's People

Contributors

samyak2 avatar satwikkansal avatar

Watchers

James Cloos avatar  avatar

python_blockchain_app's Issues

Use Decimal instead of float to store coins

The issue

  • Using float to store very small values can lead to unexpected results.
  • Since very small amounts of coins need to added or subtracted, it is bad idea to use float

Solution

  • Use decimal.Decimal to store coins

Validate coins before making a transaction

The issue

  • Currently, there is no validation done when sending messages or transactions.
  • This can lead to negative values of coins.

Possible solutions

  • Check if the sender has enough coins to make the transaction.
  • It will be computationally expensive to iterate through the entire blockchain to get the number of coins for a user, though that is the only way to guarantee that the calculations will be correct.
  • You are free to use any approach for this.

Create a better README

  • The README file does not have much information about the project.

  • Add sections like:

  • Description

  • Instructions to use / Usage

  • Implementation details

  • Add your own...

  • PRs for any one of these will also be considered.

  • Also see #4

Clean and document the code

  • The code contains a lot of unnecessary code that is commented out. Those can be removed.
  • The code is mostly undocumented.
  • Also see #3

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.