├── BlockchainProject_D.ipynb ├── README.md └── blockchainproject_d.py /BlockchainProject_D.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "nbformat": 4, 3 | "nbformat_minor": 0, 4 | "metadata": { 5 | "colab": { 6 | "name": "BlockchainProject_D.ipynb", 7 | "provenance": [] 8 | }, 9 | "kernelspec": { 10 | "name": "python3", 11 | "display_name": "Python 3" 12 | }, 13 | "language_info": { 14 | "name": "python" 15 | } 16 | }, 17 | "cells": [ 18 | { 19 | "cell_type": "markdown", 20 | "metadata": { 21 | "id": "XQBne1gCxxoy" 22 | }, 23 | "source": [ 24 | "Block chain\n", 25 | "\n", 26 | "Block chain: In simple words, Blockchain can be defined as a chain of the block that contains information." 27 | ] 28 | }, 29 | { 30 | "cell_type": "code", 31 | "metadata": { 32 | "id": "WQTTCJLo15X_" 33 | }, 34 | "source": [ 35 | "#Project Starts:" 36 | ], 37 | "execution_count": 3, 38 | "outputs": [] 39 | }, 40 | { 41 | "cell_type": "markdown", 42 | "metadata": { 43 | "id": "u7i5qiYA1v76" 44 | }, 45 | "source": [ 46 | "we will be using \"hash function \" to create fingerprints for each transactions , the hash function will link each out block chain to other block . To make this easier to use, we’ll define a helper function to wrap the python hash function that we’re using" 47 | ] 48 | }, 49 | { 50 | "cell_type": "code", 51 | "metadata": { 52 | "id": "zfzTZO6SxdLP" 53 | }, 54 | "source": [ 55 | "import hashlib,json,sys\n" 56 | ], 57 | "execution_count": 1, 58 | "outputs": [] 59 | }, 60 | { 61 | "cell_type": "code", 62 | "metadata": { 63 | "id": "K-B516tAx5s0" 64 | }, 65 | "source": [ 66 | "def hashMe(msg=\"\"):\n", 67 | " # For convenience, this is a helper function that wraps our hashing algorithm\n", 68 | " if type(msg)!=str:\n", 69 | " msg = json.dumps(msg,sort_keys=True) # If we don't sort keys, we can't guarantee repeatability!\n", 70 | " \n", 71 | " if sys.version_info.major == 2:\n", 72 | " return unicode(hashlib.sha256(msg).hexdigest(),'utf-8')\n", 73 | " else:\n", 74 | " return hashlib.sha256(str(msg).encode('utf-8')).hexdigest()" 75 | ], 76 | "execution_count": 2, 77 | "outputs": [] 78 | }, 79 | { 80 | "cell_type": "markdown", 81 | "metadata": { 82 | "id": "RkGzm7Gp1_8Z" 83 | }, 84 | "source": [ 85 | "Next, we want to create a function to generate exchanges between vinny and kinny. We’ll indicate withdrawals with negative numbers, and deposits with positive numbers. We’ll construct our transactions to always be between the two users of our system, and make sure that the deposit is the same magnitude as the withdrawal- i.e. that we’re neither creating nor destroying money." 86 | ] 87 | }, 88 | { 89 | "cell_type": "code", 90 | "metadata": { 91 | "id": "RHM_VNJ71ipU" 92 | }, 93 | "source": [ 94 | "import random\n", 95 | "random.seed(0)\n" 96 | ], 97 | "execution_count": 4, 98 | "outputs": [] 99 | }, 100 | { 101 | "cell_type": "code", 102 | "metadata": { 103 | "id": "J74P-tj52CjP" 104 | }, 105 | "source": [ 106 | "def makeTransaction(maxValue=3):\n", 107 | " # This will create valid transactions in the range of (1,maxValue)\n", 108 | " sign = int(random.getrandbits(1))*2 - 1 # This will randomly choose -1 or 1\n", 109 | " amount = random.randint(1,maxValue)\n", 110 | " vinnyPays = sign * amount\n", 111 | " kinnyPays = -1 * vinnyPays\n", 112 | " # By construction, this will always return transactions that respect the conservation of tokens.\n", 113 | " # However, note that we have not done anything to check whether these overdraft an account\n", 114 | " return {u'Vinny':vinnyPays,u'kinny':kinnyPays}" 115 | ], 116 | "execution_count": 5, 117 | "outputs": [] 118 | }, 119 | { 120 | "cell_type": "markdown", 121 | "metadata": { 122 | "id": "WjeV9XTg2GVe" 123 | }, 124 | "source": [ 125 | "lets create transcations\n" 126 | ] 127 | }, 128 | { 129 | "cell_type": "code", 130 | "metadata": { 131 | "id": "NVn89Iva2Eac" 132 | }, 133 | "source": [ 134 | "txnBuffer = [makeTransaction() for i in range(30)]" 135 | ], 136 | "execution_count": 6, 137 | "outputs": [] 138 | }, 139 | { 140 | "cell_type": "code", 141 | "metadata": { 142 | "id": "OFaTUPPs2I0l" 143 | }, 144 | "source": [ 145 | "# WAIT WAIT Project Code is longer and detailed explained.\n", 146 | "# Mail me to get Full Project Code at [ vatshayan007@gmail.com ]" 147 | ], 148 | "execution_count": 10, 149 | "outputs": [] 150 | }, 151 | { 152 | "cell_type": "markdown", 153 | "metadata": { 154 | "id": "wgjLCK4d2MxX" 155 | }, 156 | "source": [ 157 | "# Mail me at vatshayan007@gail.com for Project Files.\n", 158 | "## Project Files will include Project Code, Project PPT. Report and documentations " 159 | ] 160 | }, 161 | { 162 | "cell_type": "code", 163 | "metadata": { 164 | "id": "GZP3Aw-12L6j" 165 | }, 166 | "source": [ 167 | "" 168 | ], 169 | "execution_count": null, 170 | "outputs": [] 171 | } 172 | ] 173 | } -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Money-Transcation-Security-Blockchain-Project 2 | Protection and Security of Transaction between friends with help of Blockchain. Project Code, Project PPT, Report and Synopsis for College Project(Final Year Project). 3 | 4 | ### PPT: [Link](https://github.com/Vatshayan/Blockchain-Final-Year-Project/blob/main/Blockchain%20Money%20PPT.pdf) 5 | 6 | ### Demo: 7 | 8 | 9 | https://user-images.githubusercontent.com/28294942/161795296-c79508aa-3c91-4942-a797-b7b9ab601a03.mov 10 | 11 | 12 | 13 | ## ABSTRACT: 14 | Transcation between friends is secured by using blockchain technology. Here we will use see how transcation is secured and protected. Project is in python Programming. 15 | 16 | 17 | 18 | Blockchain is a system of recording information in a way that makes it difficult or impossible to change, hack, or cheat the system. 19 | 20 | A blockchain is essentially a digital ledger of transactions that is duplicated and distributed across the entire network of computer systems on the blockchain. Each block in the chain contains a number of transactions, and every time a new transaction occurs on the blockchain, a record of that transaction is added to every participant’s ledger. 21 | 22 | ### Blocks 23 | Every chain consists of multiple blocks and each block has three basic elements: 24 | 25 | The data in the block. 26 | A 32-bit whole number called a nonce. The nonce is randomly generated when a block is created, which then generates a block header hash. 27 | The hash is a 256-bit number wedded to the nonce. It must start with a huge number of zeroes (i.e., be extremely small). 28 | When the first block of a chain is created, a nonce generates the cryptographic hash. The data in the block is considered signed and forever tied to the nonce and hash unless it is mined. 29 | 30 | ### Nodes 31 | One of the most important concepts in blockchain technology is decentralization. No one computer or organization can own the chain. Instead, it is a distributed ledger via the nodes connected to the chain. Nodes can be any kind of electronic device that maintains copies of the blockchain and keeps the network functioning. 32 | 33 | Every node has its own copy of the blockchain and the network must algorithmically approve any newly mined block for the chain to be updated, trusted and verified. Since blockchains are transparent, every action in the ledger can be easily checked and viewed. Each participant is given a unique alphanumeric identification number that shows their transactions. 34 | 35 | Combining public information with a system of checks-and-balances helps the blockchain maintain integrity and creates trust among users. Essentially, blockchains can be thought of as the scaleability of trust via technology. 36 | 37 | _________________________________________________________________________________________________________________________________________________ 38 | 39 | 40 | Hi there, 41 | 42 | **You Can use this Beautiful Project for your college Project and get good marks too.** 43 | 44 | Email me Now **vatshayan007@gmail.com** to get this Full Project Code, PPT, Report, Synopsis, Video Presentation and Research paper of this Project. 45 | 46 | 💌 Feel free to contact me for any kind of help on any projects. 47 | 48 | ### HOW TO RUN THE PROJECT- 49 | ⚡ Email me at **vatshayan007@gmail.com** to get a detailed Guide report with Code to run the project with source Code. 50 | 51 | ### Need Code, Documents & Explanation video ? 52 | 53 | ## How to Reach me : 54 | 55 | ### Mail : vatshayan007@gmail.com 56 | 57 | ### WhatsApp: **+91 9310631437** (Helping 24*7) **[CHAT](https://wa.me/message/CHWN2AHCPMAZK1)** 58 | 59 | ### Website : https://www.finalproject.in/ 60 | 61 | ### 1000 Computer Science Projects : https://www.computer-science-project.in/ 62 | 63 | Mail/Message me for Projects Help 🙏🏻 64 | 65 | ### Top blockchain projects : https://vatshayan.medium.com/top-3-blockchain-final-year-projects-e910c25403a4 66 | -------------------------------------------------------------------------------- /blockchainproject_d.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | """BlockchainProject_D.ipynb 3 | 4 | Automatically generated by Colaboratory. 5 | 6 | Original file is located at 7 | https://colab.research.google.com/drive/17FaQ8UIUZxzJWPrwJWC1W8l6fxECSu5k 8 | 9 | Block chain 10 | 11 | Block chain: In simple words, Blockchain can be defined as a chain of the block that contains information. 12 | """ 13 | 14 | #Project Starts: 15 | 16 | """we will be using "hash function " to create fingerprints for each transactions , the hash function will link each out block chain to other block . To make this easier to use, we’ll define a helper function to wrap the python hash function that we’re using""" 17 | 18 | import hashlib,json,sys 19 | 20 | def hashMe(msg=""): 21 | # For convenience, this is a helper function that wraps our hashing algorithm 22 | if type(msg)!=str: 23 | msg = json.dumps(msg,sort_keys=True) # If we don't sort keys, we can't guarantee repeatability! 24 | 25 | if sys.version_info.major == 2: 26 | return unicode(hashlib.sha256(msg).hexdigest(),'utf-8') 27 | else: 28 | return hashlib.sha256(str(msg).encode('utf-8')).hexdigest() 29 | 30 | """Next, we want to create a function to generate exchanges between vinny and kinny. We’ll indicate withdrawals with negative numbers, and deposits with positive numbers. We’ll construct our transactions to always be between the two users of our system, and make sure that the deposit is the same magnitude as the withdrawal- i.e. that we’re neither creating nor destroying money.""" 31 | 32 | import random 33 | random.seed(0) 34 | 35 | def makeTransaction(maxValue=3): 36 | # This will create valid transactions in the range of (1,maxValue) 37 | sign = int(random.getrandbits(1))*2 - 1 # This will randomly choose -1 or 1 38 | amount = random.randint(1,maxValue) 39 | vinnyPays = sign * amount 40 | kinnyPays = -1 * vinnyPays 41 | # By construction, this will always return transactions that respect the conservation of tokens. 42 | # However, note that we have not done anything to check whether these overdraft an account 43 | return {u'Vinny':vinnyPays,u'kinny':kinnyPays} 44 | 45 | """lets create transcations 46 | 47 | """ 48 | 49 | txnBuffer = [makeTransaction() for i in range(30)] 50 | 51 | # WAIT WAIT Project Code is longer and detailed explained. 52 | # Mail me to get Full Project Code at [ vatshayan007@gmail.com ] 53 | 54 | """# Mail me at vatshayan007@gail.com for Project Files. 55 | ## Project Files will include Project Code, Project PPT. Report and documentations 56 | """ 57 | 58 | --------------------------------------------------------------------------------