DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING A PROJECT REPORT ON “TRADE SECURITY USING BLOCKCHAIN “ Submitted in partial fulfillment for the award of the degree of BACHELOR OF ENGINEERING IN COMPUTER SCIENCE AND ENGINEERING BY STEPHEN BANZ 1NH15CS133 Under the guidance of Ms. SHEBA PARI Assistant Professor, Dept. of CSE, NHCE DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING CERTIFICATE It is hereby certified that the project work entitled “TRADE SECURITY USING BLOCKCHAIN” is a bonafide work carried out by STEPHEN BANZ (1NH15CS133) in partial fulfilment for the award of Bachelor of Engineering in COMPUTER SCIENCE AND ENGINEERING of the New Horizon College of Engineering during the year 2018-2019. It is certified that all corrections/suggestions indicated for Internal Assessment have been incorporated in the Report deposited in the departmental library. The project report has been approved as it satisfies the academic requirements in respect of project work prescribed for the said Degree. ………………………… Signature of Guide ……………………….. Signature of HOD (Ms. Sheba Pari) (Dr. B. Rajalakshmi) ……………………………… Signature of Principal (Dr. Manjunatha) External Viva Name of Examiner Signature with date 1. ………………………………………….. …………………………………. 2. …………………………………………… ………………………………….. TRADE SECURITY USING BLOCKCHAIN ABSTRACT Because of the popularity of the Internet, the integration services have gradually changed people daily life, such as e-commerce activities on transactions, transportation and so on. The E-auction, one of the popular e-commerce activities, allows bidders to directly bid the products over the Internet. As for sealed bid, the extra transaction cost is required for the intermediaries because the third-party is the important role between the buyers and the sellers help to trade both during the auction. In addition, it never guarantees whether the third-party is trust. To resolve the problems, we propose the blockchain technology with low transaction cost which is used to develop the smart contract of public bid and sealed bid. The smart contract, proposed in 1990 and implements via Ethereum platform, can ensure the bill secure, private, non-reputability and inalterability owing to all the transactions are recorded in the same but decentralized ledgers. The smart contract is composed of the address of Auctioneer, the start auction time, deadline, the address of current winner, the current highest price. Dept of CSE, NHCE I TRADE SECURITY USING BLOCKCHAIN ACKNOWLEDGEMENT The satisfaction and euphoria that accompany the successful completion of any task would be impossible without the mention of the people who made it possible, whose constant guidance and encouragement crowned our efforts with success. I have great pleasure in expressing my deep sense of gratitude to Dr. Mohan Manghnani, Chairman of New Horizon Educational Institutions for providing necessary infrastructure and creating good environment. I take this opportunity to express my profound gratitude to Dr. Manjunatha , Principal NHCE, for his constant support and encouragement. I am grateful to Dr.Prashanth C.S.R, Dean Academics, for his unfailing encouragement and suggestions, given to me in the course of my project work. I would also like to thank Dr. B. Rajalakshmi , Professor and Head, Department of Computer Science and Engineering, for her constant support. I express my gratitude to Ms. Sheba Pari , Assistant Professor, my project guide, for constantly monitoring the development of the project and setting up precise deadlines. Her valuable suggestions were the motivating factors in completing the work. Finally a note of thanks to the teaching and non-teaching staff of Dept of Computer Science and Engineering, for their cooperation extended to me, and my friends, who helped me directly or indirectly in the course of the project work. STEPHEN BANZ (1NH15CS133) Dept of CSE, NHCE II TRADE SECURITY USING BLOCKCHAIN CONTENTS SI 1 2 3 4 TITLE PAGE ABSTRACT I ACNOWLEDGEMENT II LIST IF FIGURES VI LIST OF TABLES VIII INTRODUCTION 1 1.1 ABSTRACT 1 1.2 PROBLEM IDENTIFICATION 1 1.3 EXISTING SYSTEMS 2 1.4 PROPOSED SYSTEM AND ADVANTAGES 3 LITERATURE REVIEW 4 2.1 INTRODUCTION 4 2.2 LITERATURE REVIEW 4 ANALYSIS 10 3.1 INTRODUCTION 10 3.2 SOFTWARE REQUIREMENT SPECIFICATION 10 3.2.1 SCOPE 11 3.2.2 VARIOUS DIVISIONS IN THE PROJECT 11 3.2.3 FUNCTIONAL REQUIREMENTS 14 3.2.4 NON FUNCTIONAL REQUIREMENTS 15 3.2.5 SOFTWARE REQUIREMENTS 15 3.2.6 HARDWARE REQUIREMENTS 16 SYSTEM DESIGN Dept of CSE, NHCE 17 III TRADE SECURITY USING BLOCKCHAIN 5 6 4.1 INTRODUCTION 17 4.2 SYSTEM ARCHITECTURE DIAGRAM 18 HIGH LEVEL DESIGN 22 5.1 INTRODUCTION 22 5.2 DESIGN CONSIDERATION 22 5.2.1 ASSUMPTIONS AND DEPENDENCIES 22 5.2.2 MODE OF OPERATION 23 5.2.3 USER OPERATIONS 28 5.3 DATAFLOW DIAGRAM 28 LOW LEVEL DESIGN 35 6.1 INTRODUCTION 35 6.2 USE CASE DIAGRAM 35 6.3 SEQUENCE DIAGRAM 36 6.3.1 USER REGISTRATION 36 6.3.2 BID UPDATE 37 6.3.3 CREATE BID 38 6.3.4 REGISTER BI ON BLOCKCHAIN 39 6.3.5 DISTRIBUTE TRANSACTION DATA 40 6.3.6 REGISTER PRODUCT 40 6.3.7 PRODUCT WINNING 41 6.4 CLASS DIAGRAMS 7 42 6.4.1 USERS CLASS DIAGRAM 42 6.4.2 BID CLASS DIAGRAM 43 6.4.3 NODE CLASS DIAGRAM 44 6.4.4 BLOCKCHAIN CLASS DIAGRAM 45 IMPLEMENTATION 46 7.1 INTRODUCTION 46 Dept of CSE, NHCE IV TRADE SECURITY USING BLOCKCHAIN 7.2 OVERVIEW OF SYSTEM IMPLEMENTATION 8 9 10 46 7.2.1 USABILITY ASPECT 47 7.2.2 TECHNICAL ASPECT 47 7.2.2.1 SERVERS 47 7.2.2.2 DATABASE 48 TESTING 50 8.1 INTRODUCTION 50 8.2 LEVELS OF TESTING 50 8.2.1 UNIT TESTING 50 8.2.2 INTEGRATION TESTING 53 8.2.3 SYSTEM TESTING 53 8.2.4 VALIDATION TESTING 54 8.2.5 OUTPUT TESTING 54 8.2.6 USER ACCEPTENCE TESTING 55 8.2.7 GUI TESTING 55 SCREENSHOTS 56 9.1 USER SIGNIN 56 9.2 WELCOME PAGE 56 9.3 BIDDING MARKET 57 9.4 CREATE NEW BID 58 9.5 PRODUCTS UPLOADED BY ME 58 9.6 EDIT YOUR PROFILE 59 9.7 SUCCESSFUL BIDDING 59 9.8 WINNING PRODUCTS 60 9.9 NODES DESCRIPTION 60 CONCLUSION AND FUTURE WORK 61 BIBLIOGRAPHY 62 Dept of CSE, NHCE V TRADE SECURITY USING BLOCKCHAIN LIST OF FIGURES SI TITLE PAGE 1.1 PROBLEM IDENTIFICATION 2 2.1 DATA PRESERVATION AND LINKING 5 2.2 BLOCKCHAIN RECORD 6 2.3 BLOCKCHAIN BLOCKS 8 4.1 SYSTEM ARCHITECTURE 18 5.1 ACCOUNT ACCESS LAYER 29 5.2 NODE IMPLEMENTATION 30 5.3 SUPER ADMIN CONFIG 31 5.4 PRODUCT ADDITION 32 5.5 BID MARKET 33 5.6 PRODUCTS AND WIN LOGS 34 6.1 USE CASE DIAGRAM 35 6.2 USER REGISTRATION SSD 36 6.3 BID UPDATE SSD 37 6.4 CREATE BID SSD 38 6.5 REGISTER BID SSD 39 6.6 DISTRIBUTE DATA SSD 40 6.7 REGISTER PRODUCT SSD 40 6.8 PRODUCT WINNING SSD 41 6.9 USERS CLASS DIAGRAM 42 6.10 BID CLASS DIAGRAM 43 6.11 NODE CLASS DIAGRAM 44 6.12 BLOCKCHAIN CLASS DIAGRAM 45 9.1 USER SIGNIN 56 9.2 WELCOME PAGE 56 Dept of CSE, NHCE VI TRADE SECURITY USING BLOCKCHAIN 9.3 BIDDING MARKET 57 9.4 CREATE A NEW BID 58 9.5 MY PRODUCTS 58 9.6 EDIT PROFILE 59 9.7 SUCCESSFUL BIDDING 59 9.8 WINNING PRODUCTS 60 9.9 NODES DESCRIPTION 60 Dept of CSE, NHCE VII TRADE SECURITY USING BLOCKCHAIN LIST OF TABLES SI TITLE PAGE 3.1 SOFTWARE REQUIREMENTS 15 3.2 HARDWARE REQUIREMENTS 16 5.1 MODES OF OPERATION 23 5.2 USERS OPERATION 28 8.1 TESTCASES FOR THE PROJECT 51 8.2 TESTCASES FOR INTEGRATION TESTING 53 8.3 TESTCASES FOR INPUT-OUTPUT 54 Dept of CSE, NHCE VIII TRADE SECURITY USING BLOCKCHAIN CHAPTER 1 INTRODUCTION 1.1 Abstract Because of the popularity of the Internet, the integration services have gradually changed people daily life, such as e-commerce activities on transactions, transportation and so on. The E-auction, one of the popular e-commerce activities, allows bidders to directly bid the products over the Internet. As for sealed bid, the extra transaction cost is required for the intermediaries because the third-party is the important role between the buyers and the sellers help to trade both during the auction. In addition, it never guarantees whether the third-party is trust. To resolve the problems, we propose the blockchain technology with low transaction cost which is used to develop the smart contract of public bid and sealed bid. The smart contract, proposed in 1990 and implements via Ethereum platform, can ensure the bill secure, private, non-reputability and inalterability owing to all the transactions are recorded in the same but decentralized ledgers. The smart contract is composed of the address of Auctioneer, the start auction time, deadline, the address of current winner, the current highest price. 1.2 Problem Identification In an online biding system, an extra transaction cost is required for the intermediaries because the third-party is an important role between the buyers and the sellers help to trade both during the auction. In addition, it never guarantees whether the third-party is a trusted one. Dept of CSE, NHCE 1 TRADE SECURITY USING BLOCKCHAIN Fig 1.1 Problem Identification E-auction has two main problems. • First, a centralized intermediary is required in bidding system to help communication between bidders and auctioneers. The charge fees for the centralized intermediary to increase the transaction cost. Besides, the personal data and transaction records are stored in database might cause privacy leakage. • Secondly, in a sealed envelope, bidders have no way to ensure that lead bidder never leaks their bidding price 1.3 Existing Systems Nowadays, E-auction can be classified into two types, namely public bid and sealed bid • Public bid is that bidders could raise the price to bid the products. Thus, the bidding price gets increasing continuously until no bidders are willing to pay a higher price. The bidder is as a winner if he bids the highest price for such the product. During public bid, bidders can bid several times; thus, public bid is also called multi-bidding auction • Sealed bid is that bidders encrypts the bill and only send the bill once. If the time is due, the auctioneer compares all of the bills. The bidder who bids for the highest price is the winner of the sealed bid. Due to bidders only can bid once, it is also called single-bidding auction. In the seal bid, all bidders’ prices are sealed until the bid opening deadline is compared to the prices of all bidders. There is a common shortcoming in electronic seal ticket auctions. Before the deadline for opening bids, Dept of CSE, NHCE 2 TRADE SECURITY USING BLOCKCHAIN the bidder cannot ensure that the bid price has been leaked by a third party (the principal bidder), resulting in malicious bidders may collaborate with the bid winner to obtain the best bid price The blockchain is a technology that accesses, verifies, and transmits network data through distributed nodes. It uses a peer-to-peer network to achieve a decentralized data operation and preservation platform 1.4 Proposed System and Advantages This project applies the blockchain technique into the E-auction to resolve the two main problems in the E-auction that we stated earlier. • The blockchain is peer-to-peer access structure such that points in the structure can trust each other points. Each location can securely communicate, authenticate and transfer data to any of the other sites. Consequently, in the decentralized structure, the centralized intermediary can be removed to reduce the transaction cost. • As for the second problem, the smart contract is used to avoid the bid price leaked by the lead bidder. Some rules are written inside the smart deal which cannot be opened before the deadline. Advantages • Decentralized structure for communicating between bidders and auctioneers thus reducing the charge fee. • Peer to peer access structure to establish the trust thus protecting the personal data and transactional records. • The bid price leaked by the lead bidder will be avoided through the smart contract. Dept of CSE, NHCE 3 TRADE SECURITY USING BLOCKCHAIN CHAPTER 2 LITERATURE REVIEW 2.1 Introduction Nowadays, E-auction can be classified into two types, namely public bid and sealed bid • Public bid is that bidders could raise the price to bid the products. Thus, the bidding price gets increasing continuously until no bidders are willing to pay a higher price. The bidder is as a winner if he bids the highest price for such the product. During public bid, bidders can bid several times; thus, public bid is also called multi-bidding auction • Sealed bid is that bidders encrypts the bill and only send the bill once. If the time is due, the auctioneer compares all of the bills. The bidder who bids for the highest price is the winner of the sealed bid. Due to bidders only can bid once, it is also called single-bidding auction. In the seal bid, all bidders’ prices are sealed until the bid opening deadline is compared to the prices of all bidders. There is a common shortcoming in electronic seal ticket auctions. Before the deadline for opening bids, the bidder cannot ensure that the bid price has been leaked by a third party (the principal bidder), resulting in malicious bidders may collaborate with the bid winner to obtain the best bid price. 2.2 Literature Review • Marco Iansiti and Karim R Lakhani. “The truth about blockchain” • M Jenifer and B Bharathi. "A method of reducing the skew in reducer phase block chain algorithm" Dept of CSE, NHCE 4 TRADE SECURITY USING BLOCKCHAIN • Yan Zhu, Ruiqi Guo, Guohua Gan, and Wei-Tek Tsai. “Interactive incontestable signature for transactions confirmation in bitcoin blockchain” The blockchain is mainly based on the following technologies as the operating base Identity identification and security: Identification and anti-counterfeiting are performed using a public key infrastructure. Each account in the blockchain has a public key and a private key used to send and receive the transactions. After the private key encrypts the transaction message, the receiver then uses the sender’s public key to decrypt the message, and the identity of the sender can be confirmed. Message delivery and broadcasting: Message delivery and broadcasting are performed using a peer-to-peer technique, allowing each node to connect and exchange messages with each other. The transactions are stored in the same ledger. Each node in the blockchain can verify the transactions using the zero knowledge over the decentralized access structure Data preservation and linking: The transaction data stored in a block to generate a hash value and the block is linked to the previous block with the hash values to construct a blockchain as shown in Fig below. Fig 2.1 Data Preservation and Linking Dept of CSE, NHCE 5 TRADE SECURITY USING BLOCKCHAIN The fields in the block, as shown in Fig below, to detail the records of the block such as time-stamp, transaction quantity, hash value, etc. Fig 2.2 BlockChain Record In the blockchain, there might be different transactions in a block. When a new transaction is just triggered, each node collects unverified transactions to the block to produce a POW (Proof of Work). That is, the node can calculate the Nonce to verify the transaction as soon as possible to get some rewards. If the node completes the proof of work, it broadcast the block to other nodes to verify whether the transaction is valid. If valid, the block is attached to the blockchain Blockchain and Its Use Blockchain is a distributed database that stores data records that continue to grow, controlled by multiple entities. Blockchain (distributed ledger) is a trustworthy service system to a group of nodes or non-trusting parties, generally blockchain acts as a reliable and reliable third party to keep things together, mediate exchanges, and provide secure Dept of CSE, NHCE 6 TRADE SECURITY USING BLOCKCHAIN computing machines. There are several types of Blockchain ie. • Permissionless Blockchain, like Bitcoin or Ethereum, all can be a user or run a node, anyone can "write", and anyone can participate in a consensus in determining the state's validity. • Permission Blockchain inversely proportional to the previous type, operated by known entities such as consortium blockchains, where consortium members or stakeholders in a particular business context operate a Blockchain permission network. This Blockchain permission system has means to identify nodes that can control and update data together, and often has ways to control who can issue transactions. • Private blockchain is a special blockchain permitted by one entity, where there is only one domain trust The widely known Blockchain technology currently exists in the Bitcoin system which is the public ledger of all transactions. Bitcoin is a decentralized, peer-to-peer digital payments system based on the first public key cryptography proposed by Satoshi Nakamoto in 2008. Bitcoin uses a consensus protocol called PoW (Proof of Work) based on cryptocurrency to ensure only legitimate transactions are allowed within the system. Where each transaction is calculated its hash value and entered into a database called Blockchain as described in fig.1. To connect between one block with another block, the hash value of the previous block inserted into the next block then calculated its hash value. The hash value must meet certain requirements called difficulty in order to be considered a legitimate block. Searching for hash values that match those requirements is called Proof Of Work. Bitcoin stores all transaction information in a database called blockchain in the internet network. Blockchain consists of several blocks associated with each other and in sequence as shown in fig below. Dept of CSE, NHCE 7 TRADE SECURITY USING BLOCKCHAIN Fig 2.3 BlockChain Blocks The blocks are related because the hash values of the previous block are used in the next block creation process. The effort to change the information will be more difficult because it must change the next blocks. The first block is called the genesis block. In creating new blocks, miner required in the mining process using hash computing equipment. Miner compete against each other to create a new legitimate block in accordance with the specified difficulty. A new block is generally generated by a miner but there are times when more than one new block is generated by multiple miners that both meet the criteria even though the odds are small, making blockchain a fork. If this case occurs, then the voting process conducted by the miners. The voting process is done by way of the miner choosing one of several new blocks and then producing the discovery of a longer chain branch. Then the entire Bitcoin system uses the longest branch and deletes all other branches. Unused blocks are called block orphans and become invalid, also all transactions that have been recorded in the block orphan will be inserted into the new block. Blockchain comes with a variety of different types, but has several common elements: • Blockchain is distributed digitally to a number of computers in almost real time. • Blockchain is decentralized, the entire recording is available for all users and peer to peer network users. This eliminates the need for central authorities, such as banks, as well as trusted intermediaries. Dept of CSE, NHCE 8 TRADE SECURITY USING BLOCKCHAIN • Blockchain uses many participants in the network to reach consensus. Participants use their computers to authenticate and verify every new block. For example, to ensure that transactions not occur more than once, new blocks are only adopted by the network after the majority of its members agree that they are valid. • Blockchain uses cryptography and digital signatures to prove identity. Transactions can be traced back to the cryptographic identity, which is theoretically anonymous, but can be re-linked with real-life identity using reverse engineering techniques. • Blockchain has a difficult (but possibly) mechanism for altering stored records. Although all data can be read and new data can be written, previously existing data on blockcahin can’t be changed theoretically unless the rules embedded in the protocol allow such changes by requiring more than 50 percent of the network to approve the change • A Blockchain is time-stamped. Transactions in blockchain are timed, so they are useful for tracking and verifying information • Blockchain is programmable. Instructions embedded in blocks, such as "if" this "then" do that "else do this, allow transactions or other actions to be performed only if certain conditions are met, and may be accompanied by additional digital data. Blockchain has several advantages, which makes it a powerful and secure alternative to distributed databases. • High Availability: Distributed completely to all nodes and stored in the database completely. • Verifiability and Integrity: Each block is verified and added to the blockchain. Therefore, it will be difficult to change the data in it because all the blocks have to be changed value. Dept of CSE, NHCE 9 TRADE SECURITY USING BLOCKCHAIN CHAPTER 3 ANALYSIS 3.1 Introduction Analysis is the process of breaking a complex topic or substance into smaller parts to gain a better understanding of it. Analysts in the field of engineering look at requirements, structures, mechanisms, and systems dimensions. Analysis is an exploratory activity. The Analysis Phase is where the project lifecycle begins. The Analysis Phase is where you break down the deliverables in the high-level Project Charter into the more detailed business requirements. The Analysis Phase is also the part of the project where you identify the overall direction that the project will take through the creation of the project strategy documents. The process of gathering requirements is usually more than simply asking the users what they need and writing their answers down. Depending on the complexity of the application, the process for gathering requirements has a clearly defined process of its own. This process consists of a group of repeatable processes that utilize certain techniques to capture, document, communicate, and manage requirements 3.2 Software Requirement Specification A software requirements specification (SRS) – a requirement specification for a software system – is a complete description of the behavior of a system to be developed. In addition to a description of the software functions, the SRS also contains non-functional requirements. Software requirements are a sub-field of software engineering that deals with the elicitation, analysis, specification, and validation of requirements for software. Dept of CSE, NHCE 10 TRADE SECURITY USING BLOCKCHAIN 3.2.1 Scope Because of the popularity of the Internet, the integration services have gradually changed people daily life, such as e-commerce activities on transactions, transportation and so on. The E-auction, one of the popular e-commerce activities, allows bidders to directly bid the products over the Internet. As for sealed bid, the extra transaction cost is required for the intermediaries because the third-party is the important role between the buyers and the sellers help to trade both during the auction. In addition, it never guarantees whether the third-party is trust. To resolve the problems, we propose the blockchain technology with low transaction cost which is used to develop the smart contract of public bid and sealed bid. The smart contract, proposed in 1990 and implements via Ethereum platform, can ensure the bill secure, private, non-reputability and inalterability owing to all the transactions are recorded in the same but decentralized ledgers. The smart contract is composed of the address of Auctioneer, the start auction time, deadline, the address of current winner, the current highest price. 3.2.2 Various divisions in the project User profile operations • Here, the end users of the project will be provided with an interface where they can request access to our project. • They will be provided with an HTML interface using which they can create a new account by providing the required information (like email ID, phone number, first name, last name, etc). • The user’s registration is subject to approval from the project administrators. Once the administrators approve a user registration, the user can proceed with logging in to our portal, perform various account operations(edit profile, change password,etc) • After this, the users will be granted access to rest of the modules of the project. Dept of CSE, NHCE 11 TRADE SECURITY USING BLOCKCHAIN Node Implementation • In this module we will be implementing the blockchain network by creating our set of distributed ledger nodes. • Each node will be able to perform various operations o Receive the blockchain data once the transaction in the blockchain has been committed and the block is mined. o Perform block validation by comparing the hashcodes of the current block and the hash codes of the previous blocks o Provide a readonly access to the clients on that node for visualizing the number of blocks and the type of data being stored o Provide the block chain data to the bidding application once requested. • Each node will be deployed in its own platform over the cloud infrastructure. For this purpose, we make use of Digital ocean cloud service proider Super Admin Configuration • This feature is made available only the super admin of the project. • The super admin of the project essentially will be the product owners himself/herself. • Through this feature, the super admin of the project will be able to perform nodes addition, nodes deletion, and nodes visualization operation from the front end user interfaces provided to him/her • This feature will be secured and nobody else apart from the super admin will be able to get access to. • More the number of nodes, stronger the security measures provided by the blockchain bidding application • Hence, it is recommended to add as many nodes as possible. Dept of CSE, NHCE 12 TRADE SECURITY USING BLOCKCHAIN Product Addition • In this module the seller of the product in our portal will be given an HTML interface through which he/she can add the product which he/she is planning to sell. • The seller will have to provide some basic information about the product like the name, description, and the URL to the actual product • All the above fields are mandatory to be provided by the seller. • The product once added, it will immediately be shown up in the market where the users can start bidding for it. • The end users will not be given a luxury to upload the products images due to the limitations in the cloud storage space. Instead, the sellers must be specifying the URL to the image of the product from google drive or any other hosting sites. Bid Market and Participation • The product once added by the seller, it will immediately be shown up in the market where the users can start bidding for it. • The user must be entering the amount in the textbox provided against the product of interest. • The amount bid by the buyers along with the unique identifier for the product will be stored in the blockchain network • There will be a blockchain service class which does the operation of writing and reading to and from blockchain network. • This blockchain service class will make use of the Ledger Distribution Thread to write to numerous blockchain network concurrently Dept of CSE, NHCE 13 TRADE SECURITY USING BLOCKCHAIN My Products and Win Logs • This portal enables the seller of the product to see the status of their products and the bidders details for their product • At any point of time, the seller can close the bid window and declare the buyer with highest bid as the winner • An email communication will be sent to both buyer and seller once the bidding window has been closed • The buyer details and the log of the total bidders will always be there at this portal so that the seller can have an access to this data at any point of time 3.2.3 Functional Requirements • To design and implement the blockchain technology into an online bidding system • To design and develop the decentralized system for making the entire database owned by many users. • To ensure the cheating sources of the database manipulation is reduced through the concept of block chain • To design the solution in such a way that it is simple and feasible to replace the traditional bidding system • To make sure the results of the bidding are available to both buyers and sellers at any instance of the time Dept of CSE, NHCE 14 TRADE SECURITY USING BLOCKCHAIN 3.2.4 Non-Functional Requirements • Should be easier to access it from the various browsers available. • Response time of the applications should reflect the real time observations. • The algorithm should never fail in any of the test cases. • There shouldn’t be any security concerns on the merged data. • Each user’s activity should be separated from the other user’s activities 3.2.5 Software Requirements Operating System Windows Programming Language – Core Java, Advanced Java, J2EE, Map Reduce Framework, MVC Backend Framework Programming language – Bootstrap Framework, HTML, CSS, JavaScript, Ajax, Jquery Frontend Development Eclipse Oxygen IDE environment Application Server Apache Tomcat v9.0 Database HDFS Table 3.1 Software Requirements Dept of CSE, NHCE 15 TRADE SECURITY USING BLOCKCHAIN 3.2.6 Hardware Requirements Processor Intel Core i5 or AMD FX 8 core series with clock speed of 2.4 GHz or above RAM 2GB or above Hard disk 40 GB or above Input device Keyboard or mouse or compatible pointing devices Display XGA (1024*768 pixels) or higher resolution monitor with 32 bit color settings Miscellaneous USB Interface, Power adapter, etc Table 3.2 Hardware Requirements Dept of CSE, NHCE 16 TRADE SECURITY USING BLOCKCHAIN CHAPTER 4 SYSTEM DESIGN 4.1 Introduction Systems design is the process of defining the architecture, components, modules, interfaces, and data for a system to satisfy specified requirements. Systems design could see it as the application of systems theory to product development. There is some overlap with the disciplines of systems analysis, systems architecture and systems engineering. If the broader topic of product development "blends the perspective of marketing, design, and manufacturing into a single approach to product development," then design is the act of taking the marketing information and creating the design of the product to be manufactured. Systems design is therefore the process of defining and developing systems to satisfy specified requirements of the user. Object-oriented analysis and design methods are becoming the most widely used methods for computer systems design. The UML has become the standard language in object-oriented analysis and design. It is widely used for modeling software systems and is increasingly used for high designing non-software systems and organizations. The design of the system is perhaps the most critical factor affecting the quality of the software. The objective of the design phase is to produce overall design of the software. It aims to figure out the modules that should be in the system to fulfill all the system requirements in an efficient manner. The design phase is followed by two sub phases • High Level Design • Detailed Level Design Dept of CSE, NHCE 17 TRADE SECURITY USING BLOCKCHAIN 4.2 System Architecture Diagram The below figure shows a general block diagram describing the activities performed by this project. Fig 4.1 System Architecture Major divisions in this project are ➢ Data Access Layer Data access layer is the one which exposes all the possible operations on the data base to the outside world. It will contain the DAO classes, DAO interfaces, POJOs, and Utils as the internal components. All the other modules of this project will be communicating with the DO layer for their data access needs Dept of CSE, NHCE 18 TRADE SECURITY USING BLOCKCHAIN ➢ Account Operations Account operations module provides the following functionalities to the end users of our project. • Register a new seller/ buyer account • Login to an existing account • Logout from the session • Edit the existing Profile • Change Password for security issues • Forgot Password and receive the current password over an email • Delete an existing Account Account operations module will be re-using the DAO layer to provide the above functionalities. ➢ User profile operations • Here, the end users of the project will be provided with an interface where they can request access to our project. • They will be provided with an HTML interface using which they can create a new account by providing the required information (like email ID, phone number, first name, last name, etc). • The user’s registration is subject to approval from the project administrators. Once the administrators approve a user registration, the user can proceed with logging in to our portal, perform various account operations (edit profile, change password, etc). • After this, the users will be granted access to rest of the modules of the project. Dept of CSE, NHCE 19 TRADE SECURITY USING BLOCKCHAIN ➢ Node Implementation In this module we will be implementing the blockchain network by creating our set of distributed ledger nodes. Each node will be able to perform various operations • Receive the blockchain data once the transaction in the blockchain has been committed and the block is mined. • Perform block validation by comparing the hashcodes of the current block and the hash codes of the previous blocks • Provide a readonly access to the clients on that node for visualizing the number of blocks and the type of data being stored • Provide the block chain data to the bidding application once requested. Each node will be deployed in its own platform over the cloud infrastructure. For this purpose, we make use of Digital ocean cloud service proider ➢ Super Admin Configuration • The super admin of the project essentially will be the product owners himself/herself. • Through this feature, the super admin of the project will be able to perform nodes addition, nodes deletion, and nodes visualization operation from the front end user interfaces provided to him/her • This feature will be secured and nobody else apart from the super admin will be able to get access to. More the number of nodes, stronger the security measures provided by the blockchain bidding application • Hence, it is recommended to add as many nodes as possible. Dept of CSE, NHCE 20 TRADE SECURITY USING BLOCKCHAIN ➢ Product Addition In this module the seller of the product in our portal will be given an HTML interface through which he/she can add the product which he/she is planning to sell. The seller will have to provide some basic information about the product like the name, description, and the URL to the actual product. All the above fields are mandatory to be provided by the seller. The product once added, it will immediately be shown up in the market where the users can start bidding for it. The end users will not be given a luxury to upload the products images due to the limitations in the cloud storage space. ➢ Bid Market and Participation The product once added by the seller, it will immediately be shown up in the market where the users can start bidding for it. The user must be entering the amount in the textbox provided against the product of interest. The amount bid by the buyers along with the unique identifier for the product will be stored in the blockchain network There will be a blockchain service class which does the operation of writing and reading to and from blockchain network. This blockchain service class will make use of the Ledger Distribution Thread to write to numerous blockchain network concurrently. ➢ My Products and Win Logs • This portal enables the seller of the product to see the status of their products and the bidders details for their product. At any point of time, the seller can close the bid window and declare the buyer with highest bid as the winner • An email communication will be sent to both buyer and seller once the bidding window has been closed. The buyer details and the log of the total bidders will always be there at this portal so that the seller can have an access to this data at any point of time Dept of CSE, NHCE 21 TRADE SECURITY USING BLOCKCHAIN CHAPTER 5 HIGH LEVEL DESIGN 5.1 Introduction The System design phase involves two sub phases • High Level Design • Low Level Design In the high level design, the proposed functional and non functional requirements of the software are depicted. Overall solution to the architecture is developed which can handle those needs. This CHAPTER involves the following consideration. • Design consideration • Data flow diagram 5.2 Design consideration There are several design consideration issues that need to be addressed or resolved before getting down designing a complete solution for the system 5.2.1 Assumptions and dependencies The main assumptions and dependencies identified are as follows: • JDK has to be installed in the machine where all the three subcomponent will be executing. • The application servers like either the JBOSS or the Apache Tomcat will have to be Dept of CSE, NHCE 22 TRADE SECURITY USING BLOCKCHAIN supported by the host machines • There shall not be any firewall or other engines that prevents the remote requests from the portal. • There shouldn’t be any permission related issues on any cluster. The host operating system should take of permitting all the requests to the cluster from the interface layer. 5.2.2 Mode of operation The system is capable of operating in two different modes Table 5.1 Modes of Operation Users Profile Operations Here, the end users can perform various operations on their profiles. Firstly, the users can register a new account and thus getting an access to the portal. And then the users can login to their accounts using the registered email ID and password to access various other divisions in the portal. The users can then choose to update their profile by providing the new values to the fields they have provided during the registration phase, or the user can wish to change their password by providing their old password and new password. The user can also opt to delete their accounts in case they wish to no longer access our portal. The user can also logout from the portal to make sure the session created for them during login is terminated Dept of CSE, NHCE 23 TRADE SECURITY USING BLOCKCHAIN Node Implementation In this module we will be implementing the blockchain network by creating our set of distributed ledger nodes. Each node will be able to perform various operations o Receive the blockchain data once the transaction in the blockchain has been committed and the block is mined. o Perform block validation by comparing the hashcodes of the current block and the hash codes of the previous blocks o Provide a readonly access to the clients on that node for visualizing the number of blocks and the type of data being stored o Provide the block chain data to the bidding application once requested. Each node will be deployed in its own platform over the cloud infrastructure. For this purpose, we make use of Digital ocean cloud service proider Dept of CSE, NHCE 24 TRADE SECURITY USING BLOCKCHAIN Super Admin Configuration This feature is made available only the super admin of the project. The super admin of the project essentially will be the product owners himself/herself. Through this feature, the super admin of the project will be able to perform nodes addition, nodes deletion, and nodes visualization operation from the front end user interfaces provided to him/her This feature will be secured and nobody else apart from the super admin will be able to get access to. More the number of nodes, stronger the security measures provided by the blockchain bidding application Hence, it is recommended to add as many nodes as possible. Dept of CSE, NHCE 25 TRADE SECURITY USING BLOCKCHAIN Product Addition In this module the seller of the product in our portal will be given an HTML interface through which he/she can add the product which he/she is planning to sell. The seller will have to provide some basic information about the product like the name, description, and the URL to the actual product All the above fields are mandatory to be provided by the seller. The product once added, it will immediately be shown up in the market where the users can start bidding for it. The end users will not be given a luxury to upload the products images due to the limitations in the cloud storage space. Instead, the sellers must be specifying the URL to the image of the product from google drive or any other hosting sites. Dept of CSE, NHCE 26 TRADE SECURITY USING BLOCKCHAIN Bid Market and Participations The product once added by the seller, it will immediately be shown up in the market where the users can start bidding for it. The user must be entering the amount in the textbox provided against the product of interest. The amount bid by the buyers along with the unique identifier for the product will be stored in the blockchain network There will be a blockchain service class which does the operation of writing and reading to and from blockchain network. This blockchain service class will make use of the Ledger Distribution Thread to write to numerous blockchain network concurrently My products and Win logs This portal enables the seller of the product to see the status of their products and the bidders details for their product At any point of time, the seller can close the bid window and declare the buyer with highest bid as the winner An email communication will be sent to both buyer and seller once the bidding window has been closed The buyer details and the log of the total bidders will always be there at this portal so that the seller can have an access to this data at any point of time Dept of CSE, NHCE 27 TRADE SECURITY USING BLOCKCHAIN 5.2.3 User operations Table 5.2 User Operations Account Operations User must be creating a new account in our portal to get access to the rest of the modules. The user can also perform various other account operations like retrieving the forgotten password, login, logout, delete profile, change password, and edit profile Super Admin configuration Here the super admin of the project will be adding/deleting the nodes from the blockchain network Product Addition Sellers of the product will be adding the product to the market here Bid Market and participation Here the sellers of the product will be performing the bid and able to see the transaction logs 5.3 Data flow diagram A data flow diagram is the graphical representation of the flow of data through an information system. DFD is very useful in understanding a system and can be efficiently used during analysis. A DFD shows the flow of data through a system. It view a system as a function that transforms the inputs into desired outputs. Any complex systems will not perform this transformation in a single step and a data will typically undergo a series of transformations before it becomes the output. With a data flow diagram, users are able to visualize how the system will operate Dept of CSE, NHCE 28 TRADE SECURITY USING BLOCKCHAIN that the system will accomplish and how the system will be implemented, old system data flow diagrams can be drawn up and compared with a new systems data flow diagram to draw comparisons to implement a more efficient system. Data flow diagrams can be used to provide the end user with a physical idea of where the data they input, ultimately as an effect upon the structure of the whole system. Next section explains the module wise data flow diagram Module 1: Account Access Layer Fig 5.1 Account access Layer Account operations module provides the following functionalities to the end users of our project. • Register a new seller/ buyer account • Login to an existing account • Logout from the session • Edit the existing Profile Dept of CSE, NHCE 29 TRADE SECURITY USING BLOCKCHAIN • Change Password for security issues • Forgot Password and receive the current password over an email • Delete an existing Account Account operations module will be re-using the DAO layer to provide the above functionalities. The DAO layer is the service layer which provides database CRUD (create, update, read, and delete) services to the other layers. It will contain the POJO classes to map the database tables into java object. It will also contain the Util classes to manage the database connections. Module 2: Node Implementation Fig 5.2 Node Implementation • In this module we will be implementing the blockchain network by creating our set of distributed ledger nodes. • Each node will be able to perform various operations o Receive the blockchain data once the transaction in the blockchain has been committed and the block is mined. o Perform block validation by comparing the hashcodes of the current block and the hash codes of the previous blocks o Provide a readonly access to the clients on that node for visualizing the number of blocks and the type of data being stored Dept of CSE, NHCE 30 TRADE SECURITY USING BLOCKCHAIN o Provide the block chain data to the bidding application once requested. • Each node will be deployed in its own platform over the cloud infrastructure. For this purpose, we make use of Digital ocean cloud service proider Module 3: Super Admin configuration Fig 5.3 Super Admin Config • This feature is made available only the super admin of the project. • The super admin of the project essentially will be the product owners himself/herself. • Through this feature, the super admin of the project will be able to perform nodes addition, nodes deletion, and nodes visualization operation from the front end user interfaces provided to him/her • This feature will be secured and nobody else apart from the super admin will be able Dept of CSE, NHCE 31 TRADE SECURITY USING BLOCKCHAIN to get access to. • More the number of nodes, stronger the security measures provided by the blockchain bidding application • Hence, it is recommended to add as many nodes as possible. Module 4: Product addition Fig 5.4 Product Addition • In this module the seller of the product in our portal will be given an HTML interface through which he/she can add the product which he/she is planning to sell. • The seller will have to provide some basic information about the product like the name, description, and the URL to the actual product • All the above fields are mandatory to be provided by the seller. • The product once added, it will immediately be shown up in the market where the users can start bidding for it. • The end users will not be given a luxury to upload the products images due to the limitations in the cloud storage space. Instead, the sellers must be specifying the URL to the image of the product from google drive or any other hosting sites. Dept of CSE, NHCE 32 TRADE SECURITY USING BLOCKCHAIN Module 5: Bid Market and Participation Fig 5.5 Bid Market • The product once added by the seller, it will immediately be shown up in the market where the users can start bidding for it. • The user must be entering the amount in the textbox provided against the product of interest. • The amount bid by the buyers along with the unique identifier for the product will be stored in the blockchain network • There will be a blockchain service class which does the operation of writing and reading to and from blockchain network. • This blockchain service class will make use of the Ledger Distribution Thread to write to numerous blockchain network concurrently Dept of CSE, NHCE 33 TRADE SECURITY USING BLOCKCHAIN Module 6: My Products and Win Logs Fig 5.6 Products and Win Logs • This portal enables the seller of the product to see the status of their products and the bidders details for their product • At any point of time, the seller can close the bid window and declare the buyer with highest bid as the winner • An email communication will be sent to both buyer and seller once the bidding window has been closed • The buyer details and the log of the total bidders will always be there at this portal so that the seller can have an access to this data at any point of time Dept of CSE, NHCE 34 TRADE SECURITY USING BLOCKCHAIN CHAPTER 6 LOW LEVEL DESIGN 6.1 Introduction During the detailed phase, the view of the application developed during the high level design is broken down into modules and programs. Logic design is done for every program and then documented as program specifications. For every program, a unit test plan is created. 6.2 Use case diagram The external objects that interact directly with the system are called actors. Actors include humans, external devices and other software systems. The important thing about actors is that they are not under control of the application. In this project, user of the system is the actor. Fig 6.1 Use case Diagram Dept of CSE, NHCE 35 TRADE SECURITY USING BLOCKCHAIN 6.3 Sequence diagram A sequence diagram in a Unified Modeling Language (UML) is a kind of interaction diagram that shows how processes operate with one another and in what order. It shows the participants in an interaction and the sequence of messages among them; each participant is assigned a column in a table. Below section shows the sequence diagrams in this application 6.3.1 User Registration Fig 6.2 User Registration SSD Dept of CSE, NHCE 36 TRADE SECURITY USING BLOCKCHAIN 6.3.2 Bid Update Fig 6.3 Bid Update SSD Dept of CSE, NHCE 37 TRADE SECURITY USING BLOCKCHAIN 6.3.3 Create Bid Fig 6.4 Create Bid SSD Dept of CSE, NHCE 38 TRADE SECURITY USING BLOCKCHAIN 6.3.4 Register Bid On BlockChain Fig 6.5 Register Bid SSD Dept of CSE, NHCE 39 TRADE SECURITY USING BLOCKCHAIN 6.3.5 Distribute Transaction Data Fig 6.6 Distribute Data SSD 6.3.6 Register Product Fig 6.7 Register Product SSD 6.3.7 Product Winning Dept of CSE, NHCE 40 TRADE SECURITY USING BLOCKCHAIN Fig 6.8 Winning Products SSD Dept of CSE, NHCE 41 TRADE SECURITY USING BLOCKCHAIN 6.4 Class Diagrams A class diagram in the Unified Modeling Language (UML) is a type of static structure diagram that describes the structure of a system by showing the system's classes, their attributes, operations (or methods), and the relationships among the classes. The class diagram is the main building block of object oriented modeling. It is used both for general conceptual modeling of the systematic of the application, and for detailed modelling translating the models into programming code. Class diagrams can also be used for data modeling. The classes in a class diagram represent both the main objects, interactions in the application and the classes to be programmed. 6.4.1 Users Class Diagram Fig 6.9 Users Class Diagram Dept of CSE, NHCE 42 TRADE SECURITY USING BLOCKCHAIN 6.4.2 Bid Class Diagram Fig 6.10 Bid Class Diagram Dept of CSE, NHCE 43 TRADE SECURITY USING BLOCKCHAIN 6.4.3 Node Class Diagram Fig 6.11 Node Class Diagram Dept of CSE, NHCE 44 TRADE SECURITY USING BLOCKCHAIN 6.4.4 Blockchain Class Diagram Fig 6.12 blockchain Class Diagram Dept of CSE, NHCE 45 TRADE SECURITY USING BLOCKCHAIN CHAPTER 7 IMPLEMENTATION 7.1 Introduction Implementation is the realization of an application, or execution of a plan, idea, model, design, specification, standard, algorithm, or policy. In other words, an implementation is a realization of a technical specification or algorithm as a program, software component, or other computer system through programming and deployment. Many implementations may exist for a given specification or standard. Implementation is one of the most important phases of the Software Development Life Cycle (SDLC). It encompasses all the processes involved in getting new software or hardware operating properly in its environment, including installation, configuration, running, testing, and making necessary changes. Specifically, it involves coding the system using a particular programming language and transferring the design into an actual working system. This phase of the system is conducted with the idea that whatever is designed should be implemented; keeping in mind that it fulfills user requirements, objective and scope of the system. The implementation phase produces the solution to the user problem. 7.2 Overview of System Implementation This project is implemented considering the following aspects: 1. Usability Aspect. 2. Technical Aspect. Dept of CSE, NHCE 46 TRADE SECURITY USING BLOCKCHAIN 7.2.1 Usability Aspect The usability aspect of implementation of the project is realized using two principles: a.) The project is implemented as a Java application There could be many ways of implementing the this project. We have chosen JAVA to come up with the required reader. The reason being many: Firstly, Java provides a wonderful libraries which simplifies the implementation part of it. Secondly, JAVA is platform independent, meaning the project can run on literally any platform which has JVM installed within it. Thirdly, Oracle Corporation claims more than 70 billion devices run on JAVA which makes the end users used to it. Lastly, it can be readily portable to any devices like mobile phones, ipads, PDA, and any hand held devices that are capable of running JAVA. b.) The user-friendly interface using Java's view architecture The interface provided by this application is very user friendly and is developed using Java Swings. 7.2.2 Technical Aspect 7.2.2.1 Servers Apache Tomcat to develop the product Apache Tomcat (or simply Tomcat, formerly also Jakarta Tomcat) is an open source web server and servlet container developed by the Apache Software Foundation (ASF). Tomcat implements the Java Servlet and the JavaServer Pages (JSP) specifications from Sun Dept of CSE, NHCE 47 TRADE SECURITY USING BLOCKCHAIN Microsystems, and provides a "pure Java" HTTP web server environment for Java code to run. Apache Tomcat includes tools for configuration and management, but can also be configured by editing XML configuration files JBOSS Application server to host the product WildFly, formerly known as JavaBeans Open Source Software Application Server (JBoss AS, or simply JBoss) is an application server that implements the Java Platform, Enterprise Edition (Java EE). JBoss is written in Java and as such is cross-platform: usable on any operating system that supports Java. JBoss was developed by JBoss, now a division of Red Hat. Licensed under the terms of the GNU Lesser General Public License, JBoss is free and open source software. The renaming to WildFly was done to reduce confusion. The renaming only affects the JBoss Application Server project. The JBoss Community or the Red Hat JBoss product line (with JBoss Enteprise Application Platform) all retain their names. 7.2.2.2 Database MySQL officially, but also called /maɪ ˈsiːkwəl/ "My Sequel") is (as of 2008) the world's most widely used open source relational database management system (RDBMS) that runs as a server providing multi-user access to a number of databases. It is named after co-founder Michael Widenius' daughter, My. The SQL phrase stands for Structured Query Language. The MySQL development project has made its source code available under the terms of the GNU General Public License, as well as under a variety of proprietary agreements. MySQL was owned and sponsored by a single for-profit firm, the Swedish company MySQL Dept of CSE, NHCE 48 TRADE SECURITY USING BLOCKCHAIN AB, now owned by Oracle Corporation. MySQL is a popular choice of database for use in web applications, and is a central component of the widely used LAMP open source web application software stack (and other 'AMP' stacks). LAMP is an acronym for "Linux, Apache, MySQL, Perl/PHP/Python." Free-software-open source projects that require a full-featured database management system often use MySQL. For commercial use, several paid editions are available, and offer additional functionality. Applications which use MySQL databases include: TYPO3, Joomla, WordPress, phpBB, MyBB, Drupal and other software. MySQL is also used in many high-profile, large-scale World Wide Web products, including Wikipedia, Google (though not for searches), Facebook, Twitter, Flickr, Nokia.com, and YouTube. Dept of CSE, NHCE 49 TRADE SECURITY USING BLOCKCHAIN CHAPTER 8 TESTING 8.1 Introduction The purpose of testing is to discover errors. Testing is the process of trying to discover every conceivable fault or weakness in a work product. It provides a way to check the functionality of components, sub-assemblies, assemblies and/or a finished product. It is the process of exercising software with the intent of ensuring that the software system meets its requirements and user expectations and does not fail in an unacceptable manner. The system has been verified and validated by running the test data and live data. 8.2 Levels of Testing 8.2.1 Unit Testing Unit testing is a method by which individual units of source code, sets of one or more computer program modules together with associated control data, usage procedures, and operating procedures, are tested to determine if they are fit for use. Intuitively, one can view a unit as the smallest testable part of an application. In object-oriented programming a unit is often an entire interface, such as a class, but could be an individual method. For unit testing first we adopted the code testing strategy, which examined the logic of program. During the development process itself all the syntax errors etc. got rooted out. For this developed test case that result in executing every instruction in the program or module i.e. every path through program was tested. Dept of CSE, NHCE 50 TRADE SECURITY USING BLOCKCHAIN Test cases Table 8.1: Test cases for the project Steps Test Action Results Step 1 Enter the URL Index page loaded http://192.168.56.101:8080/Bidding/index.jsp successfully Step 2 Click on Register Register page loaded successfully Step 3 Create a new account Account Creation Successful Step 4 Click on login Login page loaded Step 5 Login to an existing account Login Successful Step 6 Click on Add product Add product page opens successfully Step 7 Enter product details and click on Add Product added successfully Step 8 Logout and login as another account for buyer Login successful Step 9 Click on market Market page loaded successfully Step 10 Enter the amount against any product and Bid Placement successful click on Place Bid Step 11 Click on My participations Participation logs shown correctly Dept of CSE, NHCE 51 TRADE SECURITY USING BLOCKCHAIN Step 12 Repeat the steps 8 to 11 some four times All the operations successful Step 13 Login back as seller Login successful Step 14 Click on my products My products page loaded successfully Step 15 Click on the product and see the bidders Bidders information shown correctly Step 16 Click on Close bidding window Bidding window closed for the product Step 17 Step 18 Check for an email in both seller and buyer Both users received mail account successfully Repeat the above steps for sealed bid Sealed bid operations also works fine Step 19 Login as super admin Super admin login successful Step 20 Add and remove nodes Adding and removing nodes works fine Dept of CSE, NHCE 52 TRADE SECURITY USING BLOCKCHAIN 8.2.2 Integration Testing Data can be lost across an interface, one module can have an adverse effect on the other sub function, when combined may not produce the desired functions. Integrated testing is the systematic testing to uncover the errors with an interface. This testing is done with simple data and developed system has run successfully with this simple data. The need for integrated system is to find the overall system performance. Steps to perform integration testing: Step 1: Create a Test Plan Step 2: Create Test Cases and Test Data Step 3: Once the components have been integrated execute the test cases Step 4: Fix the bugs if any and re test the code Step 5: Repeat the test cycle until the components have been successfully integrated Name of the Test Integration testing Test plan To check whether the system works properly when all the modules are integrated. Test Data Sample product informations Table 8.2: Test cases for integration testing 8.2.3 System testing Ultimately, software is included with other system components and the set of system validation and integration tests are performed. System testing is a series of different tests whose main aim is to fully exercise the computer-based system. Although each test has a different role all work should verify that all system elements are properly integrated and formed allocated functions. Dept of CSE, NHCE 53 TRADE SECURITY USING BLOCKCHAIN Table 8.3: Test cases for Input-Output Name of the Test System Testing Item being tested Over all functioning of GUI with all functions properly linked. Sample Input Sample text files Expected Output All the modules like add product, market etc working as expected Actual Output Application reacts to user inputs in expected manner. Remarks Successful 8.2.4 Validation Testing At the culmination of black box testing, software is completely assembled is as a package. Interfacing errors have been uncovered and the correct and final series of tests, i.e., validation tests begins. Validation test is defined with a simple definition that validation succeeds when the software function in a manner that can be reasonably accepted by the customer. 8.2.5 Output Testing After performing validation testing, the next step is output testing of the proposed system. Since the system cannot be useful if it does not produce the required output. Asking the user about the format in which the system is required tests the output displayed or generated by the system is required tests the output displayed or generated by the system under consideration. The output format is considered in two ways, one is on screen Dept of CSE, NHCE 54 TRADE SECURITY USING BLOCKCHAIN format and the other is printed format. The output format on the screen is found to be corrected as the format was designated in the system has according to the user needs. 8.2.6 User acceptance Testing: User acceptance testing of the system is the key factor for the success of the system. A system under consideration is tested for user acceptance by constantly keeping in touch with the prospective system at the time of development and making change whenever required. This is done with regard to the input screen design and output screen design. 8.2.7 GUI Testing: GUI testing is use to ensure the visual clarity of the system, flexibility of the system, user friendliness of the system. The various components which are to be tested are: • Relative layout • Various Links and Buttons Dept of CSE, NHCE 55 TRADE SECURITY USING BLOCKCHAIN CHAPTER 9 SCREEN SHOTS In this CHAPTER we will present some of the screenshots of this project. 9.1 User Signin Fig 9.1 User Signin 9.2 Welcome Page Fig 9.2 Welcome Page Dept of CSE, NHCE 56 TRADE SECURITY USING BLOCKCHAIN 9.3 Bidding Market Fig 9.3 Bidding Market Dept of CSE, NHCE 57 TRADE SECURITY USING BLOCKCHAIN 9.4: Create a New Bid Fig 9.4 Create a New Bid 9.5 Products Uploaded By Me Fig 9.5 My Products Dept of CSE, NHCE 58 TRADE SECURITY USING BLOCKCHAIN 9.6 Edit Your Profile Fig 9.6 Edit profile 9.7 Successful Bidding Fig 9.8 Successful Bidding Dept of CSE, NHCE 59 TRADE SECURITY USING BLOCKCHAIN 9.8 Winning Products Fig 9.9 Winning Products 9.9 Nodes Description Fig 9.10 Nodes Description Dept of CSE, NHCE 60 TRADE SECURITY USING BLOCKCHAIN CHAPTER 10 CONCLUSION AND FUTURE WORK Conclusion This project provides an E-auction mechanism based on blockchain to ensure electronic seals confidentiality,non-repudiation, and unchangeability. We propose the blockchain technology with low transaction cost which is used to develop the smart contract of public bid and sealed bid. The smart contract, proposed in 1990 and implements via Ethereum platform, can ensure the bill secure, private, non-reputability and inalterability owing to all the transactions are recorded in the same but decentralized ledgers. The smart contract is composed of the address of Auctioneer, the start auction time, deadline, the address of current winner, the current highest price Future work In future, we would be working towards scaling our project to enormous amounts of users and come up with an efficient algorithm for balancing the load across them. Dept of CSE, NHCE 61 TRADE SECURITY USING BLOCKCHAIN BIBILOGRAPHY [1] Gang Cao and Jie Chen. Practical electronic auction scheme based on untrusted third-party. In Computational and Information Sciences (ICCIS), 2013 Fifth International Conference on, pages 493–496. IEEE, 2013. [2] llichetty S Chandrashekar, Y Narahari, Charles H Rosa, Devadatta M Kulkarni, Jeffrey D Tew, and Pankaj Dayama. Auction-based mechanisms for electronic procurement. IEEE Transactions on Automation Science and Engineering, 4(3):297–321, 2007. [3] Wen Chen and Feiyu Lei. A simple efficient electronic auction scheme. In Parallel and Distributed Computing, Applications and Technologies, 2007. PDCAT’07. Eighth International Conference on, pages 173–174. IEEE, 2007. [4] Christopher K Frantz and Mariusz Nowostawski. From institutions to code: Towards automated generation of smart contracts. In Foundations and Applications of Self* Systems, IEEE International Workshops on, pages 210–215. IEEE, 2016. [5] Marco Iansiti and Karim R Lakhani. The truth about blockchain. Harvard Business Review, 95(1):118–127, 2017. [6] M Jenifer and B Bharathi. A method of reducing the skew in reducer phase??block chain algorithm. In Circuit, Power and Computing Technologies (ICCPCT), 2016 International Conference on, pages 1–4. IEEE, 2016. [7]Junichi Kishigami, Shigeru Fujimura, Hiroki Watanabe, Atsushi Nakadaira, and Akihiko Akutsu. The blockchain-based digital content distribution system. In Big Data and Cloud Computing (BDCloud), 2015 IEEE Fifth International Conference on, pages 187–190. IEEE, 2015. [8]Wenbo Shi, Injoo Jang, and Hyeong Seon Yoo. A sealed-bid electronic marketplace bidding auction protocol by using ring signature. In Computer Sciences and Convergence Dept of CSE, NHCE 62 TRADE SECURITY USING BLOCKCHAIN Information Technology, 2009. ICCIT’09. Fourth International Conference on, pages 1005–1009. IEEE, 2009. [9] Wee-Kheng Tan and Yung-Lun Chung. User payment choice behavior in e-auction transactions. In e-Education, e-Business, e-Management, and e-Learning, 2010. IC4E’10. International Conference on, pages 183–187. IEEE, 2010. [10] Hu Xiong, Zhiguang Qin, Fengli Zhang, Yong Yang, and Yang Zhao. A sealed-bid electronic auction protocol based on ring signature. In Communications, Circuits and Systems, 2007. ICCCAS 2007. International Conference on, pages 480–483. IEEE, 2007. [11] Shengbao Yao, Wan-An Cui, and Zhenqian Wang. A model in support of bid evaluation in multi-attribute e-auction for procurement. In Wireless Communications, Networking and Mobile Computing, 2008. WiCOM’08. 4th International Conference on, pages 1–4. IEEE, 2008. [12] Affan Yasin and Lin Liu. An online identity and smart contract management system. In Computer Software and Applications Conference (COMPSAC), 2016 IEEE 40th Annual, volume 2, pages 192–198. IEEE, 2016. [13] Fangguo Zhang, Qiongfang Li, and Yumin Wang. A new secure electronic auction scheme. In EUROCOMM 2000. Information Systems for Enhanced Public Safety and Security. IEEE/AFCEA, pages 54–56. IEEE, 2000. [14] Yan Zhu, Ruiqi Guo, Guohua Gan, and Wei-Tek Tsai. Interactive incontestable signature for transactions confirmation in bitcoin blockchain. In Computer Software and Applications Conference (COMPSAC), 2016 IEEE 40th Annual, volume 1, pages 443–448. IEEE, 2016. [15] Guy Zyskind, Oz Nathan, et al. Decentralizing privacy: Using blockchain to protect personal data. In Security and Privacy Workshops (SPW), 2015 IEEE, pages 180–184. IEEE, 2015. Dept of CSE, NHCE 63