You are on page 1of 50

University of Central Punjab

BSCS FINAL PROJECT

Product Warranty Verification Using Blockchain

Project Advisor

Mr. Asif Farooq

Presented by:
Group ID: F22BS012

Student Reg# Student Name

L1F19BSCS0091 JAWAD AFZAL


L1F19BSCS0116 M SHEHARYAR
L1F19BSCS0181 USMAN SHAHID

Faculty of Information Technology

University of Central Punjab


University of Central Punjab

Complete System
SDP Phase IV

PRODUCT WARRANTY
VERIFICATION USING
BLOCKCHAIN
Advisor: Mr. Asif Farooq

Team F22BS012
Member Name Primary Responsibility
Jawad Afzal Front End Development, Research, Back End
Development
M Sheharyar Front End Development, Research, Back End
Development
Usman Shahid Back End Development, Front End
Development, Research
PRODUCT WARRANTY VERIFICATION USING BLOCKCHAIN

Table of Contents
Table of Contents ........................................................................................................................... i
Revision History ............................................................................................................................ ii
Abstract ......................................................................................................................................... iii
1. Introduction ..............................................................................................................................1
1.1 Product......................................................................................................................................... 1
1.2 Background.................................................................................................................................. 1
1.3 Objective(s)/Aim(s)/Target(s) ..................................................................................................... 1
1.4 Scope ........................................................................................................................................... 1
1.5 Business Goals............................................................................................................................. 2
1.6 Document Conventions ............................................................................................................... 2
1.7 Miscellaneous .............................................................................................................................. 2
2. Technical Architecture ............................................................................................................3
2.1 Application and Data Architecture .............................................................................................. 3
2.2 Component Interactions and Collaborations ............................................................................... 5
2.3 Design Reuse and Design Patterns .............................................................................................. 8
2.4 Technology Architecture ............................................................................................................. 8
2.5 Architecture Evaluation ............................................................................................................... 8
3. Detailed/Component Design ....................................................................................................9
3.1 Component-Component Interface ............................................................................................... 9
3.2 Component-External Entities Interface ..................................................................................... 12
3.3 Component-Human Interface .................................................................................................... 12
4. Screenshots/Prototype ...........................................................................................................13
4.1 Workflow................................................................................................................................... 13
4.2 Screens....................................................................................................................................... 14
5. Other Design Details ..............................................................................................................18
Smart Contracts:..................................................................................................................................... 18
6. Test Specification and Results ..............................................................................................23
6.1 Test Case Specification ............................................................................................................. 23
6.2 Summary of Test Results ........................................................................................................... 33
7. Project Completion Status ....................................................................................................34
8. Deployment/Installation Guide .............................................................................................36
9. User Manual ...........................................................................................................................37
10. References ...............................................................................................................................39
11. Project Summary Form .........................................................................................................40
Appendix A: Glossary..................................................................................................................44
Appendix B: IV & V Report .......................................................................................................45

F22BS012 SDP Phase IV (Final) Page i


PRODUCT WARRANTY VERIFICATION USING BLOCKCHAIN

Revision History
Name Date Reason For Changes Version
Smart Contracts 25/05/20 It was advised by the jury in the presentation of
23 phase 3 to add owner name in the smart
contracts to ensure authenticity of products
Database 28/05/20 Database was updated as selling details were
23 shifted to smart contracts from database due to
the above change
ERD & Class 03/06/20 With regards to the changes mentioned above
Diagram 23 the erd and class diagrams have also been
updated

F22BS012 SDP Phase IV (Final) Page ii


PRODUCT WARRANTY VERIFICATION USING BLOCKCHAIN

Abstract
Counterfeit products are a persistent problem that affects both customers and manufacturers. Not
only do fake products risk the safety of consumers, but they also damage the reputation and
revenue of manufacturers. Additionally, the traditional method of providing warranties often
leads to a complicated and time-consuming process, causing inconvenience for customers.

To address these challenges, a novel solution leveraging blockchain technology can provide a
reliable and efficient system for product authentication and warranty claims. By using smart
contracts written in the solidity language, a web application can be developed to offer unique
interfaces for manufacturers, sellers, and buyers. Customers can verify product authenticity using
a distinct code provided during purchase, while the seller can input the sale date to facilitate a
simplified warranty claim process.

This blockchain-based system can provide numerous benefits, including faster and automated
verification, increased transparency, and a secure and immutable ledger of all product
transactions. It can also potentially reduce costs and minimize fraud by eliminating
intermediaries and increasing trust between parties.

Overall, blockchain technology offers a promising solution to combat counterfeit products and
streamline warranty claims, enhancing the safety and satisfaction of customers while improving
the reputation and revenue of manufacturers.

F22BS012 SDP Phase IV (Final) Page iii


PRODUCT WARRANTY VERIFICATION USING BLOCKCHAIN

1. Introduction
1.1 Product
Like many others, I have fallen victim to the sale of fake products by dishonest merchants
in the market. Currently, there is no digital method for authenticating products.
Additionally, claiming a warranty for products requires keeping the warranty card safe.
This instigated the idea that there should be a digital system that can be used to solve these
problems using technologies like blockchain where data is immutable and safe.

1.2 Background
The identification of fake products has always been a challenge. As per the EU Intellectual
Property Office and the Organization for Economic Cooperation and Development, the
worldwide sales of counterfeit or pirated products have increased dramatically to 460
billion euros, representing approximately 3.3% of all international trade. This has caused
significant harm to businesses across the world, with the clothing and pharmaceutical
sectors incurring losses of 26.3 billion euros and 10.2 billion euros, respectively.
Furthermore, the advancement of technology and e-commerce has led to an exponential
increase in the market for counterfeit products online.

Databases can easily be manipulated, and gaining unauthorized access to traditional


databases in this era is not difficult.

Blockchain is an emerging technology that utilizes immutable, decentralized data nodes


known as blocks. These blocks are connected in a peer-to-peer model distributed across
multiple peers which successfully exhibits a trustless and secure connection.

1.3 Objective(s)/Aim(s)/Target(s)
Upon the Completion of this project following targets will be achieved:

 Product verification Web Application


 Product Verification Demo
 Independent interfaces for the manufacturer, seller, and the buyer
 Successful deployment of smart contracts for the products on the TestNet

1.4 Scope

Blockchain is an emerging technology that is currently being used in authentication


systems such as the authentication of academic documents. Using blockchain, we can
authenticate electronic products as well. Currently, there are proposals to use blockchain
to verify products in order to combat the manufacturing of counterfeit products but no such
platform is available.

F22BS012 SDP Phase IV (Final) Page 1


PRODUCT WARRANTY VERIFICATION USING BLOCKCHAIN

1.5 Business Goals


Research shows that the market for fake products has rapidly exploded. The sales of
permeated products are around 460 billion euros annually. The development of this
product will the ensure eradication of these products from the market. The proposed
business model for this software would be a subscription charge charged from the seller at
the time of registration and the manufacturer would pay in accordance with registering the
products on the website.

1.6 Document Conventions

1. Section Number: Used with reference to Table of Contents


2. Font: Times (14) (Bold): used for sub-heading.
3. Font: Times (12): Used for Description and references.

1.7 Miscellaneous
NA

F22BS012 SDP Phase IV (Final) Page 2


PRODUCT WARRANTY VERIFICATION USING BLOCKCHAIN

2. Technical Architecture
2.1 Application and Data Architecture

Class Diagram:

Figure 2.1

F22BS012 SDP Phase IV (Final) Page 3


PRODUCT WARRANTY VERIFICATION USING BLOCKCHAIN
ER DIAGRAM:

Figure 2.2

This project is primarily built on blockchain technology, and as such, it has limited reliance on
traditional database systems. However, a traditional database is being used instead of blockchain
to avoid incurring additional gas costs. The given class diagram and the entity relationship
diagram describe the required database schema for facilitating the registration of the login
processes of the manufacturer and the seller. These include attributes such as a unique id, name,
password, email, and phone number for each manufacturer and seller. It also explains the
attributes of the product whose database is being created, primarily for the purpose of storing the
selling date that can later be used for the purpose of claiming a warranty. Additionally, the
diagram also explains the necessary attributes of the administrator.

F22BS012 SDP Phase IV (Final) Page 4


PRODUCT WARRANTY VERIFICATION USING BLOCKCHAIN
2.2 Component Interactions and Collaborations

ACTIVITY DIAGRAM:

Figure 2.3

The diagram above represents the working model of the project under discussion. As the
diagram represents, an individual, whether a manufacturer or a buyer, has to log in to be
granted access to the system. If they have a login already, they may sign in to continue,
alternatively, if they aren’t already signed up, they may use the provided option to do so.

Once logged in, a manufacturer will be provided with an option to enter the product
details. As soon as that is done, the product will be registered successfully.

A seller will have the option to enter the product details which will show up since the
manufacturer will have entered them by the time the product reaches the seller. At the time
of sale, the seller will enter the date of sale, once this process is complete, the product will
be registered as sold.

The buyer may enter the product details and get the resultant verification.

F22BS012 SDP Phase IV (Final) Page 5


PRODUCT WARRANTY VERIFICATION USING BLOCKCHAIN

SEQUENCE DIAGRAM:

Figure 2.4

The diagram above represents the working model of the project. As the diagram represents, an
individual, whether a manufacturer or a buyer, has to log in to be granted access to the system. If
they have a login already, they may sign in to continue, alternatively, if they aren’t already signed
up, they may use the provided option to do so.

Once logged in, a manufacturer will be provided with an option to enter the product details.
Assoon as that is done, the product will be registered successfully.

A seller will have the option to enter the product details which will show up since the manufacturer
will have entered them by the time the product reaches the seller. At the time of sale, the seller
will enter the date of sale, once this process is complete, the product will be registered as sold.

The buyer may enter the product details and get the resultant verification.

F22BS012 SDP Phase IV (Final) Page 6


PRODUCT WARRANTY VERIFICATION USING BLOCKCHAIN
DFD:

Figure 2.5

F22BS012 SDP Phase IV (Final) Page 7


PRODUCT WARRANTY VERIFICATION USING BLOCKCHAIN

2.3 Design Reuse and Design Patterns


There are multiple user authentication models that exist at the moment, one of these user
authentication models could be reused to authenticate the users if it adheres to security guidelines.
Since this is not a major aspect of this project and is only used to allow authorized access, reusing
such a model will not affect the overall work.

2.4 Technology Architecture


It is a blockchain-based system that uses smart contracts written in solidity. These smart contracts
include features like unique ids and names of products. The smart contracts will be tested on the
testnet before deploying them on the mainnet.
In addition to this MongoDB is being used for the purpose of storing data. The purpose of using
traditional databases instead of blockchain for these purposes is to avoid access gas costs.
The overall architecture working includes a manufacturer who is registered on the platform, who
will register the product, and upon registration smart contracts would be deployed. In addition,
the seller, who is also registered with the system, can add the selling date of the product. This
data can later be used for warranty claim purposes. The buyer/customer could use his interface
to verify the authenticity of the product.

2.5 Architecture Evaluation


This project largely works on blockchain but the traditional database is also being used in some
instances. This approach makes the product efficient and secure while minimizing gas costs.
Blockchain technology serves to verify the authenticity of products and store the sale date and
product owner details, which ensures the system is tamper-proof, while the traditional database
stores the login credentials and contract address with reference to the unique product ID. This
hybrid approach creates an affordable, accessible, and secure system that can help streamline the
warranty verification process.

Using a traditional database to store data about product user credentials details reduces the need
for additional gas costs associated with blockchain transactions. Similarly, by using blockchain
technology to verify the authenticity of the products, the system prevents any attempt to
manipulate the verification process. Blockchain technology provides a secure, tamper-proof
environment that ensures the integrity of the system. Any attempt to modify the system’s data
will be immediately detected and rejected.

F22BS012 SDP Phase IV (Final) Page 8


PRODUCT WARRANTY VERIFICATION USING BLOCKCHAIN

3. Detailed/Component Design
3.1 Component-Component Interface

Flowchart:

Figure 3.1

The given flowchart explains the operation process of the project, which primarily caters to three
distinct users: the manufacturer, the seller, and the buyer. To access the platform services, both
the manufacturer and the seller must first register themselves using the signup feature provided
on the website. Upon registration, the administrator will validate the authenticity of the
manufacturer and seller’s credentials and if successful, the manufacturer and the seller will be
duly registered on the platform.
After the successful registration, both the manufacturer and the seller will be able to log in to the
website. After successful login, the manufacturer and the seller can proceed to register the
product and the seller can add the selling date of the product.

F22BS012 SDP Phase IV (Final) Page 9


PRODUCT WARRANTY VERIFICATION USING BLOCKCHAIN
Block Diagram:

Figure 3.2

F22BS012 SDP Phase IV (Final) Page 10


PRODUCT WARRANTY VERIFICATION USING BLOCKCHAIN
Pictorial Representation:

Figure 3.3
F22BS012 SDP Phase IV (Final) Page 11
PRODUCT WARRANTY VERIFICATION USING BLOCKCHAIN

3.2 Component-External Entities Interface


NA

3.3 Component-Human Interface

Figure 3.4: Sign in Page

Figure 3.5: Verification Page

F22BS012 SDP Phase IV (Final) Page 12


PRODUCT WARRANTY VERIFICATION USING BLOCKCHAIN

4. Screenshots/Prototype
4.1 Workflow

SWIM LANE DIAGRAM:

Figure 4.1

F22BS012 SDP Phase IV (Final) Page 13


PRODUCT WARRANTY VERIFICATION USING BLOCKCHAIN
4.2 Screens

Figure 4.2: Home Page

Figure 4.3: Home Page

F22BS012 SDP Phase IV (Final) Page 14


PRODUCT WARRANTY VERIFICATION USING BLOCKCHAIN

About Us Pages:

Figure 4.4

Figure 4.5

F22BS012 SDP Phase IV (Final) Page 15


PRODUCT WARRANTY VERIFICATION USING BLOCKCHAIN

Services Pages:

Figure 4.6

Figure 4.7

F22BS012 SDP Phase IV (Final) Page 16


PRODUCT WARRANTY VERIFICATION USING BLOCKCHAIN

Product Registration Page:

Figure 4.8

The product registration page depicted in the picture showcases a user-friendly interface where
manufacturers can enter essential details about their products, such as the product name, model number,
description, and serial number. With the integration of the Metamask extension, manufacturers can
connect their digital wallet and seamlessly deploy smart contracts on the Ethereum blockchain. This
ensures the creation of an immutable record of the product's registration and ownership, providing
transparency and security. The page allows manufacturers to review the entered information before
finalizing the registration, enhancing accuracy. Overall, the page exemplifies a streamlined approach to
leveraging blockchain technology, enabling manufacturers to protect their brand reputation and build
consumer trust through secure and transparent product authentication.

F22BS012 SDP Phase IV (Final) Page 17


PRODUCT WARRANTY VERIFICATION USING BLOCKCHAIN

5. Other Design Details


Smart Contracts:
Television:

Figure 5.1

The smart contract above is for televisions which consists of variables like IMEI, product name,
manufacturing date, warranty period, structs having specification details (e.g., processor, RAM, storage),
and sale details (e.g., owner name, selling details). The constructor initializes the contract with all
necessary product attributes except sale-related information. The first sale function records the initial
sale by capturing owner details, selling price, and date. The update owner details function enables
subsequent ownership updates. These smart contracts establish a comprehensive system for tracking
product information, ownership changes, and facilitating warranty claims, ensuring transparency and
accurate record-keeping throughout the product lifecycle.

F22BS012 SDP Phase IV (Final) Page 18


PRODUCT WARRANTY VERIFICATION USING BLOCKCHAIN

Laptop:

Figure 5.2

The smart contract above is for laptops which consists of variables like IMEI, product name,
manufacturing date, warranty period, structs having specification details (e.g., processor, RAM, storage),
and sale details (e.g., owner name, selling details). The constructor initializes the contract with all
necessary product attributes except sale-related information. The first sale function records the initial
sale by capturing owner details, selling price, and date. The update owner details function enables
subsequent ownership updates. These smart contracts establish a comprehensive system for tracking
product information, ownership changes, and facilitating warranty claims, ensuring transparency and
accurate record-keeping throughout the product lifecycle.

F22BS012 SDP Phase IV (Final) Page 19


PRODUCT WARRANTY VERIFICATION USING BLOCKCHAIN

Gaming Console:

Figure 5.3

The smart contract above is for gaming consoles which consists of variables like IMEI, product name,
manufacturing date, warranty period, structs having specification details (e.g., processor, RAM, storage),
and sale details (e.g., owner name, selling details). The constructor initializes the contract with all
necessary product attributes except sale-related information. The first sale function records the initial
sale by capturing owner details, selling price, and date. The update owner details function enables
subsequent ownership updates. These smart contracts establish a comprehensive system for tracking
product information, ownership changes, and facilitating warranty claims, ensuring transparency and
accurate record-keeping throughout the product lifecycle.

F22BS012 SDP Phase IV (Final) Page 20


PRODUCT WARRANTY VERIFICATION USING BLOCKCHAIN

Smart Watch:

Figure 5.4

The smart contract above is for smart watches which consists of variables like IMEI, product name,
manufacturing date, warranty period, structs having specification details (e.g., processor, RAM, storage),
and sale details (e.g., owner name, selling details). The constructor initializes the contract with all
necessary product attributes except sale-related information. The first sale function records the initial
sale by capturing owner details, selling price, and date. The update owner details function enables
subsequent ownership updates. These smart contracts establish a comprehensive system for tracking
product information, ownership changes, and facilitating warranty claims, ensuring transparency and
accurate record-keeping throughout the product lifecycle.

F22BS012 SDP Phase IV (Final) Page 21


PRODUCT WARRANTY VERIFICATION USING BLOCKCHAIN

Mobiles:

Figure 5.5

The smart contract above is for mobiles which consists of variables like IMEI, product name,
manufacturing date, warranty period, structs having specification details (e.g., processor, RAM, storage),
and sale details (e.g., owner name, selling details). The constructor initializes the contract with all
necessary product attributes except sale-related information. The first sale function records the initial
sale by capturing owner details, selling price, and date. The update owner details function enables
subsequent ownership updates. These smart contracts establish a comprehensive system for tracking
product information, ownership changes, and facilitating warranty claims, ensuring transparency and
accurate record-keeping throughout the product lifecycle.

F22BS012 SDP Phase IV (Final) Page 22


PRODUCT WARRANTY VERIFICATION USING BLOCKCHAIN

6. Test Specification and Results


6.1 Test cases Specifications

Table 6.1: TC-1

Identifier TC-1
Related requirements(s) User Sign-Up (Manufacturer)
Short description Verify that a manufacturer can successfully signup in the system
Pre-condition(s) None
Manufacturer’s Details(M.Username, M.Name, M.Password,
Input data
M.email, M.PhoneNo)
1. Manufacturer initiates the sign-up process
2. Manufacturer provides the required details
Detailed steps
3. System validates the details and creates a new manufacturer
account
Expected result(s) Manufacturer account successfully created
Post-condition(s) Manufacturer can proceed to sign in to the system
Actual result(s) Manufacturer account successfully created
Test Case Result Pass

Table 6.2: TC-2

Identifier TC-2
Related requirements(s) User Sign-Up (Seller )
Short description Verify that a seller can successfully signup in the system
Pre-condition(s) None
Seller’s Details(S.Username, S.Name, S.Password, S.email,
Input data
S.PhoneNo)
1. Seller initiates the sign-up process
2. Seller provides the required details
Detailed steps
3. System validates the details and creates a new manufacturer
account
Expected result(s) Seller account successfully created
Post-condition(s) Seller can proceed to sign in to the system
Actual result(s) Seller account successfully created
Test Case Result Pass

F22BS012 SDP Phase IV (Final) Page 23


PRODUCT WARRANTY VERIFICATION USING BLOCKCHAIN

Table 6.3: TC-3

Identifier TC-3
Related requirements(s) User Sign-Up
Short description Verify that a user cannot sign up with incomplete details
Pre-condition(s) None
Incomplete user Details (e.g. missing S.Username, missing
Input data
M.Name)
1. User initiates the sign-up process
Detailed steps 2. User provides the incomplete details
3. System attempts to create a new user account
Expected result(s) Sign Up process fails due to missing details
Post-condition(s) User account not created
Actual result(s) Sign Up process fails due to missing details
Test Case Result Pass

Table 6.4: TC-4

Identifier TC-4
Related requirements(s) User Sign-In (Manufacturer)
Short description Verify that a manufacturer can successfully sign in to the system
Pre-condition(s) Manufacturer account exists
Input data Manufacturer provides credentials(M.email, M.password)
1. Manufacturer initiates the sign-in process
2. Manufacturer provides correct credentials
Detailed steps
3. System verifies the credentials and allows the manufacturer
to access to their account
Expected result(s) Manufacturer successfully signs in to the system
Manufacturer can access their account and perform relevant
Post-condition(s)
operations
Actual result(s) Manufacturer successfully signs in to the system
Test Case Result Pass

F22BS012 SDP Phase IV (Final) Page 24


PRODUCT WARRANTY VERIFICATION USING BLOCKCHAIN

Table 6.5: TC- 5

Identifier TC-5
Related requirements(s) User Sign-In (Seller)
Short description Verify that a seller can successfully sign in to the system
Pre-condition(s) seller account exists
Input data seller provides credentials(S.email, S.password)
1. Seller initiates the sign-in process
2. Seller provides correct credentials
Detailed steps
3. System verifies the credentials and allows the Seller to
access to their account
Expected result(s) Seller successfully signs in to the system
Post-condition(s) Seller can access their account and perform relevant operations
Actual result(s) Seller successfully signs in to the system
Test Case Result Pass

Table 6.6: TC- 6

Identifier TC-6
Related requirements(s) User Sign-In
Short description Verify that a user cannot sign in with incorrect credentials.
Pre-condition(s) User account exists.
Input data Incorrect credentials (email, password)
1. User initiates the sign-in process.
2. User provides incorrect credentials.
Detailed steps
3. System verifies the credentials and denies access to the
account.
Expected result(s) Sign-in process failed
Post-condition(s) User cannot access their account.
Actual result(s) Sign-in process fails due to incorrect credentials.
Test Case Result Pass

F22BS012 SDP Phase IV (Final) Page 25


PRODUCT WARRANTY VERIFICATION USING BLOCKCHAIN

Table 6.7: TC- 7

Identifier TC - 7
Related requirements(s) Product Registration
Short description Verify that a manufacturer can successfully register a product.
Pre-condition(s) None
Product details (e.g. Product unique id, Product name,
Input data
specifications etc.)
1. Manufacturer initiates the product registration process.
2. Manufacturer provides the required product details.
Detailed steps
3. Smart contract registers the product and assigns a unique
identifier.
Expected result(s) Product is successfully registered with a unique identifier.
Post-condition(s) Product is added to the blockchain ledger.
Actual result(s) Product registration is successful.
Test Case Result Pass

Table 6.8: TC- 8

Identifier TC-8
Related requirements(s) Product Sale
Short description Verify that a seller can successfully sell a registered product.
Pre-condition(s) A registered product exists.
Input data Product identifier, buyer's name, sale date
1. Seller initiates the sale process.
2. Seller provides the product identifier, buyer's name, and
Detailed steps sale date.
3. Smart contract updates the owner and sale date for the
product.
Expected result(s) Product ownership and sale date are successfully updated.
Post-condition(s) Product ownership is transferred to the buyer.
Actual result(s) Product ownership and sale date are updated.
Test Case Result Pass

F22BS012 SDP Phase IV (Final) Page 26


PRODUCT WARRANTY VERIFICATION USING BLOCKCHAIN

Table 6.9: TC- 9

Identifier TC-9
Related requirements(s) Warranty Claim
Short description Verify that a buyer can successfully claim warranty for a product.
Pre-condition(s) A sold product with a valid sale date exists.
Input data Product identifier, buyer's name, claim date
1. Buyer initiates the warranty claim process.
2. Buyer provides the product identifier, buyer's name, and
Detailed steps claim date.
3. Smart contract validates the claim based on the sale date
and buyer's information.
Expected result(s) Warranty claim is successfully validated.
Post-condition(s) Warranty claim is processed.
Actual result(s) Warranty claim is validated.
Test Case Result Pass

Table 6.10: TC- 10

Identifier TC-10
Related requirements(s) Product Verification
Verify that a customer can successfully verify the authenticity of a
Short description
product.
Pre-condition(s) A sold product with a valid unique identifier exists.
Input data Product identifier
1. Customer initiates the product verification process.
2. Customer provides the product identifier.
Detailed steps
3. Smart contract verifies the authenticity of the product based
on the identifier.
Expected result(s) Product authenticity is successfully verified.
Post-condition(s) Product authenticity is confirmed
Actual result(s) Product authenticity is verified.
Test Case Result Pass

F22BS012 SDP Phase IV (Final) Page 27


PRODUCT WARRANTY VERIFICATION USING BLOCKCHAIN

Table 6.11: TC- 11

Identifier TC-11
Related requirements(s) Product Resale
Verify that a seller can successfully update the owner name when
Short description
a product is resold.
Pre-condition(s) A sold product with an existing owner exists.
Input data Product identifier, new owner name
1. Seller initiates the owner update process.
2. Seller provides the product identifier and the new owner
Detailed steps
name.
3. Smart contract updates the owner name for the product.
Expected result(s) Owner name is successfully updated.
Post-condition(s) Owner name is changed to the new owner.
Actual result(s) Owner name is updated.
Test Case Result Pass

Table 6.12: TC- 12

Identifier TC-12
Related requirements(s) Product Registration
Short description Verify that a product cannot be registered with missing details.
Pre-condition(s) None
Input data Incomplete product details (e.g., missing model number)
1. Manufacturer initiates the product registration process.
Detailed steps 2. Manufacturer provides incomplete product details.
3. Smart contract attempts to register the product.
Expected result(s) Product registration fails due to missing details.
Post-condition(s) Product is not registered.
Actual result(s) Product registration fails due to missing details.
Test Case Result Pass

F22BS012 SDP Phase IV (Final) Page 28


PRODUCT WARRANTY VERIFICATION USING BLOCKCHAIN

Table 6.13: TC- 13

Identifier TC-13
Related requirements(s) Product Sale
Verify that a product cannot be sold without a valid product
Short description
identifier.
Pre-condition(s) None
Input data Invalid product identifier
1. Seller initiates the sale process.
Detailed steps 2. Seller provides an invalid product identifier.
3. Smart contract attempts to update the owner and sale date.
Expected result(s) Sale process fails due to an invalid product identifier.
Post-condition(s) Product ownership and sale date remain unchanged.
Actual result(s) Sale process fails due to an invalid product identifier.
Test Case Result Pass

Table 6.14: TC- 14

Identifier TC-14
Related requirements(s) Warranty Claim
Verify that a warranty claim cannot be processed without a valid
Short description
sale date.
Pre-condition(s) A sold product without a valid sale date exists.
Input data Invalid sale date
1. Buyer initiates the warranty claim process.
2. Buyer provides the product identifier, buyer's name, and an
Detailed steps
invalid sale date.
3. Smart contract attempts to validate the warranty claim.
Expected result(s) Warranty claim fails to validate due to an invalid sale date.
Post-condition(s) Warranty claim remains unprocessed.
Actual result(s) Warranty claim fails to validate due to an invalid sale date.
Test Case Result Pass

F22BS012 SDP Phase IV (Final) Page 29


PRODUCT WARRANTY VERIFICATION USING BLOCKCHAIN

Table 6.15: TC- 15

Identifier TC-15
Related requirements(s) Product Verification
Verify that a customer receives an error message when verifying an
Short description
invalid product identifier.
Pre-condition(s) None
Input data Invalid product identifier
1. Customer initiates the product verification process.
2. Customer provides an invalid product identifier.
Detailed steps
3. Smart contract attempts to verify the authenticity of the
product.
Product verification fails due to an invalid product identifier, and
Expected result(s)
the customer receives an error message.
Post-condition(s) Product authenticity remains unverified.
Product verification fails due to an invalid product identifier, and
Actual result(s)
the customer receives an error message.
Test Case Result Pass

Table 6.16: TC- 16

Identifier TC-16
Related requirements(s) Product Resale
Verify that a seller cannot update the owner name without a valid
Short description
product identifier.
Pre-condition(s) None
Input data Invalid product identifier
1. Seller initiates the owner update process.
2. Seller provides an invalid product identifier and the new
Detailed steps
owner name.
3. Smart contract attempts to update the owner name.
Expected result(s) Owner update process fails due to an invalid product identifier.
Post-condition(s) Owner name remains unchanged.
Actual result(s) Owner update process fails due to an invalid product identifier.
Test Case Result Pass

F22BS012 SDP Phase IV (Final) Page 30


PRODUCT WARRANTY VERIFICATION USING BLOCKCHAIN

Table 6.17: TC- 17

Identifier TC-17
Related requirements(s) Product Registration
Verify that multiple products can be successfully registered by the
Short description
same manufacturer.
Pre-condition(s) None
Input data Product details for multiple products
1. Manufacturer initiates the product registration process.
2. Manufacturer provides the details for multiple products.
Detailed steps
3. Smart contract registers each product and assigns unique
identifiers
Expected result(s) All products are successfully registered with unique identifiers.
Post-condition(s) All products are added to the blockchain ledger.
Actual result(s) All products are successfully registered with unique identifiers.
Test Case Result Pass

Table 6.18: TC- 18

Identifier TC-18
Related requirements(s) Product Sale
Verify that multiple products can be successfully sold by the same
Short description
seller.
Pre-condition(s) Multiple registered products exist.
Input data Product identifiers, buyer's names, sale dates for multiple products
1. Seller initiates the sale process.
2. Seller provides the product identifiers, buyer's names, and
Detailed steps sale dates for multiple products.
3. Smart contract updates the owner and sale date for each
product.
Expected result(s) Ownership and sale dates are successfully updated for all products.
Post-condition(s) Ownership is transferred to the respective buyers for each product.
Actual result(s) Ownership and sale dates are successfully updated for all products.
Test Case Result Pass

F22BS012 SDP Phase IV (Final) Page 31


PRODUCT WARRANTY VERIFICATION USING BLOCKCHAIN

Table 6.19: TC- 19

Identifier TC-19
Related requirements(s) Product Resale
Verify that a seller cannot update the owner name for a product that
Short description
does not exist.
Pre-condition(s) None
Input data Non-existent product identifier, new owner name
1. Seller initiates the owner update process.
2. Seller provides a non-existent product identifier and the
Detailed steps
new owner name.
3. Smart contract attempts to update the owner name.
Expected result(s) Owner update process fails due to a non-existent product identifier.
Post-condition(s) Owner name remains unchanged.
Actual result(s) Owner update process fails due to a non-existent product identifier.
Test Case Result Pass

Table 6.20: TC- 20

Identifier TC-20
Related requirements(s) Product Details Retrieval
Verify that a user can retrieve all the details of a product using its
Short description
unique identifier.
Pre-condition(s) Product with a valid unique identifier exists.
Input data Product unique identifier
1. User accesses the product details retrieval feature.
2. User enters the unique identifier of the product.
Detailed steps
3. System searches for the product based on the unique
identifier and retrieves its details.
Expected result(s) System successfully retrieves all the details of the product..
Post-condition(s) User can view the complete details of the product.
Actual result(s) System successfully retrieves all the details of the product.
Test Case Result Pass

F22BS012 SDP Phase IV (Final) Page 32


PRODUCT WARRANTY VERIFICATION USING BLOCKCHAIN

Summary of Test Results

Table 6.2: Summary of All Test Results

Number of defects Number of Number of


found defects corrected defects still
so far need to be
Module Name Test cases run corrected

Module 1 (Sign up) 5 5 0


TC1, TC2, TC3

Module 2 (Sign in) 3 3 0


TC4, TC5, TC6

Module 3 (Product 8 8 0
Registration) TC7, TC12, TC17

Module 4 (Warranty
TC9, TC14 6 6 0
Claim)

Module 5 (Product Sale) TC8, TC13, TC18 7 7 0

Module 6 (Product
Resale) TC11, TC16, TC19 6 6 0

Module 7 (Data
Retrieval) TC10, TC15, TC20 2 2 0

Complete System 20 37 37 0

F22BS012 SDP Phase IV (Final) Page 33


PRODUCT WARRANTY VERIFICATION USING BLOCKCHAIN

7. Project Completion Status

Table 7.1: Project Completion Status

Status
Module Name
(Complete, Partially Implemented, Not Implemented)
Module 1 (Back-End Development) Complete
Module 2 (Front-End Development) Complete
Module 3 (Front-End & Back-End
Integration) Complete
Module 4 (Testing) Complete
Complete System Complete

Gantt Chart:

The project has achieved a significant milestone as all phases have been successfully completed.
Beginning with the initial phase of analysis and documentation, the project team diligently examined
requirements and defined the project's scope. Subsequently, the second phase focused on developing the
back-end infrastructure and deploying smart contracts, ensuring efficient implementation of the project's
core functionality. In the third phase, a user-friendly front end and an intuitive interface were created,
enhancing the overall user experience. Recently, the integration of the back end and front end was
finalized, establishing a cohesive system. The project has now concluded with comprehensive testing
and debugging, addressing any potential issues or glitches. These efforts have ensured the smooth
functionality and reliability of the final product, marking the successful completion of all project phases.

F22BS012 SDP Phase IV (Final) Page 34


PRODUCT WARRANTY VERIFICATION USING BLOCKCHAIN

Table 7.2: Objective(s)/Target(s) Status

Target/Objective Status Reason(s)

Objective 1
(Product Completed Completely Implemented
Verification Web
Application)
Objective 2
(Product Completed Completely Implemented
Verification
Demo)
Objective 3
(Independent Completely Implemented
interfaces for Completed
seller, buyer &
manufacturer)
Objective 4
(Smart Contract Completed Completely Implemented
Deployment on
Testnet)
Number of
Targets 4
Completed
Number of
Targets Partially 0
Completed
Number of
Targets Not 0
Completed

F22BS012 SDP Phase IV (Final) Page 35


PRODUCT WARRANTY VERIFICATION USING BLOCKCHAIN

8. Deployment/Installation Guide
This is a web based project that works on any browser and not much installations are required.
However, in case of the manufacturer and the seller they need to connect there browser with
metamask to connect to blockchain. Following are explained the steps required to set up
metamask on google chrome browser:

1. Open Google Chrome: Launch your Google Chrome web browser.

2. Visit the Chrome Web Store: Go to the Chrome Web Store by entering
"chrome.google.com/webstore" in the address bar.

3. Search for MetaMask: In the search bar of the Chrome Web Store, type "MetaMask" and press
Enter.

4. Locate MetaMask Extension: Look for the official MetaMask extension in the search results. It
is usually indicated by the MetaMask logo and the name "MetaMask - NFT Wallet".

5. Add to Chrome: Click on the "Add to Chrome" button next to the MetaMask extension listing.

6. Confirmation: A pop-up window will appear, confirming the installation. Click on the "Add
extension" button to proceed.

7. Pin MetaMask to Toolbar (optional): After the installation, you can choose to pin the MetaMask
extension to your Chrome toolbar for easier access. Click on the puzzle piece icon at the top-
right corner of Chrome, find MetaMask in the list, and click on the pin icon next to it.

8. Set up MetaMask: Once MetaMask is installed, click on the MetaMask icon in the Chrome
toolbar to launch the extension. Follow the on-screen prompts to set up your MetaMask wallet,
create a new account, and secure it with a strong password.

9. Backup Secret Phrase: During the wallet setup process, MetaMask will provide you with a secret
phrase (also known as seed phrase or recovery phrase). It is crucial to write down and securely
store this phrase, as it can be used to recover your wallet in case of any issues.

10. Connect to Blockchain Network: After setting up your wallet, you will be prompted to connect
to a blockchain network. Select the appropriate network, such as the Ethereum Mainnet or a test
network like Ropsten, Rinkeby Ganache or BNB testnet.

11. Import Existing Account (if applicable): If you already have a MetaMask account with an
existing wallet, you can choose the option to import it by entering your account's seed phrase or
private key.

F22BS012 SDP Phase IV (Final) Page 36


PRODUCT WARRANTY VERIFICATION USING BLOCKCHAIN

9. User Manual

1. Manufacturer User Manual:

Introduction:

Welcome to the blockchain-based product authentication and warranty system designed


for manufacturers. This user manual will guide you through the steps to effectively utilize
the system.

Account Creation:

1. Visit the system's website and click on the "Create Account" button.
2. Fill in the required information and submit the form.

Product Registration:

1. Log in to your account using your credentials.


2. Navigate to the "Product Registration" section.
3. Enter the unique code associated with the product along with product details and
specification
4. Enter details like warranty duration and manufacturing date.
5. Submit the registration form to add the product to the blockchain.

2. Seller User Manual:

Introduction:

Welcome to the blockchain-based product authentication and warranty system designed


for sellers. This user manual will guide you through the steps to effectively utilize the
system.

Account Creation:

1. Visit the system's website and click on the "Create Account" button.
2. Fill in the required information and submit the form.

Product Registration:

1. Log in to your account using your credentials.


2. Navigate to the "Product Registration" section.
3. Enter the unique code find the registered smart contract and then enter the selling
date and product owner name for warranty claims.
4. Submit the registration form to add the product to the blockchain.

F22BS012 SDP Phase IV (Final) Page 37


PRODUCT WARRANTY VERIFICATION USING BLOCKCHAIN

System Benefits:

Simplified product verification process.


Reduced warranty claim complications.
Increased customer trust and satisfaction.

3. Buyer User Manual:

Introduction:

Welcome to the blockchain-based product authentication and warranty system designed


for buyers. This user manual will guide you through the steps to effectively utilize the
system.

Product Authentication:

Navigate to the "Product Authentication" section.


Enter the distinct code provided with your purchased product.
Verify the product's authenticity based on the system's response.

System Benefits:

Reliable product authentication.


Easy warranty claim process.
Increased confidence in purchasing genuine products

F22BS012 SDP Phase IV (Final) Page 38


PRODUCT WARRANTY VERIFICATION USING BLOCKCHAIN

10. References
1. https://www.mdpi.com/1424-8220/22/22/8969

2. https://intellectual-property-helpdesk.ec.europa.eu/news-events/news/use-blockchain-protect-
against-counterfeiting-2022-09-16_en

3. http://https//arxiv.org/pdf/2206.08565.pdf#:~:text=A%20consumer%20can%20verify%20the,produ
ct%20linked%20to%20the%20Blockchain.&text=Over%20the%20years%2C%2

4. https://www.securingindustry.com/euipo-completes-blockchain-authentication-pilot/s111/a15418/

5. https://www.analyticsinsight.net/how-blockchain-technology-can-be-used-to-identify-phony-
products/

6. https://www.sciencedirect.com/science/article/pii/S2666790822000866

7. https://www.zurich.ibm.com/security/digitalassets.html

8. http://https//arxiv.org/pdf/2206.08565.pdf#:~:text=A%20consumer%20can%20verify%20the,produ
ct%20linked%20to%20the%20Blockchain.&text=Over%20the%20years%2C%2

9. https://www.mdpi.com/1424-8220/22/22/8969

10. www.visual-paradigm.com

11. https://creately.com/

12. https://teamgantt.com/

13. https://remix.ethereum.org/

14. https://erdplus.com/

15. Visual Paradigm - Online Office Suite (visual-paradigm.com)

F22BS012 SDP Phase IV (Final) Page 39


PRODUCT WARRANTY VERIFICATION USING BLOCKCHAIN

11. Project Summary Form


Name of Product Warranty Verification system using Blockchain.
Project
Project Type Blockchain-based web interface.
Department FOIT
Start Date 18/10/2022
Completion 15/06/2023
Date
Supervisor / Mr. Asif Farooq
Team Leader
Team Usman Shahid, Muhammad Sheharyar, Jawad Afzal
Members (if
any)
Funding None
Agency (if
any)
Amount of None
Funding (if
any)
Assign SDGs  Goal 9: Industry, Innovation and Infrastructure
to Project  Goal 12: Responsible, Consumption and Production
 Goal 16: Peace, Justice and strong Institutions
 Goal 17: Partnership for the goals
The project aligns with the United Nations’ sustainable
development goals

Motivation of By developing and implementing a blockchain-based system for


Project product authentication and warranty claims, we aim to empower
customers to make informed purchases and protect themselves from
dishonest merchants and counterfeit products. This project is designed
to restore trust in the marketplace, ensuring that customers’ hard-
earned money is invested in genuine and safe products. Together, we
can create a future where transparency, accountability, and customer
satisfaction prevail, leaving no room for counterfeiters to deceive
unsuspecting buyers.

Practical / The project's practical and potential applications span across various
Potential industries, including e-commerce platforms, consumer electronics,
Application luxury goods and fashion, automotive and spare parts, supply chain
and logistics, as well as government initiatives. By implementing the
blockchain-based system, customers can verify product authenticity,

F22BS012 SDP Phase IV (Final) Page 40


PRODUCT WARRANTY VERIFICATION USING BLOCKCHAIN
manufacturers can protect their brand reputation, and industries can
combat counterfeiting. This solution ensures trust and integrity in the
marketplace, enhances consumer safety, and fosters fair trade
practices, ultimately benefiting both businesses and consumers.
Abstract This project proposes the development of a blockchain-based system
to tackle the issue of counterfeit products and simplify warranty
claims. Using a web application with smart contracts, customers can
verify product authenticity and sellers can facilitate efficient warranty
claims. The system aims to automate verification, enhance
transparency, and provide a secure ledger of product transactions. By
eliminating intermediaries, reducing costs, and increasing trust, the
project seeks to improve customer satisfaction and protect
manufacturers from counterfeit-related reputation and revenue risks.
Key The project's key technical features include utilizing blockchain
Technical technology for a decentralized and immutable ledger, smart contracts
Features for automation, unique identifiers for product verification, automated
warranty claim processes, transparency, and traceability throughout
the product lifecycle. These features collectively create a reliable and
efficient system for product authentication and warranty claims,
enhancing security, streamlining processes, and fostering trust among
manufacturers, sellers, and customers.
Projects
Images /
Screenshots

F22BS012 SDP Phase IV (Final) Page 41


PRODUCT WARRANTY VERIFICATION USING BLOCKCHAIN

F22BS012 SDP Phase IV (Final) Page 42


PRODUCT WARRANTY VERIFICATION USING BLOCKCHAIN

F22BS012 SDP Phase IV (Final) Page 43


PRODUCT WARRANTY VERIFICATION USING BLOCKCHAIN

Appendix A: Glossary
Authenticity: The quality of being genuine or legitimate.

Authentication: The process of verifying the identity or validity of a product or entity.

Blockchain: A decentralized and distributed digital ledger that records transactions across multiple
computers.

Counterfeit: An imitation or fake product that is made to resemble a genuine product.

Gas costs: The fees required to perform transactions or execute operations on a blockchain network.

Hybrid approach: A combination of different technologies or methods to achieve a desired outcome.

Immutable: Unable to be changed or modified over time.

Ownership updates: Changes in the legal ownership or possession of a product.

Peer-to-peer: A decentralized network where participants interact directly with each other without
intermediaries.

Product details: Information specific to a particular product, such as its specifications, features, and
characteristics.

Product lifecycle: The stages a product goes through from development to disposal.

Product verification: The process of confirming the authenticity and legitimacy of a product.

Record-keeping: The process of creating and maintaining accurate and organized records.

Smart contracts: Self-executing contracts with the terms of the agreement written into code, stored and
executed on a blockchain.

Solidity: A programming language used for writing smart contracts on the Ethereum blockchain.

Tamper-proof: Resistant to unauthorized modification or alteration.

Traditional database: A conventional system for storing and managing data using tables, rows, and
columns.

Transparency: Openness and visibility of information or processes.

Warranty claims: Requests made by customers for repairs or replacements of products covered under
warranty.

F22BS012 SDP Phase IV (Final) Page 44


PRODUCT WARRANTY VERIFICATION USING BLOCKCHAIN

Appendix B: IV & V Report


(Independent verification & validation)
IV & V Resource

Name Signature

Fix Time
S# Defect Description Origin Stage Status
Hours Minutes
1 Solidity functions were not working Phase 2 Fixed 0 45
because of wrong version of
solidity selected

2 Cross Browser Compatibility Error Phase 3 Fixed 2 30

3 Smart Contract constructor Error Phase 3 Fixed 0 25

4 Functions of sale not working Phase 3 Fixed 1 15

5 MongoDB connection unsuccessful Phase 4 Fixed 5 45

6 MongoDB connection to front end Phase 4 Fixed 4 15


unsuccessful

7 Ganache Connection Error Phase 4 Fixed 1 00

8 Accepting characters in integer Phase 4 Fixed 1 05


type values

9 No Warning Messages Phase 4 Fixed 2 00

10 Bar Size of email and password for Phase 4 Fixed 0 30


manufacturer and seller small

11 Pictures overlapping to text in Phase 4 Fixed 1 00


Services Page

12 Manufacturer Page non Responsive Phase 4 Fixed 2 00

13 Seller Update Owner Function not Phase 4 Fixed 3 35


working
Table B.1: List of non-trivial defects

This document has been adapted from the following:


1. Previous project templates at UCP
2. High-level Technical Design, Centers for Medicare & Medicaid Services. (www.cms.gov)

F22BS012 SDP Phase IV (Final) Page 45

You might also like