# A Non-Fungible Token Solution for the Track and Trace of Pharmaceutical Supply Chain
## 4 Web3 Serialization with Blockchain and Non-Fungible Tokens
### The Robust Traceability NFT Process  
As explained in the previous section, when an item is serialized and minted, the only actor of the supply chain that can append information about the status of the item is the creator (who at that specific moment corresponds with the owner). This binding creates a powerful mechanism of anticounterfeiting, as explained in Figure 6, which shows the generic distribution process with the locking mechanism operated by the smart contract. In fact, the smart contract method UpdateOwner is a secure mechanism for granting the ownership token (T) among the actors of the distribution network. In the example in Figure 6, it is assumed that there are four actors in the distribution network. At the minting, the ownership of the NFT is the producer who is the pharmaceutical factory (Figure 6a). As owner of the token, only the pharmaceutical factory can invoke the functions of the smart contract by means of its private key. In order to carry on with shipping the package to the next actor in the supply chain, the wholesaler distributor, the pharmaceutical factory has to invoke the function UpdateOwner in order to pass the ownership token to the wholesaler distributor, and modify the Owner Public Address of the NFT for the package. Once the package is received by the wholesaler distributor (Figure 6b), a \"delivered\" event is appended to NFTEvent list in the smart contract, including, if needed, other information about the status of the package. Additionally, in this case, before the next shipment, the token owner has to pass the ownership to next actor, the hospital (or pharmacy) that, acting as the last actor of the distribution network, will update the information about the package (Figure 6c) with the event \"ready for selling\", which guarantees that the product can be administered (or sold) to the patient. Once the product is given to the patient, the NFT is burnt by transferring the ownership to an inaccessible address such that no one else will ever be able to modify the NFT information (Figure 6d). The traceability process hereby described provides a powerful tool to the final client that verifies the history of the product and checks whether it is at the correct status to be  
Figure 6: An example of robust track and trace process with NFT serialization: (**a**) the NFT is minted; (**b**) the ownership is passed the warehouse; (**c**) the ownership is passed to the hospital retailer; (**d**) the NFT is burnt as soon is administered to the patient. sold. In fact, during the entire production and distribution process, the transparency of the blockchain allows all actors to analyse the status of each item by scanning the QR code with a Web3 application. This allows the reduction and prevention of counterfeiting attempts, as shown in the example in Figure 7. For instance, if at a certain point of the distribution network a counterfeited product enters the distribution chain, the malicious path can be easily revealed. In fact, the next actor who is receiving the package will be able to check the status of the NFT and verify that the last event in the NFTEvent list does not show the delivered status in favour of the previous actor who owns the physical product, nor that this last actor was able to update the NFT in favour of the next owner. In the example in Figure 7, Patient A can verify that the product purchased was \"ready to be sold\", as certified by Pharmacy A, which is the legitimate selling point. On the other hand, Patient B can visualize the same information shown to Patient A, understanding that (i) the selling point is not Pharmacy B and (ii) that the product has already left the distribution network (because it was sold by Pharmacy A). The smart traceability process based on the proposed blockchain solution is shown in Figure 8. As it can be seen, it is similar to the one shown in [9] and the main change that has been made in this part of the process arises from the use of a publicly permissioned blockchain, as it will be seen in the next subsection.