Blockchain Based Solutions for Milk Procurement Management and Adulteration Detection

. In our day-to-day life, milk is a fundamental component that is rudimentary for many food products. Consuming milk regularly is very important because it is a mixture of various macro and micronutrients and is a source of proteins, fats, carbohydrates, and vitamins. Particularly in our nation, women's empowerment and milk production are closely related. Furthermore, rural Indian communities rely heavily on small holder dairy farms for their livelihoods, and women play an important role in milk production. The dairy sector is estimated to contribute around 6% of the country's agricultural GDP, with the value of milk production in India exceeding 200 million ton by the year 2023 [1]. Milk is a highly perishable commodity, when not handled properly it is susceptible to microbial spoilage. The milk after production must be processed properly to retain its quality till consumption. Nowadays, many milk vendors are adulterating the milk for financial gain. Consumers have the rights to obtain good and safe milk, as it is largely consumed by people of all age groups. Supply chain process of a small holder dairy farming has been examined recently in Salem, Tamil Nadu, India and it has been observed that the current process in dairy involves the accumulated milk from dairy farmers are being poured into the milk cane, then being detected and sent to a larger container where it is mixed with all the other milk. In most cases, it would be impossible to separate fresh milk from un-fresh milk. Therefore, the objective of this research work aims to develop a Blockchain and IoT based solution for milk procurement and adulteration detection there by providing a complete milk traceability data to the consumers from production to consumption, and establishing a trust in providing quality milk to the society.


Introduction
Milk is an ideal ingredient in every household. There are important nutrients found in milk, such as calcium, phosphorus, carbohydrates (lactose), vitamins B, C, and D, potassium, and vitamin D [4]. Also, it is an excellent source of protein. As a result of milk consumption, chronic conditions such as obesity, high blood pressure, and cancer are significantly reduced. There are a variety of sources of milk in the world, including cows, buffaloes, goats, sheep, and camels, with buffalo milk being the second most frequently consumed type after cows' milk. In terms of milk production, India is the world's largest contributing twenty-four per cent of global milk production.
All of us have been facing adulteration in food since civilization's beginning, as it not only reduces the quality of foods but also results in a continuing problem with severe economic and health consequences [3]. While at the same time, milk vendors often adulterate milk with water, detergents, caustic soda, starch, formalin, urea, ammonium sulphate and sodium carbonate, which can be harmful to health. It is due to greed for money that they produce synthetic milk without any nutritional value. An adulteration occurs when a milk product does not conform to federal or state regulations. By adding another substance to milk, one can increase the quantity of milk, though the actual quality may suffer. As well as financial gain, milk can be adulterated due to unhygienic conditions such as processing, packaging, transportation, distribution, etc. Water is the most common adulterant used which decreases nutritional value of milk and lowers the quality of milk.
A study done by the FSSAI (Food Safety and Standard Authority of India) during the year 2019 shows that 68.4% of the milk in the country is not as per the legal standard. Not only in India, but also in other developed countries like USA; milk related incidences were high. It was reported that 160 products in the USA were recalled in 2018 due to undeclared allergens, of which one third was milk-related [2]. Such incidents have increased the concern for the traceability of the milk and other dairy products. Keeping a dairy product's nutritional values and quality on a consistent basis requires transparency in its supply chain. Food frauds impacting millions of people have been caused by the lack of transparency, traceability, and provenance in the dairy supply chain [5].
Moreover, expensive milk analysing machines are not used in small holder dairy farming especially in rural areas. As a result, there may be a longer waiting time in the queue for quality check and farmers may have to wait for hours to complete their milk collection process. In addition to that, in the existing system, milk received containing all details of milk transactions may be recorded in the cloud based milk collection software which use distributed databases that are centrally managed by a service provider.
Unlike cloud storage, which relies on third parties to secure data, Blockchaina decentralized immutable public ledger, on the other hand, ensures data protection and integrity without the involvement of third parties. The technology has a great potential to transform the dairy industry since it can address a number of challenges that are preventing transparency and traceability in the dairy supply chain. In order for this to work, all of the members involved must be registered in the Blockchain network; they will have a unique digital identity and profile. Milk and milk products must be updated as they move in the network, which is also automated by the use of IoT. By using RFID tags, sensors, and other devices to update the data across the system, automation can be performed. Therefore, to reduce manual work of milk collectors and to enforce trust among the stakeholders, this research paper propose a Blockchain and IoT based solution for milk adulteration detection and dairy supply chain traceability to determine the authenticity, and the freshness of the milk from production to consumption. In the rest of the paper, Section-2 presents an overview of Blockchain technology; Section-3 provides an overview of Internet of Things technology; Section-4 gives about the need of integrating Blockchain and IoT technologies; and Secion-5 addresses the literature study and related works with few use cases in the dairy supply chain system; Section-6 proposes a Blockchian and IoT based solutions for milk supply chain traceability and adulteration detection with respect to four stages namely, at the farm, at the dairy society, at the packaging and distribution unit, and at the retailer's shop. Section-7 provides a brief conclusion for the research work.

Blockchain
The technology underlying other cryptocurrencies like Bitcoin is known as "Blockchain technology," sometimes known as "Distributed Ledger Technology (DLT)". It was first released under the alias of Satoshi Nakamoto. According to some, this technology has the ability to upend practically every business and has been called the second-most important innovation to civilization after the Internet. Blockchain is a digital database system where recorded data is transferred simultaneously across computer network which is depicted in figure-1. It lacks a centralized authority, in contrast to the current conventional database system. Nodes are the components of the Blockchain network. The network's participants are known as nodes. The network receives information that has been digitally signed using cryptographic keys by the nodes. Then, additional nodes will get such information and verify its validity. This stops false information from being saved. This information will be included in the block after authentication. Such a block has a special code known as a hash. Such a hash code adds new blocks by connecting them to the preceding block, and each following block links back to the prior block to form a chain. If someone wants to change the data in the network, they must decipher the hash code, which takes a lot of processing power. As a result, the Blockchain database is immutable and offers protection to the data saved on the network. Similar to that, it is simple to determine the history of the information that is present in the network.

Need of Consensus Mechanisms
Consensus plays a significant role in the growth of trust among the stakeholders in distributed computing systems. Trading on the Blockchain network requires total transparency due to its decentralized nature. This minimizes the chances of a buyer becoming a victim of fraud. When distributed systems reach an agreement on a single data value, this is known as a consensus mechanism which is depicted in figure-2. That is, in a network involving multiple users or nodes, these mechanisms (algorithms) achieve reliability. To do so, these consensus mechanisms ensure that a transaction is reflected in the Blockchain as soon as it gets validated. Also, it ensures that all the transactions are rightly listed in the Blockchain network. Similarly, there is another consensus mechanism called "smart contract" in Blockchain. It is a self-executing programme based on if-then logic that secures, enforces, and carries out the settlement of a contract between businesses, individuals, and things.. The most widely used blockchain for smart contracts is Ethereum, which has a robust ecosystem of dapps and tools for creating, evaluating, and implementing smart contracts using the Solidity programming language.
Three categories of blockchains-public, private, and consortium (also known as federated)-have been established based on the uses and specifications. A blockchain network can be joined by anyone who has access to the internet because the public blockchain is a permissionless, non-restrictive distributed ledger system. Mining and cryptocurrency exchange are the two main uses of such blockchains.
The consortium blockchain, also known as federated blockchains, is ideally suited for businesses that require both public and private blockchains. This type allows access to preselected nodes for reading, writing, and auditing the Blockchain. There are multiple central authorities in charge, or we could say multiple organisations involved. The control maintains its decentralised nature because there is no single authority overseeing it. Blockchains like the IBM Food Trust are an example.

Need of Blockchain in Supply Chain Management
Globally, ensuring dairy supply chain safety and excellence has become a major concern, and Blockchain based supply chain traceability is seen as a crucial tool in overcoming it. It has evolved into an excellent tool for security, visibility, and transparency thanks to its decentralised structure, distributed storage, consensus processes (smart contracts), and asymmetric encryption. Thus, it ensures that no single entity has control over the entire business process, making it more resistant towards manipulation or fraud.
Furthermore, Blockchain can be used to automate the performance of smart contracts automatically once the necessary circumstances have been met, taking conventional contracts to a new level by executing agreements between two or more parties in a decentralized system. Therefore, businesses in industries such as shipping, manufacturing, finance, healthcare, among others, benefit from Blockchain and other interrelated technologies like IoT, AI, and Cloud. In particular, Blockchain can revolutionize the supply chain logistics industry by enabling the tracking of every product or item, including perishable goods through the use of smart contracts.

Overview of Internet of Things Technology
The Internet of Things (IoT) encompasses the interconnectedness of various physical devices and objects through the Internet. This network includes everyday items like appliances, vehicles, buildings, and individuals. The primary objective of IoT is to facilitate the collection and exchange of data among these objects, transforming them into intelligent entities that can interact with their surroundings and other devices in real-time.
IoT enables a seamless connection between the physical and digital worlds. These devices gather and transmit data using sensors, processors, and internet connectivity. The data collected may pertain to the device's status, environmental conditions, or user behaviour. Subsequently, this information is a central platform or cloud-based system, which undergoes processing, analysis, and utilization to trigger appropriate actions or generate valuable insights. Real-time data processing is fundamental to IoT as it enables swift decision-making and response. The practical applications of IoT are vast and diverse, spanning various industries and sectors. The various applications of IoT is shown in the figure-1. One notable application of the IoT lies in the domain of smart homes. Homeowners can remotely control and monitor numerous aspects of their living environment by incorporating IoT-enabled devices. For instance, they can adjust room temperatures, activate or deactivate lighting fixtures, or manage security systems-all through the convenience of their smartphones.
These interconnected devices communicate, creating an intelligent and interconnected living space. Healthcare is another field where IoT plays a significant role, particularly in remote patient monitoring. Wearable sensors continuously track vital signs, activity levels, and other health-related data. The collected information is then transmitted to healthcare providers, empowering them to monitor patients' well-being and intervene prom if required remotely. Real-time data from IoT devices significantly enhances the quality of healthcare services, particularly for individuals with chronic illnesses or needing constant monitoring. Transportation and logistics also benefit from IoT technology. IoT devices integrated into vehicles enable real-time tracking and monitoring of fleet operations. This integration enhances operational efficiency by optimizing routes, reducing fuel consumption, and improving overall logistics management. IoT sensors installed in cargo containers provide real-time information about their location, condition, and security, minimizing the risk of theft or damage during transit. The agricultural sector has also experienced significant transformations through the application of IoT. Farmers can monitor critical factors such as soil moisture, temperature, and nutrient levels by utilizing connected sensors. This datadriven approach empowers farmers to make informed decisions regarding irrigation, fertilization, and other farming practices.

The Integration of IoT and Blockchain in Dairy Supply Chain
With IoT, the collection of data from physical devices becomes possible. On the other hand, Blockchain can be used to store this data securely and ensure its immutability. By relying on sensors and other edge devices, IoT integration is changing how businesses operate. In a world where connected devices are increasing each year, IoT devices are processing huge amounts of data. The data are supplied in a chain and are vulnerable to cybercriminal attacks. Blockchain is a distributed ledger technology that, when combined with IoT, enables machine-to-machine transactions in a trusted manner. Therefore, by integrating IoT and Blockchain technologies, it is possible to create decentralized and secure system that can automate various processes and decision-making tasks. For example, in the dairy supply chain industry, the integration of IoT and Blockchain can enable tracking of freshness of the milk and other dairy products, which reduces the risk of fraud, and improve supply chain transparency and efficiency. Also, in other sectors like healthcare, the integration of these technologies can enable the secure exchange of medical data and assist in the diagnosis and treatment of patients. Similarly, it can also enable the creation of smart cities, where various urban systems such as transportation, energy, and waste management can be optimized through the use of decentralized technologies.
There are many industrial benefits of adopting Blockchain with IoT, as shown in fig-4: 1) Blockchain and IoT in supply chains: Through Blockchain, supply chains can be built stronger, more resilient, and business relationships can be improved. Blockchain adds transparency to trading partners, streamlines processes, and resolves issues more quickly. In addition to that, disruptions can be dealt with sooner.
2) Blockchain and IoT in Foodchain: It can protect food safety and freshness, as well as reduce food waste in the food industry. 3) Blockchain and IoT in cold chain monitoring: Every action is traced out as perishable/temperature-sensitive products such as pharmaceuticals and biologics that move through the cold supply chain system. The subsequent audit trail makes it possible to track down a product from its place of origin to a pharmacy/retail store, assisting in the fight against counterfeiting and allowing manufacturers to find recalled goods quickly. 4) Blockchain and IoT in finance: Regarding the financial sector, it assists in minimizing friction and delays, and enhancing operational effectiveness everywhere. This encompasses a variety of operations such as lending, consumer banking, clearing and settlement, and international trade. 5) Blockchain and IoT in healthcare: It can assist the healthcare business, which is overwhelmed by data breaches, increase patient data security while facilitating record sharing among doctors, clients, and researchers. The patient retains control over access, fostering more confidence. 6) Blockchain and IoT in Insurance: Insurance companies are automating manual and paper-intensive procedures like underwriting and claims settlement using blockchain technology and smart contracts to improve speed, efficiency, and cut costs. Faster, verified data exchanges enabled by blockchain assist lower fraud and abuse. 7) Blockchain and IoT in Governance: Governments may be able to operate more insightfully and quickly using blockchain. In addition to providing an unchangeable audit trail for regulatory compliance, contract management, identity management, and citizen services, secure data sharing between citizens and agencies can boost confidence. . Numerous instances of adulteration of milk have been described globally, wherein substances such as foreign polypeptide urea and melamine, vegetable or animal fats have been added as potential adulterants in milk. To overcome this issue in dairy farms, various Blockchain based frameworks have been described. Remarkable outcomes were Vietnamese domestic dairy supply chain makes use of Blockchain with IoT and smart contract technologies [26]. Adnan Iftekhar (2020) proposed a Blockchain based framework for Australian dairy industry to keep track of dairy supply chain transactions in a secured manner and to be transparent to stakeholders according to the agreed set of policies and rules without involving any centralized authority. This paper focuses on exploring and building an uncomplicated, low-cost solution to quickly link the existing food industry at different geographical locations in a chain to track and trace the dairy products in the market.
Roberto Leonardo Rana et al., (2021) presents a systematic literature on the perspective of sustainable agri-food supply chain of Blockchain technology. They have also presented several challenges such as scalability, privacy, sustainability, cost effectiveness and connectivity in terms of integrating Blockchain and IoT technologies [20]. Abishek M Aware et al., (2018) presents the design and development of low cost and efficient Arduino controller based IoT system to detect the parameters of milk such as potential of hydrogen (pH) , corrected lactometer reading (CLR) and SNF regarding milk adulteration, milk density and quality checking. The developed system was smaller in size and weight; works with lower power consumption and has a faster response [21]. Vyas S et al., proposed, The authors assume that block chain technology can contribute to economic and environmental dimensions to promote agri-food supply chain [27]. Paul et al., (2022), presents that the Blockchain technology can be used to address issues with the food supply chain, including poor management, a lack of transparency and traceability, poor communication between supply chain participants, system mistakes, product delays, and inadequate trust between consumers and suppliers. Suppliers can incorporate RFID chips, which include an antenna, a microchip, and printed identification information, inside their products and implant data like harvesting date and price into a Blockchain database. Tracking reusable and recyclable materials over the life cycle of the tea supply chain involves multiple stakeholders. Radio frequency identification (RFID) technology driven by Blockchain technology can help to manage the complexities of circular tea supply chain management, establishing transparency and traceability in the B2B tea industry [25].
In the following table-1, the characteristics of Blockchain based dairy supply chain system is compared with traditional dairy supply chain system. Data analytics can be applied to analyse the large volumes of data generated by the supply chain system to identify patterns and insights that can enhance the efficiency and effectiveness of the supply chain. Therefore, the Blockchain-based system for tracking and monitoring the flow of dairy products is transparent and accessible to all parties. Hence, with the help of IoT and Blockchain techonologies, the diary supply chain system may guarantee safe transactions, offer end-to-end visibility and traceability, and enhance the supply chain's overall efficacy and efficiency.  In situations, when bad domestic dairy products and improper supply chain practises were directly related to the production of dairy related products, it would be identified either by consumers or by the dairy authorities of India in most of the cases. Even if the faulty goods were established to be genuine, the dairy companies involved in the supply chain process would typically attempt to deny their involvement. And occasionally they would try to put the blame on the shipping or storage procedures used by the merchants, store owners, or even the customers. Therefore, a Blockchain based framework with IoT and smart contract technologies has been proposed with four stages to detect the adulteration of the milk and to track the freshness of the milk in a small holder farming which is depicted in the fig-4.
1) Stage-1-At the Farm: The initial stage of milk traceability is the farm, where it begins. At this point, the farmer's cows are normally each identified by an RFID tag. In order to track the cow's milking operation, the raw milk that it produces twice a day is deposited into stainless steel milk churns that have QR codes attached.
2) Stage-2-At the Dairy Society: This stage involves raw milk collector at the dairy society. He usually collects the milk twice a day. He/She will either accept or reject the farmer's milk by testing the purity of the milk against the standard values through smart contract code. In certain cases, if the collector detects a milk churn that does not meet the initial requirements and hence has to reject it, the farmer will know exactly which one of his or her cows is potentially having an issue by scanning the QR code on the rejected churn. 4) Stage-4 -At the Retailer's Shop: Ultimately the end customers/consumers will scan the QR code in the milk packet and can check the freshness of the milk from the production till consumption.
All of these stages of data can be automatically recorded in Blockchain system through smart contract validation. The end customers can view the supply chain traceability through QR code scanning. They will be redirected to a webpage that contains information about the milk they are about to consume: date of milk packaging and expiration, details of the farm, farmers, quality of the milk in terms of FAT, SNF and PH values, breed who produced the milk, healthiness of the breed, vaccination details of the breed, breed type such as cow or buffalo, and food safety standards that are followed in the dairy supply chain process.

Conclusion
The world health organization (WHO) has shown a significant concern towards reducing the public health risks associated with the sale of dairy products. There are many different types of adulterations, both intentional and unintentional. Intentional adulteration which is also known as food fraud that includes the purposeful incorporation of adulterants into the milk that includes water, sugar, soap, melamine, sodium bicarbonate etc. Contrarily, unintentional adulteration, also known as food contamination, is brought on by ignorance, inadequate facilities for maintaining the required level of food quality, incorrect food handling, and poor packaging techniques. Therefore, in this paper, a Blockchain and IoT based solution was developed to trace the entire dairy supply chain data from production to consumption and to detect the adulterations that are present in the milk. It was observed that the milk meets out its quality standards if the milk's pH and EC values with no adulteration range falls between 6.45 to 6.67 and 4.65 mS/cm to 5.26 mS/cm respectively, and FAT by 3.5% and SNF by 8.5% respectively. These standard values are compared with actual milk samples during milk collection stage. The raw milk is accepted if they adhere to the quality standards; otherwise gets rejected. The web application is implemented using smart contract technology. Smart contract is built using the following Blockchain based technologies: Ganache (Ethereum Blockchain server), Metamask (Ethereum Wallet), Truffle (Development framework for Ethereum Blockchain), Visual Studio Code (Integrated Development Environment) and Windows operating system.