## 4 The Decentralized NFC-Enabled Anti-Counterfeiting System-dNAS
### The Legacy NAS Components  
According to system components of the legacy NAS, as demonstrated in Figure 10, the applications provided to different registered nodes along the supply chain are the database-operating web application, _TagWINE_--the NFC-enable tag-writing mobile application and _ScanWINE_--the NFC-enabled tag-reading mobile application. The mobile applications are designed to interact with the _NTAG 203_ of NFC tag model.  
The functionalities, enabled by those system components of the legacy NAS, substantiating the use cases described in the use case analysis, are actually based on logic patterns in _AppController_ of the app-backend service. For instance, Create, Read, Update and Delete (_CRUD_) operations on wine records, performed on the database-operating web application, actually send a request to _AppController_, invoking respective methods related to such operations, and collaborate with different system components, such as the database system developed in Microsoft SQL, to reflect states transitioned back to the web application. Another example could be using _ScanWINE_ to scan NFC tags, and validate the provenance and authenticity of wine products, by validating and comparing respective states of specific wine records stored in the NFC tags, the off-chain database system connected with _AppController_, distributed IPFS storage, and the on-chain data storage of smart contract deployed to the dNAS blockchain network via the integration between the app-backend service and the blockchain service.  
Regarding the components of the app-backend service, a database system is integrated with _AppController_ to store states and versions of wine records, and _AccountController_ processes the account management of registered nodes with states and user sessions stored in the database. The _phonegap-nfc_ module is integrated with _AppController_ to enable _ScanWINE_ and _TagWINE_ mobile applications with the functionalities of any NFC-related interaction, with the specific NFC tags packaged on wine products. Further logic patterns are developed and included in _AppController_ for integration with the decentralized bits of the dNAS via the blockchain interface by invoking related API endpoints of the proposed blockchain service to perform functionalities, such as pushing data to the blockchain and validating on-chain data of specific wine records with transaction events returned to the app-backend service.  
_NTAG 203 Ferrite_ was the selected type of NFC tag for development of the legacy NAS, given its universal compatibility with most of the NFC-enabled devices and its resistance against metallic interference, for which the _NTAG 203 Ferrite Tag_ can change the magnetic flux path to avoid interference to the NFC tag, with a high surface resistance and effectiveness in preventing resonance and suppressing coupling from the metallic interference, as NFC tags are likely to be attached to foil packaging materials surrounding wine bottlenecks. However, the _NTAG 203_ chip is already out of production and has been replaced by those of the _NTAG21x_ series, such as _NTAG 213_ or _NTAG 216_, given their increased memory storage and security functions, including a password lock and scan counter. _NTAG 216 Ferrite_ is, therefore, the selected type of NFC tag for the development of dNAS, owing to its extensive configuration with _7-byte UIDs_ and _888-byte memory capacity_, for more flexibility in terms of the data stored in each NFC tag representing every unique wine product.