0% found this document useful (0 votes)
81 views37 pages

F2C Project Report Final

This document proposes a blockchain-based farmer to consumer application to enhance transparency and build trust in the food supply chain. The system uses blockchain technology to capture data on agricultural goods movement from producers to customers. Farmers, distributors, retailers and consumers are assigned digital identities for accountability and traceability across the supply chain. Farmers benefit from fair trading and direct customer service. Customers can access trustworthy information about food origins.

Uploaded by

testshreyasbhat
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
81 views37 pages

F2C Project Report Final

This document proposes a blockchain-based farmer to consumer application to enhance transparency and build trust in the food supply chain. The system uses blockchain technology to capture data on agricultural goods movement from producers to customers. Farmers, distributors, retailers and consumers are assigned digital identities for accountability and traceability across the supply chain. Farmers benefit from fair trading and direct customer service. Customers can access trustworthy information about food origins.

Uploaded by

testshreyasbhat
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 37

Blockchain Based F2C Application

A project report submitted in partial fulfillment of the requirements for the degree of

Bachelor of Engineering
In
Computer Engineering

by

Shreyas Bhat (9181)


Naman Chouhan (9184)
Renvil Dsa (9191)
Saikiran Kasturi (9202)

Under the guidance of


Dr. Monica Khanore
(Assistant Professor)

DEPARTMENT OF COMPUTER ENGINEERING


Fr. Conceicao Rodrigues College of Engineering, Bandra (W), Mumbai -
400050
University of Mumbai (2023-24)

i
Internal Approval Sheet

CERTIFICATE
This is to certify that the project entitled "Blockchain Based F2C Application" is a bonafide
work of Shreyas Bhat (9181), Naman Chouhan (9184), Renvil Dsa (9191), and Saikiran
Kasturi (9202) submitted to the University of Mumbai in partial fulfillment of the requirement
for the award of the degree of bachelor’s in computer engineering.

Dr. Monica Khanore


(Supervisor/Guide)

Dr. Sujata Deshmukh Dr. Surendra S. Rathod


(Head of Department) (Principal)

ii
Approval Sheet

Project Report Approval

This project report entitled by Blockchain Based F2C Application by Shreyas


Bhat, Naman Chouhan, Renvil Dsa, Saikiran Kasturi is approved for the degree
of Bachelor of Engineering in Computer Engineering.

Examiner 1. ————————————–
Examiner 2. ————————————–

Date:
Place:

iii
Declaration

We declare that this written submission represents our ideas in our own words and where others’
ideas or words have been included, we have adequately cited and referenced the original sources.
We also declare that we have adhered to all principles of academic honesty and integrity and have
not misrepresented or fabricated or falsified any idea/data/fact/source in my submission. We
understand that any violation of the above will cause disciplinary action by the Institute and can
also evoke penal action from the sources which have thus not been properly cited or from whom
proper permission has not been taken when needed.

Shreyas Bhat (9181)


Naman Chouhan (9184)
Renvil Dsa (9191).

Saikiran Kasturi (9202)

Date:

iv
ABSTRACT

A variety of issues, including food theft, contamination, and misleading labelling, have
put the transparency and integrity of food supply chains under scrutiny recently. This study
proposes a blockchain-based Farmer to Consumer application that leverages the inherent
properties of blockchain technology to enhance transparency and build trust in the food supply
chain to get around these challenges.

The system uses a decentralized, immutable blockchain ledger to capture and preserve
important data on the movement of agricultural goods from producers to end customers. Farmers,
distributors, processors, retailers, and consumers are all assigned unique digital identities to
guarantee accountability and traceability across the supply chain.

Farmers gain from the software as it facilitates fair trading and one-on-one customer
service. Distributors and retailers benefit from efficiency and loyalty. Customers may acquire
trustworthy information that guarantees their security and encourages moral farming.

Keywords: Decentralized, transparent, traceable, smart contracts, agricultural supply chain,


direct-to-consumer, blockchain-powered, sustainable farming.

v
Acknowledgments

We take great pleasure in presenting the report on "Blockchain Based F2C Application". We
take this opportunity to express our sincere thanks towards the guide Dr. Monica Khanore,
C.R.C.E, Bandra (W), Mumbai, for providing the technical guidelines, and the suggestions
regarding the line of this work. We enjoyed discussing the work progress with her during our
visits to the department.
We thank Dr. Sujata Deshmukh, Head of the Computer Engineering department, Principal, and
the management of C.R.C.E., Mumbai for encouragement and providing necessary infrastructure
for pursuing the project.
We also thank all non-teaching staff for their valuable support in completing our project.

Shreyas Bhat (9181)

Naman Chouhan (9184)

Renvil Dsa (9191)

Saikiran Kasturi (9202)

Date:

vi
TABLE OF CONTENTS

ABSTRACT v
ACKNOWLEDGEMENT vi
TABLE OF CONTENTS vii-viii
LIST OF FIGURES ix

1. Introduction 1-4
1.1 Aim 2
1.2 Problem Statement 2
1.3 Motivation 2
1.4 Application 2
1.5 Advantages 3
1.6 Tools and Technology 4

2. Literature Survey 5-6


2.1 Related Work 5

3. System Analysis 7-12


3.1 Hardware and Software Requirements 7
3.2 Existing Systems 7
3.3 Proposed System 8-9
3.4 Feasibility Study 10
3.5 Functional and Non-Functional Requirements 10-12

4. Design and Analysis 13-20


4.1 System Design 13-18
4.1.1 Flow Diagram 13-15
4.1.2 Product Perspective 16-17
4.1.3 Design Process 17
4.1.4 Design Strategies 18

vii
4.2 System Architecture 19-20

5. Implementation 21-24
5.1 Snapshots 22-24

CONCLUSION 25-26
REFERENCES 27-28

viii
LIST OF FIGURES

Figure Description Page


No. No.

3.3.1 Block Diagram 8

4.1.1 Flow Diagram of System 13

4.1.2.1 UML Diagram 16

4.2.1 Architectural Flow Diagram 19

ix
Chapter 1: INTRODUCTION

The typical route from farmer to consumer in modern agriculture and food distribution is
frequently marked by a complex web of middlemen, which can result in inefficiencies, a lack of
transparency, and possible problems with traceability and quality assurance. Notwithstanding
these difficulties, the application of blockchain technology has altered the landscape by providing
a ground-breaking means of streamlining and improving the supply chain overall.

Using a blockchain-based farmer-to-consumer application that leverages the transparent


and decentralized aspects of blockchain technology is a novel approach to directly connect farmers
and end customers. Distributed ledger technology, or blockchain, essentially makes it possible to
record transactions via a computer network in a transparent, safe, and unchangeable way. As a
result, a revolutionary system that improves transparency, trust, and traceability across the whole
food production and distribution process inside the boundaries of the agricultural supply chain is
developed.

Farmers may simply document and verify every phase of their farming and harvesting
processes on a decentralized platform by using the application. Every step of gardening, including
planting, watering, and adding fertilizer and pesticides, is securely recorded on the blockchain,
creating an unchangeable and irrevocable record. This ensures that consumers receive reliable and
accurate information about the product's origin, cultivation practices, and overall quality before
making a purchase. Smart contracts further streamline the process by automating and enforcing
agreements between parties. The terms of the agreement are codified, making them self-executing
contracts.

Customers can now view their food's journey from the farm to their plate with never-
before-seen insight thanks to this program. By scanning a QR code or accessing the blockchain-
based portal, customers may obtain a wealth of information on the product they are purchasing,
such as its origin, growing practices, transit details, and any certifications it may have earned.

A fundamental transformation in the agriculture business is represented by the farmer-to-


consumer application built on Blockchain, which promotes a more efficient, transparent, and
direct communication between those who grow our food and those who consume it. The
agricultural supply chain might greatly benefit from blockchain technology, especially with the
1
ongoing emphasis on food safety, sustainability, and ethical sourcing.

1.1 Aim
The aim of the blockchain-based Farmer to Consumer application is to use blockchain
technology to improve the food supply chain's transparency, responsibility, and
trustworthiness.

1.2 Problem statement


Our goal is to create a user-friendly application using blockchain for seamless interactions
between farmers and consumers. This platform will allow farmers to present their products
directly to consumers, ensuring transparency and fair compensation. By bypassing
middlemen, we aim to streamline transactions, promote agricultural sustainability, and
improve trust in the food supply chain.

1.3 Motivation
The motivation for a blockchain-based Farmer to Consumer application is to assist in
resolving issues with transparency and trust in the food supply chain. The effort aims to
create a transparent and responsible system that offers customers trustworthy information
on agricultural commodities by utilizing blockchain technology. In addition to promoting
fair trade, ensuring food safety, cutting inefficiencies, and assisting sustainable agricultural
methods, the project aims to optimize supply chain operations.

1.4 Applications
The farmer-to-consumer blockchain program is revolutionizing agriculture by enabling
transparent and traceable transactions. It helps consumers make informed food choices by
giving farmers a platform to showcase their practices. Smart contracts are cost-effective for
both parties because they eliminate the need for middlemen. This technology increases food
safety by providing real-time information on product origins. It satisfies the need for ethical
food procurement by creating a direct and transparent link between farmers and consumers.

2
1.5 Advantages
1. Transparency and Traceability: Blockchain provides clients with detailed information
about the origin, agricultural practices, and transportation of their food by ensuring an open
and verifiable record at every level of the food supply chain.

2. Reduced Intermediaries: Through the scheme, farmers and buyers may communicate
directly, eliminating the need for middlemen. Customers may now buy fresher commodities
at competitive prices, while farmers' profit margins increase because of cheaper costs.

3. Smart Contracts for Efficiency: Smart contracts streamline processes and reduce the
likelihood of disputes by automating and upholding agreements between farmers and
customers. This automation boosts output, saves time, and ensures that everyone abides by
the agreements made.

4. Enhanced Food Safety: Making decisions is easier for customers who have instant
access to a wealth of information about how food goods should be handled and prepared.
This improves food safety by giving consumers the ability to verify the authenticity and
quality of the products they purchase.

5. Decentralized and Secure Data: Blockchain protects against fraud and manipulation by
storing data decentralized among a network of computers. This improves the integrity and
confidentiality of the information on agricultural practices, certifications, and product
specifications.

6. Ethical and Sustainable Sourcing: The program encourages ethical and


environmentally friendly shopping by letting users select items based on the farming
methods they find appealing. This promotes farming practices that are considerate to society
and the environment.

3
1.6 Tools and Technology
● Blockchain Technology:
Ethereum: These are well-known blockchains that are appropriate for smart
contracts and decentralized applications (DApps).
● Smart Contract Development:
Solidity: An Ethereum smart contract creation programming language.
● Web Development:
1. HTML, CSS, and JavaScript are the three essential front-end development
technologies.
2. User interfaces that are dynamic and responsive are made using front-end
frameworks such as React, Angular, or Vue.js.
3. Node.js: A JavaScript runtime for server-side development.
4. Express: A web application framework for Node.js.
● Database:
Conventional databases for storing non-blockchain data are MongoDB or MySQL.
● APIs:
Web3.js is a JavaScript framework that facilitates communication between
Ethereum smart contracts and the blockchain.
● Testing and Debugging:
1. Remix IDE - An online IDE for smart contract development and
debugging.
2. Truffle - A development framework for Ethereum that simplifies testing.

4
CHAPTER 2: LITERATURE SURVEY

In the past, a lot of researchers have researched the field of Application of Blockchain in
Agriculture and about how to connect local farmers to the consumers. Here is what we have
presented after conducting a literature review of those research papers.

2.1 Related work


In [1], Andreas Kamilaris et al found that blockchain enables traceability, allowing
parties in the supply chain to trace the origin of products. Cooperatives can improve the
ownership of small and medium-sized farmers, using blockchain to efficiently resolve
disputes. Smart contracts streamline agreements between distributors and farmers, thereby
optimizing transactions in the agricultural sector.
In [2], Krithika L.B et al found that the decentralized nature of Blockchain offers
benefits including reduced costs and increased productivity. It eliminates middlemen,
ensuring fast and fair payments for various business activities. These qualities make
blockchain a promising solution for improving the efficiency and fairness of transactions.
In [3], Bhusal, Chandra Sekhar et al found that by solving difficulties with price
manipulation, agriproduct fraud, traceability, and poor customer confidence, blockchain
technology has the potential to transform the agriculture sector. Blockchain technology may
make future agri-foods systems better, safer, better, and more sustainable. Blockchain
technology has the potential to completely transform the agriculture industry, even though
it is still in its infancy and has many drawbacks, such as implementation costs, privacy
concerns, security concerns, scalability issues, performance issues, and immaturity. The
middlemen are removed, and timely and equitable payment is guaranteed.
In [4], Mohammad Hossein Ronaghi found that Blockchain technology is a
disruptive technology that is changing business and supply chain models. Thanks to a
distributed software architecture and advanced computing, blockchain can change the way
information is exchanged between actors in the chain. Blockchain technology provides a
platform to solve the problem of tracking product information in supply chain management.
In [5], Weijun Lin et al found that blockchain architecture builds a safe ledger with
decentralized management by utilizing several crucial techniques, such as hash, asymmetric
cryptography, digital signatures, Merkle trees, and consensus. Each block is made up of a
block header and block content. In addition to the Merkle tree root hash, the block header
now contains the timestamp, block version, and preceding block hash value. The block body
5
contains the actual contents, which are either transaction records or protected data.
Shipra Rani Sharkar et al, in [6], focuses on the development of Agrochain,
leveraging blockchain to improve supply chain management for farmers. It highlights
farmers’ unique challenges in the supply chain and introduces blockchain as a solution to
trust and information issues. Agrochain aims to address these challenges by implementing
blockchain technology in agricultural transactions.
After an in-depth review of the challenges posed by agricultural supply chains and
the potential of blockchain technology, our team decided to develop an application aimed
at bridging the gap between farmers and consumers. By implementing this solution, we seek
to empower farmers, ensure fair remuneration, and provide consumers with access to high-
quality products while fostering trust and accountability throughout the supply chain.

6
CHAPTER 3: SYSTEM ANALYSIS

3.1 Hardware and Software Requirements

Processor Intel core i5(7th Generation) or higher


RAM 8GB or higher
Memory Minimum of 10 GB
Display Any display of viewable size

3.2 Existing Systems


The agriculture supply chain has fundamentally changed because of the rise in popularity
of several blockchain-based farmer-to-consumer applications. Blockchain technology is used by
platforms such as "IBM Food Trust" to track food goods from farm to shelf, hence improving
transparency. "Provenance" gives customers a wealth of knowledge about the ethical standards
and place of origin of the products they buy. "AgriDigital" focuses on supply chain management
and transaction optimization for agricultural products with blockchain technology. Furthermore,
programs like "Farm2Kitchen" and "OriginTrail" provide consumers with direct knowledge about
the source and production processes of the food they purchase, with the goal of promoting
sustainability and customer confidence.

Limitations
● Absence of uniform data formats in the agriculture sector might potentially hinder the
smooth integration and interoperability of blockchain networks.
● In regions with inadequate internet connectivity and technological infrastructure,
accessing and utilizing blockchain applications may be challenging for both farmers and
consumers.
● Smaller farmers might not be able to afford the training and infrastructure needed to
utilize blockchain technology, which might lead to uneven adoption throughout the
agricultural sector.
● Finding a balance between openness and privacy may be difficult as consumers may be
concerned about data security and ownership in a blockchain system, while farmers may
be reluctant to provide sensitive information.
3.3 Proposed system

7
Fig3.3.1: Block diagram of the Proposed System

● The web application features a user-friendly homepage with buttons representing key
stages in the supply chain: Farmer, Quality Testing, Consumer, and Payment.

● The farmer clicks on the "Farmer" button, accessing a form where they input details about
the crop they want to sell. This includes information such as crop type, quantity, cultivation
methods, and any certifications.

● After submitting the details, the information is stored on the blockchain. The Quality
Testing button is then clicked to initiate the physical testing phase. Quality testers conduct
physical examinations of the crop, assessing factors like freshness, quality, and adherence
to standards.

● In the Quality Testing section, the tester adds details about the approval status of the crop.
This information, along with any test results, is recorded on the blockchain, ensuring an
immutable and transparent record.

8
● Once the crop receives approval, it is marked as ready for sale. This status update is
recorded on the blockchain, providing an unalterable record of the crop's quality and
approval.

● Consumers interested in purchasing the crop click on the "Consumer" button. They are
directed to a form where they input their details, preferences, and any specific
requirements for the crop they intend to buy.

● The consumer's input is recorded on the blockchain, creating a transparent and accessible
ledger of consumer preferences and demands. This information can be utilized to improve
future farming practices and align production with consumer needs.

● After selecting the desired crop, consumers click on the "Payment" button to complete the
transaction. The payment process is executed through secure blockchain-based
transactions, ensuring transparency, and reducing the risk of fraud.

● Once the payment is successfully processed, a confirmation of the transaction is recorded


on the blockchain. This step ensures an auditable and tamper-proof history of the entire
transaction, from crop cultivation to consumer purchase.

9
3.4 Feasibility Study

Developing a blockchain application for Farmer-to-Consumer (F2C) seems like a


reasonable and workable way to address the problems with the conventional agricultural supply
chain. First off, there is a strong argument for the use of blockchain technology due to its
traceability and transparency aspects. Stakeholders, including farmers, quality testers, and
consumers, may access precise and up-to-date information on the production and supply of
agricultural commodities by logging every transaction and quality test result on an irreversible
ledger. In addition to easing customer concerns about food safety and authenticity, this
transparency promotes a more trustworthy and direct connection between producers and final
consumers.
Additionally, by cutting out intermediaries, the blockchain-based F2C application
increases the system's economic feasibility. Farmers may see increased profit margins by dealing
directly with consumers and eliminating the need for several middlemen in the supply chain. The
process is further streamlined by using smart contracts, which automate agreements and lessen
the likelihood of conflicts. Because of its effectiveness in reducing overall expenses and saving
time, both large- and small-scale farmers may afford the system.

3.5 Functional and non-functional requirements

Functional Requirements:

1. User Registration and Authentication:


- Users should be able to safely register and validate their identities on the site as
farmers, quality testers, and customers.

2. Profile Management:
- It should be possible for users to build and edit their profiles, including pertinent data
such preferences, certificates, and contact information.

3. Crop Listing by Farmers:


- The capacity to enter information about the crops they wish to sell, such as crop kind,
amount, production techniques, and any certifications, is a necessity for farmers.

10
4. Quality Testing Input:
- Quality testers should have a specific interface to record information about the
physical testing of crops, including permit status, test results, and other relevant data.

5. Transparent Transaction History:


- Every transaction, including crop listings, quality test results, and consumer
purchases, should have an unalterable, transparent record preserved on the blockchain.

6. Consumer Input Form:


- Customers should be able to input their requirements and preferences while
purchasing and searching for crops. This data ought to be stored on the blockchain.

7. Payment Processing:
- To execute payments in a transparent and secure manner and guarantee reliable and
unchangeable financial transactions, the application must use blockchain technology.

8. Smart Contracts:
- Implementation of smart contracts to automate and enforce agreements between
farmers, quality testers, and consumers, streamlining the entire process.

9. Notification System:
- A notification system to alert users about the status of their transactions, quality
testing results, and other relevant updates.

10. Data Analytics Dashboard:


- An analytics dashboard for farmers and quality testers to gain insights into market
trends, consumer preferences, and overall system performance.

Non-functional Requirements:

1. Security: Robust security measures to safeguard user data, transactions, and the
integrity of the blockchain, preventing unauthorized access and tampering.

2. Scalability: The system should be designed to handle a growing number of users,


transactions, and data entries without compromising performance or responsiveness.
11
3. Usability: An intuitive and user-friendly interface to ensure that farmers, quality
testers, and consumers can easily navigate the application and perform their tasks
efficiently.

4. Performance: The application should be optimized for fast response times, especially
during peak usage periods, ensuring a seamless experience for users.

5. Interoperability: Compatibility with existing agricultural systems, databases, and


technologies to facilitate smooth integration and data exchange.

6. Reliability: High availability and reliability of the platform to minimize downtime


and ensure continuous access for users.

7. Compliance: Adherence to relevant regulations and standards in the agricultural and


financial sectors to ensure legal compliance and user trust.

8. Auditability: The ability to audit and trace every action on the blockchain for
accountability and compliance purposes.

9. Data Privacy: Strict adherence to data privacy regulations, ensuring that user
information is handled securely and ethically.

10. Backup and Recovery: Regular data backups and a robust recovery mechanism to
protect against data loss or system failures.

12
CHAPTER 4: DESIGN AND ANALYSIS

4.1 System Design:

Fig 4.1.1: Flow diagram of system

A simplified flowchart (Figure 4.1.1) illustrates the interaction between farmers and
consumers on a blockchain platform. The process commences with the initialization of the
blockchain, a secure and distributed ledger for recording transactions. Farmers then enter
data pertaining to their produce, triggering the execution of a smart contract. Smart
contracts are self-executing programs residing on the blockchain that automate pre-defined
agreements between involved parties. In this scenario, the smart contract likely facilitates
the exchange of goods between farmers and consumers. Upon execution, consumers gain
access to the farmers' data, potentially enabling them to initiate a purchase. This flowchart
effectively captures the streamlined nature of this process, where farmers and consumers
connect directly through a blockchain-powered smart contract, fostering trust and
transparency in the agricultural supply chain.

13
System design is the process of deciding on a system's components, interfaces,
architecture, and data to satisfy predefined standards. A thorough explanation of the design
functions and procedures, including screen layouts and business rules, is given in this part.
The result of this stage will define the new system as a collection of modules or subsystems.
A design strategy guarantees consistency in the work and helps to achieve deadlines on time.
The authorized requirements document contains the first piece of data that was used
throughout the design phase. For every need, a collection of one or more design elements will
be developed that offer a thorough explanation of the anticipated software capabilities. There
are often diagrams with pseudo code, entity connection diagrams that show the database
structure in detail, business rule tables, screen layout diagrams, functional hierarchy diagrams,
and business process diagrams. "Systems design" implies a methodical approach to system
design. Whichever way is used—bottom-up or top-down—the process is systematic. whereby
it considers each relevant system variable that must be produced.

Design begins with requirements model. The team works to transform this model into
four level of design detail, and they are,
● The data structure.
● The system architecture
● The interface representation
● The component level detail

The information domain model developed during analysis is transformed into the data
structure needed for implementation through data design. The basis for the data design activity
is provided by the entity relationship diagram's accurate depictions of the data content as well
as the data objects and connections it depicts. The design of the software architecture may
incorporate elements of data design.
One term that best describes the significance of software design is quality. It is possible
to evaluate the caliber of software representations created from designs. Design is an iterative

14
process that turns the requirements into a "blueprint" for the software's creation. Because of
the design's high degree of abstraction, in addition to the specific System objective, it can be
immediately related to more specific details, functional requirements, and behavioral
expectations. Three criteria make up the framework used to assess what makes a successful
design. Each of these characteristics is a goal of the design process. They are:

● The design must fulfill all the analysis model's stated criteria in addition to the intended
implicit requirements.
● The design must be clear and legible for the purposes of testing, development, and
eventually software maintenance.
● The design must give a clear image of how the functional, behavioral, and data domains
are handled from the standpoint of implementation.

The Software design includes different design materials. The designs are Architectural,
Workflow, Use case, Activity, Sequence, Database, Form Design.

15
4.1.2. Product perspective:

Fig 4.1.2.1: UML Diagram

A Unified Modeling Language or UML is a standardized visual modeling language used


in software engineering. It allows you to visualize the design of a system through various
diagrams. UML diagrams include structural diagrams (such as class diagrams) and behavioral
diagrams (such as sequence diagrams). UML facilitates communication between stakeholders
and helps understand, design and document software systems.

Our project leverages a streamlined user interaction flow facilitated by smart contracts
on a blockchain platform (Figure 4.1.2.1). This process commences with user actions, such as
farmers entering crop details or consumers specifying their preferences. This data entry triggers
the execution of a pre-programmed smart contract. Smart contracts are self-executing programs
stored on the blockchain that automate pre-defined rules governing interactions between farmers
and consumers within our project.

The execution of the smart contract, potentially coupled with additional quality control
measures, determines whether the system grants or denies user access to specific functionalities.
If a transaction ensues, the platform securely processes the payment through an integrated
16
payment gateway. Following a successful transaction, the system automatically records the
status for future reference. Finally, the system updates itself with the outcome of the user
interaction, reflecting changes in user status, product information, or any other relevant data
points specific to our project's functionalities.

This framework fosters secure and transparent interactions between farmers and consumers.
Smart contracts automate key aspects of the process, ensuring adherence to pre-defined rules,
while the blockchain guarantees tamper-proof data storage.

4.1.3. Design Process:

During the design phase, several system models at different levels of abstraction are
produced. When the design is dissected, mistakes and omissions from earlier stages are
discovered. And their feedback helps in earlier design models to be improved. ne various
design activities are:

4.1.3.1. Architectural design: The systems' subsystems are enumerated and


documented, as are their interconnections.

4.1.3.2. Abstract Specification: An abstract specification of the tasks each subsystem


completes and the constraints it faces is provided.

4.1.3.3. Interface Design: All subsystem's relationships with other subsystems are
specified and recorded. This interface design must be obvious since it allows the
subsystem to be used without the user needing to comprehend how it works.
4.1.3.4. Component Design: Services are provided to various components, and interfaces
are made between them.

4.1.3.5. Algorithm Design: The algorithms provide services with detailed designs and
needs that match.

17
4.1.4. Design Strategies
The two design strategies are:
4.1.4.1. Functional Design: The system starts off with a high-level, practical design that
develops into a more intricate configuration over time. The functions that interact
with the system share and consolidate its state.

4.1.4.2. Module Design: The system is viewed as a collection of modules rather than
functions. The different modules are later integrated together into a single unit.

18
4.2. System Architecture:

Fig 4.2.1: Architectural flow diagram

The application architecture is divided into two parts:


1. Application Interface (Farmer to Consumer)
2. Smart Contract

Farmer to Consumer interface:


The application provides entities like the Farmer, Quality Tester, and the Consumer with
a readable and user-friendly interface. Each part of the interface requires data to be fed to a form
structure about relevant information about the crop that needs to be sold, tested, or bought
respectively.

● Farmer: The farmer must feed the details of the crop such as his basic data, quantity
of crop and the price point for the same. The values are then sent to the remote
blockchain network and stored as a block.

● Quality Tester: After the farmer feeds data about the crops, the testing of the crops

19
is done physically. The tests done are subjective and depend on the Quality tester/s.
Once done, the tester/s feed the results of the test and grade the crop as A, B or C.

A – Excellent quality
B – Mediocre quality
C – Poor quality

● Consumer: The consumer when wants to buy a crop or crops will go the interface
and fetch details of the available crop options with variable price values. The
Consumer then selects the crop that he/she finds cheaper and buys through a
“Payments” page.

Each of these entities transact or work in the blockchain network, even though it appears
as if it’s a simple application. Hence each entity is identified with a hashed address on the
Ethereum network. Since the identity is completely encapsulated by hashing, there is less to no
chance of manipulation and hence transactions are safe.

Smart Contract:
A smart contract is an autonomous agreement whose terms are expressly encoded into
computer code. It is powered by distributed ledger technology, or blockchain technology, which
allows peer-to-peer transactions to be safe and transparent without the need for middlemen.
Smart contracts also act as intermediate codes that facilitate communication between off-
chain applications and the blockchain network. The smart contracts used in this project is tasked
with storage and migration of data, i.e. storing crop and quality testing data and fetching crop data
for buying crops.

20
CHAPTER 5: IMPLEMENTATION
Based on the various papers reviewed and surveyed. We implemented the F2C application as
a web application. We used React and Node.js to develop the interface and middleware. We
also made use of the Ethereum network to store transactions as blocks and connected it with
the frontend using web3.js.
With respect to a few actors (i.e. farmer, consumer, and quality tester), we tested a few
scenarios with their corresponding expected outputs, which are given below:

Testing Scene or Input Expected output Actual output Result

Application is Application should Application is Pass


running properly run properly running properly
Feed Values into the Should accept values Accepted values and Pass
Farmer side redirected to Quality
testing
Feed farmer id to Display details Successfully displayed Pass
Quality testing pertaining to the id details

Show Quality test form Redirect to Approval Successfully Pass


page page Redirected
On clicking “Approve
Details”
Display tested crop data Display details Successfully Pass
on Consumer page displayed

21
After all the testing and execution mentioned above, we came up with the following output:

Initially the farmers must enter details about the crop. In the Farmer Page, we add the values that
can be seen above. The values added pertain to the crop he/she wants to add to the blockchain
network.

Then comes the Quality testing part, which is physically done. Here, the tester later checks
whether the crop exists in the system or not.

22
Upon confirming the block’s existence, the testing is done and then details about quality of the
crop, testing date and expiration date are fed to the blockchain network through a form-like
structure.

Now the consumer if wants to buy a crop, he/she will check its authenticity by adding the crop id
and testing id. If the quality details exist, then it means that the crop is authentic and safe to
consume.

23
This part involves making payments to the farmer and buying the crop.

24
CONCLUSION
A blockchain-based farmer-to-consumer application transforms the agricultural supply
chain, ensuring transparency and trust. The decentralized ledger enables traceability of produce,
fostering consumer confidence in the origin and quality of products. Smart contracts automate
agreements, reducing costs and facilitating fair revenue distribution for farmers. Cryptocurrency
transactions enhance financial inclusion for those with limited access to traditional banking. The
system's decentralized nature improves supply chain resilience during crises. Challenges include
scalability, regulatory considerations, and the need for user education. Despite hurdles, the
potential benefits include increased sustainability, fair compensation for farmers, and heightened
consumer trust in the food supply. The application streamlines buying and selling processes,
eliminating intermediaries. Farmers can showcase their products on a platform emphasizing
sustainability and ethical practices. The technology's tamper-proof nature enhances security in
agreements. Blockchain's adoption can bring about positive transformation in agriculture.
Ongoing efforts are required to address challenges and realize the widespread success of these
applications.
LIMITATIONS
Limitations of a blockchain-based farmer-consumer application include scalability
challenges due to the potential for high transaction volumes, as well as concerns regarding
energy consumption associated with blockchain networks. Additionally, ensuring widespread
adoption and usability for farmers and consumers who may not be familiar with blockchain
technology is a challenge. Additionally, reliance on internet connectivity in rural areas where
agricultural activities often take place can hamper accessibility and real-time updates. Finally,
while blockchain improves transparency and trust, it does not in itself guarantee the quality or
safety of agricultural products, which may require additional control mechanisms.

25
FUTURE SCOPE AND PLAN
The future scope for a blockchain-based farmer-to-consumer application is exceptionally
promising, revolutionizing the agricultural supply chain. This innovative platform ensures
transparency, traceability, and efficiency by recording every transaction and movement of
agricultural products on an immutable blockchain. Smart contracts can automate processes,
facilitating direct and fair transactions between farmers and consumers, cutting out middlemen
and reducing costs. Through decentralized ledgers, consumers gain real-time access to the origin
and quality of the produce, fostering trust. Furthermore, the application can integrate IoT devices
for real-time monitoring of crops, ensuring optimal conditions and minimizing waste.
We are still working on this project and wish to introduce it as a mobile application and
make it more user friendly.

26
REFERENCES

[1] Andreas Kamilaris, Agusti Fonts and Francesc X. Prenafeta-Boldύ “The rise of
blockchain technology in agriculture and food supply chains”. DOI :
10.1016/j.tifs.2019.07.034.

[2] Krithika L.B. “Survey on the Application of Blockchain in Agriculture” Published:


29 August 2022 DOI : 10.3390/agriculture12091333.

[3] Bhusal, Chandra Sekhar, “Blockchain Technology in Agriculture: A Case Study of


Blockchain Start-Up Companies (October 2021). International Journal of
Computer Science & Information Technology (IJCSIT) Vol 13, No 5”, October
2021, Available at SSRN: https://ssrn.com/abstract=3960631.

[4] Mohammad Hossein Ronaghi “A BlockChain Maturity model in the agricultural


supply chain”DOI : 10.1016/j.inpa.2020.10.004.

[5] Weijun Lin1, Xinghong Huang1, Hui Fang 2, Victoria Wang3, Yining Hua2,
Jingjie Wang1, Haining Yin4, Dewei Yi5, (Member, IEEE), AND Laihung Yau6
“Blockchain Technology in Current Agricultural systems: From Techniques to
Applications”
https://ieeexplore.ieee.org/stamp/stamp.jsp?tp=&arnumber=9159588

[6] Sm Al-Amin1, Shipra Rani Sharkar2, M.Shamim Kaiser3 and Milon


Biswas.”Towards a Blockchain-Based Supply Chain Management for E-Agro
Business System” https://www.researchgate.net/publication/347416277

[7] Kevin Gordillo Orjuela, Paulo Alonso Gaona-García & Carlos Enrique
Montenegro Marin (2021)Towards an agriculture solution for product supply chain
using blockchain: case study Agro-chain with BigchainDB, Acta Agriculturae
Scandinavica, Section B — Soil & Plant Science, 71:1, 1-16, DOI:
10.1080/09064710.2020.1840618

27
[8] K. Demestichas, N. Peppes, T. Alexakis, and E. Adamopoulou, “Blockchain in
Agriculture Traceability Systems: A Review,” Applied Sciences, vol. 10, no. 12, p.
4113, Jun. 2020, DOI: 10.3390/app10124113.

[9] Bermeo-Almeida, O., Cardenas-Rodriguez, M., Samaniego-Cobo, T., Ferruzola-


Gómez, E., Cabezas-Cabezas, R., Bazán-Vera, W. (2018). Blockchain in
Agriculture: A Systematic Literature Review. In: Valencia-García, R., Alcaraz-
Mármol, G., Del Cioppo-Morstadt, J., Vera-Lucio, N., Bucaram-Leverone, M.
(eds) Technologies and Innovation. CITI 2018. Communications in Computer and
Information Science, vol 883. Springer, Cham. DOI : 10.1007/978-3-030-00940-
3_4

28

You might also like