Open Source Project & Paper: Blockchain proof of concept

Late last year I wrote a small paper (for my MBA program) and developed an accompanying proof of concept (Javascript/Node/P2P) on the implementation of blockchain in the retail or food distribution network around protecting goods from food fraud.

Source Code:


Food fraud is a crime which has the potential to negatively affect the brand image, financial resources and impact multiple parties in the supply chain paradigm of food distribution. The ability to track and trace the origin and touch points of products throughout the network is imperative to limit the impact caused by a food fraud incident or a food safety issue. Blockchain has the potential to disrupt multiple industries by providing a shared and trusted ledger of transactions which no single company controls. One practical application of blockchain is utilizing the platform as a static register – a distributed database for storing reference data. In this paper I will describe a technical implementation of a blockchain in a practical scenario which shares the details and a proof of concept of a food origin scenario. The implementation will share a simplistic JavaScript application of a digital ledger based blockchain allowing manufacturers to register data on the food origin in the static registry and vested parties the ability to augment and view the data for the purpose of traceability and accuracy.

Blockchain and the transformation of Marketing

Food fraud is the deliberate act of altering, modifying, substituting, misrepresenting or tampering with any food product at any point in the food supply chain for an economic gain (Smith, 2016). This type of fraud is a deceptive and an illegal practice which could cost companies their reputation and a serious loss of brand premium. One specific type of food fraud involves modifying the expiration date of products, commonly known in the industry as Food Product Dating. The motivation behind this devious practice could include 1.) Providing the perception that the food is fresher than the actual manufacturing date; 2.) Selling the food as unexpired when in fact it may have already expired; 3.) Providing a perception to the consumer that the product does not have an expiration date by removing or covering the date.

Per the United States Department of Agriculture, the food industry and consumers, Americans are throwing away about $161 billion dollars of food each year (USDA, 2015). This equates to roughly one third of their food purchased annually. The expiration date is one indicator that food should be disposed of.  Therefor tampering with these dates implies a potentially large economic opportunity for bad actors to exploit, but also potentially harmful effects on the consumer population exposed to the incorrectly labeled products. The effects from these fraudulent activities may financially benefit the actor performing the crime, however they can inadvertently have a major impact on the company who produced the product and, in this case, motivate the manufacturers to implement safety measures for the following reasons:

  • To avoid loss due to loss of business
  • To avoid unexpected expenses on recalls, disposal and penalties
  • To maintain the reputation of the company
  • To maintain consumers’ confidence and loyalty

(Hussain and Dawson, 2013)

In addition, there are two actors who may have slightly different intentions within the food supply chain who may alter food product dating 1.) Manufacturers of products may include a very conservative food product date on their products, which in turn would spoil faster, encouraging consumers to purchase more; 2.) The second actor could be distributers or retailers in impoverished countries where these actors may feel ethically challenged to dispose of food where people are starving and dying from malnutrition. This type of actor may not necessarily have a direct intention for economic gain but may indirectly cause a negative impact for reasons stated above.


In the event a food fraud or safety incident occurs, it is imperative that retailers, distributers and manufacturers work in unison to understand the potential impact, trace the issue and understand and uncover the root cause of the event. In a recent Walmart exercise, it took 6 days, 18 hours and 26 minutes to track all the touch points a pack of Mangoes, purchased at one of its stores, took through the food distribution network (Yiannis, 2018). The goal of the exercise was to uncover which company actually produced the fruit and which manufacturers, distributers, government agencies and importers were involved in this complex network, or more recently and commonly referred to as “farm to table”.

The impact of a food related incident is evident in the case of Chipotle Mexican Grill, a popular restaurant chain which initially occurred in December 2015. While this incident may not be related specifically to food fraud, I believe they have a very similar impact on the bottom line. The company’s revenue declined 20%, profit fell 82% and employee turnover soared when the company had two E. coli contamination incidents that sickened 55 people in 11 states, according to The Centers for Disease Control and Prevention (CDC, 2016). This turned into a marketing nightmare which severely damaged the chain’s reputation (Wahba, 2016). Chipotle and the CDC still do not know what caused the outbreak and after extensive investigation and scientific testing, they were only able to determine that a common meal item or ingredient served at Chipotle was likely source of the outbreak (CDC, 2016). This implies that a company has a major risk of being impacted, both financially and socially by an event they may not have even caused.


Track and trace is a term commonly used in various industries to understand touch points, sources, parties involved and the modification of products through a food distribution network. Tracing products provides interested and vested parties insights into critical information about a product.

Blockchain is an invention made in the 21st century and initially conceptualized by Satoshi Nakamoto. The basic premise is that blockchain is an open, distributed ledger that can record transactions between two parties efficiently and in a verifiable and permanent way (Iansiti and Lakhani, 2017). Additionally, blockchain can be used as a static registry – a distributed digital ledger for storing reference or transactional data. Fundamentally blockchain offers the following features making it a good candidate in the Track and Trace scenario:

  • The ledger is decentralized: multiple nodes hold a copy of the same data, therefor there is no dependency on a single entity or middleman.
  • The ledger is immutable: By using cryptographic hashes and encryption, data which has been added to the ledger cannot be altered.
  • Consensus is required: All parties involved in a transaction ensure that a single entity does not control the ledger.
  • Democratic transparency: Because all parties have equal ownership in the data (see decentralized) all parties have an equal voice on rights, sharing, protection and ownership of the data which resides in the ledger.

These features offer suppliers, manufacturers, retailers and customers unprecedented insights into each, and all transactions in the supply chain providing a trusted, single source of the truth.

Walmart understood the potential impact as well as opportunity of implementing blockchain in its distribution network and worked with IBM to develop a POC using a digital ledger on blockchain as a viable way to trace and authenticate food from farm to table. Once the implementation of the network was completed, Walmart was able to reduce the time it took to trace the complex manufacturing and distribution network of a single product, the pack of mangoes previously mentioned, from roughly 7 days, to 2.2 seconds (Yiannis, 2018).

A food safety origin proof of concept

In the case of Chipotle and the case of tampering with the food safety dates, having insights and transparency into the granular history of each and every individual item produced and distributed from farm to table is a huge undertaking. Traditionally a single entity would own, operate and share a system if they required suppliers and customers to facilitate augmentation of their data, possibly a technology such as an online portal. However, when one party owns the system the transparency is affected, and the trust is diminished as to what was recorded and the legitimacy of that information. Two core fundamentals which the peer to peer network, and immutable information concepts of a digital ledger on blockchain would solve.

In this naive and simplistic example, the concept involves 3 main parties: the product manufacturer, the distributer and the retailer. Each party would be considered a node on the blockchain network and each would have a copy of the digital ledger containing all the records.


When the manufacturing company produces a product, it would create a record in the ledger containing pertinent details about the item such as:

  • The product name
  • The serial number
  • Product expiration date

The information in this record (block) would be cryptographically encrypted and validated that it could be added to the blockchain. Pending it meets the requirements of the collective peers, it would be added.

Distribution Network

As the product moves through the supply chain in our example, the distribution company would physically collect the product from the manufacturers shipping facility, and by scanning the barcode an additional transaction would be added to the ledger, this time containing:

  • The serial number
  • The received date
  • Product expiration date

During the transport process additional data could be recorded on the ledger, the trucks temperature, the distance travelled or the amount of times the product was handled. This data could be tracked and added to augment the data set pertaining to this specific product. From the distributer’s perspective, the item would finally be delivered to the retailer, once again an additional record would be added to the blockchain ledger showing that the products ownership had changed, and the retailer was now holding the product.


As the retailer receives the product from the distributer an additional record is added, in the same context as above, showing that the store has possession and pertinent information regarding the transaction could be recorded. The transaction would include:

  • The serial number
  • The received date
  • Product expiration date

The retailer could further augment this item’s traceability by adding the location of the store and the sale date (not a part of this POC).

In the event any one of the parties involved in the supply chain would like to enquire or validate information regarding to specific item, they would have the immediate ability to query the blockchain and a specific products serial number to see the entire history of the product as it flowed from farm to table. In the event data was modified on the physical product, the parties could use the information on the blockchain to see when and at what stage of the process the date was modified and interpret which bad actor was possibly involved.

Technical Details

The blockchain implemented in this POC is based on a Javascript implementation commonly known as Naïvechain – this implies that there is no proof-of-work or proof-of-stake (Ihartikk, 2018). The solution consists of 3 major components: The server running the frontend, the server running the Peer-to-peer network and the frontend of the application which provides a simple user interface for the users to interact with. All code for this application can be found  and is described in this MIT licensed Github repository entitled: “A naive simplified implementation of using blockchain as a static register in a food origin scenario allowing manufactures, distributers and retailers to publish, update and view the data” (Aschmann, 2019).  


In the case of food fraud, digital ledgers based on blockchain can provide consumers with the assurance that the products they purchase are accurate and correct and can trust that products retailers are selling are the products advertised. In the case of a track and trace event, similar to the E. coli outbreak at Chipotle, the ability to trace which restaurants received which items from which sources would help to distinguish the common sources and possibly who the potential source of the outbreak involved to determine fault. Rapidly determining fault in the event of critical incidents can reduce the risk companies face and can reduce negative impact to the reputation of a company.

As companies invest in marketing and companies get more value associated with unquantifiable equity surrounding premium, brand value and innovation, it’s imperative that products and supply chains are transparent, accurate and contain trusted transaction data which everyone can depend on.


Smith, G. C. (2016). WHAT IS FOOD FRAUD? Retrieved from

United States Department of Agriculture. (2015). Frequently asked Questions. Retrieved from

Hussain, M. A., & Dawson, C. O. (2013). Economic Impact of Food Safety Outbreaks on Food Businesses. Foods (Basel, Switzerland)2(4), 585–589. doi:10.3390/foods2040585

Centers for Disease Control and Prevention. (2016).  Multistate Outbreaks of Shiga toxin-producing Escherichia coli O26 Infections Linked to Chipotle Mexican Grill Restaurants (Final Update). Retrieved from

Wahba, P. (2016). Chipotle Sales Continue To Plunge Because Of E. coli Outbreak. Retrieved from

Iansiti, M., & Lakhani, K. R. (2017). The Truth About Blockchain. Retrieved from

Ihartikk. (2018). A blockchain implementation in 200 lines of code. Retrieved from

Aschmann, P. J. (2019). A naive simplified implementation of using blockchain as a static register in a food origin scenario allowing manufactures, distributers and retailers to publish, update and view the data. Retrieved from