F2C Project Report Final
F2C Project Report Final
A project report submitted in partial fulfillment of the requirements for the degree of
Bachelor of Engineering
In
Computer Engineering
by
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.
ii
Approval Sheet
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.
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.
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.
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
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
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.
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.
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.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.
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.
6
CHAPTER 3: SYSTEM ANALYSIS
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.
9
3.4 Feasibility Study
Functional Requirements:
2. Profile Management:
- It should be possible for users to build and edit their profiles, including pertinent data
such preferences, certificates, and contact information.
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.
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.
Non-functional Requirements:
1. Security: Robust security measures to safeguard user data, transactions, and the
integrity of the blockchain, preventing unauthorized access and tampering.
4. Performance: The application should be optimized for fast response times, especially
during peak usage periods, ensuring a seamless experience for users.
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
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:
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.
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.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:
● 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:
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.
[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
[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.
28