Keywords

1 Introduction

Agrifood industry and land development are closely related. The food supply chain is a complex system in which citizens, institutions, businesses and tourists converge in a meeting based on two strategic axes: innovation and protection of product quality. In the field of food safety the guarantee of products quality is a key element. Traceability is considered a must and it is necessary not only from a regulatory standpoint: it allows monitoring the effectiveness of production, of processing, of logistics and sales systems in food chains and increases customer confidence and trust. The integrity of the food chain does not only include security problems, but it is also involved in the field of counterfeiting in order to limit the possibility of forgery and fraud. To address these requirements, a traceability system is needed to provide information on the origin, on processing, on retailing and on the final destination of food products. It is therefore necessary to have a product identity card which guarantees its originality, provenance and properties in a unmodifiable way and that certifies in a transparent and reliable way every single step in the production, supply and retail chain. In order to comlpy with all these needs we use an approach based on the blockchain technology as a means of safeguarding the local foodstuffs with special characteristics. In fact transparency, reliability and invariability of data are intrinsic properties of any blockchain technology, which is a digital ledger enabling a secure strategy for implementing and recording transactions, contracts and agreements is an excellent solution for those who wish to tell the history of their product in order to ensure reliability. We applied the blockchain technology to trace the food supply chain in Sardinia Region and we developed a system for protecting Made in Sardinia products food in a touristic context. It must be noted that the geographical characteristics of insularity of Sardinia characterize typical gastronomic products which are very original and connected to the agro-pastoral world. In Italy traditional agri-food products are defined as typical items whose methods of processing, preservation and maturing are performed homogeneously into a particular territory and according to traditional rules which are extended over time, for a period of at least 25 years. The platform we propose in this paper aims not only at ensuring the authenticity of typical Sardinian products, but also at improving their saling using on-line and on-site ordering in many of the major touristic points in Sardinia (beaches, ports, airports, archaeological sites, cultural heritage, etc.). The platform forecast a set of pop-up stores integrated through the development of a dynamic and innovative modular software system based on the blockchain technology within the framework of smart tourism.

The paper is structured as follows. Sections 2 and 3 present research background and related works. Section 4 explains the proposed platform based on blockchain technology and Sect. 5 describes the system architecture. In Sect. 6 proposed smart contracts are detailed through a pseudo-code. Section 7 discusses the use of the system to check the product traceability. Finally, Sect. 8 contains the conclusions.

2 Research Background and Setting

The concept of smart tourism is very recent. It is a logical consequence of the innovations and of the technological progress applied to traditional tourism, but not only that. Smart tourism is connected to the idea of smart destinations and more generally of smart cities. All those specific characteristics of urban or even rural areas typical of a smart city, and therefore useful to residents, can also be used by tourists in the context of mobility, sustainability and quality of visits [12, 13]. According to [1] the smart tourism destinations could contribute to the improvement of tourists experiences proposing products and services tailored for each visitor with the understanding of its needs, wishes and desires. Our platform and project, that we called “Bertulas”, aims at increasing the potential of smart tourism in the Sardinia Region through the creation of an innovative pop-up store system (POS), an interactive showcase of products for an effective contextual shopping that can improve the possibilities for tourists to discover the Sardinian food products. Pop-up stores are little local stores, runned by an exhibitor, that will be positioned in places of particular touristic interest in order to get the attention of potential customers inviting tourists to live an effective shopping experience, innovative and functional to specific needs. The exhibitor will be equipped with a tablet/laptop device connected to the network and channeled on a dedicated e-commerce site. Turists will able to pay in a secure way, using cryptocurrencies or by credit cards, and can choose a specific method of delivery: at their temporary residence in Sardinia or at their own home in any part of the world. Each movement of products, from local producer to customer, is mapped in a blockchain that has a double role: the role of public, transparent and unmodifiable ledger, and the role of control system which safeguards the originality of products. The latter role is implemented thanks to the computing resources available on the blockchain and will be explained later.

3 Related Works

The blockchain technology is mainly known as directly related to Bitcoin or other cryptocurrency and to financial transactions. In fact the blockchain technology can provide an appropriate solution in all those cases in which a system of relationships entirely based on a concept of trust and transparency is needed, even if the technology still suffers of various drowbacks, mainly related to the missing or the poor application of good practices of software engineering for blockchain-oriented software development [9]. Examples of blockchain technology application to smart cities or smart environments can be found in [10, 11]. The first work attempts to respond to a topical issue in the scientific context: how can blockchain help smart cities? The second study models a blockchain-based solution in order to guarantee in a smart context the rights of temporary employees and the transparency in the management of job contracts.

The use of the blockchain technology in an agrifood context is proposed in [2]. The work is based on RFID and blockchain technology for sharing and transferring information about the production, the processing, the storage, the distribution and the selling of foodstuffs. A similar work is [3] in which authors analyze the limits of RFID technology proving it unreliable in the post supply chain because tags can be rather easily cloned in the public space. An experimental ethereum blockchain based on the proof-of-concept block validation is developed in the work, with an analysis of its cost performances: the cost of managing the ownership of a product with six transfers results in about one USD. In [4] Bateman focuses on the value of traceability. The paper presents an encrypted item (bar-codes, tags or serial number representing physical goods) of transaction and sends it out to all other nodes in the blockchain network. The nodes verify if this item of transactions is legitimate and add it to a ledger that then serves for future transactions. In the research of [5] the authors study the blockchain technology applied to a supply chain for a four-party logistic (4PL) firm to increase traceability and transparency. BigchainDB [6] provides the access to a huge distributed database, with many blockchain features, such as decentralized control, immutability and transfer of digital assets. In [7] the authors develop a food supply chain traceability system for real-time food tracing based on a blockchain, on the Internet of things and HACCP (Hazard Analysis and Critical Control Points) and provide a platform transparent, reliable, secure and useful to all the actors of the supply chain. The work of Kim and collaborators [8] is focused on ontologies as tools that can contribute to blockchain design applied to food provenance knowledge and traceability. Authors use the Ethereum blockchain platform for developing smart contracts supporting goods traceability and analyze the provenance of luxury goods produced and transported in international, big and complex supply chains. Blockverify [16] is a startup which applies the blockchain technology to improve anti-counterfeit measures in different industries, such as pharmaceuticals and luxury item’s context.

4 The Blockchain Based Platform

In this section we provide an overview of how the system can be implemented by developing the following components:

  • User-friendly and high-performance e-commerce platform containing all the eno-gastronomic products that can be purchased. The e-commerce system will be used both on the web and through a dedicated app.

  • Dedicated on site exhibitors, named POS (pop-up stores), to be installed in the areas with the highest touristic presences in Sardinia and equipped with a laptop connected to the dedicated e-commerce website. These are real interactive showcases designed for a standalone use and dedicated to the sale and presentation of local, zero-mile, food and wine products.

  • E-commerce system usable both through POS and through a dedicated app. The customers will obtain information about local companies and producers in order to buy further products as well as food and wine, for increasing the attractiveness of the territory and to favor the economic development in the context of a smart touristic region.

4.1 Blockchain Features for Chain-Food Applications

A record within the blockchain cannot be modified retroactively because of its structure. Not only transactions but also other information can be recorded within the blockchain, such as documents, identity management or food traceability. These characteristics render the blockchain technology ideal for managing the entire agri-food supply chain by avoiding the counterfeiting and ensuring the transparency, the quality, the origin and the integrity.

In our model it is possible both to assign a unique digital identity card for each product that must be traced, containing significant data related to the production and the supply chain, and to verify the originality.

The innovative commercial distribution process will allow the reduction of the typical steps of the commercial chain: in our scheme the transitions will be restricted and therefore the cost of storage on the blockchain will be limited.

Customers and all actors of the food chain can verify whether the data are correct, true and accurate. Each actor in the chain has his own interest in avoiding cheating from other actors and can easily check it. The system, based on Keyless Signature Infrastructure (KSI), improves the scalability and settlement time and uses the hash function to safeguard the integrity of data, and presents three main attributes: the authenticity it secures that the data has not been tampered with or modified, the identity it allows to uniquely identify the place where the item was recorded, the proof of time it allows to uniquely identify date and time at which the item was registered on the Blockchain.

By using KSI digital signatures our platform ensures the integrity of digital assets related to local products and their authenticity through the detection of unauthorized changes in software and configurations. At the same time allows to detect a violation to access of information through the analysis of the blockchain. In this context the blockchain is an enabling technology which allows for obtaining the satisfaction of security and availability of data. Information stored in blocks characterizes the state of the blockchain. The use of blockchain applied to food supply chain in the context of smart tourism is powerful and can lead important results and transformations in terms of procedure and process management opening the way for handling complex distributed applications.

4.2 Ethereum Blockchain and Smart Contracts

There are different possible choiches of blockchain for implementing our platform. We choose the Ethereum blockchain for our system since it offers the possibility to implement smart contracts in a simple way. Furthermore Solidity is up to now the most used coding language for writing smart contracts, it is continuously supported by the evolution of the Ethereum Virtual Machine with new versions of the compiler and is continuously documented. Examples of smart contracts source codes are freely available and validated on different online platforms, like Etherscan, and bugs and fixing are continuously managed and documented. Another solution could be a permissioned blockchain. We prefer to tackle the problem with a permissionless blockchain since this approcah solves completely the problem of customer’s trust. In fact a permissioned blockchain may still give the sensation to the customer that a control which is indeed not needed (the various permissions) is applied to the food chain and may introduce the doubt that the central authority or some actor of the production chain can deny the free and complete access to all the desired information. On the contrary a permissionless and pervasively diffuse blockchain, such as Ethereum, give the sensation that nothing is hidded and all the information on the products are freele accessible increasing customer’s trust. A contract in Ethereum, or smart contract, is a special typology of account. It is recorded in a block of the blockchain, and can receive and transmit messages from and to other account, by means of transactions. Messages can request the execution of a specific contract function. In the case of our agri-chain traceability, for instance, a message can contain the address of the receiver, the name of the function, and a list of parameters that ensure the reliability of the system and protect the originality of local products. For instance smart contracts can be used in the blockchain to record measurements of product coming from the producers. All actors of the food supply chain in our system are considered as senders and recipients of transactions. They are blockchain accounts and are defined by an alphanumeric code called address. The Ethereum blockchain provides a computational environment, programmable by the development of decentralized applications. Etherum smart contracts facilitate the exchange of money, goods, contents, properties, actions or anything else of value. Once activated on the blockchain, the smart contract operates independently and performs tasks automatically when specific conditions occur. Each smart contract is executed on the blockchain and then there are no risk of downtime, censorship, fraud or interference. Different blockchains have the ability to execute programs, but often they are very limited. Ethereum instead allows developers to implement any type of computation since the EVM language is turing complete.

5 The System Architecture

The proposed system aims to certify the production and the supply chain concerning food local products by using blockchain technology and smart contract. The stakeholders involved are:

  • authority as the system administrator

  • local producers

  • suppliers identified as central or peripheral warehouses

  • retailers identified as pop-up stores and the e-commerce application

In our application, we assume the Sardinian Region as the authority, namely the system administrator which inserts and monitors information about all the other stakeholders. Each actor who want to work into the system, must be therefore authorized and certified. The administrator also records information about every food product involved that will be certified by the system. The local producer must communicate with the authority a list or a single food product which may produce as well. For each stored record a payment of a fee is required. All this information will be stored in the blockchain as will be described later. According to [14, 15] a total of 193 agri-food products are recognized as traditional. Given the shelf life, only part of these products will be sold through the system.

Fig. 1.
figure 1

The state diagram describing products agri-food chain.

Figure 1 reports a state diagram describing the supply chain of the local agri-food products. A local producer places on the market the product (S0) that will be purchased at the end by the consumer (S4). A local producer can send the product both to a POS (S1) or to a Central Warehouse (S2). It is possible to have one or more peripheral warehouse (S3). We assume that a consumer can buy a product in site by a POS or online through the e-commerce website.

6 Proposed Smart Contracts

We devised two smart contracts to automate the storage of information related to the agri-food supply chain where we have different involved stakeholders. As explained before, we have a detailed description for each local product contained into a file and we store all the information in the blockchain using hash codes. In fact a hash code can be used to verify the integrity of the data and for example can be used to check the integrity of the file containing the list of local products. By using hashing properties, it is possible to verify the integrity of the data by comparing the hash codes. We choose as algorithm of encryption the SHA256.

We propose two different smart contracts: ProductChain and SupplyChain that we describe through a pseudocode in Contract I and Contract II respectively. In the ProductChain contract all information about stakeholders is inserted by the authority, as well as information on products, with their origin and manufacturing, and then it is stored in the blockchain. Local producers can insert information about production batch when a good is ready to sell. We assume that the ProductChain contract manages the entire production chain. The SupplyChain contract instead manages the supply chain until the final consumer is reached. A customer can buy the product through a pop-up store or through the e-commerce, and at any time he/she can check the history of the product (form the production chain to the supply chain) because all transactions are recorded and available in the blockchain.

We list and show below the main steps planned which involve a blockchain transaction:

  1. 1.

    the authority records information about agri-food local products. The authority assigns to each product an identity code similar to a barcode. When the authority records information about products within the Ethereum Blockchain, it stores the hash of the file which describe the product. As explained before, only the authority, according to the function check of the designed smart contract, can insert information about stakeholders involved and agri-food local products. To insert a product, the authority uses the insert_record function described through a pseudocode in the ProductChain contract. There is a different transaction for each new record and each transaction requires a fee.

  2. 2.

    the authority validates local producers. The authority, that in our case is the Sardinian Region, has the list of accredited producer in its local database with specific information. If a local producer wants to sell its product or a list of products by using the proposed system it has to ask for accreditation. The authority makes the following steps:

    1. (a)

      creation of a wallet for the local producer, in this way he can be identified by a specific address (create_wallet pseudocode);

    2. (b)

      addition of the address to an authorized author list and pairing of it to the identity code of the agri-food product or products (enable_stakeholder function);

    3. (c)

      creation of a transaction to store the hash code of the information about the local producer; likewise the agri-food local product, also the data related to a producer will be available in a public file, so that the hash code of this public file and the hash code stored in the blockchain can be compared to verify the integrity (insert_record function);

  3. 3.

    the authority records information about other stakeholders involved such as their addresses (supplier, retailer). The authority makes the following steps:

    1. (a)

      creation of a wallet for each stakeholder involved, such as a supplier or a retailer, so that it can be identified by a specific address (create_wallet pseudocode);

    2. (b)

      addition of the address to an authorized authors list classifying it as enabled addresses (enable_stakehoder function);

    3. (c)

      creation of a transaction to store the hash code of the information about each stakeholder; like the agri-food local product also the data related to the actor will be available in a public file, so that the hash code of this public file and the hash code stored in the blockchain can be compared to verify the integrity (insert_record function);

  4. 4.

    the local producer records information about the production batch. The local producer, by using its address, can store information about the production batch:

    1. (a)

      calling of smart contract ProductChain and the function insert_production_batch providing as input its address and the products identification code; the function checks (through a check_map_product function) if the producer is enabled to record information about the production batch;

    2. (b)

      insertion of information giving a new transaction in the blockchain, about production batch including an identifying code for that production.

  5. 5.

    the local producer records information about selling and address. The local producer records within the blockchain, by using the smart contract SupplyChain, information about the sale:

    1. (a)

      call send_product function giving as input its address, the reference to the transaction within the blockchain about the production batch to send, the address of the recipient and the quantity of sending goods;

    2. (b)

      record of a transaction about selling if a function check_property is verified; that function checks if the stakeholder has the property and the quantity before selling.

  6. 6.

    the recipient records information about receipt of goods. The recipient records within the blockchain by using the smart contract SupplyChain information about the receipt:

    1. (a)

      calling of receive_product function giving as input its address, and the reference about the transaction shipment recorded within the blockchain by the sender;

    2. (b)

      record of a transaction about the receipt if a check_receiving function is satisfied, that function checks if the receiving is correct.

  7. 7.

    the stakeholder records information about selling and recipient. Steps fifth and sixth are repeated every time the product owner changes. Every step is registered with a transaction in the blockchain.

7 Product Traceability

In Fig. 2 we report a detail of the transactions that our application stores within the blockchain. We have indicated these transactions in pseudocode (see Contract I and Contract II in Appendix).

A consumer can buy a product through a pop-up store or through the specialized e-commerce. He/she can obtain information about the production chain and the supply chain in order to check authenticity, goodness and provenance of the product. The entire system is designed to certify the local agri-food product in order to prevent fraud and to promote the geographical area. All information about a product is stored in the blockchain and for each product the system recovers the information and shows it to the consumer that can verify the information by using a simple QR-code reader, or a specialized mobile app linked to the system. The customer can also manually verify the product information integrity comparing the hashcode stored in the blockchain with the hash code of the information displayed.

Our solution appears better than traditional solutions because all the infrastructure is already there and is the blockchain itself. There is no need to pay for cloud solutions or for service providers. Furthermore maintenance is avoided and customer’s trust is maximized because all the infrastructure has not an ownership. There are no actors able to manipulate data as it could be for owned or rented infrastructures. In the specific case of the Sardinia Region, but this is valid also for others authorities, our solution minimizes the role of the central authority increasing customer’s trust. The authority needs to be entrusted only for actors and products accreditations and authorizations, using already existing and used systems and infrastructures, which is a minimal requirement enforced by law. After that no intermediary is involved into the certification chain which is completely controlled through smart contracts in a completely trasparent and freely accessible way and unmodifiable.

It performs also better with respect to other solutions provided in a blockchain framework because only hashed information is inserted into the blockchain reducing gas costs and payload.

Fig. 2.
figure 2

Transactions recorded on blockchain.

8 Conclusions

The proposed platform aims at increasing the potential of the Sardinia Region as a smart tourism region and starts with the awareness that the typical local products are highly significant in order to offer to tourists a full sensory experience and able to tell, even with the taste, the uniqueness of Sardinian culture. The system is based on the blockchain technology and uses the Ethereum platform to implement a product agri-food chain by using smart contracts. The system in fact aims at ensuring the authenticity of typical Sardinian products and to sell them with online and on-site methods in many touristic places of the region through a system of pop-up stores. We know in fact, that to reach the end consumer each product deals with a complex production and distribution network and in the most recent period the need of transparency for end users is increasing even more rapidly. Sometimes some information about provenance exist, but we do not know if they are trustworthy because they are hard to verify. However, in most of the cases we ignore the supply chain process and its impacts on environment, health or safety fields. Currently there is a strong need to rely on someone who can guarantee the entire origin of goods and products. Moreover, given the complexity of the supply chain it would be desirable to have specialized entities for each different supply chain aspect causing the increase of product price. We proposed to solve the problem of traceability through the decentralized and reliable blockchain technology as a means of safeguarding the local foodstuffs with special characteristics and in order to create their digital identity card. We analyzed the use of blockchain technology for the food supply chain in Sardinia Region and we developed a system for protecting Made in Sardinia products food. The cost of managing products with blockchain technology will be minimal given the reduced number of transactions with the use of zero-mile products. The platform then ensures to the consumer to check the authenticity of the product before the purchase giving details on both production chain and supply chain. This application is now under implementation for being applied only to typical products, but it can be extended to different product types. The described system is supervised by a central authority, but it can be redesigned as decentralized system according to the blockchain vision.