# Security and Ownership in User-Defined Data Meshes
## 4 A Framework for Supporting the Transfer of Ownership in Data Meshes
### Smart Contract Architecture  
Blockchain-based architecture uses a specially designed ERC721 smart contract that was implemented to evaluate the use of the proposed framework. ERC721 is a standard that is used in EVM-compatible Blockchain networks to represent the ownership of NFTs, where each token is unique and has its own metadata. In this study, we decided to develop our smart contract based on the ERC721 standard for two main reasons: (i) with ERC721, users can securely own, transfer, and manage their digital assets with transparent and verifiable ownership records; (ii) the ERC721 standard ensures that NFTs can easily interact with several wallets and decentralized applications (dApps), enhancing their utility and accessibility. Additionally, as the smart contract was developed for deployment on EVM-compatible blockchain networks such as ETH, Matic, Avalanche, etc. that are using a Proof-of-Stake consensus mechanism, there is no need for large energy consumption for the calculation of blocks. The purpose of the smart contract developed in this paper is threefold: (i) Allow data owners to mint time-based NFTs and transfer them to an address, (ii) allow NFT owners to read specific portions of data for a certain period of time, and (iii) allow NFT owners to transfer ownership of the data to a different user. The proposed smart contract consists of three main actors: the contract owner, who is the deployer of the contract and responsible for registering administrators onto the contract; the contract administrators, who oversee the minting process; and the authorized users, who can view or transfer data. The administrator algorithmic workflow of the proposed framework is depicted in Figure 5 and summarized in pseudocode. Figure 6 presents the algorithmic workflow followed for authorized users. Authorized users can view the assigned data based on two parameters, the expiration date and the query. A user holding a valid NFT can access a token-gated website to view the data. The website checks the eligibility of the connected address to allow or refuse access to the user. Finally, as depicted in Figure 7, NFTs are separated into two categories, transferable and non-transferable. When an NFT is minted, the admin specifies if the token has read-only or transfer access. When a user who holds a specific non-expired NFT initiates a transfer function, the contract checks whether the token can be transferred or not to a different address and proceeds to accept or reject the request accordingly. If the NFT is  
Figure 5: The admin algorithmic workflow and pseudocode. successfully transferred, then the new owner of the NFT is automatically granted access to the token-gated website and can view the data. Two notes should be made here: (i) By using hash functions and asymmetric encryption, we ensure alignment with the different data privacy regulations (e.g., GDPR and CCPA). Each NFT in the developed system is owned by an EVM-compatible address, thus only the address that owns the NFT can access the system and/or transfer the NFT. Thus, granting access to data can only be initiated by the owner of the NFT and in cases in which the administrator enabled transfer access to the specific NFT during its minting (creation). (ii) Delays and costs that may occur are normally associated with the number of transactions stored on the Blockchain as well as the data volume in each transaction. In the proposed approach, this volume is kept minimal as the data themselves are not stored on the Blockchain, but rather a metadata description of these data. Moreover, as the transaction on the Blockchain does not concern the data, but only the metadata, the scaling of the DL (i.e., its expansion) does not affect the description of an existing source. In general, the scalability of the DL and the DM (i.e., the increase in their size) does not impact the metadata. The only case in which metadata are affected is when new sources of data are hosted in the DL.