1. Introduction
The monitoring of food products is one of the most critical aspects of the agriculture industry, which is necessary to track and trace the agriculture supply chain [
1,
2]. The demand for the traceability of the food supply chain has increased due to higher food safety requirements as well as contamination risks [
3]. Some existing systems claim that a thorough collection of data through information management systems such as RFID and barcodes enhances the traceability of the food supply chain and agricultural products [
4,
5]. However, these existing systems are unreliable, unstructured, and lack traceability, which makes them highly susceptible to changes in data [
6]. With many food products being traded across borders, the traceability of agricultural products is necessary to comply with all countries’ rules and regulations [
7]. The traceability of agricultural products involves collecting multiple types of information through several data sources in the supply chain [
8].
In the past few years, food safety issues such as toxic milk powder, rice mixed with mercury, and mad cow disease have arisen [
9,
10]. The World Health Organization (WHO) reported that food contaminated with viruses, chemicals, and hazardous bacteria can cause dangerous diseases [
11].
Figure 1 displays the most common products obtained by processing rice. Rice is one of the most commonly consumed staple foods among cereal grains, being largely consumed by approximately half of the world’s population. After maize and sugarcane, rice is the third most important agricultural product globally [
12]. While a considerable amount of maize and sugarcane crops are utilized for other purposes beyond direct consumption, rice is highly important for its caloric content and nutritional value; it is estimated that rice delivers approximately one-fifth of the daily consumed calories worldwide.
As a result, the tracking and record-keeping of the rice crop supply chain have become increasingly important. Due to the high demand for rice crops, many investors store rice during the season at a low cost and sell it in the off-season at a high price [
13]. This practice leads to significant economic losses and discourages governments and farmers from spending substantial amounts on importing and cultivating rice. The traditional rice supply chain system suffers from poor reliability and traceability, which has led to trust issues between supply chain stakeholders. The governments have made numerous efforts to change traditional agriculture supply chain systems by defining rules and regulations, but this has been difficult due to the poor transparency and traceability of the current supply chain systems, as well as to a lack of reliability and trust among stakeholders, as shown in
Figure 2.
To address these issues, a reliable and transparent rice supply chain management system is necessary to regulate prices. This problem can be solved by implementing Blockchain technology, which is highly transparent and provides a robust and traceable management system for rice crops using smart contracts and the elimination of intermediaries, making the entire system decentralized. Blockchain technology provides immutable and decentralized technicalities for rice crop data, making the data tamper-proof and recording all transactions and other digital data related to farmers, retailers, seed companies, rice mills, etc. These key features make Blockchain technology an ideal solution for rice crop traceability. Besides being a trusted and reliable solution, Blockchain has additional applications that can help enhance the double-checking of all transactions performed on the Blockchain.
Smart contracts are key components of the Blockchain ecosystem that implement the business rules and consensus protocols [
14]. In the Blockchain-based agriculture system, consensus protocols help in transaction verification and decision making and allow adding new blocks [
15]. Hence, smart contracts and consensus protocols enhance the trust level and security measures between stakeholders and provide cost-effective solutions. Blockchain has a distributed nature; therefore, it prevents rice crop data from illegal access, data alteration, or deletion and ensures that the rice supply is reliable and transparent [
16]. Only authorized entities have access to the system and can alter or modify the data stored in the Blockchain system. The security features and distributed nature of Blockchain make it an ideal technology for developing a rice crop traceability system.
Figure 3 shows a Blockchain ecosystem with the required features. The rice crop traceability system consists of multiple components including participants, privacy, wallets, and exchanges. The blockchain ecosystem has wallets and exchanges in the distributed ledger to enable the flow of cryptocurrency and manage the transactional data with timestamps, as shown in
Figure 3.
To manage communication among stakeholders and other participants, this technology has extended features to build DApps. In addition, some other characteristics of Blockchain such as distributed ledger and storage make this technology ideal for rice crop traceability and provide a high data transparency. The main contributions of this research are reported below.
This research provides a Blockchain-based secure, reliable, and transparent framework to make rice traceability effective and efficient. The proposed framework will resolve traceability issues and control malpractices in the existing supply chain system.
A framework to overcome the limitations of the current system of rice crop from farm to fork by implementing Blockchain technologies is proposed.
Based on an Ethereum smart contract, a Rice Coin (RC) is proposed to control the rice price. Furthermore, a discussion is presented on token creation, initial coin offering (ICO) and total supply, buying and selling rules for rice, and user authentication. In this way, farmers and all other stakeholders can obtain good wages by controlling the prices.
This study presents rice crop traceability solutions by using Blockchain technology and implementing system architecture.
The rest of the article is organized in the following way: related work is presented in
Section 2.
Section 3 described the proposed framework based on Blockchain technology and presents the implementations of the proposed framework including the system’s setup and the deployment of smart contracts. The results of the performed experiment are discussed in
Section 4. Finally, the research conclusions are reported in
Section 5.
2. Related Work
The development of Blockchain technology has impacted the research work in the area of food and agricultural products. The research work carried out on agricultural products and the food industry by using Blockchain applications has regarded architectural improvement, theoretical research, consensus mechanism, data application, and data interaction in the agriculture field as well as the food supply chain. Through traceability, decentralization, and temper proofing of Blockchain, food safety, food quality, and the food supply chain are guaranteed.
Tian et al. [
4] proposed a framework using Blockchain technology and radio frequency identification to trace and achieve reliable information about the food supply chain. Although this framework ensures the safety of food by storing and exchanging the food product information, it is susceptible in terms of central administration and fragmentation and is vulnerable to data modification. Blockchain is a transparent and shared platform that is completely consistent with distributed networks. On the other hand, Blockchain is an innovative network platform that can offer revolutionary approaches for the traceability of agricultural products and food supply chains from farm to fork [
17].
Leng et al. [
18] proposed a framework using a double-chain architecture that includes a storage mode, a dual-chain structure, and a consensus algorithm. Although the proposed framework is secure and transparent, its implementation is highly costly and experimentally not efficient, mainly for double-chain architecture [
19]. Salah et al. [
3] investigated the practical implementations of smart contracts based on Ethereum with the integration of IPFS to store data regarding supply chain actions. However, the testing or the implementation of the proposed solution was not reported; therefore, it leads to an increase in computational complexity, cost, vulnerability, and security attacks.
Ronaghi et al. [
20] presented a maturity in the agriculture supply chain domain by using a questionnaire-based method and demonstrated the importance of Blockchain technology combined with other technologies including internet of things, smart contracts, and transactions of record. However, the practical implementation of the proposed solution is missing; therefore, trust, traceability, vulnerability, and security issues are highly expected regarding this solution. In contrast, our proposed framework is secure, traceable, and able to handle large amount of crop data from farm to fork.
Wang et al. [
21] developed an information supervision model for the supply chain of the rice crop and investigated the problems associated with a complex rice supply network. Although a number of encryption algorithms were used to secure the data of enterprises, the system is still susceptible in terms of vulnerability and central administration. Our proposed model and framework provide a high level of security, tracking and tracing, as well as an ideal central administration for all stakeholders.
Peng et al. [
22] proposed a multilayer model for a refined supervision of the rice supply. They implemented a hybrid encryption algorithm to analyze the performance and security capabilities of their framework. This research provides new agricultural information and directions about how to hold and store rice using technology. However, the traceability or back traceability of rice supply chain are not possible, which makes the model less efficient than other models. Our proposed model provides ideal traceability to all stakeholders involved in the rice supply chain.
Ehsan et al. [
23] presented a decentralized traceability model based on Blockchain technology to ensure the transparency and integration of the system. Although this model is based on a smart contract for a traditional supply chain, it is not secure enough to store agricultural data and does not ensure traceability and reliability, as it is conceptual. In our work, we performed experiments to ensure that each transaction will be secure and traceable for all stakeholders.
Blockchain-enabled models and frameworks for agricultural supply chain and food management may provide significant advantages by improving trust, reliability, security, tracking and tracing, transparency, supplier reputation, and accountability [
24]. Katsikouli et al. [
25] discussed the challenges that are faced by food management systems including food fraud, inefficient processes, and food safety, as well as the environmental influence of food production. Furthermore, it was found that the implementation of Blockchain systems in the food supply chain offers huge benefits such as trust and traceability from farm to fork. Yanez et al. [
26] investigated the digital transformation of the supply chain industry and found that the agriculture industry promises a trustworthy, transparent, and reliable ecosystem by implementing smart contracts. Although the investigated approaches and frameworks are able to handle the high volume of data of the food supply chain, our proposed framework can do the same with high security, trust, and traceability.
IBM food trust is an ideal solution for distributors, wholesalers, growers, retailers, manufacturers, processors, and others involved in food supply chain. It enhances the supply chain transparency, immutability, and management that enables users to transact data in a more efficient and trusted way [
27]. However, IBM hyperledger is ideal only for private users (e.g., a specific organization), whereas our proposed solution is publicly available.
In summary, there is plenty of evidence available in the literature that indicates that a reliable and secure mechanism is required to track and trace the food supply chain for consumer satisfaction across the globe. In this research, we introduce a transparent and reliable framework for the rice supply chain by implanting smart contracts and Ethereum Blockchain. Our proposed framework will eliminate the demand for central authorities, reliability controls, and intermediaries and improve security and transparency.
3. Materials and Methods
In this study, a framework is proposed to develop a secure, reliable, efficient, and transparent traceability system for the rice crop supply chain from farm to fork, as shown in
Figure 4. The proposed framework uses state-of-the-art blockchain technology to design a transparent system for vendors in order to obtain quality rice by tracing the rice production processes completely. The blockchain ensures transparency and allows all contributors from retailers to consumers to trace the supply chain of the rice.
The payment method we propose is secured with the help of a smart contract. When a farmer purchases seeds from a grain company for rice crop production, the payment details and the entire transaction data are stored in the blockchain. All payments or data stored in the blockchain system cannot be modified, deleted, or tempered. The products move on demand from one participant to another participant in the supply chain, and all transactions are secured, transparent, and verified by using smart contracts without any interruptions or a single point of failure and centralized authority. Retailers can track the origin of their seeds, the dates of crop yields, the production farms, the production details of the rice mills, the purchase information of retailers, rice distribution network details, price details, and all other steps in the chain before buying rice from any distributor. The government can also track the rice supply chain transactions through this proposed system for audit purposes. as well as identify illegal patterns.
Figure 4 presents how blockchain technology can improve the existing rice crop production system in a more innovative way.
3.1. Proposed Architecture
This high-level system architecture was developed based on the proposed frameworks shown in
Figure 5. The stakeholders in the proposed framework are farmers, rice grain generators, rice seed companies, retailers, distributors, and government organizations. A decentralized application (DApp) is the major component of the framework, which depends upon digital storage, IPFS, blockchain network, smart contracts, and a web platform for end-user interactions. All users in the rice crop traceability system are connected with DApp in order to access the blockchain network. All participants will register to join the system by uploading their data on the rice crop management system through the web or Dapp.
After completing the registration process, a unique public address will be assigned to every user. In this way, every user over the network is identified via this unique public address. IPFS was implemented to provide a connection between digital storage and DApp components for data transmission. Furthermore, the proposed system considers different actors at different levels, such as retailers, farmers, and organizations. These actors may log into the Rice Crop Management System (RCMS) via the mobile application or the web by utilizing the blockchain network. There are several users who act as administrative and use RCMS to manage, control, and authorize processes according to their authorities. The RCMS DApp consists of an initial coin offering, an initial coin offering exchange, and the integration of a third-party payment gateway such as digital currencies, local currencies, and many other wallets in order to manage multiple tokens and coins. The rice crop management platform uses the IPFS technology to store and share user records as well as statistical values by using smart contracts. The IPFS technology transfers information among the distributed networks and digital storage, which is evaluated and controlled by the end-users through their public addresses. A retailer or buyer can buy rice crops by creating an account on a mobile DApp that has an integrated digital wallet. So, by using DApp, a retailer can buy rice crops and transfer the payment to the farmer. paying a commission to all other associated entities such as retailers and rice companies. Once a buyer purchases rice, the blockchain ledger records a new entry with complete traceability. In this way, authorities like retailers and distributors receive a notification regarding the cost at which the rice crop was sold. Furthermore, not all farmers are able to use digital wallets; therefore, a digital wallet team is necessary that can help the farmers with a poor knowledge regarding accounts and digital wallets.
3.2. Economic Model
A digital token RC was introduced to design an economical model for a secure, transparent, and auditable rice crop management system for all participants and authorities. The proposed model for the rice crop is shown in
Figure 6. The basic purpose of the RC token is the security of the system and its protection from illegal actions. The overall supply of rice coins was defined as 500 million, where each coin has a fixed price that is equivalent to USD 100.
It is not mandatory to purchase a USD 100 coin; a user can buy a coin according to his/her needs by fractionalizing the token, for example, 0.1 RC for USD 10. The RC could be purchased by using local currencies and cryptocurrencies, such as EUR, USD, PKR, BTC, BNB, ETH, etc. Due to the decentralized nature of the blockchain technology platform, RC can be purchased without paying taxes and exchange fee. In this way, the retailers can also receive equal benefits, as well as the same number of tokens for which they had paid. Once a retailer purchases RC, an equivalent amount will be added to their wallets. The retailers can purchase rice from the distributors by utilizing these tokens without paying an exchange fee or any other tax. The RC was implemented on the Ethereum blockchain as ERC-20, and its early distribution was made by using ICO. The details of RC, including symbol, price, token type, and maximum supply, are presented in
Table 1.
With our system, the rice crop can be purchased in two different ways. In the first scenario, the farmers with a digital wallet can receive their payments directly in RC. After that, an ICO exchange is implemented to convert the token into fiat currency. In another scenarios, the payment is received from the farmers by contacting their associated digital wallet team. The digital wallet team receives the RC payments and then pays cash amounts to the farmers by converting the RC into fiat currency through ICO exchange. After the farmers receive the payment, a scanned copy of the receipt or an image is transmitted back to the blockchain as a proof of secure payment. The blockchain in the proposed system is hybrid, and its data are private for many stakeholders including retailers, farmers, distributors, and rice mills. Furthermore, it is available to governments in order for them to authenticate, audit, and verify the transactions.
3.3. Distribution of the Token
Initially, 70% of the rice coins are distributed for ICO, and distributors, farmers, rice mills, retailers, and many other stakeholders can buy coins. Furthermore, 20% of RC is allocated for marketing, trading, key accusations, and liquidity. The remaining 10% of coins are allocated for the development and innovation of the ecosystem. So, the overall supply of rice coins is fixed, and no extra coin will be generated.
3.4. Conversion Fee
Some fee was defined to provide a long-term sustainability of the RC. A specific fee is charged for each transaction, depending upon the currency exchange used, such as KUcoin or Binance. The charged fees follow defined rules and vary depending on the currency exchange and on the use of crypto or digital currency. Furthermore, for the system maintenance, a fixed amount is deducted by the management authorities. The self-sustainability of the RC is verified through the cash flow that is generated by the management authorities.
3.5. Workflow of the Proposed Framework
Figure 7 shows the functionalities of the proposed framework. Application users will connect with DApp through the rice coin management system. All users can manage their wallets and profiles on DApp by using their public addresses. At the backend of the platform, an ICO and currency exchange are always running. In order to buy rice coins, the retailer pays via credit card or any bank. After the completion of a transaction, the Unspent Transactions Output (UTXO) will be available in the retailer’s wallet, which could be transferred to the farmers, distributors, and rice mills. Farmers, distributors, and all other participants can use exchange and ICO to convert rice coins into fiat currency.
For the conversion of rice coins into fiat currency, organizations use currency exchanges and pay farmers without wallets. For the smart contract management and user authentication, the administration will handle and generate sheets as well as token distribution policies. Smart contracts handle and control ICO and exchange connections. Furthermore, the rates of the rice coins with respect to various currencies are determined based on the smart contract.
3.6. Layered Structure of the Proposed Framework
The structure of the proposed framework consists of eight layers, as shown in
Figure 8. The transactions in each layer are stored in the blockchain to notify all members involved in the blockchain network. The workflow of each layer is discussed in this section.
3.6.1. Interface Layer
This layer acts as a user interface for interaction with web applications and DApp and connects buyers and sellers with the rice supply chain system. The retailers, farmers, customers, rice mills, and other participants interact with the rice management system through the interface layer. The basic purpose of this layer is to assist the users in initiating the sale and purchase of rice crops.
3.6.2. Application Layer
The application layer keeps online records, transaction metadata, identity verification, and payment data. This layer connects the business logic layer and the interface layer with each other in the form of smart contracts.
3.6.3. Business Logic Layer
This layer is responsible for dealing with all kinds of rules, regulations, terms, and conditions in the implementation of smart contracts. The business logic layer follows all regulations of communication, execution, and invocation; therefore, this layer is also an active database of the smart contract.
3.6.4. Trust Layer
The trust layer performs a security analysis by using smart contracts, a consensus protocol, and a formal verification like proof of work, proof of stake, and byzantine algorithms. This layer implements the consensus protocol on all newly added blocks as well as transactions and stores the executed data in the blockchain layer.
3.6.5. Blockchain Layer
The blockchain layer stores basic information on the ledger, distributed nodes, and block status. It also stores distributed ledger information, information on rice mills, retailers, stakeholders, and transaction records in relation to public and private addresses.
3.6.6. Transaction Layer
The transaction layer handles all kinds of rice coin transactions between retailers, farmers, seed companies, rice mills, and stakeholders of RCMS.
3.6.7. Infrastructure Layer
The infrastructure layer contains a peer-to-peer (P2P) network for the verification and distribution of the transaction data on Ethereum Blockchain. Once the transaction is completed, it is broadcasted on all other nodes. This layer ensures that each transaction is applying predefined rules and parameters for storage in Blockchain.
3.6.8. Security Layer
This layer performs a vital role in Blockchain networks by providing security solutions against multiple threats, representing 51% of possible attacks. The security layer contains multiple protocols, works parallel to the system, and checks the entire mechanism to manage and maintain the system’s integrity.
Users and actors such as retailers, farmers, seed companies, and rice mills interact through web portals and applications at the interface layer to execute the transactions. Moreover, the application layer establishes the connection between smart contracts and user transactions that implements business rules and forwards all transactions toward the trust layer. The trust layer stores each transaction in Blockchain with the help of proof-of-work as well as other consensus protocols. Furthermore, after the validation of blocks via the transaction layer, the Blockchain layer is responsible for storing all transactions in the public ledger relating to public and private keys. The infrastructure layer and security layer maintain the integrity of the system by applying security measures as well as multiple protocols.
Figure 8 presents the layered structure of the proposed framework.
4. Experiment and Results
In this section, we present the real-time implementation of the proposed framework and discuss the obtained results. The experiments were based on the following assumptions-
In the system, no miner or group of miners had 51% hash power.
Only registered users were allowed to sell and buy products.
The testnet smart chain Blockchain was implemented, and interactions occurred through Web 3.0 for the integration of our framework. The remix integrated development environment (IDE) was used for the writing of the smart contracts. In addition, Postman was used for all HTTP requests to interact with Blockchain. The AccessChain and ValidateBlock functions were used to measure the performance of Blockchain. For the evaluation of other performances, a similar procedure was implemented. Moreover, by using Web 3.0, a customized script of fifty thousand Python transactions were sent to the network. In order to evaluate the developed framework, five different experiments were performed:
Calculation of the response time to retrieve the longest chain data in nanoseconds for the evaluation of the proposed framework.
Evaluation of the latency of new blocks in the Blockchain and comparison of other statistics.
Analysis of blocks, transactions, latency of data addition, and comparisons for the confirmation of the blocks.
Evaluation of the proposed framework based on a per-transaction fee.
Evaluation of the performance.
The comparison of the performance with multiple solutions of Blockchain.
For retrieving Blockchain data, the data AccessChain was implemented on multiple blocks, as shown in
Table 2.
The AccessChain function helped us retrieve specific data from various blocks and calculate the retrieval time by using timestamp to access the data. Furthermore, the initial block retrieving latency was 400 milliseconds, which was reduced to 91 milliseconds and, after some time, increased to 950 milliseconds. Due to the decentralized nature of Blockchain, the latency time created some delays in data access. The response time to retrieve multiple blocks from the longest chain is shown in
Figure 9.
Our proposed framework adds new blocks to the Blockchain by taking less time as compared to other networks. Bitcoin network takes up to 10 min however, Ethereum takes 15 s to add a new block in Blockchain. Moreover, the proposed framework in this research will work by adding a new block after every 3 s mechanism.
Figure 10 shows the statistics of new blocks addition. This initial addition of a block showed that our proposed system is more reliable and efficient than other systems and verifies the new transactions easily. Because of the delay in blocks, the Ethereum and Bitcoin networks have 0.232 million and 1.127 million transactions per day. Whereas, the proposed framework in this research can add average transactions up to 14.29 million to Blockchain per day.
Figure 10 also shows the statistics of new blocks and defines the time required to obtain 12 network confirmations that are important in order to accept the financial payments.
Additionally, the proposed framework confirmed new transactions 6 times faster than Ethereum and 200 times faster than Bitcoin. In our proposed framework, the average transaction fee is USD 0.3, while in the Ethereum network, it is USD 100 during high traffic, as shown in
Figure 11. The average fee was also compared with those of already available Blockchain solutions. A comparison of our framework with existing Blockchain systems is presented in
Table 3.
Throughput of the Transactions
Our proposed framework for rice can manage unlimited transactions on a regular basis due to the involvement of a large number of farmers, stakeholders, and retailers. So, it is highly critical to make it scalable for high-volume transactions. Therefore, we used Apache Jmeter software to analyze the transactions on the test network over 30 days. The Blocks Per Day (BPD) of the proposed framework were calculated with the following formula, and the number of Blocks Per Minute (BPM) was derived by converting BPD to seconds.
To obtain the transaction throughput in BPM, we calculated the average number of transactions in each block and then multiplied it by the total number of blocks in minutes to obtain the Transaction Per Minute (TPM).
Figure 10 shows the block-per-minute data of our proposed framework for the rice crop. By using the BPD equation, we calculated the number of transactions that occurred in a day, and by implementing the Transaction Per Second (TPS) equation, we determined that 60 transactions were performed. Thus, the average transaction number in our proposed framework was 60 TPS. However, the number of per-hour transactions was 800 k–1.9 million. It means that our framework can handle a high volume of transactions in a day. In the case of rice crop sale and purchase, the designed framework can process a very high number of transactions on an hourly basis.
5. Conclusions
The current system of the rice crop supply chain lacks qualities like security, reliability, traceability, and transparency, which leads to high costs in the sale of crops and sometimes results in a shortage of crop stocks. Therefore, the rice crop supply chain traceability is highly important to ensure transparency to stakeholders and government authorities, enabling them to track the product from farm to fork. In this research, a Blockchain-based framework was proposed to make the rice supply chain transparent. The proposed framework for the rice crop supply chain is completely traceable and price-controlled. The framework was implemented on the Binance Smart Chain (BSC) network, is very fast, and is based on very low transaction fees as compared to available Blockchain systems including Ethereum and Bitcoin. Digital wallets and smart contracts were used to develop a system to transfer money with high reliability and complete security in all transactions, using the Rice Coin (RC). The RC ensures that farmers and stakeholders can obtain appropriate wages and rice quantities for their efforts. The proposed framework regulates the export of rice crops and controls illegal trade, saving the governments money when importing expensive rice during the off-season. To enhance data availability, data security, and stakeholder trust, an IPFS system was used to store encrypted information on farmers, retailers, and companies. Furthermore, the experimental results of the proposed framework showed that this system is far better than the traditional and existing systems in terms of transaction per minute, block latency, verification time, and average gas fee for a transaction.
The potential future research directions on this topic include the customization of smart contracts in order to reduce the transaction cost as well as to increase the system’s performance. Furthermore, mobile traceability applications and smart wallets to manage rice coins should also be the object of future research.