Detection of Counterfeit Products using Blockchain

. Supply chain management frequently faced issues such as service redundancy, poor coordination between several departments, and lack of standardization as a result of the lack of transparency. Product counterfeiting is something which is very common now-a-days and it’s almost impossible to detect a counterfeit product just by looking at it. Counterfeiters cause signiﬁcant challenges for legitimate ﬁrms, yet far too many people have no idea of the entire amount of counterfeit items’ inﬂuence on brands. There are several methods devised in the past to get away with this problem of product counterfeiting. The most popular methods are using RFID tags, Artiﬁcial Intelligence, QR code based systems, etc. But each of them had few disad-vantages such as the QR code can be copied from a genuine product and placed on a fake product, artiﬁcial intelligence uses CNN and machine learning which needs heavy computational power and so on. The idea of this project is to improve detection of fake products by tracking its supply chain history. This is achieved with Blockchain technology which ensures the identiﬁcation and traceability of real products throughout the supply chain. Blockchain based system, makes everything decentralized that may be accessed by several parties at the same time. One of its main advantages is that the recorded data is di ﬃ cult to change without the consent of all parties concerned which makes the data extremely secure and protect from all vulnerabilities. This paper presents system designed using blockchain technology for detection of counterfeit products.


Introduction
Product counterfeiting happens when a product is sold pre-tending to be another product. It is consumer fraud and commonly defined as deceptive business practices that cause consumers to su↵er financial or other losses. According to the Authentication Solution Providers' Association reports it costs the Indian economy INR 1 trillion every year. Counterfeit incident are increasing by 20% average in between 2018-20. [1]. Counterfeit goods include counterfeit handbags, clothing, cosmetics, and electronics. It not only has negative e↵ects on the economy, but on citizens too. For example poor cosmetics can a↵ect skin and cause skin diseases and rashes, counterfeit electronic components can cause malfunction in gadgets and can lead to unfavorable situations and mishaps. Poor quality clothes, shoes when worn can cause discomfort. Hence this issue necessitates finding some solution for the sale of counterfeit products.
Another consequence of counterfeiting is that a company's reputation su↵ers. Because many customers are clueless that the object they are holding is a knock-o↵, they will accuse the genuine company if the knock-o↵ product fails to perform properly, comes apart rapidly, or fails to satisfy their expectations. Customer demand recompense, either in the form of a refund or a new product, and they seek it out directly from the legitimate company. A lot of a↵ected businesses may find themselves in a scenario where they are dealing with an unhappy customer who is ⇤ e-mail: wasnik.kunal4@gmail.com complaining about the bad quality of the item, and the customer care representative is unaware that the item in question is a counterfeit. Companies are caught between a tough situations, attempting to avoid wasting time and effort dealing with poor imitations of their goods while yet trying to keep their customers pleased. The harm caused by counterfeiters extends beyond customer relationships. Because of the behaviors of counterfeiters, distributors, retailers, and other business partners frequently lose faith in legitimate enterprises.
The most successful mitigation measures for overcoming misleading counterfeit risk in global supply chains include network transparency, cost control and pre-supply evaluation approaches, and supplier relationship management. Hence the objective of this paper is to present the system designed for anti-counterfeit using Blockchain technology and to give end user and supplier power to track supply chain of product in a secured environment. In an overview of proposed system, it is aimed to solve the problem of brand counterfeiting and provide the chance to the customer, vendors and suppliers to check the integrity of the product.
The paper is organized as follows: The detail explanation of Blockchain with its working and features is mentioned in section 2. The section 3 o↵ers a comprehensive review of the literature. The proposed System in Section 4 includes the system model and the flow of the system. The simulation results for the proposed method are presented in Section 5. Section 6 is where the paper comes to a close with the conclusion.

Blockchain
Blockchain is collection blocks that are linked together which stores information. Each block has a timestamp, transaction data and hash of its own and hash of previous block, so it is difficult to tamper with data. Blockchain is a decentralized system. It ensures that every new block added to the blockchain is the one and only true version that is agreed upon by all nodes in the Blockchain. It refers to the collective maintenance of a technical solution that maintains a continuous record file as a reliable database through decentralization

Working of Blockchain
When a new transaction is entered, it is then transmitted in a network of peer-to peer computers scattered across the world. The network of computers then solve the equations to confirm the validity of the transaction. They are called miners. Once confirmed to be legitimate transactions, they are clustered together into blocks. The miner then receives an award as a proof of work. These blocks are then chained together creating a long history of all transactions that are permanent. The transaction is complete.Whole procedure is done as shown in figure 1.

Blockchain Features
Blockchain can add data records to its database which does not depend on any centralized authority as a arbitrator, instead it works on its own consensus algorithms. Blockchain is openly available database and is highly reliable. The features of Blockchain technology are described in detail below. The features of Blockchain are shown in figure 2. 1. Security and privacy : Blockchain uses cryptography to secure its data. Private key is used to sign the data, using public key we can verify whether the data has been tampered or not and check its genuineness. A user should protect its private key similar to bank OTP and passwords and prevent it from leaking to ensure the security of its data on blockchain [5][7] [8].
2. Decentralized : In a decentralized blockchain network, no one has to know or trust anyone else. Each member in the network has a copy of the exact same data in the form of a distributed ledger. If a member's ledger is altered or corrupted in any way, it will be rejected by the majority of the members in the network [5][7].
3. Untraceability : Once the block is entered into the blockchain, it cannot be tampered. Due to this if the block in the Blockchain is altered and is immediately rejected or deleted.

Transparency
The data in Blockchain is completely public and can be viewed by the participants.

Flexibility :
Being open source is one of biggest advantages of blockchain. Various public and private blockchains are available to the users, which can be used based on type of application which has to be created [5][7].

Importance of Blockchain
Blockchain increases trust as we don't have to depend on any third party. The smart contracts which are basically programs on blockchain are run only when certain conditions are met. Since all the blocks stores its data along with hash of previous block it becomes difficult to modify the blockchain with false information. If attacker changes information of block , it's hash also change but the hash of next block remains same. To alter chain would require the consensus of more than half of the participants which is unlikely, since lots of resources and financial amount is required. Also other members would come to know of this drastic change [5].

Literature Survey
The survey focused on understanding the sources of counterfeits, impact on the society.There exist various systems of fake product detection,which use Artificial Intelligence, QR codes , Machine Learning and Blockchain. The methods discussed by Shaik included the use of providing product with public and private keys as QR code, the app used to scan the QR should have cryptographic functionality to decrypt the QR code. The manufacturer is also supposed to run server to accept request and match the buyers name, and items code. The scanning app should have cryptographic functionality to decrypt ciphertext of the item code encoded in the QR code [9]. Benatia and Baudry et.al explains traceability-CPS based architecture for supply chain management consists of several layers that interact to form a traceability-CPS. Also, the proposed architecture allows supply chain monitoring and data analytic to enhance product. Safety and quality. The proposed algorithm con-sist on computing the most frequent item sets in the prod-uct transaction database. This item sets are then used as genuine product trajectories and can serve in detecting ab-normal product behavior [10].
Khalil and Doss et.al comes up with the solution of using RFID based system to reduce counterfeiting. This system allows consumers to query in-store the tag attached to an item to verify its legitimacy. RFID-based anti-counterfeiting and anti-theft schemes are suitable for large scale implementation in retail environments. The proposed scheme is lightweight and suitable for implementation using low-cost passive RFID tags. Tran and Hong's anti-counterfeiting protocol are used. This system is immune to DOS attacks [11]. Habib and Sardar et.al gives explanation on SCM trends. They are examined in their work process that executives' difficulties and transaction issues are problems featured in the SCM. Hence proposed a solution, SCM by considering the blockchain as a technological feature for solving them. Primary method for structuring new models should find the transaction process at a plan level [12].
Daoud and Vu et.al focuses on the architecture of AI Application. It has three main parts: the data set, detection models, and trained model. Anti-counterfeiting machine learning-based solution to detect fake products. Training models step and detecting logo step are the two steps required. Faster R-CNN achieves high accuracy and low training speed [13]. Chen and Shi et.al explains SCQI. Framework for blockchain based SCQI provides a theoretical basis to intelligent quality management of supply chains based on blockchain technology. RFID technology is used to record quality information, trans-action information. Smart contracts are used to execute quality control and improve the efficiency of the supply chain [14]. Toyoda, Kentaroh and Mathiopoulos, P Takis et.al Proposed system to detect fake product with the help of QR code. End users can scan the QR code assigned to product to get the product details and transaction history, the steps involved Product enrolment, ship product to distributor, and ship product to retailer, end user gets details about the produc [15].
In a Blockchain based system the data is stored on each node, then the nodes exchange information with each other over the network. Each node maintains all Blockchain data. The node verifies the received transactions and include them in the new block based on its own Blockchain data, and try to obtain the rights of the new block. Ethereum as the back-end Blockchain operating system. Store relevant information on product sales in Blockchain which is accessible to everyone. It is cost efficient [7]. In this blockchain technology for information sharing is proposed. Is this the information is in the control of the owner so third party interference is difficult. Users are always aware of the data that is being collected about them and how it is used. The blockchain block contains sender, amount, receiver, transaction id, product id and metadata [16]. Ethereum is a open-source Blockchain.Ethereum is a technology that's home to digital money,global payments and applications.The process is simple as to get into the portal,pick a wallet that lets you connect to Ehereum and manage your funds , Get the ETH, use applications powered by Ethereum, start building [17].
Abhijeet and Adrew et. al. [18] discusses various findings on counterfeiting in global supply chain environments based on various papers and online surveys of professionals targeted at a national purchasing body and affiliated UK purchasing groups. It was found that counterfeiting is widely increasing in areas of low-cost spare parts and sectors like drug market. Strategies used by industries to tackle this problem include avoidance, prevention based on previous experience, destruction. The counterfeit products were difficult to identify for customers due to availability of forged certificates.
The limitations in the existing systems are that brands used QR codes on products to prove the validity of the product.But the QR code can be copied and used to label counterfeit products [9]. In the RFID based system that low Cost RFID tags can be used for auto identification of products, but due to cloning of RFID tags, this method is not suitable [14]. In AI and machine learning application, CNN takes more time and memory.It needs training and testing phase before its actual deployment.Artificial Intelligence fails to detect tag reapplication attacks, wherein a counterfeiter removes a legitimate tag from a genuine product and reapplies it to a counterfeit or expired product [13]. There is no power for the customer,suppliers and retailers to check the integrity of product.

Proposed system
Counterfeit has spread worldwide and has huge e↵ects on organizations, manufacturers, and consumers. It a↵ects the influence of the organization and the wellbeing of the consumers. India is not excluded. The proposed system is aimed at consumer products, and it helps track the products by maintaining the product and the supply chain integrity by using Blockchain. This gives the customers the power to track the history of the entire product from manufacturer to customer using blockchain and QR code.

System Model
The proposed system will be a decentralized application (Dapp) which will be implemented using the Ethereum Network as the main blockchain for keeping all the records and managing the transactions regarding the products of the companies listed on Dapp. The basic system architecture is shown in figure 3. Figure 3: System Architecture [19].

Ethereum
It is a decentralized blockchain which uses a proof-ofwork consensus mechanism. Proof-of-work is adding block to the blockchain by solving the mathematical expressions. Solving the puzzle "proves" that nodes have done the "work" by using computational resources. It confirms that the block is added and recorded in the blockchain. This process is known as mining. Mining is typically brute force trial and error, but successfully adding a block is rewarded in ethereum (ETH) [17] [19].

Smart contract
Smart contracts are programs that are stored inside Blocks. Smart contracts replaces the involvement of thirdparty members. These are basically protocols that execute when the conditions are satisfied. They never change, that means no one can tamper with the contract [19].

Flow of Proposed System
The main aim of this proposed system is to maintain the Genuity of the product by helping the customer track the supply chain history of the product. System give customers the power to track the history of an entire product from manufacturer to customer using blockchain. This product anti-counterfeiting system based on Blockchain is composed of three roles, the Manufacturer role, the Seller role, and the Consumer role, as discussed and shown in figure 4.

Manufacturer:
Manufacturer logs into the manufacturer account and generates QR Code for Product and adds other required details of the product and by using his ethereum wallet, the manufacturer adds a block to Ethereum blockchain. The userid of our local database and the wallet address of the entity will be mapped together, if both the things are there, that is a manufacturer logs in from his own account and uses his own wallet then only the block will be added to the digital ledger.

Supplier:
Supplier logs into supplier account and scans the QR code on the product. The seller can access information about his products that the manufacturer has entered. It adds its own details of the product like shop destination and pushes it into the Blockchain. Those details can be viewed by the buyer.

Customer:
Customers can check the integrity of the product by scanning QR code which will list the history of transactions and thus verifying the genuinity of the product. At the time of customer purchasing the product after the QR scan in supply chain history, if the last location is not matched with the purchase location, the customer will know that the product is not genuine. It concludes that the QR code was copied and the customer becomes aware of counterfeiting. The process of detecting a counterfeit product by the customer while purchasing is shown in figure 5.

Result and Discussion
The proposed system allows both manufacturers and suppliers to interact with the system to add their respective block containing the transaction details to blockchain without modifying other's block. The contracts for the manufacturer and supplier block are written using solidity. Since the code is running on local network ganache have been used for local testing. The host"127.0.0.1", and port 7545 is configured in tru✏e-config.js file. The contracts are then compiled and deployed using tru✏e. Migrations files are created for deployment. Migrations are files that help us to deploy contracts on an ethereum blockchain network.
The interface is created using React. To allow interacting with ethereum blockchain Web3.js library is used which is used to perform actions like sending ether, confirming transactions reading and writing data from smart contracts. Metamask is installed on a browser which is a wallet to interact with ethereum blockchain, to allow accessing ethereum wallet through a browser. Accounts from ganache are imported into the metamask. To add supplier and manufacturer blocks they have to confirm the transactions using their account using metamask wallet which is connected using Web3.js.The end-user can then check the supply chain by scanning the QR code to check the product integrity.
Accounts can be categorized into manufacturer ,supplier and customer as shown in Figure 6. The manufacturer connects to his Ethereum account using the Metamask Wallet as shown in Figure 7.  The Manufacturer logs into his account using his credentials like username and password as seen in Figure 8. The credentials are stored in SQL server as shown in Figure 9. SQL database is used for storing manufacturer and supplier login details and their address. As shown in Figure 10, after logging into his account the manufacturer assigns unique serial number for the product and generates its QR Code. This QR code is placed on the product when it is transported to other places.Along with this the manufacturer fills other details of product like its name , current address that is the source and destination where it is currently headed.Once all the details are filled the manufacturer clicks add block button which is used to add all the filled details to blockchain. A metamask confirmation popup is displayed which asks for the confirmation as in Figure 11.  Once the product reaches the supplier destination , the supplied needs to login into his account shown in Figure  13 and connect his metamask wallet. Once done the supplies is presented with screen to fill in the required details of product.This time the supplier doesn't generate the QR code ,the supplier clicks on scan qr and scans the qr code.The supplier enters the required details for the product and clicks on add block as shown in Figure 14.The block gets added after the supplier confirms his transaction through the metamask wallet and logs out. Other supplier involved similarly log into their account and adds their respective blocks to the blockchain. After the product reaches the customer he can visit the customer page , scan the QR code as shown in Figure 15 and check the complete supply chain history of product. The supply chain history as shown in Figure 16 and Figure 17 shows various information of like the the product id , its name , source , destination address related to the entities involved , their ethereum account address , timestamp of when the block was added ,and any additional remarks if added.  At the time of customer purchasing the product after the QR scan in supply chain history, if the last location is not matched with the purchase location, the customer will know that the product is not genuine. It concludes that the QR code was copied and the customer becomes aware of counterfeiting.

Conclusion
Blockchain is a decentralized system, therefore the local suppliers cannot interfere with the checking or counterfeiting of the product in the proposed system. Manufacturers and Suppliers can use the system to store product details in Blockchain which o↵ers certain properties such as tamperresistance, data consistency and confidentiality that assure the security and privacy of the data on the network. The customer views the product supply chain history and verifies if the product is genuine. Customers can be sure about the integrity of goods they purchase. The proposed system can e↵ectively lower the rate of counterfeiting of branded goods and provide the companies with an easier approach to provide consumers with the confidence that they will not purchase counterfeit goods. This system will help to build trust and good bonding between manufacturer and customer and in deed it will help in improving economy and reducing corruption. Further system can be extended to avoid frauds done in banking, healthcare, voting system, online shopping and so on.