Blockchain-Based Supply Chain System-A Proof of Concept for the Coffee Industry

A supply chain is a logistic system that converts raw materials into finished products and distributes them to customers. The system usually consists of material producers, factories, organisations, sellers, consumers as well as transportation. Data and information such as manufacturing data and shipment data also form an important part of the supply chain system and is usually maintained centrally by one entity. Centralisation can cause several problems in supply chain system management, such as single point of failure, corruption, and data tampering. Blockchain has for the past years emerged as a decentralised technology that can help solve the problem of centralisation. The research, therefore, explores the feasibility of using blockchain technology in the supply chain system focusing on coffee produce and shipment. We analyse the suitability of blockchain to the supply chain. We then designed and implemented a smart contract using Solidity, which runs on an Ethereum-based blockchain to show that supply chain data can be traced and blockchain can be used for supply chain purposes.


INTRODUCTION
Manufacturing and logistics have become more complex due to the increasing number of entities involved in the process.This is especially the case with the intermediaries between producers and consumers.What is worse is that there is little knowledge about the product's origin, how it is processed, and eventually shipped to the hands of the customers [1].The coffee industry is worth billions of dollars globally.In Thailand, coffee consumption and revenue in the coffee market has steadily increased for the past five years to USD838.5 million in 2023 [2] and will continue to increase in the foreseeable future.The coffee supply chain is a complex business.This is because coffee beans have to pass through the hands of coffee growers, traders, coffee processors, roasters and finally into the hands of customers.Most farmers have no idea where their coffee beans go and what price they are sold for at the end of the supply chain [3].This, therefore, means that the main challenge of the coffee industry and its supply chain is the ability for all involved entities to trace their data or product.Many other industries have faced the same problem.Data management systems have, as a result, been designed and implemented so that data can be stored.However, there are two major problems with the conventional supply chain data management system.The first is that only the system owner can use and look at the data.The second is that it is managed centrally.
A centrally managed supply chain system presents several threats, including single point of failure, system availability, and data integrity and tampering.In single point of failure, if the supply chain management system fails, it means that no one will be able to record and access any data, which leads to the problem of system availability.When the system is owned and managed by one single central authority, there is a chance that data will be modified, leading to corruption and fraud [4].This on the whole means that the coffee supply chain entities cannot yet collaboratively work together and verify the data and process.As a result, it has now become necessary to create a trusted ecosystem that allows all parties from coffee bean farmers to coffee consumers to access and verify the supply chain data.This will in turn lead to a more transparent and more accurate supply chain data management process.
Blockchain is a technology that can reduce the abovementioned risks by introducing the principle of decentralisation.In other words, blockchain is a distributed technology that allows participating entities to keep record of all data and transactions.This means no single entity has control of the entire system.Moreover, by allowing all entities to have access to all data and transactions, transparency is achieved [5].In addition, blockchain has another desirable property, namely immutability, which means that once a transaction or data has been recorded, it cannot be modified.These principles of blockchain, therefore, make blockchain a feasible property for solving the existing problems of the centrally managed supply chain system.
There have been several attempts to apply blockchain to the supply chain process [6], such as IBM Food Trust, Ambrosus, and Vechain, all of which allow for businesses to track their product movement.However, they appear to use their own proprietary chain, which makes it less accessible to others.Even though blockchain provides many desirable properties as mentioned earlier, there are still challenges in integrating blockchain into the supply chain ecosystem.One such challenge is the willingness to protect confidentiality by the businesses, which is practically the opposite of what blockchain tries to achieve in transparency.Saying that, we feel that the advantages of blockchain still outweigh the challenges, and therefore would like to explore the feasibility of using blockchain in supply chain by proving the concept in the coffee industry.We begin our study by analysing the suitability of blockchain in the supply chain ecosystem.We then design and implement a prototype of a supply chain system via an Ethereumbased smart contract to show that the data or coffee product can really be tracked using our proposed system.
The remainder of this paper is organised as follows.Section 2 provides background knowledge and literature.Section 3 provides the design of the proposed supply chain system based on blockchain and smart contract.Section 4 illustrates whether the entered and stored data can be traced by using the proposed system, and Section 5 concludes the paper.

BACKGROUND KNOWLEDGE
This section gives an overview of supply chain management, blockchain technology and how it has been adopted and applied to supply chain management.

Supply chain
A supply chain is defined as a network of entities that perform the functions of collecting raw materials, converting them into products, distributing them to retailers and finally to consumers [7] [8].In turn, supply chain management is the process of ensuring that the flow of products is done in an efficient manner [9].Effective supply chain management can be achieved by focusing on the following five areas.The first is production, which is where consumers' demands are studied, and products are made with the consideration of quality control.The second is inventory which is the stock of raw materials, semi-finished and finished products.The purpose of inventory is to act as a buffer between the producers and consumers.The third area location which is concerned with where raw materials are collected, where products are made and where inventory is located so that the most cost-effective place can be pinpointed.The fourth area is transportation, which deals with the distribution of raw materials and products from one entity to another.The fifth area is data or information, which considers the accuracy of the data related to the other four areas as well as the amount of data to be shared among the participating entities.
Traceability has recently become a requirement for entities participating in supply chain, including, in the case of coffee industry, farmers, traders, coffee bean roasters, coffee shops, and customers.Traceability allows for tracking information about products, such as where they originate, where and how they are produced or manufactured, and how they are distributed [10].Moreover, traceability is now critical for some companies as it is forced by government regulations in some countries, especially in the food industry [11] [12].
With traceability comes transparency.In other words, when supply chain is traceable, any participating entity including end customers can have access to the relevant data.For example, they will be able to have information on where coffee beans are harvested, who roasted the beans, how they are transported, and who the retailers are.It can, therefore, be said that traceability increases visibility, which helps with consumers' assurance of the products.However, currently the supply chain is now as transparent as it can be.As a result, consumers have to solely rely on the retailers (or the coffee shops) to provide them with the information regarding the product or coffee they are consuming.It is, therefore, necessary to enable traceability and transparency to increase customers' trust and to make the perspective of the supply chain better for all parties.Achieving traceability and transparency is, nonetheless, not an easy task [4], but with the availability of blockchain technology, we will provide an attempt to see whether it is possible.

Blockchain
Blockchain is the technology behind a successful cryptocurrency named Bitcoin, which was proposed as a peer-to-peer electronic cash system [13].Blockchain introduces the concept of distributed ledger, which stores transactions and data at each node on the blockchain network.When a transaction occurs and data is to be stored in a block or a ledger, verification is done and a consensus is reached by a mechanism called proof-of-work or proof-of-stake, depending on which technology is used on the blockchain.Blockchain has several desirable characteristics including decentralisation, immutability, and transparency.
After the Bitcoin blockchain had been around and used for a number of years, Vitalik Buterin saw the potential of the blockchain technology beyond Bitcoin financial transactions and created a new blockchain platform called Ethereum [14] on which smart contracts can be generated.A smart contract is an executable computer code stored on a blockchain.The contract allows transactions to occur and to be stored on the blockchain when a certain condition is met.This provides an advantage over a traditional database.In other words, not only data can be stored, but it is also stored in the distributed manner due to the use of blockchain.More importantly computer applications can be written with specified conditions and distributed to all nodes on the blockchain, specifically Ethereum network, so that verifications can be done, and consensus can be reached prior to storing data in a block.Although blockchain has been adopted to use in other industries than finance [15] [16], it is not to say that blockchain is better than a traditional database in all aspects.There are still certain applications that are more suited to traditional databases.This is why we need to analyse whether blockchain is suitable for the supply chain data for the coffee industry.

DESIGN OF A BLOCKCHAIN-BASED COFFEE SUPPLY CHAIN MANAGEMENT SYSTEM
We designed a blockchain-based supply chain management system for the coffee industry by first analysing the suitability of blockchain using the framework introduced by Lo et al. [17].The framework is in the form of a flowchart containing yes/no questions.Once the end of the flowchart is reached, we can conclude whether blockchain is suitable for the application to be designed.The resultant analysis is presented in Table 1.
In the next stage, for simplicity, we specified three stakeholders for our proposed proof-of-concept blockchain-based supply chain management system.They were coffee farmers, coffee bean suppliers, and customers or coffee recipients.With the objective of traceability in mind, we then simulated the data that we thought would be useful for the tracing purposes and ended up with the following for each stakeholder.Firstly, for the farmers, a product code, farm location, order details, coffee planting time, coffee seed details, order date and delivery date would be the information stored on the blockchain.Suppliers would only want to add product code, customer's name, customer's address, and delivery date to the blockchain.Finally, product code, farm's location, order details, coffee seed details, and delivery date would be useful to customers.
Next, we investigated the implementation of the blockchainbased application.We found that a de facto blockchain platform used for building a decentralised application was Ethereum.Ethereum is a platform that has the ability to execute programs known as smart contracts on the blockchain, which means that we were able to write our proposed supply chain application and deploy it on the Ethereum blockchain.By creating a decentralised application or a smart contract, several properties of blockchain are guaranteed.The first is decentralisation which means that the contract and data are distributed among the participating entities, namely farmers, suppliers, and customers in this case.The second property is immutability which guarantees that the code and data stored at each entity are tamper-proof.
After the technology was chosen, the next step is to create a blockchain-based coffee supply chain management system which would allow for traceability.We obtained the knowledge earlier that the stakeholders, namely farmers, suppliers, and customers, wanted to enter and access different information.With the aforementioned information, we designed a blockchain-based supply chain prototype that allowed farmers and suppliers to enter the data related to them, and customers to trace or look up the information regarding their coffee product.The prototype was implemented on Remix Integrated Development Environment (IDE) using Solidity, which is a programming language primarily used for building smart contracts.The prototype was then deployed on a blockchain network called Sepolia, which is an Ethereum network used for testing smart contracts.Note that we implemented a prototype as proof of concept using a simple case study which involved three main entities in the supply chain.
The final step is the evaluation of the blockchain-based coffee supply chain prototype.Although there are many criteria that can be used to evaluate the proposed system, but for this particular research we would only be interested in showing that the proposed supply chain system could really be implemented as a decentralised application and deployed on a blockchain network.The traceability of coffee products would be evaluated, too.

RESULTS AND DISCUSSION
From the design, we divided stakeholders of our prototype coffee supply chain system into three groups for simplicity.They are farmers who grow coffee, suppliers who buy coffee beans from farmers and sell them on, and customers who buy coffee or coffee beans.In the context of our proposed blockchain-based system, farmers and suppliers can record information regarding product code, coffee bean data, and delivery details.Customers can then trace coffee product information.Coffee farmers and suppliers can trace as well.This is summarised in Figure 1.As already explained in the previous section, we implemented a smart contract for our prototype on Remix IDE using Solidity.The prototype allows farmers and suppliers to add the specified information.This can be seen in Figure 3.In our proposed proof of concept, we assumed that the coffee supply chain began on coffee farms, went through suppliers, and ended with customers buying coffee beans or coffee products, though more entities can always be added to the system.The workflow of this particular coffee supply chain requires coffee farmers to record coffee bean identification number (this could be called a product number), the address of the coffee farm, coffee planting date, coffee seed details, order date from the supplier, and coffee bean delivery date.Suppliers are required to record the product number, customer's name and address, and delivery date.Finally, our proposed system allows customers to trace the coffee or product's data by simply entering the product number.By entering the product number, relevant information, namely the farm's address, coffee seed details, and delivery details will be fetched and displayed to the customer.This confirms the traceability achieved by building a decentralised application on the Ethereum blockchain platform.The flow of recording data and tracing data can be seen in Figure 2.
For customers, assuming they have received their coffee product, they can enter the product identification number or product code into the provided user interface.They will then be presented with the information about the origin of the received coffee product.This includes the coffee farm's location, the coffee planting date, the coffee seed details, the order and delivery dates.Figure 4 illustrates an example of what a customer can see when tracing the coffee product.This, therefore, confirms the traceability of the proof-ofconcept coffee supply chain system.
The prototype of the coffee supply chain management system was implemented as a smart contract on an Ethereum test network called Sepolia.Although Sepolia is a test network, it still emulates the live Ethereum blockchain.When running a decentralised application of this kind on a blockchain network, we need to understand that whenever a transaction such as storing data occurs, a transaction fee needs to be paid by the entity making the transaction.Since we tested our system on a test network, we cannot say how much it cost us to execute the program and make transactions.However, at the time of writing, if the prototype were to be deployed on the live Ethereum blockchain, an average transaction fee would be 0.004 ETH, which would be approximately 6 USD, according to the exchange rate at the time of writing.This we believe might cause a problem of adoption as some entities would not think that this cost was affordable.To overcome the problem of paying transaction fees, a consortium would have to be formed and a dedicated blockchain network would have to be established.
One aspect of blockchain-based applications that we acknowledge is the issue regarding scalability.When the number of nodes grows, there will be a challenge regarding transaction processing speed, network throughput, and data storage.Fortunately, there are ways to counter such challenges which include the use of new consensus mechanisms and the optimisation of network architectures.Saying that, these are still open for future research.

CONCLUSION
We proposed a proof-of-concept coffee supply chain management system based on blockchain technology.We demonstrated that in the coffee supply chain each participating entity was able to record data related to coffee plantation, coffee beans and coffee delivery.This made it possible for end consumers to trace the data to find out where coffee products originated and where they had gone through before getting into the hands of the customers.We designed, developed, and tested our prototype on Ethereum's test blockchain network.It was found that the prototype could meet the objectives of our study, namely having a supply chain system in a decentralised environment and ensuring traceability of coffee products.
For future work, we plan to develop our prototype further so that more entities can be added to the supply chain.Moreover, since at the moment our prototype is still a proof of concept, it is desirable to turn it into a real and more accessible application so that it becomes more user-friendly for all involved in the supply chain system.

Figure 1 :
Figure 1: Use Case Diagram of the Coffee Supply Chain System Prototype

Figure 2 :
Figure 2: Flow of Coffee Data in the Proposed System

Figure 3 :
Figure 3: Farmers and Suppliers' Interface for Entering Coffee Data

Figure 4 :
Figure 4: Customer Working on Traceability Functionality

Table 1 :
Analysis of the Suitability of Blockchain for Coffee Supply Chain Management System