# A Non-Fungible Token Solution for the Track and Trace of Pharmaceutical Supply Chain
## 4 Web3 Serialization with Blockchain and Non-Fungible Tokens
### Architecture and Implementation of the NFT Track and Trace Solution  
The smart contract of the proposed NFT track and trace prototype solution, has been deployed in a test environment of the VeChain Thor blockchain, a publicly permissioned proof of authority (PoA) consensus blockchain that guarantees higher scalability and performance than traditional proof of work (PoW) protocols [85]. This blockchain is provided by the VeChain Foundation, which lists 101 authorized master nodes (known also as Thrudheim) that are in charge of providing the validation of the blockchain transaction. The ownership of the master nodes belongs to several private and public companies, organizations, and individuals. To guarantee the stability of the ecosystem, the blockchain ecosystem can count on what are called economic nodes. The main reason for the adoption of this blockchain is that the VeChain ecosystem aims at building a trust-free and distributed business ecosystem platform to enable transparent information flow, efficient collaboration, and high-speed value transfers [86]. These key elements have made VeChain one of the most valuable blockchains to use for supply chain and track and trace. Moreover, the foundation provides a user-friendly Web3 connector, Sync2, that can be installed as a plugin in most well-known browsers.  
Figure 11 shows the progressive web decentralized application developed for this prototype. For each phase of the lifecycle of a product, this application shows the status, the timestamp of the transaction, the public address of the owner who entered the data (who has signed the transaction), and a link (\"View Transaction\") that opens the public blockchain explorer containing all the details of the corresponding transaction. Two main actions can be performed as the owner, for each NFT: the creation of a new event and the handover to a new owner.  
Figure 12 presents the infrastructure of the NFT track and trace solution, showing the main components that constitute it. As discussed previously, the generic pharmaceutical manufacturer runs the blockchain server (integrated with the serialization equipment) to mint the NFTs, interacting directly with the NFT smart contract of the blockchain, by means of its public address. The generic user's user device, by means of a mobile device connected to the Internet, can scan the QR code of the NFT, redirecting the user to the progressive web decentralized application that is hosted in the DAPP repository. The DAPP is coded to unlock or lock the granted access of the user who--due to the Sync2 plugin--interacts with the smart contract.  
Figure 10: Process flow of pharmaceutical factory packaging using the blockchain serialization.  
For the NFT track and trace, in order to perform as an interoperable solution that complements the serialization process, three major requirements must be fulfilled:  
1. Each actor of the supply chain (who is going to become an active owner of a package) has to be identified with its VeChain public address (basically, this is not necessary for the final consumers);
2. Each actor of the supply chain has to keep VET or VeThor tokens in a wallet as they are required to sign the transactions and update the status of the package;  
Figure 11: Prototype of the DAPP running within the VeChain Thor blockchain test network.  
Figure 12: High-level SW/HW Infrastructure of the NFT Track & Trace ecosystem.  
3. Each actor of the supply chain has to know the public addresses of the companies involved in the distribution network in order to pass the NFT to the correct owner. This last requirement can be easily maintained by using the track and trace decentralized web application, provided that the companies register themselves autonomously (at the moment they retrieve their public address or even later) using the Sync2 plugin.