Professional Documents
Culture Documents
10.1007@978 981 13 8775 311 PDF
10.1007@978 981 13 8775 311 PDF
10.1007@978 981 13 8775 311 PDF
Abstract Blockchains play a vital role in FARMAR to track and trace the origin of
food products in food supply chain. Supply Chain Management (SCM) is an essential
business process in all spheres of the economy. SCM uses specific processes to con-
nect from producer to consumer requirement through a chain. In a BCT(Blockchain
Technology) based system, “records are immutable and trusted, eliminating the need
for third parties to be involved. Potential farmer-facing impacts include ensuring that
farmers receive timely and complete payments through the use of smart contracts and
helping farmers to capture real-time data to more effectively manage their crops and
harvests (source: nextbillion.net)”. Another benefit of using BCT in FARMAR is
security where hacking or tampering the existing data is impossible by any interme-
diary. As an add-on to this process, IoT devices (Mobile phone-based Android app)
are used to update the real-time quality and transit time of the product in FARMAR.
It is integrated for improved traceability and usability of the products in the supply
chain. The FARMAR aims to achieve these goals by developing a web application
where FARMAR creates a value chain of integrity from farm to fork by using BCT.
Agriculture plays a vital role where it accounts an 18% of India’s Gross Domestic
Product, as well as, it accounts for employment to 50% of the countries workforce.
India is the world’s largest producer of pulses, rice, wheat, spices, and spice prod-
ucts. From the producer (farmer) down to the consumer, the agricultural supply chain
in India is plagued by inefficient intermediaries. Information regarding prices, sup-
plies, and stocks are asymmetrically distributed among the middle man farmer and
consumer. Though the improvement of this said problem has been addressed by the
various planning and management techniques like Material Requirement Planning,
Enterprise Resource Planning, and Advanced Supply Chain Planning and Optimiza-
tion, there still exists a lack of Transparency, Trust, and Centralized authority [1].
To address the above issue, we proposed a novel project for Supply Chain Man-
agement in Agriculture using Blockchain called FARMAR (FARMer And Rely).
FARMAR embeds Blockchain Technology (BCT), which has emerged in recent
years and it plays a key role in the agricultural supply chain management to resolve
this problem. Blockchain is a decentralized Distributed Ledger Technology (DLT)
which is used to store data of a supply chain, which in turn cannot be tampered
with. Each block has a hash and pre-hash Signature Value linking them together. The
transactions are administered in a distributed system in fully decentralized servers.
Once the data in the block is entered/committed, it cannot be altered. All the data is
cryptographically secure.
The blockchain is a new approach to data storage and transmission that has great
potential for agriculture, both for agribusiness and consumers. It is undoubtedly
attractive, combining cryptography to guarantee the integrity and permanence of data,
a peer-to-peer architecture that avoids centralizing intermediaries, and principles
of collective governance where each player can access transactions and guarantee
their legitimacy. As such, the blockchain promises increased trust, transparency, and
fluidity of transactions within multi-stakeholder systems [2].
Features of Blockchain Technology
BigchainDB doesn’t enhance, rather, it builds upon blockchain technology. It adds
blockchain characteristics like decentralized control, immutability, and the transfer
of digital assets by starting with a big data distributed database.
• Decentralization: It means there is no single point of control and failure. A fed-
eration of voting nodes constitute a P2P network and works through decentralized
control.
Supply Chain Management in Agriculture Using Blockchain and IoT 229
Traditional databases are MySQL, MongoDB, and Postgre. CRUD operations can
be done in these databases [3, 4]; it means anybody can edit, copy, remove, delete,
or update the documents and hence, the security is breached. Whereas, blockchain is
a secured database where you can’t do any CRUD operations. It means nobody can
edit, delete, or tamper data and the transactions are secured. Traditional databases are
centralized in a central server but blockchain database is decentralized throughout
many servers.
Asset Databases
Assets are the goods, which will be digitally stored in the blockchain database. Every
asset will have its digital twin with a public key and private key. These digitally stored
assets will be secured. All the assets will be tracked using the public key. The assets
can be anything. tomatoes, mangoes, milk products, etc.
The assets will be stored in the blockchain database in asset collection and perfect
chain of that asset alongside transaction will be maintained. When consumers will
scan the QR code using the mobile application, all the transactions of the asset will be
retrieved with perfect data analytics on the asset from asset collection in blockchain
database.
The security of assets is guaranteed by the use of blockchain technology. Through-
out the agricultural supply chain, at each step, we record the transactions between
Supply Chain Management in Agriculture Using Blockchain and IoT 231
the shareholders. This ensures the maintenance of quality of the asset as it transits
through the supply chain. In this way, any malpractice or dishonest handling of the
asset can be caught (Fig. 1).
Blockchain in Agricultural Supply Chain System
Supply Chain Management (SCM) is an essential business process in all spheres of
the economy. SCM uses specific processes to connect from producer to consumer’s
requirement through a chain.
The existing problems that prevail in the agriculture supply chain are:
• Rampant corruption among the middlemen.
• Lack of transparency in the whole chain as goods transit through the chain.
• Lack of accountability on the part of all the stakeholders involved.
• In order to solve these, we envision developing a blockchain enabled system that
manages the whole agricultural supply chain while enforcing a high standard of
security and transparency.
In the context of Supply Chain, blockchain plays a vital role as decentralized
Distributed Ledger Technology (DLT) which is used to store data of a supply chain,
which in turn cannot be tampered with. Each block has a hash and pre-hash Signature
Value linking them together. The transactions are administered in a distributed system
in a fully decentralized way. Once the data in the block is entered, it cannot be altered.
All the data is cryptographically secure.
According to a report in Press Information Bureau (PIB), the total wastage in agri-
culture product with or without using blockchain technology is depicted as follows:
Group
Within agricultural supply chains, blockchains play a vital role. First, track and trace
the origin of food products [5]. As an addon to this process, IoT devices will be used
to update the real-time quality of the product. The Raspberry Pi (IoT) that runs on
Raspbian OS is used to give the quality of the soil and the current temperature of the
place from where the product transits. It is integrated for improved traceability and
usability of the products of the supply chain [6].
The FARMAR aims to achieve these goals by developing a web application where
we can create a value chain of integrity from farm to fork by using BCT (BigchainDB,
Tendermint, MongoDB, Smart Contracts, MONIT, Python, NodeJS, Docker Dae-
mon) and IoT [7].
There is no denying that agricultural supply chain is the essential supply chain
that impacts our everyday lives. A farmer sells his product to a distributor who
in turn, stocks it across his various warehouses and supplies it to the retailers.
232
Fig. 1 Showing the graph of agricultural optimization with and without blockchain. Source http://www.pib.nic.in/indexd.aspx
M. D. Borah et al.
Supply Chain Management in Agriculture Using Blockchain and IoT 233
Fig. 2 Graphical representation of shared data in the decentralized and distributed network
The distribution network takes care of linking the farmer and retailer via a supply
chain. This supply chain network has the geographical reach, as well as the scale up
capability to take care of fluctuating supply and demand. The distribution network
itself comprises of many players who have the logistics capability to handle the supply
chain at local and global levels (source: radiostud.io). To eliminate the middleman
in the supply chain management, blockchain technology can help in the following
manner. This process consists of series of steps that are going to work in actual SCM
where at each and every point an IoT device is kept for tracking and all the data is
added in the blockchain network through a shared ledger (Fig. 2).
Objective of the Work
The objective of this work is to:
• Design of a decentralized and secured supply chain management system.
• Reduction in the number of middlemen in the system.
• Increased cost efficiency.
• Enhanced quality of goods.
• Sustainable development of India’s GDP in the long run. Facilitate fast and trans-
parent delivery of products.
5 Existing Methods
of goods they buy. Farmers are deprived of their fair share and the intermediaries
exploit them and take away the bulk of profits.
BigchainDB
We will implement our application using BigchainDB as a database with blockchain
characteristics. It has high throughput, low latency, powerful query functionality,
decentralized control, immutable data storage, and built-in asset support. Developers
and enterprises can deploy blockchain proof of concepts, platforms, and applications
with a blockchain database, supporting a wide range of industries and use cases. We
used BigchainDB version 2.0b9 using pip and docker for installation. In order to
start a BigchainDB server, it requires to download from a GitHub repository of
BigchainDB, a Python package/library and perform a docker operations on it or else
make normal installation from a Python pip.
Structuring our data is the most important thing to learn and understand about
BigchainDB. Data is structured in tables in traditional SQL databases. Other data
structuring formats are used to structure data in NoSQL databases like JSON, key
values, and tables. Data is structured as assets in BigchainDB. Anything can be
perceived and represented as an asset. Any digital or physical object can be thought
of as an asset. For example, a car, a data set, or an intellectual property right.
Linux (UBUNTU)
We used Linux (Ubuntu 16.04 and above during the development phase) operating
system for easy, fast installation, and setup. As Linux is open source, it is easy for
anyone to fix some issues with Linux and there is a good community support for
this. It also supports several operating systems. Ubuntu is convenient to handle and
it is secure for decentralized network without any system faults. The Linux terminal
plays a crucial role in production.
Supply Chain Management in Agriculture Using Blockchain and IoT 235
Python 3.6
During the development and testing phase, we used a new version of PYTHON and
PIP. In the nearby future, we are also looking to develop the same thing in Node.js.
Monit
We used Monit (s Watchdog) for system monitoring and fixing errors. One cannot
make sure that all the servers are running excellent all the time. Sometimes tendermint
works good but there will be a problem in MongoDB, if MongoDB works fine, then
BigchainDB shoots some errors and we cannot make all the servers running on each
terminal. So, Monit ensures and starts all the servers at a time by giving the process
ID, and it also shows the status of the system (we can also check the system status,
process, filesystem, process, hosts, etc., for every time set by us).
How to Connect to MongoDB
We must connect to it a MongoDB database before we query it. To do that, what is
needed to know its hostname and port. If a BigchainDB node is being run on a local
machine (e.g., for development and test), then the hostname should be local host and
the port should be 27017, unless we did something to change those values. The same
holds true, when a BigchainDB node is being run on a remote machine and we can
SSH to that machine. If a BigchainDB node is being run on a remote machine and its
MongoDB has been configured to use auth and to be publicly accessible (to people
with authorization), then perhaps, we can figure out its port and hostname (source:
docs.bigchaindb.com) (Fig. 3).
Querying BigchainDB
In order to search and query stored data (transactions, assets, and metadata), the
complete power of MongoDB query engine can be used by the operator of a node.
The decision as to how much of the query power they should expose to other external
users lies with the node operators themselves.
An operator of a BigchainDB node has full access to their local MongoDB
instance. Hence, they can in order to run queries, they may use any MongoDB
APIs, such as the Mongo Shell, MongoDB Compass, one of the MongoDB drivers,
like PyMongo, or a third-party tool for doing MongoDB queries. Some collections
in the Bigchain database are:
• Transactions
• Assets
• Metadata
• Blocks
• and also you will get some other collections when you check the MongoDB
database while BigchainDB server running on the background.
The source code of a smart contract (which is basically a computer program) can be
stored in BigchainDB. But arbitrary smart contracts can’t be run on BigchainDB. It
can be used to enforce permissions for both fungible and non-fungible asset transfers.
Double-spending will thus be prevented. Putting it another way, a BigchainDB net-
work can be used instead of an ERC-20 (fungible token) or ERC-721 (non-fungible
token) smart contract. Asset transfer permissions can also be interpreted as write per-
missions. Hence, writing to a log, journal, or audit trail can be controlled by them.
Through oracles or interchain communications protocols, A BigchainDB network
can be connected to other blockchain networks. Thus, in order to run arbitrary smart
contracts, BigchainDB can be used as part of a solution that uses other blockchains.
How to Set Up a BigchainDB Network
The node operators called members must share some information with each other,
so they can form a network. We use Tendermint for maintaining and making decen-
tralized network or nodes.
Each BigchainDB node is identified by its:
• Hostname
• Tendermint.pub_key.value
• Tendermint node_id.
The Tendermint file should look like:
Member: Connect to the Other Members: At this point, the Member should
have received the genesis.json file. The Member must copy the genesis.json file
into their local $HOME/.tendermint/config directory. Every Member now shares the
same chain_id and genesis_time (used to identify the Network), and the same list of
validators.
Each Member must edit their $HOME/.tendermint/config/config.toml file and
make the following changes.
240 M. D. Borah et al.
9 Conclusion
References
1. Tribis, Y., El Bouchti, A., Bouayad, H.: Supply chain management based on blockchain: a
systematic mapping study. In: International Workshop on Transportation and Supply Chain
Engineering. https://doi.org/10.1051/matecconf/201820000020
2. The blockchain: opportunities and challenges for agriculture. http://ictupdate.cta.int/2018/09/
04/the-blockchainopportunities-and-challenges-for-agriculture/. Accessed 22 Nov 2018
3. Chandra, D.G.: BASE analysis of NoSQL database. Futur. Gener. Comput. Syst. 52, 13–21
(2015)
4. Deka, G.C. (ed.): NoSQL: Database for Storage and Retrieval of Data in Cloud. CRC Press
(2017)
5. How blockchain can revolutionize agricultural supply chain. https://radiostud.io/blockchain-
can-revolutionize-agricultural-supply-chain-part-1/. Accessed 23 Nov 2018
6. Supply chain management in Indian agriculture. https://www.civilsdaily.com/supply-chain-
management-in-indian-agriculture/. Accessed 22 Nov 2018
7. Pethuru, R., Chandra Deka, G.: A Deep Dive into NoSQL Databases: The Use Cases and
Applications, vol. 109. Academic Press (2018)
Dr. Malaya Dutta Borah Working as an Assistant Professor Grade-II at National Institute of
Technology, Silchar. She has more than 10 years of experience of teaching and research. Her area
of interest is Blockchain Technology, Data Mining, Machine learning, Cloud computing, and Big
data Analytics. She has 25 publications in journal/conference on repute. She is a member of Com-
puter Society of India and IEEE. For more information, kindly refer to http://cs.nits.ac.in/malaya/.
Vadithya Bharath Naik He is a B.Tech final year student in the Department of Computer Sci-
ence and Engineering at National Institute of Technology, Silchar. He is a web developer (devel-
oped 15+ websites including Web Virtual Reality), Blockchain Researcher, Desktop Application
developer, Tech enthusiast, and he enjoys web surfing, listening to music, and watching sports.
242 M. D. Borah et al.
Aditya Bhargav He is a B.Tech final year student in the Department of Computer Science and
Engineering at National Institute of Technology, Silchar. Apart from being a tech enthusiast, he
developed a few scalable applications and made contributions to many startups. He also started a
startup called rushbud.
Barneel Phukan He is a B.Tech final year student in the Department of Computer Science and
Engineering at National Institute of Technology, Silchar. Apart from being a tech enthusiast, he
enjoys books, music, and movies.
Shiva G. M. Basani He is a B.Tech final year student in the Department of Computer Science
and Engineering at National Institute of Technology, Silchar. He is fond of civil services and he
is a black belt holder in karate.