# A Non-Fungible Token Solution for the Track and Trace of Pharmaceutical Supply Chain
## 4 Web3 Serialization with Blockchain and Non-Fungible Tokens
### Non-Fungible Token as Digital Twin of a Serialized Item  
As explained in Section 3, serialization requires that any parcel assembled by the packaging lines of a pharmaceutical factory has to be characterized by a unique identifier, in the form of a QR code that contains the relevant information for its identification and its traceability along the distribution network. Therefore, it can be possible to create a digital twin version of each QR code by minting an NFT in the blockchain. As shown in Figure 5, an NFT is characterized by the following properties:  
* _Uniqueness_: NFTs are cryptographic tokens providing a representation of unique assets with individual characteristics used to differentiate them from one another. * _Authenticity_: NFTs provide a representation of real-world assets, establishing their authenticity. Authenticity is a key feature of an NFT because it ensures the uniqueness of NFTs. * _Ownership_: NFTs are indivisible and can be only owned by the entity that has ownership of it. * _Interoperability_: NFTs are stored in a smart contract in the blockchain. Due to the previous features, it becomes possible to use NFTs at different levels of granting access in Web3 applications. An NFT of a serialized item has to contain the following fields:  
* _NFTId_: this field corresponds with the GTIN and serial number assigned by the serialization process. This unique ID is added as an index of the NFT in the smart contract. This field cannot be modified;
* _NFTSerialized_ (GTIN, Serial Number, Lot Information, Expiration Date): this field contains the information of the serialized item, contained in the QR code of the label attached to the package. This field cannot be modified;
* _NFTProperties_ (Commercial Name, Active Principle, Company Name, Description): this field cannot be modified;
* _Creator Public Address_: this field must be the public address of the pharmaceutical factory (corresponding to the GLN number of the company). This field cannot be modified;
* _Owner Public Address_: this corresponds with the public address of the actor of the distribution network that has ownership in that phase of distribution. This field can change during the process;
* _NFT Events_ (<Id, OwnerAddress, Timestamp, Location, Event, Description>): this field represents the list of events that characterize the NFT lifecycle, where:  
* Id: is an incremental integer (handled by the smart contract);
* Address: corresponds with the address of the owner of the NFT that performs the action characterizing the event;
* Timestamp: is the datetime of the event;
* Location (nullable): is the GPS coordinates where the event occurs;
* Event: is the type of event that has occurred with the NFT;
* Description (nullable): is additional information that can be attached to the event. This field can grow in the number of items; once appended the item cannot be modified during the process. * _ChildOf_ (nullable): this field corresponds with the NFTId of the parent NFT used to handle the hierarchical packaging. This field can change (during the reconfiguration of the packaging) and is generally assigned after the minting;
* _Children_ (NFTId[]):this field contains the list of children NFTIds that handle the hierarchical packaging (in case the NFT represents a second or third level of packaging). This field can change (during the reconfiguration of the packaging). The smart contract that encrypts all the previous information must be codified in order to handle and strengthen the traceability process along the distribution network. In order to do that, as soon the packaging of a drug is complete and the QR code is applied  
Figure 5: Main properties of a non-fungible token (NFT). to the box, the NFT of the serialized item has to be minted, using the smart contract method MintNFT(NFTId, NFTSerialized, NFTProperties).