TRACEME

APRIL '20 - '21
TEAM SIZE: 4

A blockchain-based mobile application for easier and secure food supply chain management

ETHEREUM
FLASK
FLUTTER
SOLIDITY
FIGMA

INTRODUCTION

India is an agricultural country, being the second-largest producer in the world after China. It employs over 41.49% of the country and yet they don't see equitable profits. This is due to a corrupt, centralized, non-auditable system with the majority of the power resting with the middlemen.

The major phases of a food supply chain involve production, processing, transportation, distribution, retail, and consumption. There are various problems associated with this supply chain. In order to help solve these issues and proivde easier management, we propose a mobile application that utilizes a secure, blockchain-based system to ensure transparency and traceability of the food supply chain without the need for a central authority. Customers and authorities would additionally be entitled to view unmodified details like the owner, manufacturer and trace the entire product history they consume by scanning the QR code for the product.

Team Members: Anay Kulkarni, Anjum Khandeshi, Fatema Motiwala (myself), Nisarg Shah
For the first half of the project, every member played an active and equal role in every phase of the project. Collaboration and communication was the key. In our discussions, we would divide each phase of the project like literature review, design and development, etc. amongst ourselves strategically, so that each member would be involved and the tasks could be completed efficiently. For the second half, two of our members couldn't continue on the project further. I and my team-mate, Anay were responsible for the remaining development, addition of new features, their development, end-to-end testing of the entire app, preparing project reports and presentations and also, writing, presenting and publishing a research paper.

THE PROBLEM

The major phases of a food supply chain involve production, processing, transportation, distribution, retail, and consumption. There are various problems associated with this supply chain.

  • Difficult to find the point of failure in the case of sub-par end products
  • Growing importance of quality, transparency, and security for supply chain traceability systems by participating organizations and consumers
  • Systems are centralized and thus lack credibility due to the chance of tampering with the information
  • Inability of tracking waste food between phases
  • Need for trust between stakeholders often linked to their reputation
  • Corruption as suppliers at each stage increase the tax unfairly to pay for their self-demand

Based on the above problems, there is a need for a fully traceable and transparent supply chain to overcome food wastage, lack of profits, corruption, fraud prevention and provide complete traceability of a product and its history.

THE PROCESS

Our process of formulating the solution consisted of 4 stages

Composing the Problem Statement

Before directly delving into the ideation of the solution to the problem, we first began with a very crucial stage of design and development - Properly Developing the Problem Statement.

Once we had identified the problem and chosen it for our project, during discussions, we realized that we had a lot of inconsistencies between us team members ourselves. Everyone seemed to have a different perspective of the problem and issues that we wanted to solve. We realized that properly defining the problem statement would help us all identify the goals of our project and outline the scope of our project. It helped us get on the same page which made the further stages easier.

Conducting a Literature Review

We conducted a detailed literature review by studying various research papers that proposed blockchain-based solutions for this problem in order to understand their approach and methodically formulate our solution. Since our project spanned multiple aspects, we consolidated our research according to four criterias.

Dividing the survey into these helped us with optimizing our approach in each aspect. Additionally, we also looked at various smart contract implementations and approaches on the web. Conducting such research helped us understand our problem better, come across new features and issues, and design an optimized solution.

Designing and Developing the Solution

These two phases were iterative throughout the year. We decided on the initial set of use cases and system design architecture and began development. But as we proceeded, we kept noticing new features and better handling of use cases which took us back and forth between the design and development phases.

THE DESIGN
Identifying Features

We began the design by first defining the objectives and features of our system. Since it was iterative, these were added in different phases throughout the year.

  • Recording of product information: At the time of the creation of a product, additional information for the product can be entered and recorded on the blockchain. All owned products by a stakeholder are maintained on the system and help with the management.
  • Handling transactions: The transfer of products from one stakeholder to another can be recorded on the blockchain along with the transactional properties. With the consensus of both parties, the product will be transferred and ownership of the product will be changed.
  • Maintaining product transformations: As a food product transforms throughout the supply chain, from raw materials to processed foods, or when product batches are split and distributed, all these transformations will be maintained by the system.
  • Traceability: Anyone interested in knowing the history of the product they are buying, can trace the entire path of the product to its source.
  • Automatic fraud detection: According to the rules ensuring good product quality, if any product violates a rule, the problem will be detected by the system automatically and highlighted in the trace of the product.
  • Transparency: Before buying a product, the product trace can be viewed along with any detected problems, ensuring complete transparency to the stakeholders.
  • Rating and Ranking: After every transaction, stakeholders can rate the seller based on the transactional experience and quality of the product. This promotes better work practices. The ranking offers more opportunities for users, because even small-scale stakeholders, through good work practices and ratings can be noticed by more people now.

Identifying Users

We identified the different users of our application. For the food supply chain, the major stakeholders involved: Farmer, Transporter, Processor, Distributor, and Retailer. Additionally, Consumers were identified as major users for the app.

Based on these users, we mapped out the features for each.

Designing the Application

Once the features and users were identified, it was time to design our application. Since transactions between stakeholders are likely to happen on-site, we decided that a mobile application would be an easy-to-use and handy method to implement this food supply chain management system.

We first roughly sketched out the flow of UI in order to target the above features for stakeholders.

Sketching the flow enhanced our understanding of the application flow and helped us formulate it better. Next, we made a design prototype consisting of the different UI screens on Figma. Check out all the pages of our app on Figma here.

THE DEVELOPMENT
System Design Architecture

Our application architecture was a 3 layered structure consisting of the mobile app, backend - server, and blockchain. The mobile app was developed in Flutter, with a backend server running in Flask that communicates to the Smart Contract in Solidity on Ethereum Blockchain using the web3.py module.

Developed Prototype

Blockchain-side - Smart Contract
The smart contract was the crux of our whole implementation and is where all the important data and logic were being stored. It consisted of 3 main structures participant structure storing user information, a product structure storing product information, and a Trace Structure storing the transaction of products between users information. Along with these, we had multiple mappings and functions that stored the relationship between the various structures and held the logic of our system.

Server-side implementation - Rest API
The server, written in Flask, consisted of GET and POST methods to interact with the blockchain and return data to the frontend. The flask backend communicated with the blockchain smart contract using the Web3 module. Web3 provided a connection object that takes the address of the deployed contract and an ABI (Abstract Blockchain Interface, a list of all methods in the smart contract).

Client-side implementation - Mobile application features
The mobile app, written in Flutter, consisted of a front-end for all our proposed features. Each of the pages had associated functionalities, which made HTTPS calls to our server-side methods.

PUBLICATION

This project was developed as a part of my final year BE project. We also published a research paper named “Trace Me - Application Using Blockchain for Traceability & Transparency in Food Supply Chain” (DOI: 10.2139/ssrn.3862323) on Elsevier’s SSRN Digital library and presented it at the 4th International Conference of Advances in Science and Technology. The project was very well received by the judges and they were happy to see that we young students were leveraging novel technologies like blockchain to build solutions.

FUTURE SCOPE

To make it more robust and ready for the industry, several more modules for safety and reliability can be added. Verification of the stakeholders to make sure that only verified organizations can register to the application, some consensus mechanism or some way to check that the information added by the owner while adding a product is correct and true information and a module for auditing the product at every stage will help make the application more robust and safe. Additionally, the application can be customized according to specific policies and supply chain structures.