Skip to content

pks03/Supply-Chain

Repository files navigation

Supply-Chain

Blockchain Assignment - 1

Team members - (Group 4)

  1. Prachi Shah (2021A7PS2589H)
  2. Shramana Ghosh (2021A7PS1834H)
  3. Ambi Gaur (2021A4PS2923H)
  4. Harigovind R (2021A7PS2810H)

Objective

  • The objective of this project is to develop a secure supply chain management system using blockchain technology. This system aims to ensure the efficient and error-free distribution of products from manufacturers to clients through a network of distributors
  • This assignment focuses on implementing the consensus algorithm - Delegated Proof of Stake for SCM Blockchain.

Delegated Proof of Stake (DPoS) algorithm

In DPoS consensus users can either directly vote or give their voting power to another entity to vote on their behalf. The chosen witness are responsible for generating blocks by verifying transactions. If they verify and sign all transactions in a block, they are rewarded, which is usually shared with those who have voted for witness. If a witness fails to verify all transactions in the given time, block is missed, all transactions are left unverified and no reward is distributed to that witness. The reward is added up to reward of the next witness which verifies that block.

Problem Statement

To prevent errors in the distribution of products, you need to build a supply chain management system using Blockchain technology with the following features:

  1. To register new clients, distributors and a manufacturer (only one) to the system, with the client and distributor depositing a security amount to a trusted third party.
  2. To improve the security of the blockchain, incorporate a consensus algorithm assigned to your group.
  3. Implementing Merkle tree to calculate the hash of all the transactions in a block and successfully mine the block with the transaction.
  4. To view the current product status in the supply chain using a QR code.
  5. At one time, the distributor can distribute a product to a dedicated client. Once the transaction is confirmed by both the distributor and the consumer, then only the next delivery can be taken by him/her.
  6. A well-known issue is understood when: a. The distributor has dispatched the product, and the client has received it, but the client is denying it (The client is lying, but the distributor is not). b. The distributor has not dispatched the product, and the client has not received it (The client is not lying, but the distributor is). Resolve both issues & after identifying the liar, make deductions from the security deposit if the distributor or consumer is telling a lie.

Solution

Our solution for secure supply chain management and blockchain verification ensures the integrity and transparency of the entire process. When a client places an order, only authorized distributors can accept it and sign a digital timestamp upon dispatch, providing indisputable proof of order fulfillment. To receive the product, clients use their private keys to digitally sign the order key, confirming receipt. We employ blockchain technology to validate these transactions, using the public keys of clients and distributors to check signatures. Valid transactions are added to a mined block, while invalid ones result in the forfeiture of a security deposit. This multi-layered approach guarantees the security of the supply chain, prevents fraud, and maintains trust throughout the process.

How to run

     node test.js

Required installation

     npm install readline-sync
     npm install qrcode-terminal
     npm install crypto
     npm install js-sha256

Screenshots of the working application

Register Distributor

WhatsApp Image 2023-10-02 at 7 33 46 PM

Register Client

WhatsApp Image 2023-10-02 at 7 35 45 PM

Client Placing an order

WhatsApp Image 2023-10-02 at 7 38 04 PM

Distributor dispatching the order

WhatsApp Image 2023-10-02 at 7 46 54 PM

Distributor trying to view order status

WhatsApp Image 2023-10-02 at 7 49 52 PM

Client has not received the order so there are no verified transactions yet hence block can't be mined

WhatsApp Image 2023-10-02 at 7 50 58 PM

Client confirms delivery of order

WhatsApp Image 2023-10-02 at 7 54 55 PM

Block is mined with valid transaction

WhatsApp Image 2023-10-02 at 7 56 46 PM

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published