scieee AI-readable full text Open interactive document viewer

Blockchain – NFTs for luxury objects authenticity

Morais, André Loureiro

Abstract

Counterfeiting of luxury goods is becoming more of a problem, and manufacturers must battle it while also accepting the challenge of finding new ways to combat it. Companies have spent a lot of money over the years to ensure that these products are authentic, and blockchain has given the luxury market fresh hope and potentially fuel a new process of authenticity. One of the technologies seeking to ensure the validity of these valuable products is blockchain technology, which has generated multiple start-ups, blockchain platforms, and protocols. With the explosive growth of blockchain technology, NFTs (Non-Fungible Tokens) are becoming increas ingly popular, even in sectors where there appears to be no benefit, such as in the postal service. Its use is already standardized (for example, through ERC-721, ERC-1155, ERC20). In the context of this work, it was necessary to analyze and evaluate existing NFT platforms, with regard, among others, to costs, usability, ease of programming; design and implement a platform that is specifically tailored to the authenticity of luxury items, such as jewelry, art, and luxury clothes; and finally test all procedures and features that are appropriate for the authenticity of luxury products.

Full text

Universidade do Minho Escola de Engenharia André Loureiro Morais Blockchain – NFTs for luxury objects authenticity October, 2023 Universidade do Minho Escola de Engenharia André Loureiro Morais Blockchain – NFTs for luxury objects authenticity Master’s Dissertation Integrated Master’s in Informatics Engineering Work supervised by José Carlos Bacelar Almeida October, 2023 ii COPYRIGHT AND TERMS OF USE OF THIS WORK BY A THIRD PARTY This is academic work that can be used by third parties as long as internationally accepted rules and good practices regarding copyright and related rights are respected. Accordingly, this work may be used under the license provided below. If the user needs permission to make use of the work under conditions not provided for in the indicated licensing, they should contact the author through the RepositóriUM of Universidade do Minho. License granted to the users of this work Creative Commons Atribuição-NãoComercial-CompartilhaIgual 4.0 Internacional CC BY-NC-SA 4.0 https://creativecommons.org/licenses/by-nc-sa/4.0/deed.pt iii STATEMENT OF INTEGRITY I hereby declare having conducted this academic work with integrity. I confirm that I have not used plagiarism or any form of undue use of information or falsification of results along the process leading to its elaboration. I further declare that I have fully acknowledged the Code of Ethical Conduct of the Universidade do Minho. , (Location) (Date) (André Loureiro Morais) Acknowledgements I want to express my sincere gratitude to all those who have contributed to this project over the years. Your support and encouragement have been invaluable, and I am truly thankful for each of you. To my family, especially my parents and sister, your constant support and understanding have lifted me up during challenging times, and I am deeply grateful for everything you have done for me. To my girlfriend Magda, your presence in my life has served as a motivational and inspirational force. I can’t express enough gratitude for your consistent support and confidence in my talents, which have inspired me to accomplish more than I ever imagined. To my friends, especially Pedro, José Pedro and Luís, thank you for standing with me through thick and thin. Your encouragement have made this journey more enjoyable and fulfilling. To Dipcode, I am grateful for the opportunities you have provided me with to grow both personally and professionally. To Professor José Pina Miranda, our expertise and insights have shaped the direction of this project, and I am thankful for your contributions. Each and every one of you has played a significant role in my journey, and I am honored to have had your support. This project would not have been possible without all of you, and I am deeply appreciative of your contributions. Thank you from the bottom of my heart for being a part of this incredible journey. Your belief in me has made all the difference, and I am excited to share this achievement with each of you. iv Abstract Blockchain – NFTs for luxury objects authenticity Counterfeiting of luxury goods is becoming more of a problem, and manufacturers must battle it while also accepting the challenge of finding new ways to combat it. Companies have spent a lot of money over the years to ensure that these products are authentic, and blockchain has given the luxury market fresh hope and potentially fuel a new process of authenticity. One of the technologies seeking to ensure the validity of these valuable products is blockchain technology, which has generated multiple start-ups, blockchain platforms, and protocols. With the explosive growth of blockchain technology, NFTs (Non-Fungible Tokens) are becoming increasingly popular, even in sectors where there appears to be no benefit, such as in the postal service. Its use is already standardized (for example, through ERC-721, ERC-1155, ERC20). In the context of this work, it was necessary to analyze and evaluate existing NFT platforms, with regard, among others, to costs, usability, ease of programming; design and implement a platform that is specifically tailored to the authenticity of luxury items, such as jewelry, art, and luxury clothes; and finally test all procedures and features that are appropriate for the authenticity of luxury products. Keywords: Blockchain, Ethereum, Smart Contracts, NFTs, Off-chain, Market, Luxury Objects, Authenticity, Solidity v Resumo Blockchain – NFTs para autenticidade de objetos de luxo A falsificação de objetos de luxo está se a tornar um problema cada vez maior, e os fabricantes devem lutar contra isso enquanto, também, devem encontrar novas maneiras de combatê-la. As empresas têm gasto muito dinheiro ao longo dos anos para garantir que estes produtos são autênticos, e a blockchain deu ao mercado de luxo uma nova esperança e, potencialmente acelerar um novo processo de autenticidade. Umas das tecnologias que visa procurar a garantia da validação destes produtos valiosos é a tecnologia blockchain, que já deu oportunidades à criação de múltiplas start-ups, plataformas de blockhain e protocolos. Com o crescimento explosivo da tecnologia blockchain, Os NFTs (Non Fungible Tokens) têm uma utilização cada vez maior, estando até a ser utilizados em áreas em que aparentemente não haveria qualquer vantagem na sua utilização, como por exemplo na área postal.A sua utilização já está standardizada (entre outros, através do ERC-721, assim como do ERC-1155, ERC-20). No contexto deste trabalho, foi necessário analisar e avaliar plataformas de NFTs existentes, no que diz respeito, a custos usabilidade, facilidade de programação; desenhar e implementar uma plataforma costumizada especificamente para a autenticidade de objetos de luxo, como jóias, arte e roupas de luxo; e finalmente testar todos os procedimentos e recursos adequados para a autenticidade de luxo. Palavras-chave: Blockchain, Ethereum, Contratos Intiligentes, NFTs, Off-chain, Mercado, Objetos de Luxo, Autenticidade, Solidity vi Contents List of Figures x List of Tables xii Acronyms xiii 1 Introduction 1 1.1 Problem Statement ................................. 2 1.2 Objectives and Contributions ............................ 4 1.3 Document Structure ................................. 5 2 Background 6 2.1 Blockchain ..................................... 6 2.1.1 Smart Contract ............................... 7 2.1.2 Bitcoin ................................... 8 2.1.3 Consensus Mechanism ........................... 9 2.1.4 Decentralized applications ......................... 10 2.2 Ethereum ...................................... 11 2.2.1 Smart Contracts .............................. 11 2.2.2 Ethereum virtual machine ......................... 12 2.2.3 Fees .................................... 12 2.3 NFTs ........................................ 13 3 State of Art 15 3.1 Blockchain Benchmarking .............................. 15 3.2 Smart Contract Languages ............................. 18 3.3 Ethereum Scaling .................................. 19 3.4 EIP and ERC .................................... 21 3.5 Tools ........................................ 23 3.6 Principles ...................................... 27 vii CONTENTS 3.7 NFTs Platforms ................................... 28 4 System Modeling 30 4.1 Functional Requirements .............................. 30 4.1.1 Type of users ................................ 31 4.1.2 Use cases ................................. 32 4.1.3 Sequence Diagrams ............................ 32 4.2 Application architecture ............................... 44 4.2.1 dApp Architecture ............................. 44 4.2.2 Smart Contract and Frontend Communication ................ 45 4.2.3 IPFS .................................... 45 4.2.4 Scalling with Plasma ............................ 46 5 Implementation 47 5.1 Moralis server (Parse server) ............................ 47 5.1.1 Install the Parse-server ........................... 47 5.2 Smart-Contract ................................... 48 5.2.1 Integration of use cases using smart contracts ............... 50 5.3 Frontend ...................................... 53 5.3.1 Integration with metamask ......................... 54 5.3.2 Integration with Smart Contracts ...................... 54 5.3.3 Autogenerated CSV to import NFTs ..................... 55 6 Deployment 58 6.1 Docker ....................................... 58 6.2 Running the Project ................................. 60 7 Conclusion 61 7.1 Final Considerations ................................ 62 7.2 Future work ..................................... 64 Bibliography 65 Appendices 72 A Appendix 72 A.1 Profile Page ..................................... 72 A.2 Homepage ..................................... 73 viii CHAPTER 1. INTRODUCTION generation of blockchains, such as Ethereum, in 2014 with the primary objective of enabling decentralized applications [12], has since become a prominent figure in the blockchain and cryptocurrency community. His contributions have inspired a new generation of developers and entrepreneurs to explore the vast range of blockchain-based systems that extend beyond finance [65]. Buterin remains actively engaged in the development of Ethereum and the wider blockchain ecosystem, participating in numerous conferences and events where he shares his vision for the future of decentralized technologies, and advocates for greater innovation and collaboration within the industry [11]. Overall, his contributions have been critical in advancing the state of the art in decentralized technologies, and his vision for Ethereum continues to shape the future of this exciting field [12]. One of the significant developments brought about by the Ethereum network was the introduction of smart contracts. These contracts allow for secure transactions without the entities knowing each other or relying on mutual trust [57]. Blockchain technology is increasingly being seen as a new hope for the luxury goods industry and a new authenticity process. According to a study published in the Journal of Enterprise Information Management by Elodie de Boissieu and colleagues [10], blockchain technology can help luxury firms address challenges such as counterfeit, gray market, and copycat products by ensuring traceability and origin of luxury goods. The study suggests that blockchain technology can promote greater transparency and efficiency within supply chains, which can help build consumer trust and improve brand revenue. However, the implementation of blockchain technology in the luxury industry faces constraints such as the knowledge gap, multiplicity of third parties involved in the production process, and bias toward short-term returns on investment. Overall, blockchain technology has the potential to enhance the authenticity, transparency, and trustworthiness of the luxury goods industry [10]. As such, blockchain technology presents a new opportunity for the luxury industry and can facilitate a new process of authentication Moving on from the potential of blockchain technology in the luxury goods industry, another application of blockchain that has gained significant attention in recent times is the creation of Non-fungible tokens (NFTs). These tokens are essentially unique digital assets that can represent anything from art to collectibles to event tickets. With the help of smart contracts and blockchain technology, all transactions associated with these tokens are recorded on a public ledger, ensuring transparency and traceability. Although NFTs are not specific to any particular network, Ethereum is currently the most popular platform for creating and trading them. Overall, the emergence of NFTs is yet another example of how blockchain technology can be used to create new opportunities and transform traditional industries. [73] 1.1 Problem Statement Luxury items are seen as requirements for belonging to a high-level class or a consequence of a wealthy lifestyle. People live to please others and want to flaunt their automobiles and their most expensive outfits 2 CHAPTER 1. INTRODUCTION in order to increase their social status, and as a result, there is a tremendous demand for these products, resulting in the rapid proliferation of counterfeit items. However, counterfeit of these products is not a recent occurrence; in fact, it has accompanied the world’s history and is considered one of the world’s oldest professions. For example, when there was no money paper in B.C., people mixed base metals with gold and silver to make counterfeit money [68]. Counterfeiting is one of the most serious risks to brand owners, causing serious harm to earnings, business reputation, and, in the worst-case scenario, customer safety and loyalty. However, given the global nature of the crime and the local subtleties that come into play in different countries, developing a resilient anti-counterfeiting plan can be difficult [34]. Because counterfeiting is a criminal activity, official numbers are difficult to come by. The copyright businesses in the United States, on the other hand, have been collecting detailed data on product piracy for some years. These are the most heavily impacted sectors. In 1996, pirated copies accounted for about half of all motion picture videos, over 40% of all business software, and a third of all music records sold [49]. More recently, In 2020, the value of counterfeit goods seized by U.S. Customs and Border Protection was over $1.3 billion, a 27% increase from the previous year and in 2021 report by the United States Patent and Trademark Office estimated that the total value of counterfeit goods seized by U.S. law enforcement agencies was $1.4 billion in 2019 [70]. In Europe, counterfeit apparel, both fashion and sportswear, is fairly common. Importing plain clothing and attaching labels in one EU Member State, then releasing the products for sale in another EU Member State, taking advantage of the free movement of commodities across borders, is a typical approach [49]. To help to illustrate this scenario, Figure 1shows a study made by OECD [24], representing the percentage of the industries most affected by counterfeit products in 2016. Figure 1: Counterfeit graph. From OECD study (2016) [24] 3 CHAPTER 1. INTRODUCTION As we see in Figure 1, a percentage graph does not tell us much about the reality, but when we notice that this graph represents 3.3 percent of the world trade, then we realize that is a big scourge to the companies and is way more serious subject that the world is not very aware. NFTs offer a novel solution that has instilled renewed optimism among companies combating counterfeiting. These digital tokens not only enhance the authenticity of luxury items but also bridge the digitalmaterial divide. They allow businesses to take more control over their supply chains and establish an unbreakable link between digital assets and physical products, thereby mitigating the widespread problem of counterfeit luxury items [35]. One of the transformative aspects of NFTs is their potential to revolutionize the post-sale phase, which is often a critical juncture for safeguarding product authenticity. Beyond the point of purchase, NFTs come into play, enabling companies to comprehensively trace a product’s journey, from its origin to the point of sale and throughout its entire life cycle. This end-to-end tracking ensures that the product remains authentic and unaltered. NFTs essentially act as a guardian, providing an immutable record that attests to a luxury item’s authenticity, a level of protection not previously achievable. In addition to their pivotal role in anti-counterfeiting efforts, NFTs have the capacity to greatly enhance the customer experience. By scanning an NFT associated with a product, consumers can access a wealth of information about their purchase. This includes details about the product’s origin, materials, and production processes. This enhanced product knowledge enriches the shopping experience, forging a deeper connection between the brand and the consumer. Trust is nurtured as shoppers can confidently verify the authenticity and provenance of their luxury acquisitions. The result is a more personalized and meaningful shopping experience that strengthens the bond between consumers and luxury brands. In conclusion, NFTs have the potential to revolutionize the luxury goods market by offering a comprehensive solution that encompasses both anti-counterfeiting measures and enhanced customer experience. By underpinning the authenticity of luxury products with NFTs, we aim to not only curtail the counterfeit trade but also to cultivate an environment where consumers can shop with confidence, secure in the knowledge that the luxury items they acquire are genuine and cherished for their unique qualities. This research, therefore, represents a significant step toward establishing a more secure, trustworthy, and transparent market for luxury goods. 1.2 Objectives and Contributions This dissertation endeavors to offer a comprehensive analysis of existing NFT (Non-Fungible Token) systems with a particular focus on their relevance to luxury items, including jewelry, art, and luxury clothing. The research project outlines the following objectives and contributions: The first goal is to perform a comprehensive analysis and evaluation of various NFT systems currently in operation. This analysis will encompass critical factors such as pricing mechanisms, usability, and ease 4 CHAPTER 1. INTRODUCTION of programming. The outcome of this analysis will serve as the foundation for identifying the gaps and opportunities specific to NFTs in the luxury goods industry. Subsequently, the research aims to design a specialized NFT platform uniquely tailored to the requirements of luxury products. This platform will seek to address the challenges and prerequisites that are distinct to the authentication and representation of high-end goods within the NFT ecosystem. In addition to platform development, the research will propose a set of standard principles for NFTs. These principles will be directed towards enhancing the correlation between the NFT and the associated product. Throughout the project, we will investigate and address any technical challenges that may arise in the process of adapting NFTs for luxury items By including these proposed guidelines for NFTs and maintaining a strong emphasis on product authenticity verification in every trade, this research project seeks to provide valuable insights and solutions to the distinct challenges faced by NFTs in the luxury industry. 1.3 Document Structure This thesis is divided into seven chapters, each of which is briefly described as follows: • Chapter 1: An overview of the work’s subject, the driving force behind it, and the main goals. • Chapter 2: Theoretical concepts of Blockchain, Ethereum and NFTs, as well as their goals, features and how do they work. • Chapter 3: The choices and procedures used to carry out the proposed work, including information on each tool and related projects. • Chapter 4: Covers the functional requirements, including the type of users and use cases, and the application architecture, • Chapter 5: Focused on implementation, covering the Moralis server, integration of use cases using smart contracts, and frontend development. • Chapter 6: Integration of the developed project into Docker. • Chapter 7: An overview of the dissertation is provided, followed by a discussion of the objectives, which are stated in this chapter, and the findings from the preceding chapter. The conclusion includes some recommendations for additional research. • Appendix: Several photos to provide an overview of the website and its use cases. 5 Chapter 2 Background This chapter has the goal to contextualize the reader about where this dissertation fits, give him the minimum knowledge to understand the following chapters. Therefore, the primary focus will be on explaining what a blockchain and Ethereum network are, elucidating some of the network’s properties, such as what a fee or a smart contract is, as well as exploring the term Non-Fungible Tokens and some of the present features. 2.1 Blockchain Unlike traditional databases, which are owned by central entities such as banks and governments, blockchain is, usually, a decentralized open ledger system that uses a consensus of replicated, shared, and synchronized digital data without centralized data storage and is maintained by a distributed network of computers. Centralized systems have centralized information and anyone who want to use it, must rely on the main entity, where power and authority are concentrated in one location. In decentralized systems, such as blockchain, all the users participate on the decisions made, without needing an intermediary, implying that the system will be transparent and interoperable [29,80]. Because of the extensive use of cryptographic functions, blockchain technology is the cornerstone of modern cryptocurrencies. To digitally sign and securely transact within the system, users must use public and private keys. Users can solve puzzles using cryptographic hash functions in the hopes of being paid with a specific amount of money on cryptocurrency-based blockchain networks that use mining. [79]. Satoshi Nakamoto introduced a revolutionary approach by innovatively merging elements of technology to establish a novel model in which a network of computers collaboratively maintains data integrity. Blockchains are decentralized digital ledgers that organize information into blocks of cryptographically 6 CHAPTER 2. BACKGROUND signed transactions. Each block is cryptographically linked to the one preceding it, ensuring tamperproofness. As more new blocks are added, older ones become increasingly resistant to alteration, providing robust tamper resistance. Network copies of the ledger automatically duplicate new blocks, and conflicts are resolved according to predefined procedures [79]. Each block contains a data record and an unique identifier known as hash code. Miners on the network validate the transactions, and when they produce a new block, they include this hash. Afterwards, the block is completed is broadcasted to other nodes so that all have a copy of the database because there is no centralized system to verify such changes [45]. In the following figure is illustrated a simple scheme of the architecture of the blockchain: Figure 2: Generic Blockchain architecture. From [79] It’s worth noting that any blockchain implementation can define its own data fields; nevertheless, many blockchain implementations use data fields like the ones in the Figure 2. As can be seen, each block contains a block header and block data. This block’s metadata is stored in the block header. The block data comprises a list of transactions that have been uploaded to the blockchain network that have been verified and authenticated [4,59,79]. Also, something not depicted in the figure above, but worth noting is the permission model, which determines who can maintain blockchain networks, can be used to categorize them. It is permissionless if anyone can publish a new block and it is permissioned if only certain users can post blocks. A permissioned blockchain network is similar to a restricted business intranet, but a permissionless blockchain network is similar to the public internet, where anybody can participate. Permissioned blockchain networks are frequently used for a group of organizations and individuals known as a consortium [79]. 2.1.1 Smart Contract Smart contracts are self-executing contracts with the terms of the agreement between buyer and seller being directly written into lines of code. They run on a decentralized network, typically a blockchain, and are executed automatically when certain conditions are met [74]. 7 CHAPTER 2. BACKGROUND Computer scientist and cryptographer Nick Szabo initially proposed smart contracts in 1994. However, it wasn’t until the advent of blockchain technology that smart contracts became truly feasible. The first blockchain-based smart contract platform was Ethereum, which was launched in 2015. Since then, many other blockchain platforms have emerged, each with their own unique features and capabilities [74]. The usage of these kind of contracts eliminates the need for trusted intermediates and reduces the possibility of purposeful and unintentional exceptions. Transactions are completed in their entirety, with any changes to the global state (accounts, contracts, etc.) being recorded only if the entire process is completed successfully. The term “successful termination” refers to a program that has completed its execution without errors. [5,39]. Figure 4exemplifies in 4 simple steps how a smart contract work Figure 3: How smart contract work. From capital.com One notable advantage of implementing smart contracts in comparison to traditional contracts lies in the streamlined efficiency of the contractual process. For instance, smart contracts offer a straightforward method of monitoring the historical actions of the contracting parties. In addition, smart contracts provides transparency, eliminating the need for trust as a necessary factor in the execution of the contract. Participants can remain anonymous while having confidence that the contract will automatically execute when the specified conditions are met. [39]. 2.1.2 Bitcoin Bitcoin was the first cryptocurrency ever created. Unlike conventional financial organizations, no single entity bears responsibility for processing transactions. Prior to the emergence of Bitcoin, electronic payments necessitated the aid of a third party, such as a bank or payment processor. Nevertheless, Bitcoin is 8 CHAPTER 2. BACKGROUND a decentralized system that operates as a peer-to-peer electronic currency, whereby funds are transferred directly from one individual to another. Transactions are recorded on a public ledger that is upheld by the network of users, ensuring that fraudulent activities or double-spending are prevented. The success of Bitcoin has helped disseminate the concept of blockchain technology, which provides the foundation for its operation. By comprehending the principles of Bitcoin and its blockchain, one can gain insight into the potential of this groundbreaking technology to revolutionize various industries and applications, extending beyond the realm of digital currencies. [4,47,58]. To use a cryptocurrency, you need a wallet to store your virtual coins that has a unique address. This address correspond to your public key generated by Elliptical Curve Digital Signature Algorithm (ECDSA) as well as the private key that is used to sign transactions [4,46]. A person A sends his public encryption key (account number) to a person B, which initiates the transaction. B’s wallet send the amount selected to A and signs it using B’s private key. The network has to verify and confirm the transaction, made between A’s and B’s wallet, to become valid. The bitcoin network has now disseminated the transaction via peer-to-peer but it is not included in the blockchain until it is confirmed and included in a block through the mining process [4,58]. Payments undergo validation by miners who engage in solving intricate computational problems that require complex calculations. These miners compete to find a solution as quickly as possible. When one of them successfully finds a solution, they submit it to the network for verification by their peers. To ensure the transaction’s validity, a consensus is reached among a substantial number of miners. Only when a significant number of miners agree on the transaction’s validity is it added to the blockchain. Miners are motivated to invest processing power in the verification process due to the possibility of earning new Bitcoins as a reward [58]. This process builds trust in the network’s security and reliability. In this version, the flow of the paragraph is clearer, and it emphasizes the importance of 2.1.3 Consensus Mechanism The consensus algorithm plays a crucial role in ensuring the security and efficiency of the blockchain. There are a variety of consensus procedures, but they all have the same goal in mind: to ensure that records are accurate and truthful. The distinction is in how the agreement is made. Proof of Work (PoW) is the consensus algorithm employed by Bitcoin and Ethereum blockchains. In this model, a user publishes the following block by solving a computationally intensive challenge first. The “evidence” that they have worked is the solution to this puzzle. The challenge is designed in a manner that renders solving it difficult, yet validating a solution is straightforward. This allows all other complete nodes to quickly check any suggested next blocks, and any recommended block that does not meet the puzzle’s requirements will be rejected. Bitcoin, for example, modifies the puzzle difficulty every 2016 blocks to keep the block publication rate about once every ten minutes [79]. 9 CHAPTER 2. BACKGROUND Proof of Stake (PoS) determines whether or not new blocks are published based on the amount of stake a user holds. The amount of cryptocurrency that a blockchain network user has staked in the system is known as stake. For this reason, there is no need to do resource-intensive computations (including time, electricity, and processing power) as in PoW using this consensus approach [38,43,79]. The Delegated Proof of Stake (DPoS) is a consensus algorithm in which stakeholders vote to elect delegates who validate transactions and produce new blocks. These delegates are known as “witnesses” and are responsible for validating blocks in a decentralized network. Unlike PoW and PoS, DPoS is more scalable because it avoids the need for all nodes to validate transactions, as only a smaller number of witnesses are elected to do so [18]. The Proof of Authority (PoA) is a consensus algorithm that relies on the identity of validators to secure the blockchain network. Validators are pre-approved and known entities, such as businesses or organizations, that have already gained trust in the community. PoA is a more centralized consensus mechanism than others, but it is useful for private blockchains where security is more important than decentralization [42]. The choice of consensus mechanism depends on the goals and requirements of the blockchain network. Regardless of the consensus mechanism used, the primary goal is to ensure that all nodes in the network agree on the validity of transactions and the state of the blockchain. 2.1.4 Decentralized applications Decentralized applications (dApp) are software programs that operate on a decentralized network, typically a blockchain. The blockchain is a distributed ledger that records transactions and other data across a network of computers. The use of blockchain technology allows dApps to operate without the need for a central authority, such as a server or a company, making them more secure, transparent, and resilient than traditional centralized applications [78]. DApps offer a variety of advantages. For instance, by eliminating the need for users to share their personal information with a centralized authority, they can enhance user privacy. Since there is no central authority that can be targeted by governments or other organizations looking to censor access to information or services, they may also be more resistant to censorship [56]. Additionally, dApps can make it possible for new business models that weren’t previously feasible. They might enable the development of decentralized marketplaces, for instance, where buyers and sellers can deal directly without the involvement of a middleman. This may lower transaction costs and improve market effectiveness [13]. Overall, dApps offer increased security, privacy, and transparency compared to traditional centralized applications, and can enable new business models that were not previously possible [13,56]. 10 CHAPTER 2. BACKGROUND 2.2 Ethereum Ethereum, originally established as a platform primarily dedicated to the development of dApp, initially adopted a PoW algorithm akin to Bitcoin. Within this consensus mechanism, Ethereum nodes undertake data storage, smart contract execution, and maintain a synchronized record of the global state [12,67]. However, as of 2022, Ethereum has undergone a transition from PoW to a PoS consensus mechanism.- Ethereum is a platform, not a currency, that allows dApps to run all over the world where Ether, or ETH, is the currency used to reward network participants. Developers write contracts in high-level languages - the most common used is the Solidity - and compile them to Ethereum virtual machine (EVM) (explained in section 2.2.2) [67]. In Ethereum, smart contracts represent self-executing agreements where the contractual terms between buyer and seller are directly encoded into lines of code. Upon deployment to the Ethereum network, the contract’s address, invoked function, and corresponding arguments become essential for user interactions with the contract. Moreover, smart contracts possess the capability to call other contracts and transfer ether units to users or other contracts in response to specific requests. Furthermore, the Ethereum protocol assigns a cost (in gas units) to each EVM action in order to make spamming prohibitively expensive.[67]. The urge to eliminate middlemen through smart contracts was so strong that Ethereum and other competitors with similar goals, including as Cardano, NEO, and Hyperledger, gained traction on the market [41]. Nevertheless, Ethereum has been the market’s most consolidated smart contract and decentralized application platform, attracting a large community from all over the world to contribute to its growth [41]. 2.2.1 Smart Contracts Ethereum is a blockchain platform that supports smart contracts. Smart contracts are self-executing programs that can automate transactions and enforce agreements without the need for intermediaries. Ethereum’s smart contract functionality differs from other blockchain platforms due to several unique features [3]. Ethereum has a large and active development community that has created a rich ecosystem of tools and resources for smart contract development and deployment. Additionally, Ethereum’s smart contracts are stored on a blockchain that is optimized for smart contract execution. This enables the platform to handle a high volume of transactions, making it suitable for decentralized applications that require scalability. Finally, Ethereum has implemented various security measures to ensure that smart contracts are executed correctly and securely. These measures include the Solidity programming language and the Ethereum Virtual Machine [3,5]. These features have helped make Ethereum a leading platform for smart contract development and deployment. 11 CHAPTER 3. STATE OF ART Figure 6: Outcome of the DSS for DUO a based on their blockchain feature requirements’ priorities. Adapted [26] 3.2 Smart Contract Languages Ethereum smart contract programs are written in a stack-based bytecode language and executed in EVM, as previously stated. Ethereum smart contracts are written in a variety of high-level languages [62,75, 77], such as: •Solidity1: Is a language inspired mainly on C++, being the most common and used for the develop of Ethereum smart contracts. •Vyper2: Is a contract-oriented programming language influenced on Python for being simple and easy to read. •Yul3: Is an intermediate language. In other hands, only consider Yul or Yul+ until you’ve learned about smart contract security best practices and how to operate with the EVM. •FE4: Is also inspired by Python and Rust. It is still in its early phases, but it aspires to be simple to understand. •Lisp Like Language (LLL)5: Is one of the first smart contract programming languages for Ethereum. Is a low-level programming language that is comparable to Assembly, simple and minimalistic. Solidity is a contract-oriented high-level language that is akin to JavaScript and C++. It lets you create contracts and compile them to EVM bytecode, as stated before [16]. A smart contract when deployed on the network cannot be modified, that is why programmers have to test their code to ensure that the smart contract will perform flawlessly. 1https://docs.soliditylang.org/ 2https://vyper.readthedocs.io/ 3https://docs.soliditylang.org/en/latest/yul.html 4https://github.com/ethereum/fe 5https://lll-docs.readthedocs.io/ 18 CHAPTER 3. STATE OF ART Listing 1 demonstrates a simple example that sets the value of a variable within the ’SimpleStorage’ [23]: Listing 1 Solidity Smart Contract . From docs.soliditylang.org/ 1// SPDX-License-Identifier: GPL-3.0 2pragma solidity >=0.4.16 <0.9.0; 3 4contract SimpleStorage { 5uint storedData; 6 7function set(uint x) public { 8storedData =x; 9} 10 11 function get() public view returns (uint) { 12 return storedData; 13 } 14 } 3.3 Ethereum Scaling Ethereum has experienced significant growth in recent years, with an increasing number of users pushing the blockchain’s limits. Consequently, the cost of network access has risen, necessitating the implementation of ’scaling solutions.’ Scaling solutions aim to enhance certain features, such as transaction speed and reduced gas fees, while maintaining security and decentralization [60]. It is worth noting that Ethereum has explored and adopted specific scaling solutions to address these challenges. Scaling can be divided into two categories: •On-chain: Focus on layer 1 or base layer. There are few choices on this method, because this would necessitate highly specialized nodes to handle the additional traffic, resulting in more centralization and, as a result, worse security. •Off-chain: Focus on layer 2. Some solutions rely on layer 1 Ethereum consensus for security, while others need the construction of new chains in various forms that are not dependent on Mainnet for security. Mainnet is like the real-world version of a blockchain. It is the actual network where people do real transactions and everything works just as intended. It is the live and fully functional version of the blockchain system. 19 CHAPTER 3. STATE OF ART There are several options available when it comes to practical scaling solutions. While some of the choices are now available and can boost Ethereum network throughput in the short to medium term, others are aimed at the medium to long future [60]. The following are the most widely used layer-2 scaling methods: •Rollups 6: Rollups execute transactions outside of layer 1, then send the data to layer 1, where consensus is obtained. Rollups can be safeguarded by native Ethereum security because transaction data is included in layer 1 blocks [40]. •Zero-Knowledge Rollups 7: Zero-Knowledge Rollups are a layer 2 scaling solution for blockchains that allow for off-chain transaction processing while maintaining security and privacy. Through the use of cryptographic techniques, these rollups provide proof of transaction validity without disclosing sensitive data. This approach significantly reduces computational load on the main blockchain (Layer 1), enabling faster and more scalable transactions. Zero-Knowledge Rollups present a promising solution to enhance blockchain scalability and operational efficiency [81]. However, it’s essential to consider the potential trade-offs. While Zero-Knowledge Rollups enhance scalability and operational efficiency, they may lead to an increase in the state stored in the blockchain. This increase in blockchain state can be a trade-off to achieve the desired scalability benefits [81]. •State channels 8: Multisig contracts, also known as ”Multisignature”contracts, enable multiple parties to collectively approve transactions before they are executed. This added security feature is particularly useful in state channels, allowing users to conduct fast and unrestricted off-chain transactions before permanently settling them on the Mainnet [63]. •Sidechains 9: Are blockchains that run alongside the Ethereum Mainnet (main blockchain) and are compatible with the Ethereum Virtual Machine (EVM). They achieve interoperability with the Ethereum Mainnet through ’two-way bridges,’ which are mechanisms allowing assets and data to move back and forth between the Mainnet and the sidechain. Additionally, sidechains operate with their own consensus mechanism [61]. •Plasma 10: Is a distinct blockchain anchored to the Ethereum Mainnet, using fraud proofs to settle disputes. Because they are effectively smaller replicas of the Ethereum’s main chain, these ones are also called to as child chains. Plasma chains are similar to sidechains, but they sacrifice some functionality in exchange for more security [54,69]. 6https://ethereum.org/en/developers/docs/scaling/layer-2-rollups/ 7https://ethereum.org/en/developers/docs/scaling/zk-rollups/ 8https://ethereum.org/en/developers/docs/scaling/state-channels/ 9https://ethereum.org/en/developers/docs/scaling/sidechains/ 10https://ethereum.org/en/developers/docs/scaling/plasma/ 20 CHAPTER 3. STATE OF ART •Validium 11: Validium is another layer 2 scaling solution for blockchains that is similar to Zero- Knowledge Rollups. It allows for off-chain transaction processing while preserving privacy and security. However, instead of using cryptographic proofs, Validium relies on trusted validators to handle the off-chain computations and then submit a summary of the results to the main blockchain. This approach maintains the benefits of scalability and efficiency while providing a different trade-off between trust and computation [72]. Figure 7: Transactions per second. From novuminsights.com As depicted in Figure 7, Polygon12, which utilizes Plasma technology, significantly outperforms other off-chain solutions in terms of TPS (Transactions Per Second). Additionally, they offer more cost-effective transactions and dominate the market for layer 2 scaling solutions. These advancements are expected to have a substantial impact on the Ethereum ecosystem, positioning them favorably to lead the field of Decentralized Finance (DeFi) by leveraging Ethereum’s well-established protocols [17]. 3.4 EIP and ERC Ethereum Improvement Proposals (EIP) define Ethereum basic protocol standards, such as core protocol definitions, client APIs, and contract standards [15,32]. Ethereum smart contract developers utilize Ethereum Request for Comments (ERC) as technical papers, laying forth a set of guidelines for implementing tokens in the Ethereum ecosystem. There are many kinds of ERC, but in the context of this dissertation, the most usable ones would be ERC-721[22] and ERC-1155[20]. ERC-721 Non-Fungible Token Standard ERC-721 is a standard for NFTs that defines a set of features for managing a token in a secure and convenient manner, as well as providing complementary functionality to NTFs such as making secure token transfers from one account to another, obtaining the token’s owner, or obtaining all the tokens available on the network, as is demonstrated below [22]. 11https://ethereum.org/en/developers/docs/scaling/validium/ 12https://docs.polygon.technology/ 21 CHAPTER 3. STATE OF ART Listing 2 Functions and Events available on ERC-721 . From ethereum.org 1// FUNCTIONS 2function balanceOf(address _owner) external view returns (uint256); 3function ownerOf(uint256 _tokenId) external view returns (address); 4function safeTransferFrom(address _from, address _to, uint256 _tokenId, bytes data) 5external payable; 6function safeTransferFrom(address _from, address _to, uint256 _tokenId) external payable; 7function transferFrom(address _from, address _to, uint256 _tokenId) external payable; 8function approve(address _approved, uint256 _tokenId) external payable; 9function setApprovalForAll(address _operator, bool _approved) external; 10 function getApproved(uint256 _tokenId) external view returns (address); 11 function isApprovedForAll(address _owner, address _operator) external view returns (bool); 12 13 // EVENTS 14 event Transfer(address indexed _from, address indexed _to, uint256 indexed _tokenId); 15 event Approval(address indexed _owner, address indexed _approved, uint256 indexed _tokenId); 16 event ApprovalForAll(address indexed _owner, address indexed _operator, bool _approved); Listing 2 presents the core functions and events defined by the ERC-721 standard for non-fungible tokens (NFTs). This standard establishes a framework for uniquely identifying and managing individual Ethereum assets. The listed functions include operations such as checking token balances, transferring tokens, approving token transfers to third parties, and setting approval for all transfers, among others. The associated events enable tracking and notification of important token-related activities, such as transfers and approvals. Within the ERC-721 smart contract, each NFT is recognized by a unique uint256 ID. The pair (contract address, uint256 tokenId) will then serve as a globally unique and fully qualified identification for a single Ethereum asset. Also, ERC-721 standardizes a safe transfer function safeTransferFrom and an unsafe function transferFrom that can be started by an NFT owner, an NFT’s approved address or even an NFT’s current owner’s authorized operator [19]. 22 CHAPTER 3. STATE OF ART ERC-1155 Multi-Token Standard A standard for contracts that handle a variety of digital assets. The concept is straightforward: develop a smart contract interface that can represent and handle a wide range of fungible and non-fungible token kinds. In other words, the ERC-1155 token may perform the same functions as the ERC-20 (standard for Fungible Tokens)[21] and ERC-721 tokens, and even both at once. Most importantly, increasing the functionality of both standards, making them more efficient, and resolving implementation flaws in these last two standards. ERC-1155 added new features like multiple assets can be transferred in a single call along with get their balances. Also, a set of rules for secure transfer had been added [20]. 3.5 Tools In this subsection, the tools needed for the development of this project will be analyzed and compared. There are essential software tools to move forward on this work, specifically tools to help smart contract development, storage platforms, NFT standards or Web3 development. OpenZeppelin is a library that offers a collection of standards aimed at enhancing the security of blockchain, such as ERC-720 and ERC-1150. It will be used to establish robust security measures within our smart contracts. The utilization of Interplanetary File System (IPFS) is crucial for storing metadata like images, descriptions, or other attributes that cannot be efficiently stored on the smart contract due to the associated high costs. IPFS will serve as our distributed storage solution for handling large volumes of data and media associated with our project. Many web3 development platforms already incorporate the distributed file system, which proves advantageous by saving time and effort. These platforms will enable efficient integration with IPFS and other web3 technologies. For effective communication with front-end interfaces, the web3.js package is required. It will facilitate fundamental interactions with smart contracts on the blockchain network, allowing seamless integration between our project’s back-end and user interfaces. Web3 represents the modern approach to building decentralized applications and services using blockchain technology. It prioritizes giving users more control, ownership of their data, and creating trust without relying on intermediaries. In this discussion, we will delve into each tool’s specific use case and explore various smart contract development IDEs and platforms for web3 development. Smart Contract development Working with smart contracts sometimes can be very tricky and for that there is some platforms to test, compile and deploy these contracts on a testnet or mainet blockchain. Below are so of these tools and their characteristics: 23 CHAPTER 3. STATE OF ART •Remix13 –Open-source web app (and have a desktop app for thoses who prefer); –The Remix documentation simple and good for beginners; –Test are done only in Solidity; –Used by OpenSea[50], Ethereum.org[33] and Moonbeam[44] . •Hardhat14 : –assists developers in managing and automating common procedures associated with the development of smart contracts and Dapps; –Hardhat documentation is very simple and well-organized; –Hardhat features a rich plugin ecosystem and relies heavily on these plugins; –Used by Openzeppelin[51], Aave[2] and Optimism[52]. •Truffle15 : –Is a blockchain testing framework and asset pipeline based on the EVM; –Truffle documentation is clear and has a section to guide begginers on common tasks; –Truffle works with helpful boilerplates, commonly known as, boxes; –Used by 1inch[1], Bitgo[36] and JPMorgan Chase & Co[37]. Web3 Providers Keep in mind that Ethereum is made up of nodes that all share the same data. Setting a Web3 Provider in Web3.js instructs our code to communicate with which node to handle our readings and writes. In a traditional web app, it’s similar to defining the URL of the external web server for your API queries. As a provider, you could run your own Ethereum node. However, there is a third-party service that makes your life easier by allowing you to give a DApp to your consumers without having to manage your own Ethereum node [14]. On Polygon, the excess of traffic on public Remote Procedure Calls (RPCs) can cause a bottleneck, making the server to crash. To avoid that, there is some free RPCs, running on Polygon nodes, to help relive this congestion [76]: •Infura16 : 13https://remix-ide.readthedocs.io/ 14https://hardhat.org/hardhat-network/ 15https://trufflesuite.com/docs/ 16https://infura.io/ 24 CHAPTER 3. STATE OF ART –Acess to their own IPFS; –Provide fast connections to peer-to-peer networks –Arbitrum Rollup, Filecoin (beta), and Optimism Ethereum are among the other technologies Infura supports. •Moralis17 : –Acess to their own IPFS; –It has full cross-chain interoperability, making it completely future-proof. –Moralis currently supports Ethereum, Binance Smart Chain, Polygon (previously Matic), and Avalanche, which are all well-known blockchains. Furthermore, other credible chains in the pipeline have Moralis’ support as well. •Alchemy18 : –Alchemy provide access to nodes that are extremely scalable, stable, and reliable; –Alchemy also has a feature called “Notify”, which allows you to add notifications to your items right away. –Alchemy supports Ethereum’s mainnet and testnets (Rinkeby, Ropsten, Kovan, Görli) and also Polygon, Arbitrum Rollup and Optimism Ethereum Browser Wallets A secure and practical method of interacting with the dApp without disclosing the user’s private keys is by using a browser extension wallet. Users may easily manage their cryptocurrency transactions by signing transactions and connecting their wallet to the dApp. Advanced features like gas price customization and transaction history tracking are also available in browser extension wallets, making it simpler for users to manage their cryptocurrency transactions on the dApp. Here are a few potential options: •Metamask19: –Metamask is known for its simple and intuitive user interface –Metamask is a browser extension that integrates seamlessly with popular web browsers like Chrome, Firefox, and Brave, allowing users to interact with decentralized applications (DApps) directly from their browsers. –In addition to Ethereum, Metamask supports other Ethereum-based blockchains like Binance Smart Chain and Polygon 17https://moralis.io/ 18https://www.alchemy.com/ 19https://metamask.io/ 25 CHAPTER 3. STATE OF ART •Wallet Connect20: –As it does not require users to enter private keys directly into DApps, WalletConnect reduces the risk of exposing sensitive information to potential phishing attacks. –WalletConnect offers a smooth user experience, with quick and easy connections to DApps through scanning QR codes, making it a preferred choice for mobile users. –Like Metamask, WalletConnect supports multiple blockchains, enabling users to interact with various decentralized applications across different networks. •MyEtherWallet21: –Provides robust token management features, making it easy to view, send, and receive various ERC-20 tokens in addition to Ether (ETH). –Is a client-side wallet, meaning all the data is generated and stored on the user’s device. Users have full control over their private keys and funds. –Can be used offline, allowing users to access their wallets and sign transactions securely without an internet connection. 20https://walletconnect.com/ 21https://www.myetherwallet.com/ 26 CHAPTER 3. STATE OF ART 3.6 Principles Every NFT is one-of-a-kind and may be used to represent any digital asset on a blockchain. In the context of this dissertation, an NFT is associated with a physical object, and some principles must be established to strengthen that association. Drawing inspiration from C. Allen’s work on self-sovereign identity [64], I propose the following principles for NFTs representing one object: •Existence: The assets (physical objects) must always exist if there is an NFT associated. That is one of the main properties of the NFT - the assets are in the center of the ecosystem and their existence does not depend on any third-party. •Control: The owner of the NFT must have absolute control over the NFT and the associated assets. •Access: The owner of the NFT must always have access to the associated assets, and claim that they belong to him. •Transparency: The NFT’s records should be open to the public so that anyone can track the associated asset and see where it came from. •Persistence: NFTs must be persistent and long-lived. The NFT must be available to be transacted or traded as long as the associated asset exist. However, persistence does not mean the association between the asset and the NFT is forever - the owner of the NFT has the right to finish that association if they intend to. •Provable: This can be done through the addition of verifiable attestations made by third trusted parties. •Ownership: The owner of the NFT must own the associated assets. •Portability: The NFT should be portable, in the sense that it can be stored by its owner in a mobile. •Interoperability: The NFT should be transacted across different blochchains/ledgers, meaning that it has to be interoperable with different blockchains/ledgers. •Consent: The transaction of the NFT can only occur with the consent of its owner. Even when proofs are added by third-parties, it must have the consent of the owner to be added to the NFT. •Minimalization: In the process of sharing information about the owner of the NFT and the associated assets, the disclosure of personal information should be minimal, in order to enhance the owner’s privacy. When applicable or needed, selective disclosure of the owner´s personal data (or of the information of the associated asset) can be achieved using zero-knowledge techniques. 27 CHAPTER 4. SYSTEM MODELING Create an NFT This sequence diagram illustrates the process of creating a Non-Fungible Token (NFT) on the blockchain. The main participants involved in this transaction are the User, the IPFS (InterPlanetary File System) for storing the asset’s metadata, the Smart Contract responsible for NFT management, Metamask for user authentication and transaction signing, and the Blockchain itself for validating and recording the NFT’s ownership details. The diagram showcases the interactions between these entities, including the user’s asset upload to IPFS, the request for NFT creation through the Smart Contract, and the successful validation and minting of the NFT on the blockchain. This sequence diagram illustrates the process of creating a Non-Fungible Token (NFT) on the blockchain. The main participants involved in this transaction are the User, the IPFS (InterPlanetary File System) for storing the asset’s metadata, the Smart Contract responsible for NFT management, Metamask for user authentication and transaction signing, and the Blockchain itself for validating and recording the NFT’s ownership details. The diagram showcases the interactions between these entities, including the user’s asset upload to IPFS, the request for NFT creation through the Smart Contract, and the successful validation and minting of the NFT on the blockchain. Transaction signing, as mentioned, is a crucial step in the process. When a user initiates the creation of an NFT, Metamask, a widely used cryptocurrency wallet and transaction manager, plays a vital role. It not only helps authenticate the user but also facilitates the secure signing of the transaction. Transaction signing involves the user’s approval and cryptographic signature, ensuring the authenticity and integrity of the NFT creation process. This step is essential for authorizing and recording the NFT creation on the blockchain ledger. 34 CHAPTER 4. SYSTEM MODELING Figure 10: Create an NFT Sequence Diagram 35 CHAPTER 4. SYSTEM MODELING Sell an NFT The sequence diagram illustrates the process of selling an NFT on the blockchain. The main participants are the Buyer, the System/App facilitating the purchase, the Smart Contract managing the sale, the current Owner of the NFT, and the Blockchain. The interactions include the Buyer’s purchase request, Smart Contract verification, successful transaction, and the update of ownership details on the blockchain. Figure 11: Sell NFT Sequence Diagram 36 CHAPTER 4. SYSTEM MODELING Reserve an NFT The sequence diagram depicts the process of reserving an NFT. The key participants include the User, the System/App handling the reservation, the Smart Contract responsible for managing the NFT queue, and the Blockchain. The interactions involve the User’s request to reserve the NFT, the Smart Contract’s queue management, and the recording of the reservation on the Blockchain. Figure 12: Reserve an NFT Sequence Diagram 37 CHAPTER 4. SYSTEM MODELING Look into an NFT’s background The sequence diagram demonstrates the process of looking into the background of an NFT. The key participants are the User, the System/App and the Blockchain Explorer website. The interactions involve the User’s request to view the NFT background, the System/App redirecting the User to the Blockchain Explorer website, and the User accessing the NFT information directly on the Blockchain Explorer platform. Figure 13: NFT history Sequence Diagram 38 CHAPTER 4. SYSTEM MODELING Update price of an NFT The sequence diagram illustrates the process of updating the price of an NFT. The primary participants include the User, the System/App responsible for managing the NFT, and the Smart Contract handling the NFT’s price update. It’s important to note that only the owner of the NFT has the authority to update its price, and this action can be performed only when the NFT is not currently listed for sale. The interactions involve the User’s request to update the NFT price, the System/App validating the request, and, if the conditions are met, the successful execution of the price update by the Smart Contract, reflecting the changes in the NFT’s pricing. Figure 14: Update NFT Price Sequence Diagram 39 CHAPTER 4. SYSTEM MODELING List an NFT on the market This sequence diagram illustrates the process of listing an NFT for sale. The main participants include the Owner, the System/App handling the listing, the Smart Contract managing NFT ownership and status, and the Blockchain for recording and confirming the transaction. The interactions involve the Owner providing listing details, the Smart Contract transferring NFT ownership to the Owner and updating the status to ’on sale soon,’ confirmation exchanges between the Smart Contract, Blockchain, and System/App, the Creator confirming the associated object’s availability, and finally, the Smart Contract updating the NFT status to ’on sale’ and listing it on the Blockchain with further confirmation exchanges. Figure 15: List NFT Sequence Diagram 40 CHAPTER 4. SYSTEM MODELING Visualize my own NFTs This sequence diagram illustrates the process of displaying a user’s NFTs on their profile page. The primary participants in this interaction are the User, the System/App responsible for handling profile page navigation, the Smart Contract, and the Blockchain. The interactions begin with the User navigating to their profile page. When the User requests to view their NFTs, the System communicates with the Smart Contract, which in turn interacts with the Blockchain. The Smart Contract facilitates the retrieval of the User’s NFT information from the Blockchain. Importantly, the getLuxyTokenForId() function, responsible for fetching the user’s NFTs, is designed as a public view function, which means that users do not need to pay gas fees when accessing it. This ensures a seamless user experience. Finally, the System takes the retrieved NFT information and displays it back to the User on their profile page. Figure 16: Visualize my own NFTs Sequence Diagram 41 CHAPTER 4. SYSTEM MODELING Visualize the list of market NFTs This sequence diagram illustrates the process of displaying a user’s NFTs on the market page for potential buyers. The main participants are the User, the System/App handling the market page navigation, the Smart Contract fetching the user’s NFTs, and the Blockchain for retrieving and sending the NFT information. The interactions involve the User navigating to the market page, the System requesting the user’s NFTs from the Smart Contract, the Smart Contract communicating with the Blockchain to retrieve the user’s NFTs, and the System displaying the NFT information on the market page for potential buyers to view. Figure 17: Visualize market’s NFTs Sequence Diagram 42 CHAPTER 4. SYSTEM MODELING Login with Metamask This sequence diagram illustrates the process of logging in with Metamask on the platform. The main participants are the User, the System/App responsible for handling the login process, and Metamask as the external wallet application. The interactions involve the User initiating the login process, the System requesting authentication through Metamask, the User approving the login request in Metamask, and the System granting access to the platform after successful authentication via Metamask. Figure 18: Login with Metamask Sequence Diagram 43 CHAPTER 5. IMPLEMENTATION Listing 6 Example of an Event 1event TokenSold ( 2uint256 indexed tokenId, 3address seller, 4address buyer 5); Additionally, a mapping that works similarly to a hash table and allows data to be stored and retrieved using unique keys connected to the status of the contract was created. Also, it should be noted that in every transaction in the market, there is a negligible fee of 0.00001 ether. 5.2.1 Integration of use cases using smart contracts This section aims to provide a comprehensive explanation of how a smart contract was developed to fit into a project’s use cases Create NFT Before discussing the writing process for the NFT creation function, it is important to understand the purposes of the ERC-721 functions _safeMint,_setTokenURI e o setApprovalForAll. The _safeMint function is an element of the ERC721 standard for NFTs on the Ethereum blockchain that mints new NFTs securely by performing out checks to make sure the minting process is performed correctly and without errors, such as validating the minting authority and token uniqueness. Another feature of the ERC721 standard is the _setTokenURI function, which enables the association of a particular token with a URI (Uniform Resource Identifier) that leads to a location where more details about the token may be obtained. This URI acts as a link to metadata about the token that can be found elsewhere, like an IPFS hash, a website link, or a JSON file. The metadata of NFTs on the ERC721 standard can be accessed and transparently provided by using this function. The setApprovalForAll function acts as a method for granting authority to a particular address or smart contract to handle a token on behalf of its owner. This power is often granted to a smart contract that holds the tokens on behalf of the owners, allowing for more effective management and transfer of the assets. This power may include the ability to transfer or trade the token. Following that explanation, my createToken method takes as parameters a URI that will hold all IPFS- saved metadata and its starting price. To construct the NFT, I use the _safeMint function with the arguments msg.sender and tokenID, where msg.sender is the user that calls the function. then connect the URI provided as an input to _setTokenURI. 50 CHAPTER 5. IMPLEMENTATION Get a list of NFTs Using the mapping that was developed, which, given an ID, gives the token linked with that identifier, we may, for instance, see the list of NFTs available on the market. Therefore use a for loop to iterate through all NFTs, check which ones are for currently for sale and return then in a list. Update price NFT It is essential that you are the owner of an NFT and that the asset is not currently up for sale in order to change the price of it. It won’t be possible to change the price if these conditions are not satisfied. Technically, the method begins by checking those two conditions. If both are true, we simply retrieve the price attribute from the token provided by the mapping and update the price. The following code serves as an example of the aforementioned process of updating the price of an NFT: Listing 7 Update Price of NFT Function 1mapping(uint256 => LuxyToken) private idToLuxyToken; 2 3function updatePriceNFT(uint256 tokenId, uint256 price) public { 4require(msg.sender == idToLuxyToken[tokenId].seller, ”You are not the owner of this NFT”); 5require(idToLuxyToken[tokenId].currentlyListed == false,”NFT is already on sale”); 6idToLuxyToken[tokenId].price =price; 7} Place the NFT for sale As previously said, in order to sell an NFT, the owner must give the creator/store ownership of both the token and the associated physical item. Once the creator or store has the item, they will confirm receipt and put it for sale. The properties of the token in the smart contract must be adjusted, for example, setting “currentlyListed” to true, update “last_owner”, initialize the buyers list to empty, among other things. After the data is up to date, the ownership of a particular token is transferred from one Ethereum address to another by calling _transfer function in an ERC-721 smart contract. Two arguments that are normally passed when the function is called: the address of the token being transferred and the address of the new owner. Additionally, this function does various checks to ensure that the token is currently owned, for example. In order to send the transaction fee to the market, it is required to use the payable function. An event will be released to confirm the transaction once the payment has been successfully completed. 51 CHAPTER 5. IMPLEMENTATION Reserve NFT Since Solidity is statically typed language, its arrays should have a pre-defined size to improve optimization and reduce the possibility of runtime mistakes. Plus the Ethereum Virtual Machine’s restricted memory, and dynamic memory allocation can be costly and unpredictable in terms of gas consumption. Therefore, in order to join a buyers’ line, you must first not be the owner or creator. If these conditions are met, the function proceeds to update the buyer’s list of the NFT by creating a new memory array with one more element than the current buyers list. The function then loops through the current buyers list and copies the address of each buyer to the new list. Finally, the last element of the new list is set to the address of the current sender of the function call (msg.sender). The newBuyersList is then assigned to the NFT’s buyers property, effectively updating the list of buyers for the specified NFT. The approach described above is demonstrated by the code below: Listing 8 Join the buyers’ queue 1function reserveNFT(uint256 tokenId) public { 2require(msg.sender != idToLuxyToken[tokenId].seller, ”Cannot buy your own NFT”); 3require(msg.sender != idToLuxyToken[tokenId].owner, ”Cannot buy this NFT”); 4require(idToLuxyToken[tokenId].currentlyListed == true,”This NFT is not on sale”); 5 6uint buyersNumber =idToLuxyToken[tokenId].buyers.length; 7address[] memory newBuyersList =new address[](buyersNumber+1); 8for(uint i=0;i<buyersNumber;i++){ 9newBuyersList[i] =idToLuxyToken[tokenId].buyers[i]; 10 } 11 12 newBuyersList[buyersNumber] =msg.sender; 13 idToLuxyToken[tokenId].buyers =newBuyersList; 14 } Remove first buyer from buyers’ queue To remove the first element of the queue, is similar to the last procedure, but the opposite. Create a new memory array with one less element than the current buyers list. The function then loops through the list of new purchasers and copies the addresses of all of the buyers from the previous list, with the exception of the first one(buyer[0]). Then the list of buyers is updated with the new one. Execute Sale If the NFT is available for sale, the function proceeds to update the metadata associated with the NFT in the idToLuxyToken mapping. The NFT’s currentlyListed and isOnStore values are set to false, the seller is set to the buyer, the buyers array is set to an empty array, and the holders value is incremented by 1. 52 CHAPTER 5. IMPLEMENTATION The function then calls the _transfer() function to transfer the ownership of the NFT to the buyer, and, consequently, pay the fee to the marketplace. Finally, an event called TokenSold is emitted with the tokenId, seller, and buyer as parameters. 5.3 Frontend As the Smart contract development section is now complete, we have all the backing we need to begin the interface development strategy. React21 will be used to construct the interface server. React.js is a well-liked JavaScript toolkit for creating user interfaces that provides developers with a number of benefits. React’s component-based architecture, which enables developers to create reusable components is one of its main advantages. In addition, React’s usage of JSX, makes it simple to design and comprehend components, and allows for the use of pure JavaScript functions to express components, which can improve the performance of the application by avoiding unnecessary re-renders. The contents and functionalities will be applied through the various application perspectives as anticipated in the examined requirements. The interface will feature distinct pages for each of the three sorts of application users, including owners, creators, and buyers, based on the intended user experience for each. The index.js file serves as the program’s main entry point in a React application. It is in charge of importing the required dependencies and modules, setting up the foundational parameters for the application, and rendering the program’s root component, commonly referred to as App, to the DOM. Additionally, the index.js file connects the application to the DOM, enabling it to be rendered and presented to the user. On the other hand, the root component of the application is defined in the App.js file. The top-level component, often known as this one, contains child components that make up the various elements of the user interface and serves as a representation of the complete application. The App component is in charge of controlling the application’s state and properties as well as rendering the child components on the screen. This file also contains a module named Router that is in charge of defining the routes to all of the project’s views. To prevent any non-logged-in user from accessing a given view, it is necessary to protect the interface routes. As such, it was defined that a user must be authenticated (presence of the signer) to access the various pages of the application, as well as restricting the necessary routes. Only the main menu, where you can learn more about the project, does not requires you to be logged in. 21https://react.dev/ 53 CHAPTER 5. IMPLEMENTATION 5.3.1 Integration with metamask Metamask was integrated using the Moralis library, which has all the tools required to make this an easy process. One of the main features of the Moralis module is its support for web3.js, a JavaScript library that allows developers to interact with smart contracts and read and write data to the blockchain. A client-side storage mechanism (window.localStorage), which enables you to store data in the browser, saves the login after it has been made. Even after the browser is closed or the user leaves the website, the data kept in localStorage is permanent and stays there. Only the origin (domain, protocol, and port) that created the data can access the localStorage data. Once logged in, you have access to all of the website’s pages, and also check your wallet balance and change the current chain you are. 5.3.2 Integration with Smart Contracts The user interface of the application must be connected to the actual smart contract on the blockchain in order to integrate a frontend with smart contracts. Creating the proper development environment is the first step in integrating a frontend with smart contracts. This includes the installation of necessary tools and libraries such as web3.js and Metamask. Web3.js is a JavaScript library that enables developers to connect with the blockchain and Metamask, as we said before, enables users to communicate with dApps. Compiling and deploying the smart contract come next after the development environment has been configured. The smart contract code is compiled to bytecode, which is the format recognized by the Ethereum Virtual Machine. Then the bytecode is distributed to the blockchain, which is often on the Ethereum network. To obtain the bytecode and Application Binary Interface (ABI) was used Remix as a deployment tool. The ABI file, which is a JSON-encoded document, contains details about the functions of the smart contract as well as the data types of its input and output parameters. After the smart contract is deployed, the frontend can communicate with it by utilizing web3.js. This library allows developers to interact with the Ethereum blockchain and invoke smart contract functions. Below is an example of how it was normally integrated the frontend with a function of the smart contract: 54 CHAPTER 5. IMPLEMENTATION Listing 9 Integration with Smart Contract to call executeSale function 1const executeSale =async (e) => { 2e.preventDefault(); 3try { 4const provider =new ethers.providers.Web3Provider(window.ethereum); 5const signer =provider.getSigner(); 6 7let contract =new ethers.Contract(marketAddress, abi, signer); 8 9let transaction =await contract.executeSale(id, false); 10 await transaction.wait(); 11 12 alert('You have transfered the NFT to ' +nft.buyers_list[0]+' with success'); 13 } 14 catch(e) { 15 alert(”Transfer Error: ”+e) 16 } 17 } 5.3.3 Autogenerated CSV to import NFTs The functionality to generate NFTs from a completed CSV file constitutes a prominent feature of this project, affording users the capacity to dynamically and efficiently produce a batch of NFTs. The feature ensures that your data is safe and trustworthy. This makes sure that your information is protected and won’t get lost easily. Moreover, the system ensures that your data cannot be changed or tampered with without proper authorization. Once your data is recorded, it becomes almost impossible to alter, ensuring a high level of security and accuracy. With this dependable and tamper-resistant approach to data storage and exchange, you can confidently make data-driven decisions. Businesses and industries relying on accurate information can explore new possibilities, fostering innovation and growth in their fields. Below, a detailed explanation will be provided outlining the step-by-step procedures required for creating NFTs. 55 CHAPTER 5. IMPLEMENTATION Step 1 The process of creating NFTs can be divided into three distinct stages. The first stage is of utmost importance, as it involves selecting the name of the collection, name of the token, and determining the product type. The product type can be selected from a range of available options, which may include: • Watch • Jewellery • Shoes • Bags • Clothes –Shirt/Coat –Trousers/Shorts Furthermore, in this stage, it is possible to upload the images that will be associated with the NFT. These images, once uploaded, will be deployed on the IPFS provided by the Moralis module. This allows for the secure and decentralized storage of the associated images and ensures their availability for the lifetime of the NFT. Step 2 The subsequent step in the process is to download a CSV file, which will contain several fields that have been pre-populated with information selected during the previous stage. This CSV file contains the information that will be assigned to the NFT. The list below represents the common attributes to all existing NFT: • Title • Description • Image • Price • Brand • Product Id • Made In 56 CHAPTER 5. IMPLEMENTATION • Color • Composition • Type Then, based on the kind of product you select, there will be more specialized fields for you to fill out. If you choose: • Watch –Circumference –Diameter –Height –Width • Jewellery –Circumference –Length –Width • Clothes Shoes –Size • Bags –Depth –Handle –Height –Width Step 3 Upon ensuring that the CSV has been properly filled, a few quick verifications are performed to confirm the lack of any errors, including the proper number of columns. Subsequently, the CSV is uploaded to the IPFS platform, specifically Piñata. The final step is to invoke the function within the smart contract responsible for minting the corresponding NFT. 57 C h a p t e r 6 Deployment Deployment, which entails making the application accessible to end users, is a crucial phase in the software development process. An overview of the deployment procedure for our application, including the integration with Docker will be given in this chapter. 6.1 Docker Docker is an open-source technology that enables developers to package a program and its dependencies in a single container that may operate reliably across many settings. Multiple isolated applications can run on a single host, conserving resources and boosting efficiency. It also makes it easier to deploy, scale, and manage applications. [71] Building an application as a group of small, independently deployable services is referred to as a microservice-based architecture. Each service has a distinct set of responsibilities and interacts with other services via clearly defined interfaces. Each service can have its own isolated environment with the particular requirements and parameters it needs by making a distinct Dockerfile for each server. As a result, the application can be maintained and scaled more effectively. Here is an illustration of my Dockerfile, in this case for the app itself: 58 CHAPTER 6. DEPLOYMENT Listing 10 Dockerfile 1# Use an official Node.js runtime as the base image 2FROM node:18.12 3 4# Set the working directory in the container 5WORKDIR /src/ 6 7# Copy the package.json and package-lock.json files to the container 8COPY . /src/ 9 10 # Build the server 11 RUN yarn install 12 RUN yarn build 13 14 # Expose the port that the server will listen on 15 EXPOSE 1337 16 17 # Start the server 18 CMD [ ”yarn”,”dev” ] The docker-compose.yml file is used to define and run multi-container Docker applications. It uses a declarative syntax to specify the services, networks, and volumes that make up your application. To run your application using docker-compose, you can simply create a docker-compose.yml file with the necessary configuration, and run the “docker-compose up” command in the same directory. Here is an example of a docker-compose.yml file for an application with two services, “server” and “market”: Listing 11 docker-compose.yml 1version:'3' 2services: 3server: 4image: andremorais98/luxyserver 5environment: 6-REACT_APP_MORALIS_SERVER_URL=http://luxy-market-server.projj.eu/server 7ports: 8-”1337:1337” 9market: 10 image: andremorais98/luxymarket 11 ports: 12 -”3000:3000” To execute the aforementioned application using docker-compose, it is necessary to store the provided code snippet as a file named “docker-compose.yml” in the root directory of the project. After doing so, issue the command “docker-compose up” within the same directory. This will initiate the two services defined in the ’docker-compose.yml’ file, specifically “server” and “market”, and expose their associated ports to the host machine. It is noteworthy that the andremorais98/luxyserver image is intended for 59 BIBLIOGRAPHY [12] V. Buterin et al. “A next-generation smart contract and decentralized application platform.” In: white paper 3.37 (2014), pp. 2–1. [13] W. Cai, Z. Wang, J. B. Ernst, Z. Hong, C. Feng, and V. C. Leung. “Decentralized Applications: The Blockchain-Empowered Software System.” In: IEEE Access 6 (Sept. 2018), pp. 53019–53033. issn: 21693536. doi: 10.1109/ACCESS.2018.2870644. [14] CryptoZombies | Lesson 6 Chapter 2. 2018. url: https://cryptozombies.io/en/lesson/ 6/chapter/2. [15] I. Daniel and F. Novo. Property-based testing of ERC-721 Ethereum smart contracts. 2021. [16] C. Dannen. Introducing Ethereum and Solidity: Foundations of Cryptocurrency and Blockchain Programming for Beginners. 1st. USA: Apress, 2017. isbn: 1484225341. [17] Deep dive into Polygon | Ethereum off-chain scaling solutions. url: https://novuminsights. com/post/deep-dive-into-polygon-or-ethereum-off-chain-scaling-solutions/ (visited on 01/04/2022). [18] T. Do, T. Nguyen, and H. Pham. “Delegated proof of reputation: a novel blockchain consensus.” In: Proceedings of the 1st International Electronics Communication Conference. 2019, pp. 90–98. [19] EIP-721: Non-Fungible Token Standard. url: https://eips.ethereum.org/EIPS/eip-721 (visited on 01/14/2022). [20] ERC-1155 Multi-Token Standard | ethereum.org. url: https://ethereum.org/en/developers/ docs/standards/tokens/erc-1155/ (visited on 01/03/2022). [21] ERC-20 TOKEN STANDARD. url: https://ethereum.org/pt/developers/docs/standards/ tokens/erc-20/ (visited on 01/03/2022). [22] ERC-721 Non-Fungible Token Standard | ethereum.org. url: https : / / ethereum . org / en / developers/docs/standards/tokens/erc-721/ (visited on 01/03/2022). [23] Ether — Ethereum Homestead 0.1 documentation. url: https://ethdocs.org/en/latest/ ether.html (visited on 12/29/2021). [24] EUIPO/OECD ‘Trends in Trade in Counterfeit and Pirated Goods’ Study. 2019. url: https : / / euipo.europa.eu/ohimportal/pt/news/-/action/view/5031024. [25] European Parliament, Council of the European Union. Directive 2004/48/EC of the European Parliament and of the Council of 29 April 2004 on the enforcement of intellectual property rights. Official Journal of the European Union L 195/16, 2.6.2004, pp. 16-25. 2004. url: https : / / eurlex.europa .eu /legal - content/ EN/ TXT/ ?uri=CELEX:32004L0048 (visited on 04/22/2023). 66 BIBLIOGRAPHY [26] S. Farshidi, S. Jansen, S. Espana, and J. Verkleij. “Decision Support for Blockchain Platform Selection: Three Industry Case Studies.” In: IEEE Transactions on Engineering Management 67 (4 Nov. 2020), pp. 1109–1128. issn: 15580040. doi: 10.1109/TEM.2019.2956897. url: https://www. researchgate.net/publication/338491432_Decision_Support_for_Blockchain_ Platform_Selection_Three_Industry_Case_Studies. [27] M. Fazli, A. Owfi, and M. R. Taesiri. “UNDER THE SKIN OF FOUNDATION NFT AUCTIONS A PREPRINT.” In: (2021). [28] Gas and fees | ethereum.org. url: https://ethereum.org/en/developers/docs/gas/ (visited on 12/29/2021). [29] J. Golosova and A. Romanovs. “The advantages and disadvantages of the blockchain technology.” In: 2018 IEEE 6th Workshop on Advances in Information, Electronic and Electrical Engineering, AIEEE 2018 - Proceedings (Dec. 2018). doi: 10.1109/AIEEE.2018.8592253. [30] J. Hietanen, J. B. Murray, A. Sihvonen, and H. Tikkanen. “Seduced by “fakes”: Producing the excessive interplay of authentic/counterfeit from a Baudrillardian perspective.” In: Marketing Theory 20 (1 2020), pp. 23–43. issn: 1741301X. doi: 10.1177/1470593119870214. [31] Y. Hirai. “Defining the Ethereum Virtual Machine for Interactive Theorem Provers.” In: Financial Cryptography and Data Security. Ed. by M. Brenner, K. Rohloff, J. Bonneau, A. Miller, P. Y. Ryan, V. Teague, A. Bracciali, M. Sala, F. Pintore, and M. Jakobsson. Cham: Springer International Publishing, 2017, pp. 520–535. isbn: 978-3-319-70278-0. [32] Home | Ethereum Improvement Proposals. url: https://eips.ethereum.org/ (visited on 01/03/2022). [33] Home | ethereum.org. url: https://ethereum.org/en/ (visited on 01/05/2022). [34] How to combat counterfeiting - World Trademark Review. 2017. url: https://www.worldtrademarkreview. com/anti-counterfeiting/how-combat-counterfeiting. [35] How to know whether to focus on your products or your market - The Business Journals. 2015. url: https://www.bizjournals.com/bizjournals/how-to/growth-strategies/2015/07/ how-to-know-whether-to-focus-on-your-products.html. [36] Institutional Digital Asset Platform - BitGo. url: https://www.bitgo.com/ (visited on 01/05/2022). [37] JPMorgan Chase Co. url: https://www.jpmorganchase.com/ (visited on 01/05/2022). [38] S. King and S. Nadal. PPCoin: Peer-to-Peer Crypto-Currency with Proof-of-Stake. 2012. [39] M. Kõlvart, M. Poola, and A. Rull. “Smart Contracts.” In: Feb. 2016, pp. 133–147. isbn: 978-3-319- 26894-1. doi: 10.1007/978-3-319-26896-5_7. 67 BIBLIOGRAPHY [40] Layer 2 Rollups | ethereum.org. url: https : / / ethereum . org / en / developers / docs / scaling/layer-2-rollups/ (visited on 01/04/2022). [41] A. Lielacher. Best Smart Contract Platform Tokens, Rated and Reviewed for 2020 - Bitcoin Market Journal. 2020. url: https:// www . bitcoinmarketjournal.com / smart - contractplatforms/ (visited on 12/17/2021). [42] M. A. Manolache, S. Manolache, and N. Tapus. “Decision making using the blockchain proof of authority consensus.” In: Procedia Computer Science 199 (2022), pp. 580–588. [43] D. Mingxiao, M. Xiaofeng, Z. Zhe, W. Xiangwei, and C. Qijun. “A review on consensus algorithm of blockchain.” In: 2017 IEEE International Conference on Systems, Man, and Cybernetics (SMC). 2017, pp. 2567–2572. doi: 10.1109/SMC.2017.8123011. [44] Moonbeam | Polkadot Smart Contract Platform. url: https://moonbeam.network/ (visited on 01/05/2022). [45] T. Moura. Design Patterns for Ethereum Smart Contracts Specialization Area of Information and Knowledge Systems. 2020. [46] M. Möser. Anonymity of Bitcoin Transactions An Analysis of Mixing Services. 2013. url: https: //www.torproject.org/. [47] S. Nakamoto. Bitcoin: A Peer-to-Peer Electronic Cash System. 2009. url: www.bitcoin.org. [48] Non-fungible tokens (NFT) | ethereum.org. url: https://ethereum.org/en/nft/ (visited on 01/03/2022). [49] OECD. “Organisation for Economic Co-operation and Development Organisation de Coopération et de Développement Economiques The Economic Impact of Counterfeiting.” In: (1998). [50] OpenSea, the largest NFT marketplace. url: https://opensea.io/ (visited on 01/05/2022). [51] OpenZeppelin. url: https://openzeppelin.com/ (visited on 01/05/2022). [52] Optimism - Ethereum at Lower Costs Lightning Speed. url: https://www.optimism.io/ (visited on 01/05/2022). [53] G. A. Pierro and H. Rocha. “The influence factors on ethereum transaction fees.” In: Proceedings - 2019 IEEE/ACM 2nd International Workshop on Emerging Trends in Software Engineering for Blockchain, WETSEB 2019 (May 2019), pp. 24–31. doi: 10.1109/WETSEB.2019.00010. [54] J. Poon and V. Buterin. “Plasma: Scalable Autonomous Smart Contracts.” In: (2017). url: https: //plasma.io/. [55] ProjectOpenSea/opensea-js: JavaScript SDK for the OpenSea marketplace. Let your users buy or sell cryptogoods on your own site! url: https://github.com/ProjectOpenSea/opensea-js (visited on 01/18/2022). 68 BIBLIOGRAPHY [56] S. Raval. Decentralized Applications: Harnessing Bitcoin’s Blockchain Technology - Siraj Raval - Google Livros. 2016. url: https : / / books . google . pt / books ? hl = pt - PT & lr = &id = fvywDAAAQBAJ&oi=fnd&pg=PR2&dq=decentralized+apps+blockchain&ots=-185tYeLKm& sig=N4Nexb21EDUYPxMeMQn3Zy0tqH0&redir_esc=y#v=onepage&q=decentralized\ %20apps\%20blockchain&f=false. [57] F. Regner and A. Schweizer. NFTs in Practice-Non-Fungible Tokens as Core Component of a Blockchainbased Event Ticketing Application. url: https://www .researchgate.net/publication/ 336057493. [58] S. Riksbank. Economic Review 2, 2014. 2014. [59] S. S. Sarmah. “Understanding Blockchain Technology.” In: Computer Science and Engineering 8 (2 2018), pp. 23–29. doi: 10.5923/j.computer.20180802.02. url: http://journal.sapub. org/computer. [60] Scaling | ethereum.org. url: https://ethereum.org/en/developers/docs/scaling/ (visited on 01/04/2022). [61] Sidechains | ethereum.org. url: https://ethereum.org/en/developers/docs/scaling/ sidechains/ (visited on 01/04/2022). [62] Smart contract languages | ethereum.org. url: https://ethereum.org/en/developers/ docs/smart-contracts/languages/ (visited on 12/31/2021). [63] State Channels | ethereum.org. url: https : / / ethereum . org / en / developers / docs / scaling/state-channels/ (visited on 01/04/2022). [64] Q. Stokkink and J. Pouwelse. “Deployment of a Blockchain-Based Self-Sovereign Identity.” In: 2018 IEEE International Conference on Internet of Things (iThings) and IEEE Green Computing and Communications (GreenCom) and IEEE Cyber, Physical and Social Computing (CPSCom) and IEEE Smart Data (SmartData) (July 2018), pp. 1336–1342. doi: 10 . 1109 / Cybermatics _ 2018 . 2018.00230. url: https://ieeexplore.ieee.org/document/8726562/. [65] D. Tapscott and A. Tapscott. Blockchain revolution: How the technology behind bitcoin is changing money, business, and the world. Penguin, 2016. [66] The Architecture of a Web 3.0 application. 2021. url: https://www.preethikasireddy.com/ post/the-architecture-of-a-web-3-0-application (visited on 01/07/2023). [67] S. Tikhomirov, E. Voskresenskaya, I. Ivanitskiy, R. Takhaviev, S. Moscow, Y. Alexandrov, and E. Marchenko. “SmartCheck: Static Analysis of Ethereum Smart Contracts.” In: (2018). doi: 10.1145/ 3194113.3194115. 69 BIBLIOGRAPHY [68] G. Tom, B. Garibaldi, Y. Zeng, and J. Pilcher. “MAR WILEJ RIGHT BATCH Base of text Top of text Top of CT Base of DF Consumer Demand for Counterfeit Goods.” In: Psychology Marketing 15 (5 1998), pp. 405–421. [69] Understanding: Plasma Chains vs. Sidechains — @pigi documentation. url: https : / / docs . plasma.group/en/latest/src/plasma/sidechains.html (visited on 01/04/2022). [70] United States Patent and Trademark Office. “The Economic Impacts of Counterfeiting and Piracy.” In: (2021). url: https://iccwbo.org/news-publications/policies-reports/economicimpacts-counterfeiting-piracy-report-prepared-bascap-inta/. [71] Use containers to Build, Share and Run your applications. 2020. url: https://www.docker. com/resources/what-container/ (visited on 01/28/2023). [72] VALIDIUM | ethereum.org. url: https://ethereum.org/en/developers/docs/scaling/ validium/ (visited on 07/19/2023). [73] Q. Wang, R. Li, Q. Wang, and S. Chen. “Non-Fungible Token (NFT): Overview, Evaluation, Opportunities and Challenges (Tech Report V2 ).” In: (). url: https://www.coingecko.com/en/nft. [74] S. Wang, L. Ouyang, Y. Yuan, X. Ni, X. Han, and F. Y. Wang. “Blockchain-Enabled Smart Contracts: Architecture, Applications, and Future Trends.” In: IEEE Transactions on Systems, Man, and Cybernetics: Systems 49 (11 Nov. 2019), pp. 2266–2277. issn: 21682232. doi: 10.1109/TSMC.2019. 2895123. [75] S. Wang, Y. Yuan, X. Wang, J. Li, R. Qin, and F. Y. Wang. “An Overview of Smart Contract: Architecture, Applications, and Future Trends.” In: IEEE Intelligent Vehicles Symposium, Proceedings 2018-June (Oct. 2018), pp. 108–113. doi: 10.1109/IVS.2018.8500488. [76] What’s the Difference Between Moralis, Alchemy, and Infura? » Moralis - The Ultimate Web3 Development Platform. url: https://moralis.io/whats-the-difference-between-moralis- alchemy-and-infura/ (visited on 01/05/2022). [77] M. Wohrer and U. Zdun. “Smart contracts: Security patterns in the ethereum ecosystem and solidity.” In: 2018 IEEE 1st International Workshop on Blockchain Oriented Software Engineering, IWBOSE 2018 - Proceedings 2018-January (Mar. 2018), pp. 2–8. doi: 10.1109/IWBOSE.2018. 8327565. [78] K. Wu, Y. Ma, G. Huang, and X. Liu. “A first look at blockchain-based decentralized applications.” In: Software: Practice and Experience 51.10 (2021), pp. 2033–2050. [79] D. Yaga, P. Mell, N. Roby, and K. Scarfone. “Blockchain technology overview.” In: arXiv preprint arXiv:1906.11078 (2019). 70 BIBLIOGRAPHY [80] K. Yousaf. “(DOC) Effect of Cryptocurrency on Business Model Innovation Student Details | kamran yousaf - Academia.edu.” In: (2017). url: https://www.academia.edu/34485391/Effect_ of_Cryptocurrency_on_Business_Model_Innovation_Student_Details (visited on 12/28/2021). [81] ZERO-KNOWLEDGE ROLLUPS | ethereum.org. url: https://ethereum.org/en/developers/ docs/scaling/zk-rollups/ (visited on 07/19/2023). [82] W. Zou, D. Lo, P. S. Kochhar, X. B. D. Le, X. Xia, Y. Feng, Z. Chen, and B. Xu. “Smart Contract Development: Challenges and Opportunities.” In: IEEE Transactions on Software Engineering 47 (10 Oct. 2019), pp. 2084–2106. issn: 19393520. doi: 10.1109/TSE.2019.2942301. 71 Appendix A Appendix A.1 Profile Page This is the profile page, of a wallet with username ’Gucci’ which is verified, so is a trustworthy entity. Figure 20: Profile 72 APPENDIX A. APPENDIX A.2 Homepage This is homepage, where are described the 15 principles by which this project was guided. Figure 21: Homepage 73 APPENDIX A. APPENDIX A.3 Create NFT To create an NFT or multiple NFTs, it is needed to go through this process, where in the Step 1 you need to give a collection name, say which type of product is and upload the respective images to the NFT. Figure 22: Step 1 On Step 2 is to download the CSV file that was dynamically built according to Step 1 choices. Then in Step 3 is to upload that CSV file already filled and submit it. Figure 23: Step 2 74 APPENDIX A. APPENDIX A.4 NFT Detail page This is the detail page of an NFT, in owner’s perspective, where it can list it or update the price. Figure 24: Detail page of NFT, not on sale This is the detail page of an NFT, in creator’s perspective, that is on sale. Only the creator knows who is the first buyer in queue, and can transfer the NFT or remove this one from the queue Figure 25: Detail page of NFT, in creators’s perspective 75