Giter Site home page Giter Site logo

merkletreeinpython's Introduction

MerkleTree

Program for implementing Merkle Tree and its application

Python Script to calculate Merkle Root of a CSV File Input. By using a merkle tree, one can validate a large data set contained inside the tree by just comparing the merkle root / root node of the tree.

This script assumes the input data is in the form of CSV File, and saves the finally calculated merkle root for the user in another CSV File.

The data is stored in the leaf nodes and we bubble up from botton to top by calculating the hash of each leaf node.

At the end we are left with a single merkle root capable of validating the whole data set with just a single hash string of 32 bytes. Merkle Trees reduce the number of computations required for verification of a single component in a large data set as once the tree is created it needs a small amount of information (1 hash per level of the tree) to calculate and reach the valid merkle root. As shown in tree.png file.

Program Implementation:-

The File MerkleScript.py will calculate the final hash value for the input. Input here is given by a example.csv file which contains random hash values generated in python by using sha256() or md5() and just they are copy paste in excel file and seperated by using commas to make multiple enteries in the excel file.

And the other files :- Hash.py and text files verify.txt,verify1.txt,verify2.txt,verify3.txt are just for reference created by me to calculate randown hash values using particular algorithum and stored it the excel file named latish.csv. By using values in this file e can put it int the example.csv file which is input to the main file.

Performance of the script is fast as it can generate hash values of 1000 enteries in just few seconds.

merkletreeinpython's People

Contributors

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