Open Access
ARTICLE
Smart Contract to Traceability of Food Social Selling
University of Cauca, Calle 5 #4-70, 190003, Popayan-Cauca, Colombia
* Corresponding Author: Cristian Valencia-Payan. Email:
Computers, Materials & Continua 2023, 74(3), 4703-4728. https://doi.org/10.32604/cmc.2023.031554
Received 21 April 2022; Accepted 30 June 2022; Issue published 28 December 2022
Abstract
Traditionally, food sustainability has been considered solely in the stage of agricultural production. However, globalization, the expansion of the food production industry, and the emergence of supermarket chains that control the retail food market require specific significant changes in supply chains in the food sector and, therefore, we need to address the economic, social, and environmental impacts of these events. On the other hand, social selling has increased rapidly in recent years, with a further boom, following current events related to the coronavirus disease (COVID-19). This explosion of social sales, where there are usually no control and regulation entities, can bring problems associated with mishandling items. In this paper, we expose how Blockchain technology supports the traceability of social sales by validating the data provided by the chain participants such as digital health passports, production and transport data in the sale process; the proposed solution generates recommendations on product management considering the agreements previously made by the network actors. To evaluate the proposed smart contracts, we use Hyperledger Caliper, obtaining an average throughput of 12.6 transactions per second and an average latency of 0.3 s for the asset update process. We also use a study case to evaluate the proposed project platform’s selling-transport stage using Internet of Things (IoT) sensors.Keywords
Traditionally, the sustainability of food has been considered solely in the stage of agricultural production. However, globalization, the expansion of the food production industry, and the emergence of supermarket chains that control the retail food market require consideration of specific significant changes in supply chains in the food sector and, therefore, it is essential to address the effects of this on the economy, the society, and the environment.
To reduce the uncertainty and the risk of business and ensure the chain’s sustainability, it is pertinent to strengthen the quality of the relations between the participants. In this context, the barriers most considered when implementing sustainable supply chains are higher costs, coordination and complex effort, and insufficient or lack of communication between the different actors in the chain [1].
Recently the use of social networks as sales platforms has increased. Consumers have turned to social media to get quicker access, and in some cases, at lower prices, to specific types of products or goods for sale [2]. Still, the sold products sometimes do not have the desired quality, and buyers can’t verify the origins of the purchased goods [3]. On the other hand, when buying food, the consumer wants to know how and who manipulated the product. Information about the food manipulation and selling processes are a concern that has grown in recent years. Furthermore, due to COVID-19 events, the consumer demands information about the operator’s health conditions [4].
Also, online business has become more expensive. It requires more sophisticated knowledge making it difficult for freelancers to afford these activities, and it has a more extensive reach so that the company will prevail [5]. Although social selling has been more commonly used in business-to-consumer (B2C) transactions, some researchers consider social selling a prominent approach with the potential for the business-to-business (B2B) transactions [6]. Social selling has reduced the number of intermediaries buying and selling goods and services. However, this has caused the traceability process to be more complicated, involving parties that do not necessarily follow the government regulations. Social selling still has a long way to go when it comes to traceability.
In recent years there has been an increase in the use of Blockchain technology with traceability due to its distributed, transparent, secure, and auditable features [7]. What can Blockchain technology do to improve an already tested and accepted traceability process? Traceability can be defined as identifying and tracking the history, distribution, location, and application of products, parts and materials of a final product to ensure reliability [8]. Nevertheless, the information is centered, and traceable partners may not have access to certain information about the product in real-time. Blockchain technology could also present new threats to traceability processes, as authors like [9] mention. For this reason, data reliability, human errors, and the reliability of sensor-generated measurements, due to the lack of mutual trust mechanism in the data collection and transmission processes giving place to multiple security threats [10], must be checked. Even if the data recorded on the Blockchain is secure and tamper-resistant, the chance of an altered input must be considered by [11].
A smart contract with data validation and a food blockchain platform for social selling are proposed in this study. With this proposal, technology will contribute to the economic component of sustainability and specifically to the traceability of products in favor of potential protection for consumers. Also, using Blockchain technology, a Social Selling platform could improve the traceability of the processes in social sales so that users can quickly respond to any adverse event that can be present in the sales process and increase the scope of the business by offering reliable traceability methods despite the informal nature of the social selling environment.
A systematic mapping of the scientific research database was carried out based on the methodology proposed in [12] to obtain an overview of the research area and locate shortcomings and contributions. Our primary focus is the available Blockchain-enabled social selling traceability implementations and the use of smart contracts to perform data validation on each transaction generated in the selling process. The topics of interest were: Blockchain, smart contracts, social selling, traceability, and data reliability. First, we will review the key concepts used in this systematic mapping.
A smart contract is a transaction protocol intended to execute automatically. Its execution begins once a set of pre-defined conditions have been met [13]. This type of contract does not require the intervention of a third party for its execution, and they are entirely auditable. The transaction fees are low because these contracts do not require a third party that corroborates the process. Currently, Blockchain platforms support smart contract execution due to the multiple possible applications like the Internet of Things, E-commerce, etc.
It develops relationships as part of the sale process, using social networks like Facebook, Twitter, etc. Nevertheless, this process can take place online or offline, and it is focused on building solid relationships with potential buyers. Social selling is an approach that leverages social media to understand, connect and engage customers in what is deemed relevant to their decision-making processes [6].
Data reliability is a crucial foundation when building data on an interesting topic. The data is sufficiently complete and accurate [14]. It is related to the quality of the captured data. Reliability can also be expressed as the number of failures over a time window [15].
Our goal is to answer the following research questions:
RQ1: What implementations of Blockchain are used to support social selling processes in small businesses? How can a food Blockchain traceability platform improve the trust in a social selling scheme?
RQ2: Can a smart contract be used to measure the reliability of the data stored in a food Blockchain traceability platform? Could this negatively affect the number of transactions performed on the network per second?
We limited the review to those related to the food supply chain or product traceability and security, considering that the following research was selected for the final evaluation.
In [16], the authors reviewed different Blockchain applications in food traceability, showing the Blockchain platform used, the traced product, and the use cases. Finally, they discuss the role of this technology in enhancing traceability processes. Authors in [17,18] show how it is possible to solve problems associated with the lack of trust in traditional centralized systems using blockchain technology. However, there is no mention of trust problems related to the reliability of the data stored on the network. Authors in [19] explore the potential of Blockchain as a sustainability tool for food supply chains; they conclude that the technology is used as a tool for sustainability and addressing sustainability challenges.
On the other hand, authors like [20,21] propose using Blockchain technology to improve data reliability, transparency, and food safety in an agri-food supply chain. Each research shows multiple benefits this technology provides in traceability, information access, decision making, etc. Authors in [22] offer a solution for untrusted food traceability information using Blockchain technology combined with IoT technologies to collect and update traceability information. Unlike the discussed research, our work proposes smart contracts to validate the data using the previously agreed conditions by the traceability partners.
We observe that some authors like [10,11,23–25] have been addressing data reliability in Blockchain networks from different perspectives proposing storage systems that can be incrementally updated to ensure data reliability and efficient consensus protocol to address data reliability on IoT systems. These approaches offer control goals for Blockchain oracles and blockchain-based sensor network data security storage mechanisms to reduce network storage consumption. Finally, a distribution of transaction database using expiration recognition method based on Least Recently Used, optimizing storage by moving out transactions. Authors in [26] show an improvement in the Merkle tree structure, thus obtaining an effective reduction in the transmission load of the network and an improvement when verifying the blocks of the network. However, the authors validate the complete information of the block but do not validate the information contained in each transaction. In [27], the authors proposed a Blockchain-IoT sensor (BIoTS) to address security challenges related to data integrity by integrating mining capabilities in a sensor connected to a Blockchain network. However, the authors do not consider the constant increase in the difficulty of the proof of work consensus algorithm and the resource consumption on the BIoTS device. Nevertheless, none of these approaches considers smart contracts as tools to validate data generated outside the Blockchain network.
Authors like [28] proposed using Blockchain technology to detect harmful behavior on a social network using enhanced audit and collaboration strategies. Nevertheless, the authors do not consider if the audited data has been validated before. Authors like [29,30] analyze the inclusion of Blockchain technology in social networks, how they would benefit, the challenges it would offer, and how the dissemination of cryptocurrencies on social networks can be considered a performance indicator; however, the authors do not consider a social selling environment and has been focused on the social interaction between users.
We also manage to find some authors that have to consider the impact of COVID-19 on the food supply chain and perform an analysis of the chain safety like [31] that provide suggestions about improving food supply chain safety research and motivates other researchers to determine how Blockchain technology affects these traceability processes. Authors like [32,33] have proposed using technological solutions in the prediagnosis of COVID-19, obtaining excellent results in detecting and differentiating it from other respiratory diseases. However, these proposals require data that cannot be processed without additional specific hardware. Finally, in [34], the authors proposed a traceability system using Blockchain technology to ensure consumer safety and COVID-19 free cold or frozen product. However, none of these proposals considered the use of health passports and the health status of the supply chain operators.
Based on our review, no evidence has been found of Blockchain technology and Traceability on social selling in small businesses. Still, we managed to get information about the most used implementations of Blockchain platforms used in food traceability and how other authors look to improve trust in food supply chains using Blockchain technology. We believe that these advantages remarked by the authors in their investigations are valid even in a social sales scenario.
In this research paper, we make the following contributions.
• A platform for food traceability using Blockchain technology for small business social selling.
• A smart contract with data reliability validation for data generated outside the Blockchain network.
3 Traceability in Food Supply Chains
The food industry has evolved into a customer-oriented sector to deal with food incidents faster [35]. With the increased travel distance from producer to consumer, keeping the food in good condition has become challenging at most supply chain stages. Governments, consumer organizations, and the food industry has been dealing with credibility issues due to the crisis of food contaminated with bacteria or viruses that are harmful to humans or food produced from genetically modified seeds.
Fig. 1 shows the general supply chain; each block has a complex structure depending on the number of involved members. Each block could have a long or short internal supply chain depending on how the process is conducted and the number of processes involved. The length of the supply chain based on how each block member performs its job results in an increase in the complexity of the supply chain; this could lead to a decrease in the traceability and enhanced vulnerability of the supply chain [36].
Due to the previously mentioned issues, traceability gained importance in the supply chain as a response to the increase of standards and policies regarding food safety developed for the food industry.
3.2 Social Media in the Supply Chain
With the constant growth of potential customers on social media platforms, there has been an increase in real-time access to the information regarding a product used by other customers that shared their opinion about the product [37]; companies have started to understand that consumer communities are essential to the business success. This understanding has enabled the B2C communication represented by a short supply chain that can be seen as a less complex and straightforward version of the last two stages of the food supply chain shown in Fig. 1.
This has made it possible for companies to conduct advertising campaigns directly focused on those communities that make up the core of a product’s consumption, also known as social marketing. Similarly, they have gained a way to offer ready-to-eat products directly to the end consumer through social networks or social apps; this is known as social selling. It is reducing the number of intermediaries between the business and the consumer, thanks to B2C communication through social media.
3.3 COVID-19 Pandemic Effects on the Supply Chain and Social Selling
With the COVID-19 pandemic, governments in some countries decreed the closure of factories, markets, and other centers dedicated to the production and sale of food agglomerations could occur. This has affected the capacities related to traceability in the different supply chain links due to staff limitations because of the restrictions imposed by governments.
COVID-19 has also affected the use of digital sales platforms, especially social sales platforms and e-commerce. Although developing countries struggle to harness digital opportunities, the pandemic has caused a digital shift that has boosted digital media performance. According to [38], online marketplaces have seen increases in their sales. In general, digital businesses have been more resilient to the pandemic crisis since they have not been so affected by the restrictions imposed by governments. Governments are considering the use of a Digital Health Passport (DHP) to certify that a product has not been exposed to any biological risk on the supply chain and to prevent highly contagious diseases like the COVID-19 spread to tourist locations, work facilities, or airports from and to take measures to avoid future pandemic scenarios. A Health Passport is an expandable document that contains all the critical personal, social care, and clinical information about a person with one or multiple health considerations [39], like the Digital Certificate of Vaccination “MiVacuna” [40] offered by the Colombian government, that certifies that the owner has started or completed the vaccination schedule, and the results the of COVID-19 test taken, to allow their access to highly crowded sites or events.
Although the pandemic has brought benefits, it has also presented challenges to governments and companies to obtain more significant benefits from this boom and achieve greater penetration of potential consumers. The main challenges to be solved are disruptions in traceability in the supply chain and commercial coordination due to privacy policies on social networks. In addition, access to the internet so that more people can access these methods of buying and selling food.
A way to help recover business that has not migrated to social selling or e-commerce and to improve the condition of the company that has done it is to develop a national strategy to facilitate this adaption of these strategies, a cost reduction for internet access, increased internet connectivity, among others [38]. But also the inclusion of new technologies that allow these social sales to be integrated into global supply chains [41] so that they can more quickly benefit from technology transfer, mainly in developing countries.
4 Blockchain-Based Traceability Platform for Social Selling
This section presents the Blockchain traceability platform, the Social Selling process using our proposed platform, and the smart contracts for Social Selling with data reliability validation.
4.1 Blockchain Traceability Platform (BTP) Structure
Our platform works with large or small supply chains on a Social Selling scheme, and every member of the network must include in its transactions the DHP of the involved operators; the network validates this information and notify all the relevant members when a product has been in contact with an operator with a highly infectious disease.
Platform users use their preferred social network profile to register on our platform. The social network user information is used to create their purchase/sales/transportation profile on our platform. This way, our users can use their social networks for advertising their direct products and potential buyers to our platform to purchase and track them.
To perform data validation for the product, the DHP, and the management recommendation, we develop a framework that can autonomously create smart contracts with data validation using a knowledge base, to work on the transactions made in the Blockchain network. Although the information on the Blockchain cannot be altered, the traceable information could have anomalies.
Anomalies can be present at distinct stages of the traceable product. These anomalies can be related to the process date, seller or buyer data errors, bad temperature handling, or a sick operator manipulating a product. Detecting these anomalies and deciding what to do with the affected products is an urgent task in the current COVID-19 pandemic. Also, other zoonoses may occur in the future, so implementing DHP data on this platform could help prevent the spread of these types of infectious diseases.
Fig. 2 shows the proposed traceability platform structure. The platform has three connected layers; one to control and monitor all user’s interactions with the app, one layer to watch all the data generated by the Blockchain network, and finally, a layer that analyze the collected data to find anomalies that must be corrected and create rules for updated versions of the smart contracts on the Blockchain network.
We use a Monitor-Analyze-Plan-Execute over a shared Knowledge (MAPE-K) [42] structure to detect some anomalies in the traceable process. MAPE-K framework is ideal to use on a Blockchain network since it can be decentralized. We have a knowledge module that store all the relevant information collected and generated by the other four modules. The Monitoring & Analyze module check each transaction made on the Blockchain network. The Planning module create autonomously new smart contracts to validate the previously detected inconsistencies based on the Monitoring & Analyze Module results. Also, the planning module define management recommendations and risk alerts based on the potential risks found. Finally, the Execution module update the smart contract on the Blockchain network with the one generated by the Planning module.
Fig. 3 shows the general supply chain. As can be seen, each member has its activities that can be performed by sellers, transporters, and/or buyers. The first stage is the selling process; the users set the product availability, promotion, and more information related to the product. The suppliers provide the selling goods to the users on the network or perform the selling processes directly. In the second stage, a network user could be offering its services as a transporter, or a supplier will use its private means to manage the delivery of the product to the buyer.
Finally, the last stage is the delivery of the sold object. In this stage, the social selling platform user will decide if the product fulfills the agreed conditions with the seller or the supplier and accept or reject the product. We can see that the social network manager will be able to access the information at every stage on the platform to perform evaluations, decide penalties or ban products from the network that do not follow the terms of use. Also, as indirect members, we have selected the Good Practices Models and Standard Certifications and the Governments Entities to perform validations when a supplier or user reports that a product has a certification granted by a private or governmental entity.
4.2 Social Selling Using Our Proposed BTP
A smart base contract will be running on the platform to manage distinct product sales from the beginning. Eventually, considering the anomalies found in the transaction, the contract will be updated to detect these anomalies and issue warning notifications about the traced product.
In Fig. 4, we can see the basic workflow of how the platform work; a buyer starts the process by looking for a product; if the product is available, the order placement process will begin. The seller accepts the generated charge if the buyer sends the order. If the seller agrees with the order, it will be processed, and the product’s data, the buyer, and the seller will be attached; of the latter, the DHP will be included. Once the data is secured, the transport order will be generated.
Suppose any involved actor has no DHP and/or supplies information that cannot be verified to validate DHP. In that case, the platform uses the smart contract to set a notification with the current DHP issue. Although the DHP validation is performed outside the Blockchain platform, it uses the data stored on the ledger, including any inconsistency. In cases where the information is not valid, the platform encourages users who will receive the product rejects it or takes preventive measures for its reception.
The notified carrier may decide whether to accept the transport of the product. If there are no problems and the request is received, the transporter’s data will be attached, and the delivery process will begin. Once this process has started, recurring transactions will be sent to the Blockchain network, and the smart contracts will issue notifications on the network according to the previously established conditions. Finally, both the seller and the carrier may send offers to those users who have promoted their services. The user who receives these promotions will decide whether to accept the offer and request the sale or transportation.
The deployed smart contracts will be monitoring all the stages and issuing automatic notifications to all members. In a social selling environment, this is crucial since it allow both the seller and the buyer to know the status of their product at any time during shipments or if the buyer wishes to return the product. The idea of increasing users’ trust in this type of service will eventually translate into an increase in sales and growth of small businesses that base their business model on sales through social networks.
Table 1 shows the comparison between our platform and some commercial solutions for traceability of products, whether food or otherwise. Not all commercial solutions offer protocols or steps to prevent the spread of diseases such as COVID-19, and most that offer it, are limited to contact-free delivery. As for traceable data, most of them have end-to-end traceability. But traceable information will depend on the type of contract made or the goal of the company that contracts the services. Others only track the product location during the delivery process through the services offered by the contracted transport companies.
Regarding data validation, only one of the solutions offers a separate tool to audit traced data, so there is no real-time data validation. Finally, we see that only Facebook Market Place supports social selling, just like our platform. However, it has no blockchain technology support, and traceability is low.
4.3 Smart Contract for Social Selling
Smart contracts record all information generated by the direct actors, from selling to delivering. All actors are able to consult the information related to specific activities on the supply chain. This information is not susceptible to manipulations once uploaded into the ledger. Next, we show the use of smart contracts in the activities for the three supply chain stages.
Table 2 shows the data available for the smart contracts. At each stage, a predefined smart contract between the involved members manages the data and make recommendations about the product based on the transaction’s information.
With the proposed scheme for the network and smart contracts, it is possible to achieve greater control over the status of the products sold and improve control over the spread of diseases. This proposal focuses on social selling and person-to-person sales and not on sales conducted in large stores. However, its uses could be extended to large stores.
5 Description of the Test Scenario
5.1 Artisan Sweets Supply Chain
In the department of Cauca, Colombia, specifically in the city of Popayán, the tradition of the elaboration of artisan sweets could be at risk of being lost due to a lack of appreciation and recognition, which has led to various strategies from Public Policy to safeguard this knowledge. Due to this, a study was conducted to figure out the supply chain of artisan sweets in the region, managing to find three levels of supply chain depending on the degree of “industrialization” of the production of artisan sweets. The levels can be seen in Fig. 5.
Fig. 5 shows the 3-level supply chain for artisan sweets. The level 1 supply chain consists of a link in which the producer acquires the raw material necessary for producing the sweet and subsequently sells the sweet delivered directly to the final consumer (black-colored stages). At level 2, the producer offers his products through retailers (blue-colored stage), either owned by him or by a third party. Finally, level 3 of the supply chain includes distributing the sweets (green-colored stages) to the retailer’s site.
In 2018 the confectionery sector globally produced around US$193 billion, being the Artisan Sweets a large subsection of this sector. According to [53], there are around 48 Artisan Sweets considered traditional in the city of Popayán; these sweets are sold in at least 15 retailer’s sites distributed around the city, producing around US$300.000 yearly, a crucial monetary income, in light of the fact that most of the producers are middle-class families. Considering this, it is essential to increase the traceability of the Artisan Sweets, to improve quality control, or to help in obtaining trademarks or distinctive seals such as collective trademarks or appellations of origin, which can increase the scope of these types of products, the sale price, and the economic income of the producers.
Based on the framework proposed in [54], the users are the sweet artisan producers; they will send data related to the storage of the raw material, the production process, the storage of the finished product, and its transport. The data for this case is irreversible.
The peers for the Blockchain network will be on two devices; each device will have one or more peers joined to a channel on the network, depending on the number of producers. Peers have an identity assigned to them via a digital certificate from a certificate authority on the network. Whenever a peer connects to a blockchain channel, the channel uses its identity to determine its rights. Peers can query assets over the network but cannot independently create or update an asset. All the peers on the network must reach a consensus; once the consensus is reached, the ledger is updated, and a new block is created. Our test network uses the Raft consensus algorithm [55]; it achieves consensus by relying on the ordering service intermediating messages between senders and receivers. Due to the consensus algorithm used, the deployed network does not require a transaction fee.
Our proposal uses Hyperledger Fabric Blockchain solution, and a smart contract developed using JavaScript language. The contract can self-check the transactional data looking for syntax errors in all cases. Also, it compares the newly entered data with the optimal values agreed by members to check if any recommendation must be issued. The agreed conditions are stored in the initial block, so any member involved in the selling process can check those conditions. According to the systematic mapping, most of the solutions implemented for traceability in the food supply chain use the Blockchain Ethereum platform. However, for our development for small businesses, we decided to use the Hyperledger Fabric platform since it allows us to configure the network further using diverse types of consensus algorithms, which can be plugged or unplugged at any time and do not require paying fees for each transaction.
Finally, Blockchain challenges must be considered carefully based on Campo [45]. Our focus is on Throughput and Latency mainly because the smart contract must validate the growing amount of data to be stored in the network. This proposal does not consider other challenges because it requires more development and a broader deployment for assessment.
To evaluate our proposal in a natural environment, we deploy a set of IoT sensors on the production site of “Aplanchados Doña Chepa,” one of the most famous producers of Artisan Sweets in the region. We use 5 Elitegroup Computer Systems (ECS) Tags [56]; these tags were developed for the tracking system; each tag has ambient light, temperature, humidity, and shock/tilt sensors.
To download the sensed data from the deployed ECS tags, we develop an Android app that connects to each tag to download the data and upload the data to a File Transfer Protocol (FTP) server on the machine used to deploy the Blockchain network. The ECS tags were configured to record temperature and humidity measurements only; they were located in the raw material warehouse, the production sites, the final product storage unit, and a transport unit. The transport unit is non-conventional; the producers use a motorcycle to transport the final product to each selling point where the product can be found. Once the tags start collecting data, we connect to each and upload it to the Android App server. After the sensed data reach the server, we use a python developed code to autonomously send transactions to the Blockchain network with the recollected data using the expanded smart contracts.
At the time of the development of this research, we are still developing the platform’s interface intended for the final consumer’s use. For this reason, in this case, study, only the stage corresponding to the seller-transporter of the product is evaluated. To run the FTP server and deploy the Blockchain network, we use two remote access virtual machines running ubuntu 16.04 with four cores, 8 gigabytes (GB) of RAM, and 200 GB.
6 Implementation and Performance Evaluation
Using the Hyperledger Fabric Blockchain solution, we develop a smart contract to simulate the behavior of a Social Selling process. We use the JavaScript programing language to create smart contracts. The smart contracts have three critical components for the proposed BTP (Fig. 4). The Knowledge, the Monitoring, and the Analysis modules.
Errors, anomalies, or risks represent the Knowledge module that the ECS tags sensed data could show at any transaction. The Monitoring module is represented by the functions that collect all the values sent at any transaction on the Blockchain network. After that, the Analysis module function tries to find the previously defined error patterns; if an error is detected, update the error entity on the network using the detected error for later analysis and the target entity will be is updated using the previous state. The target entity is updated using the current transaction value if no error is found. Finally, after the product is delivered, all the information on the Blockchain is exported to plain text files for the Planning and Execution modules, currently in development, to be used as the latest information in the knowledge module and to generate new rules for the detection of errors or instructions for the management recommendation. The developed smart contracts check data for reliability using the Kivenson proposed method [57] and consistency using a correlation function.
Initially, we decided to perform stress tests on the Hyperledger Fabric network; for this, the Hyperledger Caliper tool was used, which allows us to execute these tests automatically upon the network’s configuration, and execution parameters collected information on the network to generate performance metrics. We run the stress test using Caliper with 60 to 600 s duration, using 6 Workers or clients sending transactions on the network and a TransactionLoad of 10, that is the number of transactions to be maintained. The test duration was selected randomly, starting with 60 s and then modifying the configuration file to reach 600 s using 60 s increments during intervals.
Next, we present the pseudocode of the essential algorithms in the smart contracts. Algorithm one in Fig. 6 shows the asset creation process. The algorithm uses transactional data related to a product using an asset ID. Each time a product is sold, this algorithm is called and added to the traceability Blockchain network. The transported and delivered variables tell the smart contracts if the product is transported or delivered. When an asset creation transaction arrives at the platform, the contract validates if the asset is new and create the asset on the Blockchain ledger. If not, asset update algorithm is executed.
The Finite-State Machine (FSM) model presented in Fig. 6 shows the transitions between the states available at this stage for the smart contract: Transaction receive (S0), Asset creation (S1), Asset update (S2), Asset validation (S3), Ledger update (S4). This algorithm has the following a time complexity O(n) due to its linear time operations.
Algorithm two shows the asset update process. This algorithm updates the asset states on the ledger; as previously mentioned, each sold product has an ID stored as an asset.ID. Using this ID, the smart contracts update the state of all the product data on the ledger. This algorithm also calls algorithms 4 and 5 to check for syntax errors on the transactional data and set management recommendations. When the data is valid, the algorithm sets new states on the Blockchain ledger using the asset.ID, if data is invalid, the algorithm will update the conditions of the anomaly data states and update the asset states using the last valid information available. If the asset has not been created, the algorithm executes asset creation.
The FSM model presented in Fig. 7 shows the transitions between the states available at this stage for the smart contract: Transaction receive (S0), Asset creation (S1), Asset update (S2), Asset validation (S3), Ledger update (S4), Data validation (S5), Syntax error check (S6), Recommendations (S8), Consistency (S12), Reliability (S14). This algorithm has a time complexity of O(n) due to linear time operations.
Algorithm three shows the syntax error check; in this case, the smart contracts check if the traced data can be converted from string to numeric data. If the data cannot be converted, the algorithm returns the data value stored on the ledger as corrupted data to be analyzed later by an operator. If the data can be converted, the algorithm returns the string none. Finally, algorithm four shows the smart contracts recommendation function. In this case, the smart contracts will generate a management recommendation based on the received data to ensure the quality of the sold product and the users in cases where the DHP reports a contagious pathogen or disease.
The FSM model presented in Fig. 8 shows the transitions between the states available at this stage for the smart contract: Data validation (S5), Syntax error check (S6). This algorithm has a time complexity of O(n) due to linear time operations.
The FSM model presented in Fig. 9 shows the transitions between the states available at this stage for the smart contract: Data validation (S5), Optimal values retrieval (S7), and Data comparison (S8). This algorithm has a time complexity of O(n) due to linear time operations.
Algorithm five shows how the consistency value is calculated. In this case, all the historical data is used, the historical data is divided into two vectors of equal size, and the correlation between these vectors is then estimated. This value is used as the consistency parameter. Algorithm six calculates the reliability of the data; this measure is estimated by dividing the amount of data in good condition by the total amount of data.
The FSM model presented in Fig. 10 shows the transitions between the states available at this stage for the smart contract: Data validation (S5), Historical data retrieval (S9), Data selection (S10), Vectorization (S11), and Correlation (S12). This algorithm has a time complexity of O(n log(n)).
The FSM model presented in Fig. 11 shows the transitions between the states available at this stage for the smart contract: Data validation (S5), Syntax error check (S6), Historical data retrieval (S9), Data selection (S10), Total elements (S13), Reliability Calculation (S14). This algorithm has a time complexity of O(n log(n)). After developing the smart contracts, we perform the stress test over the network creating and updating assets.
In Fig. 12, we can see that the number of successful transactions in the reading stage in each test cycle increases linearly. In the read stage, the transactions create the initial status of the variables associated with the product for sale or transport. We can see a decrease in the number of transactions, but no failed transactions were logged. We can also see a drastic drop in the number of successful transactions on the network on the update transactions due to the additional processes to which each transaction is subjected. The validation processes and recommendations are executed during this stage.
In this case, failed transactions occur when two or more workers simultaneously try to update the same product. Still, the system only lets one of the workers perform the update, and the other transactions are rejected. In a typical environment, the probability of this happening will be close to zero because each product will be assigned to the user managing it at each stage. There will not be multiple users updating the same product information simultaneously.
We can also see that after 260 s of test duration, there was a decrease in the transaction rate; this could be due to a server-side problem or that the smart contracts resource consumption is heavy on the system. However, after debugging the smart contracts and performing multiple tests, we determined that the system had problems with the deployed tools. After heavy use of the Hyperledger Fabric solutions, the performance decreases.
In Fig. 13, we can see the comparison between Throughput and latency in each test performed; we can see a significant difference between the two types of transactions performed on the network. The update transactions require more processing time due to the different processes that must be conducted; however, in a natural environment, the results make us believe that the smart contracts would be executed without any inconvenience on the proposed platform due to the use of multiple channels to trace various products. As for latency, after updating the information, it would not be long for that update to be available on the network for other nodes; on average, it would take 0.4 s.
After the stress test, we relaunch and initialize the Blockchain network and the developed smart contracts to send transactions using the developed Python tool and the 5 ECS tags sensed data. To initialize the smart contracts, we used the minimum accepted values for humidity and the maximum accepted value for temperature; according to the Artisan Sweet producer’s case study, 65% of moisture and 25 Celsius degrees. The following figures show the results obtained using the final product storage unit tag.
In Fig. 14, we can see the humidity and the Consistency and Reliability values during the test. The Consistency and Reliability values calculations are made inside the smart contracts using the new data available on the recent transactions and the previously stored data from the old transactions. These transactions will also include the ones made by previous versions of the smart contracts.
As shown in Fig. 14, humidity begins at the initialized value and goes up to the current levels and varies between 75% and 80%, reaching this maximum value occasionally. Reliability always remains at one throughout the test duration. This means that the humidity transactions did not present anomalous values in terms of syntax or values below the limits established by the producer. Nevertheless, the values that exceed 80% RH could be considered semantic anomalies on the data, this type of anomaly will be detected in future versions of the smart contracts. In the case of consistency, we can see that it varies between 0 and −1, finally remaining at a value close to zero; that is, the data does not have consistency. Consistency works as a correlation between the data sent to the network. It can be seen how the humidity variations affect the consistency measure, which presents significant variations throughout the execution time.
Fig. 14 also shows the same results for the temperature data. In this case, we decided to put a limit at 16 Celsius degrees to evaluate the reliability measurement using only the data of the ECS tag located on the final product storage unit. So, the temperature data should be between 16 and 25 Celsius degrees to be considered a suitable storage temperature; it should be clarified that this limit does not represent the reality of the storage temperature of artisan sweets in the region. In this case, the reliability goes up from zero initially, but after the temperature drops below the 16 degrees limit, it rapidly goes to 0. Also, we see that the consistency stays close to 1 when the temperature data continuously drop. Still, at the beginning, when the temperature data drop and then goes up, and at the end, when the temperature starts to go up again, the consistency drops to zero. We perform the same process using the transport tag, considering the previous results. The results are shown below.
Fig. 15 shows the humidity and temperature values during a transport stage. In this case, the behavior is similar to the results found during the storage stage in consistency and reliability measurement, although the humidity values and behavior are different. Also, Fig. 15 shows that in the case of transport where no temperature control has been stipulated, the reliability value stays at 1. The consistency ones again go from 0 to 1 once the temperature values start to drop and decrease after the temperature begins to go up. In these cases, we see that the reliability values depend on the agreed terms because no syntax errors were found in the data collected from the sensors.
Fig. 16 shows the results for the shock-sensor data, only available for the transport tag. In this case, we can see that the sensor detects a shock at the final stage of the transport process, going up from 0 to 1. Due to this, the consistency measurement stays at zero, and the reliability value remains at one throughout the test. For this case, a semantic error will be anything below 0, anything above 1, or between those two. Fig. 16 shows that the product shook firmly to activate the sensor response. Based on the results obtained in all cases where the data has variations going up and down, we conclude that the consistency will not be beneficial to evaluate the quality of the data sent in each transaction unless used in environments where the values are growing or decreasing continuously.
Finally, at the end of the process, a transaction is sent that lets the smart contracts know that the sold product is going to be delivered; at that moment, the contract requests the network all the information about the product and generates a recommendation on the acceptance or rejection of the product. All the queries and states of the network are saved in plain text files for later interpretation. The next step will be the development of the graphical interface that will show all the relevant information for users, the recommendations generated by the contract, alerts for the health risks found, and the reliability score of the users based on the reliability of the data sent in each transaction conducted over the network.
With RQ1, we aimed to identify the Blockchain platform currently used to implement food supply chain traceability and its uses on small business social selling and specifications, considerations, and approaches to its proper implementation. Nevertheless, we could not find any evidence of the use of this technology for this specific topic. We found information about its use on Industry 4.0 topic. Still, due to this proposal's objective business characteristics, we do not consider them applicable or usable in our research. On the other hand, this platform can improve confidence in social sales. It is transparent with the findings made in the literary review and the proposed platform that the possibility of having real-time information about the acquired product makes users of this type of sales process feel more confident not only in the delivery of the product but also in the quality of the same, in addition to having support that allows them to make the pertinent claims in case the product does not comply with the previously agreed conditions.
With RQ2, we aimed to determine if data validations can be made using smart contracts; having this in mind, we decided to implement syntax error validations in the sensed data and two variables related to consistency and reliability, allowing us to get some metrics that enable us to decide whether the information in the network is reliable. However, the metrics are not definitive, and more research is needed. Additionally, we were able to observe the behavior of the Blockchain network by stress testing and a pilot assembly of the production and transport stage of a product that is usually sold under the social sales scheme. This allowed us to determine that using the implemented smart contracts functions does not represent a significant load on the network in this specific case, and traceability activities can be conducted without saturating the network.
The development of this platform benefits online retailers by giving them more reliability in the selling process based on the platform qualification; they could be qualified using the transactions registered on the Blockchain platform. Also, all the users will be able to track in real-time their products using the platform apps on a mobile device or a computer. Traceability implementation using Blockchain technology could help the technology be adopted more quickly by small producers in developing countries, who do not have the monetary capital to implement more elaborate traceability processes considering the limitations that the environment may present in terms of sensing technologies that could be used. Additionally, these would help identify problems in the different methods conducted during social sales so that future improvements can be applied to how the products are managed or packaged.
Although the current development only has a couple of rules to determine if a data is correct or not, with a Complex Event Processing engine or Machine Learning algorithms, rules can be generated to find correct or mistaken values, considering the historical data. Nevertheless, more data reliability measurements should be evaluated to have more clarity on the subject. In our case, the platform was more oriented toward social selling, where the supply chain is short and straightforward. Still, it could be adapted and used in other instances in which data validation is required in transactions conducted over the network.
Finally, in times, like the one affronted with the COVID-19 pandemic, this type of platform gives online retailers, transporters, and buyers a safe way to perform the activity, reducing the direct contact between the involved personnel and potentially dangerous products, having been in touch with a sick person considering the DHP data.
Acknowledgement: The authors are grateful to the Telematics Engineering Group (GIT) and the Research Group for Rural Development (Tull) of the University of Cauca, and the Ministry of Science Technology and Innovation of Colombia (Minciencias) for the Ph.D. support granted to Cristian Valencia Payan, as well as the Project “Estrategias para la valorización de los dulces tradicionales de Popayán” (Código: 110380863995) founded by Minciencias - Colombia (Contrato 127-2019).
Funding Statement: The authors received no specific funding for this study.
Conflicts of Interest: The authors declare that they have no conflicts of interest to report regarding the present study.
References
1. S. Seuring and M. Müller, “From a literature review to a conceptual framework for sustainable supply chain management,” Journal of Cleaner Production, vol. 16, no. 15, pp. 1699–1710, 2008. [Google Scholar]
2. J. N. Moore, M. A. Raymond and C. D. Hopkins, “Social selling: A comparison of social media usage across process stage, markets, and sales job functions,” Journal of Marketing Theory and Practice, vol. 23, no. 1, pp. 1–20, 2015. [Google Scholar]
3. I. H. Hong, J. F. Dang, Y. H. Tsai, C. S. Liu, W. T. Lee et al., “An RFID application in the food supply chain: A case study of convenience stores in Taiwan,” Journal of Food Engineering, vol. 106, no. 2, pp. 119–126, 2011. [Google Scholar]
4. G. Leavey, A. Abbott, M. Watson, S. Todd, V. Coates et al., “The evaluation of a healthcare passport to improve quality of care and communication for people living with dementia (EquipA protocol paper for a qualitative, longitudinal study,” BMC Health Services Research, vol. 16, no. 1, pp. 363, 2016. [Google Scholar]
5. V. Tudoran, “The new sales funnel for the smes and freelancers in the 4.0 revolution,” in Proc. of the 31st Int. Business Information Management Association Conf., IBIMA 2018: Innovation Management and Education Excellence through Vision 2020, Milan, Italy, pp. 1638–1649, 2018. [Google Scholar]
6. C. Ancillai, H. Terho, S. Cardinali and F. Pascucci, “Advancing social media driven sales research: Establishing conceptual foundations for B-to-B social selling,” Industrial Marketing Management, vol. 82, no. 7, pp. 293–308, 2019. [Google Scholar]
7. Z. Zheng, S. Xie, H. N. Dai, X. Chen and H. Wang, “Blockchain challenges and opportunities: A survey,” International Journal of Web and Grid Services, vol. 14, no. 4, pp. 352–375, 2018. [Google Scholar]
8. United Nations, “A guide to traceability: A practical approach to advance sustainability in global supply chains about the united nations global compact,” 2014. [Online]. Available: https://www.bsr.org. [Google Scholar]
9. J. Grover and S. Sharma, “Security issues in wireless sensor network-a review,” in 2016 5th Int. Conf. on Reliability, Infocom Technologies and Optimization, ICRITO 2016: Trends and Future Directions, Noida, India, pp. 397–404, 2016. [Google Scholar]
10. J. Wang, W. Chen, L. Wang, R. Simon Sherratt, O. Alfarraj et al., “Data secure storage mechanism of sensor networks based on blockchain,” Computers, Materials and Continua, vol. 65, no. 3, pp. 2365–2384, 2020. [Google Scholar]
11. M. D. Sheldon, “Auditing the blockchain oracle problem,” Journal of Information Systems, vol. 35, no. 1, pp. 121–133, 2021. [Google Scholar]
12. K. Petersen, R. Feldt, S. Mujtaba and M. Mattsson, “Systematic mapping studies in software engineering,”, in Proc. of the 12th Int. Conf. on Evaluation and Assesment in Software Engineering (EASE), Bari, Italy, pp. 68–77, 2008. [Google Scholar]
13. M. Alharby and A. van Moorsel, “Blockchain based smart contracts: A systematic mapping study,” in 11th Int. Conf. in Computer Science and Information Technologies, Yerevan, Armenia, pp. 125–140, 2017. [Google Scholar]
14. U.S. Government Accountability Office, “Assessing data reliability applied research and methods,” 2019. [Online]. Available: https://www.gao.gov/assets/710/703275.pdf. [Google Scholar]
15. P. D. T. O’Connor and A. Kleyner, “Introduction to reliability engineering,” in Practical Reliability Engineering, 5th ed., Hoboken, NJ, USA: Wiley, pp. 1–18, 2012. [Google Scholar]
16. A. J. Collart and E. Canales, “How might broad adoption of blockchain-based traceability impact the U.S. fresh produce supply chain?,” Applied Economic Perspectives and Policy, vol. 44, no. 1, pp. 219–236, 2022. [Google Scholar]
17. J. Wang, W. Chen, Y. Ren, O. Alfarraj and L. Wang, “Blockchain based data storage mechanism in cyber physical system,” Journal of Internet Technology, vol. 21, no. 6, pp. 1681–1689, 2021. [Google Scholar]
18. J. Zhang, S. Zhong, T. Wang, H. C. Chao and J. Wang, “Blockchain-based systems and applications: A survey,” Journal of Internet Technology, vol. 21, no. 1, pp. 1–14, 2020. [Google Scholar]
19. N. Friedman and J. Ormiston, “Blockchain as a sustainability-oriented innovation?: Opportunities for and resistance to blockchain technology as a driver of sustainability in global food supply chains,” Technological Forecasting and Social Change, vol. 175, no. 2, pp. 121403, 2022. [Google Scholar]
20. V. Rambhia, R. Mehta, R. Shah, V. Mehta and D. Patel, “Agrichain: A blockchain-based food supply chain management system,” in Lecture Notes in Computer Science (Including Subseries Lecture Notes in Artificial Intelligence and Lecture Notes in Bioinformatics), Vol. 12991. LNCS. Berlin, Germany: Springer, pp. 3–15, 2022. [Google Scholar]
21. I. González-Puetate, C. L. Marín Tello and H. Reyes Pineda, “Agri-food safety optimized by blockchain technology: Review,” Revista Facultad Nacional de Agronomía Medellín, vol. 75, no. 1, pp. 9839–9851, 2022. [Google Scholar]
22. C. Ling, T. Zeng and C. Li, “Design and implementation of a food safety traceability platform based on blockchain and Internet of Things,” in IEEE Information Technology, Networking, Electronic and Automation Control Conf., ITNEC 2021, Xi’an, China, pp. 1421–1425, 2021. [Google Scholar]
23. Y. Yin, Y. Li, B. Ye, T. Liang and Y. Li, “A blockchain-based incremental update supported data storage system for intelligent vehicles,” IEEE Transactions on Vehicular Technology, vol. 70, no. 5, pp. 4880–4893, 2021. [Google Scholar]
24. R. Xu, Y. Chen and E. Blasch, “Microchain: A light hierarchical consensus protocol for IoT systems,” in EAI/Springer Innovations in Communication and Computing, Berlin, Germany: Springer, pp. 129–149, 2021. [Google Scholar]
25. J. Zhang, S. Zhong, J. Wang, X. Yu and O. Alfarraj, “A storage optimization scheme for blockchain transaction databases,” Computer Systems Science and Engineering, vol. 36, no. 3, pp. 521, 2021. [Google Scholar]
26. J. Wang, B. Wei, J. Zhang, X. Yu and P. K. Sharma, “An optimized transaction verification method for trustworthy blockchain-enabled IIoT,” Ad Hoc Networks, vol. 119, no. 1, pp. 102526, 2021. [Google Scholar]
27. C. Gonzalez-Amarillo, C. Cardenas-Garcia, M. Mendoza-Moreno, G. Ramirez-Gonzalez and J. C. Corrales, “Blockchain-IoT sensor (BIoTsA solution to IoT-ecosystems security issues,” Sensors, vol. 21, no. 13, pp. 4388, 2021. [Google Scholar]
28. L. Bahri, B. Carminati, E. Ferrari and A. Bianco, “Enhanced audit strategies for collaborative and accountable data sharing in social networks,” ACM Transactions on Internet Technology, vol. 18, no. 4, pp. 1–19, 2018. [Google Scholar]
29. B. Guidi, “When blockchain meets online social networks,” in Pervasive and Mobile Computing, Vol. 62. Elsevier B.V, Amsterdam, Netherlands, pp. 101–131, 2020. [Google Scholar]
30. S. Park and H. W. Park, “Diffusion of cryptocurrencies: Web traffic and social network attributes as indicators of cryptocurrency performance,” Quality and Quantity, vol. 54, no. 1, pp. 297–314, 2020. [Google Scholar]
31. J. Luo, S. Leng and Y. Bai, “Food supply chain safety research trends from 1997 to 2020: A bibliometric analysis,” Frontiers in Public Health, vol. 9, pp. 475, 2022. [Google Scholar]
32. M. Kaur, V. Kumar, V. Yadav, D. Singh, N. Kumar et al., “Metaheuristic-based deep COVID-19 screening model from chest X-Ray images,” Journal of Healthcare Engineering, vol. 2021, pp. 8829829, 2021. [Google Scholar]
33. N. Kumar, M. Gupta, A. Hashmi and A. Kundu, “Automatic diagnosis of COVID-19 Related pneumonia from CXR and CT-Scan images,” Engineering, Technology & Applied Science Research, vol. 12, no. 1, pp. 7993–7997, 2022. [Google Scholar]
34. A. Iftekhar and X. Cui, “Blockchain-based traceability system that ensures food safety measures to protect consumer safety and COVID-19 free supply chains,” Foods, vol. 10, no. 6, pp. 1289, 2021. [Google Scholar]
35. M. M. Aung and Y. S. Chang, “Traceability in a food supply chain: Safety and quality perspectives,” Food Control, vol. 39, no. 1, pp. 172–184, 2014. [Google Scholar]
36. P. Katsikouli, A. S. Wilde, N. Dragoni and H. Høgh-Jensen, “On the benefits and challenges of blockchains for managing food supply chains,” Journal of the Science of Food and Agriculture, vol. 101, no. 6, pp. 2175–2181, 2021. [Google Scholar]
37. S. Markova and T. Petkovska-Mirčevska, “Social media and supply chain,” Amfiteatru Economic, vol. 15, no. 33, pp. 89–102, 2013. [Google Scholar]
38. United Nations, “COVID-19 and e-commerce impact on businesses and policy responses,” 2020. [Online]. Available: https://unctad.org/system/files/official-document/dtlstict2020d12_en.pdf. [Google Scholar]
39. E. Vaczy, B. Seaman, K. Peterson-Sweeney and C. Hondorf, “Passport to health: An innovative tool to enhance healthy lifestyle choices,” Journal of Pediatric Health Care, vol. 25, no. 1, pp. 31–37, 2011. [Google Scholar]
40. Minsalud, “Mi vacuna,” 2021. [Online]. Available: https://mivacuna.sispro.gov.co/mivacuna. [Google Scholar]
41. United Nations Conference on Trade and Development, “Impact of the COVID-19 pandemic on trade and development,” United Nations, pp. 1–112, 2020. [Online]. Available: https://unctad.org/es/node/29935. [Google Scholar]
42. P. Arcaini, E. Riccobene and P. Scandurra, “Modeling and analyzing MAPE-K feedback loops for self-adaptation,” in Proc. -- 10th Int. Symp. on Software Engineering for Adaptive and Self-Managing Systems, SEAMS 2015, Firenze, Italy, pp. 13–23, 2015. [Google Scholar]
43. Connecting-Food, “The world’s first food confidence platform, blockchain-based,” 2017. [Online]. Available: https://connecting-food.com/. [Google Scholar]
44. Authena, “Authena-product authentication & brand traceability,” 2020. [Online]. Available: https://authena.io/. [Google Scholar]
45. Ebay, “EBay Inc,” 2001. [Online]. Available: https://www.ebayinc.com/. [Google Scholar]
46. Amazon, “About Amazon,” 2000. [Online]. Available: https://www.aboutamazon.com/. [Google Scholar]
47. Meta, “Social metaverse company,” 2018. [Online]. Available: https://about.facebook.com/. [Google Scholar]
48. DoorDash, “About us,” 2021. [Online]. Available: https://www.doordash.com/en-US/about/. [Google Scholar]
49. Agrichain, “About the platform,” 2019. [Online]. Available: https://agrichain.com/about-the-platform/. [Google Scholar]
50. DownStream, “About downstream,” 2021. [Online]. Available: https://www.down-stream.io/about. [Google Scholar]
51. AgriDigital, “Our story,” 2016. [Online]. Available: https://www.agridigital.io/about-us. [Google Scholar]
52. Fishcoin, “Fishcoin: Blckchain based seafood traceability & data ecosystem,” 2018. [Online]. Available: https://fishcoin.co/. [Google Scholar]
53. A. Maca and L. Navia, “Estrategias para el rescate y valorización de los dulces tradicionales de popayán,” 2019. [Online]. Available: http://repositorio.unicauca.edu.co:8080/handle/123456789/1581. [Google Scholar]
54. H. Treiblmaier, “Toward more rigorous blockchain research: Recommendations for writing blockchain case studies,” Frontiers in Blockchain, vol. 2, pp. 3, 2019. [Google Scholar]
55. RAFT, “Raft consensus algorithm,” 2016. [Online]. Available: https://raft.github.io/. [Google Scholar]
56. Elitegroup, “ECS tag,” 2004. [Online]. Available: https://www.ecs.com.tw/en/product/iot/cscg_tag/overview. [Google Scholar]
57. N. Agmon and N. Ahituv, “Assessing data reliability in an information system,” Journal of Management Information Systems, vol. 4, no. 2, pp. 34–44, 1987. [Google Scholar]
Cite This Article
This work is licensed under a Creative Commons Attribution 4.0 International License , which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.