Coder Social home page Coder Social logo

proto_blockchain's Introduction

proto_blockchain

This repository is dedicated to the concepts of blockchain using python. Since python is one of the most abundant language for programming right now. Hereby I am creating a repo and initializing it with basic concepts for now.

Updates and fixes :

Update 1.1:

Fixed the mine_block function : Error was due to the usage of different spelling for the key "recipient". Due to that the already created chain was not being verified hence no adding of new block.

Added the string formatter:: Added it to calculate the balance check upto 10th place of currency. Since it's the most logical thing to do as the value of cryptos are taken seriously in decimals unlike conventional currencies.

Added the lambda function:: Added the lambda function to reduce the looping through big chains of transactions.

Added the reduce function:: Added reduce function to further reduce the calculation time.

Update 1.2:

SHA-256: A hash function is any function that can be used to map data of arbitrary size to data of fixed size¹. Added SHA-256 for the encryption technique previously we were using the basic hashing of our own.

Proof of Work: Added the proof of work system, heavy computation(theoritically) to check the authenticity of the blocks.

Minor Tweaks:

Removed the usage of dictionary

Added the orderedDict such that their is not even a single chance of altering of arguments passed. Sometimes to optimize run time, python tweaks the things a little bit and their is slight possiblity that the dict pair gets altered while passing since their are not ordered in any way.

Small entitites: Seprated the hash as hash.py. Objective is to effectively break the complete file into small entitites.

Update 2.0:

Fixed Problems with the hashing: The hashing was being shown invalid due to faulty parsing.

Fixed Genesis Block Dependency: Fixed the loading problem with the genesis block and the sidwise open_transactions. Function load_data lead to error as initially there was no record to maintain.

Change the digest to hexdigest in hashlib: Looping over hexdigest was taking infinite time(I waited for atleast 19 minutes) so changing it to hexdigest was a better option since the first two digits were compared.

'Fixed the genesis block problem:

Update 3.0:

Replaced the procedural with object oriented programming: Now all the properties of the block are windup under a Class Block.

Fixed the JSON serialization problem: Some specific objects are json serializable, hence the Class Block is not serialized by default.

JSON works with the inbuilt datatypes so by using the dict we can convert to the dictionary type from the default class type

The reason to use the copy function is that if we directly apply changes to the blocks of blockchain. Hashing of the previous block stored for the previous transactions can change in serialization. Since to save it from changing another copy is made.

Added the verification class: Seprated the verification functions under other class. Improved code readablity and reusage.

Added the node class: Added the node class which wil act as user interface. Other classes such as blockchain, verification, printable and transaction are added on the basis of functionality.

Implemented more secure channel between classes and assigned random id function i.e. uuid4 to the sender:

Removed the problem with the last transaction. It was open to manipulation. The last block was pushed when another block was created after it. So to prevent the exploitation following things were used:

Imported python package called pycryto


Using RSA public key private key pair

RSA public-key cryptography algorithm (signature and encryption).

RSA is the most widespread and used public key algorithm. Its security is based on the difficulty of factoring large integers. The algorithm has withstood attacks for 30 years, and it is therefore considered reasonably secure for new designs.

Update 3.1:

Updated the Verification Logics Added the logic to check the open_transaction for credit limit.

Added the create and load wallet feature Added the feature which on use loads the existing key value pair.


Linux

proto_blockchain's People

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.