Abstract
Traceability and food quality are significant challenges in realizing a reliable food supply chain. The reliability of data in supply chains is one of the critical factors. Ensuring transparency, integrity, and availability is the primary requirement for establishing a proper supply chain network. Blockchain is a distributed structure of immutable records that are chained together to form blocks. It provides a guarantee of storing the data correctly and reliably. Smart contracts, which are self-executing contracts containing the terms of the agreement between the entities involved, provide utility for automation of reputation calculation with the transactions. Reputation systems allow participants to rate each other, thus building trust through reputation. The present reputation systems have bounded scrutiny and lack granularity; hence they are not ideal for supply chains. In this work, we propose a reliable supply chain framework using blockchain and smart contracts. It uses a consortium blockchain network to trace communication between the participants and to calculate reputation scores dynamically. Rewards and penalties are assigned to the participants of the supply chain network based on the food product quality involved in the trade. The network participants have defined roles and the access permissions govern who can access the ledger. An immutable ledger stores all the transactions occurring in the network. Any change in one block will reflect in the consecutive blocks, which ensures the data is reliable and secure. The proposed system is implemented using Hyperledger Composer. The proposed framework is evaluated in terms of throughput and latency for varying asset size and batch size using the benchmarking tool Caliper. Results show that the security and reliability provided by the proposed framework justify the overheads in contrast to a trading model that does not include a blockchain network.
Introduction
Blockchain is an incorruptible digital ledger used for recording transactions. It has no central authority; it is shared and so open for every individual in the community to see. Once a transaction is initiated, a block is created and immediately verified by all the participants in the network. In supply chain events, where there are several processes related to the production and distribution of commodities, there is always a mechanism needed to find the point of fraud or to analyze the location of products.
In [1] developing concerns about problems in food trade regarding food safety or the quality satisfaction to be met are described. The authors discuss solutions to combat product mislabeling and fraud, making use of recent technological advancements. The infection outbreak in Maradol papayas [2] are studied to identify the reason for the infection. People infected with Salmonella were also closely related genetically. Food mislabeling incidents had led to customers asking for a check on items produced and handled. [3] discusses the mechanisms for transparent handling of products. [4] considers the use of crypto-anchors, where digital fingerprints embedded in products are linked to blockchain for product authentication. These crypto-anchors pave a new way to combat fraud and protect consumers. [5] discusses an alternate approach to making the product’s point of origin transparent. The details about the journey of the product is shared in a secure and accessible manner.
Even though the data is unmodifiable when stored in the blockchain, there is a problem associated with the data itself regarding how far the data stored is reliable. The IoT sensors that monitor the quality conditions of the food products are also prone to faults and so cannot be trusted completely. Moreover, the approaches available are either agent-based or asset-based. Some cases involve a single entity in the trade of multiple products. For such instances, the reputation of the individual product should be considered.
With the help of the reputation system, one can enhance the trust factor by allowing the users to use rating to assess an entity’s performance.
The significant contributions of this work are: A blockchain-based reliable supply chain management framework is developed for efficient handling of perishable food products Smart contracts based autonomous and transparent Reputation system calculates the penalties and rewards based on the conditions present in the contract. Penalties can also be in the form of removing a participant from the network. Hyperledger Composer platform is used to evaluate the performance. The results observed show that the overheads involved are minimal compared to a system that does not have provisions for the authenticity of data.
A food supply chain is a complex network that consists of various units like the farms, retail shops, storage and various other departments that are involved at different stages in retail, as shown in Fig. 1. The commodity moves through multiple stages right from the production to the consumer and the use of blockchain makes the handling easy, effective and trustworthy. The organization of the paper is as follows. Section 2 summarizes the present works that involve realizing supply chain solutions using blockchain. Section 3 gives an overview of the proposed system. Section 4 describes the system design and implementation of the proposed system, which is followed by the description of the workflow in Section 5. Section 6 gives the performance evaluation details done using Hyperledger Caliper. The results obtained are discussed in Section 7. Finally, Section 8 provides the concluding remarks and some future directions.

An essential food supply chain.
Supply chains have changed the way of manufacturing products. The development of technologies has led to rapid automation, improved product handling and better platforms for managing various tasks [6]. The evolution of blockchain has disrupted many existing technologies. The promise of immutability, transparency, availability, integrity, and security is associated with blockchain-based solutions. Many works are available in the literature that discusses the application of blockchain in the Supply chain domain. Table 1 summarizes the current research that exists for adopting blockchain to address the demands in the supply chain.
Summary of related works
Summary of related works
The proposed framework differs from the existing techniques because it integrates the reputation system as a part of the blockchain implementation which provides better reliability and accurate ratings from the stakeholders.
Tools and techniques
Hyperledger fabric
Fabric is a modular open-source system developed by Linux foundation for experimenting with permissioned blockchains. It has a ledger, uses smart contracts and participants manage their transactions. It is a private and permissioned blockchain implementation.
Hyperledger composer
A Composer is a high-level tool that facilitates building and running applications on top of Hyperledger fabric. It can be used for rapid prototyping and it can be easily integrated with the existing network structures.
Hyperledger caliper
Caliper contains a set of predefined use cases that can be used to measure the performance of specific blockchain implementation. The chain code used for development is sufficient to design multiple scenarios and evaluate the performance of the developed application or solution.
Framework
Figure 2 represents the proposed framework for the implementation of a reliable supply chain system that provides reputation scores for rating network participants in the business network. It is a modular and multi-level framework that addresses the basic operations at three different layers, namely the Data management layer, Blockchain layer and The Interface layer.

Reliable supply chain management framework.
The data management layer records the inputs from the sensors which are present in the warehouses, installed to monitor the quality and temperature of the food products. This layer also records the ratings used to classify the products. There is data associated with the regulatory endorsements as well wherein the food safety authorities perform fixed checks of the working locations to inspect the quality. The addition and removal of participants of the business network should also be updated periodically.
Blockchain layer
This layer performs the core operations of the proposed framework. The distributed ledger used to store transactions, the reputation system which generates trust scores for the various participants, as explained in section 5.4. The smart contracts that are used for the execution of transactions are part of this layer. The smart contracts which are used for calculation of ratings are transparent and fully automated. The temperature thresholds defined for the assurance of product quality is part of the quality contract.
Interface layer
Information regarding the ratings and reviews can be queried and known. Additionally, the stakeholder assessment details are made available for the user, which essentially provides incentives for trusted and verified participants. Similarly, for participants whose reputation score is poor, they can either be temporarily removed from the network or displayed under the bad marketer’s section.
System design and implementation
Business network
The business network defines a group of system files, participants, the smart contract and the shipment management. The various configuration files include model files, JavaScript files and access control files. Figure 3 gives an overview of the proposed business network.

Business network model.
The script files are used for implementing the business requirement, which is specified by the user. Each function is specially incorporated to satisfy every significant concern of the user.
Access control file
This file contains a set of access control rules that specify the rights associated with different users in the business network. The ID registry includes the identity of all the users in the system. It also provides the user status and the provision for issuing a new ID. While issuing, the authority may or may not be given to the new user to grant IDs in the future.
Participants
The entire system, with all the participants, is called the business network. The major participants of the business network are Grower, Importer and Shipper. The available range of commodities varies across the grower. The importer can check with it and specify the commodity required by placing a shipment order and then the shipper is responsible for the movement of the commodity from grower to importer. The grower has all commodities in the warehouse. An IoT sensor is fixed over that area to maintain the temperature of the perishable commodity. If the temperature falls below the specified threshold, the grower should pay a minimum penalty as mentioned in the contract. The wallet maintains the account balance of the users. A unique business ID identifies the network user. The users with a Business name and ID can perform transactions in the network.
Grower
The Grower has a minimum account balance and the payout is calculated according to the contract specified by the consumer. Rewards are given to a grower based on their adherence to agreements and the ratings obtained. The parameters required to add a grower in the network are his contact details that include his email, contact address, and the account balance.
Importer
The importer has direct communication with the grower and the shipper. Once the grower has deployed the commodity specified in the contract, the importer imports the commodity. The importer also has the same parameters similar to that of the grower and all other participants.
Shipper
The contractor can track the shipment, and the status can be easily known once the commodity is shipped. The shipment status consists of three possible values to monitor the status of the shipment: Created. In transit and arrived. Each shipment has a unique shipment ID. The other details include the product type, quantity, rating associated with that product and the temperature value associated with the shipment.
Workflow
Figure 4 depicts the various interactions among the participants. The network participants transact among themselves by initiating transactions that are then executed by Smart contracts. The major components involved are the Smart Contracts, Transactions, Shipment Management and the Reputation system.

Network participants interaction.
A smart contract is a code construct designed to automatically handle the movement of digital assets between the parties under the defined conditions. It has a set of permissions written in code that require an exact set of events to occur so that the terms mentioned in the agreements get triggered. In simple terms, Smart contracts enable condition-based execution of transactions autonomously and transparently. The contract is defined at the time of establishing the business network. The threshold for the minimum and maximum temperature for each perishable food product is also set in the contract. The sensor data from the warehouse is obtained and recorded. The current status of the shipment and the current temperature measurement is periodically recorded with each transaction to facilitate live monitoring and frequent update of the status and condition of the food product that is shipped.
Transaction
A transaction is any task that is performed and stored in the blockchain network in the form of blocks. The append-only data structure ensures that the old transactions cannot be parsed but new transactions can be added. The transaction happens between the participants with the asset that is created and the transaction ID is present in each block. The transaction can be initiated by any of the participants in the network and the account balance after the completion of the transaction is auto-updated. The parameters associated with each transaction are the Transaction ID, source of the transaction, account balance and transaction handling charges.
Shipment management
The shipment asset is designed to track the movement of commodities among the participants. The shipment status is updated periodically. The data that gets update includes the Shipment ID, type of product being handled, the current status of the shipment and the current temperature measurement. This facilitates live monitoring and frequent update regarding the status and condition of the food product being shipped.
Reputation system
Reputation systems allow participants to rate each other to build trust through reputation. As most entities do not get to have direct experience with other entities, they certainly rely on reputation systems for a belief. The ratings help the user to predict who is likely to be trusted from the history of transactions. The scores thereby help the parties decide whether or not to transact with a given party, which in turn, has a positive effect on the quality of the online community. The rating and review system employed in the blockchain network and users post the individual participant’s rating in the network. Each rating consists of a weighted score that involves the computation of three factors, namely Packing and shipment handling, Timeliness of order fulfilment and User experience. These factors are crucial for determining product quality and ensuring the proper handling of perishable food products. The participants can also provide a review of their overall experience, which helps other participants with their decision-making process.
The false detection mechanism is used to secure the system, in which the overall rating is estimated by the average of the last five posted ratings of different users. If the same participant is trying to give rating for a single user continuously, to reduce his overall rating, it can be easily identified and neglected. The reputation system is used to reward participants who follow ethical practices by listing them in suggestions when a user wants to perform a transaction.
Performance evaluation
Hyperledger platform measures the performance of the developed system. A sample business network in which ten network participants configured is using Composer. The participants configured include five growers, two shippers and three Importers. The transactions in the business network are executed by deploying smart contracts. Hyperledger Caliper tool evaluates the metrics from the recorded transactions for 30 minutes. This setup was implemented in an Ubuntu 18.04 environment over an Intel® Core™ i7-9750 H CPU @2.60 GHz with 8GB of RAM.
The inputs to measure the metrics are the asset size and the batch size of the transaction. As the asset size increases, the variation in latency and throughput is measured. The primary purpose of the experiments is to evaluate the role of asset size of data in blockchain and batch size, which determines the transaction flow in the network. The experiments are carried out to assess the system performance in varying transaction loads and the associated response times.
Caliper metrics for asset creation
The asset size depends upon the system and the number of transactions that are happening. The throughput of the system remains constant when there is a single node in the blockchain, but as the network grows up with an increase in the number of blockchain nodes, the throughput gradually gets decreased. The latency is the time taken for the transaction to happen. Whenever the transaction gets initiated, it takes a particular duration of time to commit the transaction, and that time taken is noted and plotted as a graph. Table 2 summarizes the results obtained for the estimation of latency and throughput for different asset sizes. Results show that as the asset size increases, the average and maximum latency increase steadily, which is evident in Fig. 5.
Metrics for Asset Creation
Metrics for Asset Creation

Latency comparison for asset creation.
Figure 6 gives a comparison of throughput for different asset sizes. It clearly shows that as the asset size increases the throughput decreases. Asset sizes or Block size is crucial for determining the performance. The asset size has a direct impact over the transaction processing as smaller asset size may lead to frequent block creation latencies and larger asset size may increase the verification times for each block. The asset size is determined at the time of the creation of a business network.

Throughput estimation for different asset sizes.
Latency is the time taken to commit the transaction. Batch size refers to the number of transactions processed by the network in a given time instance. From Table 3 we can observe that for a single transaction to happen, the latency remains less, but as the batch size gets incremented the latency increases. Similarly, throughput decreases with an increase in Batch size, as reflected in Fig. 8.
Metrics for Transactions
Metrics for Transactions

Latency comparison for different batch sizes.

Throughput estimation for various batch sizes.
Each transaction is added to a block only after it is verified and confirmed by the network participants. Figure 7 provides the estimates for average and maximum latency for a batch size of up to 50. Figure 8 illustrates the behaviour of throughput. The increase in batch size leads to an increase in latency which in turn reduces the throughput.
The evaluation of the proposed blockchain based framework shows that the results obtained are satisfactory. Throughput and latency are the major configuration parameters used for the evaluation. The essential characteristics of blockchain, such as immutability and auditability, ensure the security of the data in transactions. The system’s reliability is provided by the use of accurate data that is stored and processed using the blockchain. The identity of the user is protected and only the ratings are made available to other system users, which protects the privacy of the user without compromising the reliability. The organization of participants into specific roles such as grower, shipper and importer help in managing the system better. It also makes the addition of new users into the system much easier and new roles can also be assigned based on the system requirements. The use of smart contracts guarantees trust between the participants, which in turn makes them more accountable to honor the commitments to which they have agreed. The ratings associated with participants help other members to have better clarity to choose among the best available user for their requirement.
Conclusion
The quality and traceability of food products is a growing concern. More awareness is created in finding the right ways to eat food for a healthy and active lifestyle. Supply chains play a significant role in handling food right from where they are produced to the place they are cooked and served. In this work, we have a proposed reliable supply chain framework for handling perishable food products. The proposed framework makes use of blockchain and smart contracts to effectively manage the various transactions involved in a food supply chain. A reputation system is implemented which provides the necessary trust between the various network participants. It also provides a mechanism for rewarding participants with good practices. It ensures transparency and accountability. The proposed framework is evaluated in terms of throughput and latency using Hyperledger Caliper and the results are presented. The results obtained show that the system performs well with high throughput and reduced latency under varying transaction rates. The privacy of users is ensured, which enables them to be more honest and accountable. The accuracy of data in transactions and security is provided by the blockchain network, which guarantees the reliability of the food supply chain.
The work can be further enhanced by considering scalability and by the use of sharding for addressing the storage requirements of Blockchain nodes. Since the supply chain is an application that is evolving rapidly, scalability is an important factor that determines the effective adoption of blockchain based solutions. As the transaction volume increases, storage becomes crucial since each blockchain node keeps a copy of entire network transactions. The impact of scalability and storage requirements needs to be considered for enhancing the proposed solution.
Footnotes
Acknowledgments
The authors wish to express their sincere thanks to the Department of Science & Technology, New Delhi, India (Project ID: SR/FST/ETI-371/2014) and express their sincere thanks to the INSPIRE fellowship (DST/INSPIRE Fellowship/2016/IF160837) for their financial support. The authors also thank SASTRA Deemed to be University, Thanjavur, India for extending the infrastructural support to carry out this work.
