Traceability of Ready-to-Wear Clothing through Blockchain Technology

: Traceability and monitoring of industrial processes are becoming more important to assure the value of ﬁnal products. Blockchain technology emerged as part of a movement linked to criptocurrencies and the Internet of Things, providing nice-to-have features such as traceability, authenticity and security to sectors willing to use this technology. In the retail industry, blockchain offers users the possibility to monitor details about time and place of elaboration, the origin of raw materials, the quality of materials involved in the manufacturing processes, information on the people or companies that work on it, etc. It allows to control and monitor textile articles, from their production or importing initial steps, up to their acquisition by the end consumer, using the blockchain as a means of tracking and identiﬁcation during the whole process. This technology can also be used by the apparel industry in general and, more speciﬁcally, for ready-to-wear clothing, for tracing suppliers and customers along the entire logistics chain. The goal of this paper is to introduce the more recent traceability schemes for the apparel industry together with the proposal of a framework for ready-to-wear clothing which allows to ensure the transparency in the supply chain, clothing authenticity, reliability and integrity, and validity of the retail ﬁnal products, and of the elements that compose the whole supply chain. In order to illustrate the proposal, a case study on a women’s shirt from an apparel and fashion company, where a private and open blockchain is used for tracing the product, is included. Blockchain actors are proposed for each product stage.


Introduction
During recent years, different methods for monitoring the processes and activities involved in the connected industry have been created. This is known as Industry 4.0, and it has lead to a virtualization of the processes, where supply chains provide real-time access to relevant products and production information for all involved entities [1,2]. In this context, some research studies and patents have been published about construction projects [3], energy and health sectors [4], and oil and gas industries [5]. Some of the specific applications include monitoring damage to structures [6], analysing cardiorespiratory signals and snoring [7], checking temperatures [8], and controlling the wine supply chain [9], among others.
The growing demand of individual products as customized outcomes and the decreasing product's life cycles leads to the transformation of organizational structures. In this context, distributed systems can handle highly complex problems and help in what is known as cybernetic management, which encompasses self controlling systems [1]. There are currently many proposals to make traceability a competitive and reliable factor for final consumers. Wireless sensors, secure tags, DNA markers, Electronic Product Codes (EPC), Radio Frequency Identification Devices (RFID) or Near Field Communication (NFC) have been used for tracking individual products throughout the supply chain (see [10,11] and references therein).
Traceability maximizes the profits and ensures the quality and safety of products through transparency [12,13]. Product traceability proposals started with food and pharmaceutical industries [14,15]. Some other examples of the companies that include the blockchain technology as a way of developing the goal of transparency [16] are: A fishing company like Provenance; the world's largest container line, Maersk; the four companies that have developed a "Food Trust Framework" (Alibaba, AusPost, Blackmores, and PwC); the startups Chronicled and Modum; and Walmart (see [17] and references therein). Some of the current activities that will be improved with the use of the blockchain decentralized technology are the following: • Tracing the goods transported by ship worldwide as part of international logistics processes, to avoid unnecessary paperwork associated to each container (as an example, sending refrigerated goods from a country in East Africa to another one in Europe requires several stamps and approvals from more than twenty workers and officials).

•
Managing fishing industries where the quality control and quality assurance is a challenging task. • Enabling a record with details about the provenance for each aircraft component.

•
Helping to improve integrity and traceability in the global supply chains.
It is a known fact that textile production has grown considerably in developing countries with the goal to decrease the manufacturers' operational costs. That is one of the reasons why the improvement of product accuracy and the transparency of processes, at every stage of the clothing phase, has become essential [18].
Clothing stores have responded to lower prices and a wide variety of garments by increasing the collection of clothes. The amount of garments provided has doubled each year since 2000 and, in 2014, exceeded 100 billions, to such a degree that nearly the average number of clothing items for every person on earth is now more than 14. Consumption of clothes is estimated to be more than 30 millions of tons each year [19]. In large developing countries such as China, Brazil, Mexico, Russia and India, apparel sales grew eight times faster than in the United States, Canada, the United Kingdom and Germany [20].
The apparel industry that produces, distributes, and "uses" clothes, flows in an almost completely linear way. An increasing amount of waste is produced in manufacturing fabrics as clothes are very often only used for a short time, after which the clothes are thrown away and the materials are lost [21,22]. Furthermore, clothing companies have been usually unable to balance their sales gains with adequate improvements in environmental care. Production of cotton takes about 30% of all textile fibre consumption. Grow of fibres needs a lot of water, pesticides, and pollutants. In fact, with the creation of one kilogram of fabric, 23 kilograms of greenhouse gases are produced, on average [23].
The supply chain in the textile and clothing industries is complex and fragmented, and it involves numerous actors dealing with raw materials from very different sources and operations [24]. There is not a standard path for garments, which are produced in one country, spun in a different one, dyed and processed in a third one and converted into a garment in a factory far away from the store. The problem that must be addressed in this sector is not only how to guarantee the final product, but also the intermediate products [10]. The fashion industry is characterized by factors such as high volatility, a short lifecycle, low predictability, and high impulse purchase [25].
The ready-to-wear clothing, also known as factory-made or prêt à porter clothing, is designed according to customer demand and following a specific design. In order to track such a complex production chain, information must be stored in a distributed database over the internet to make available all the data about actors and activities related to the supply chain. The data would contain the supply-demand information, and could also include more relevant details about the product [26,27].
Several factors are involved in textile and clothing supply chain traceability, some of them are listed below [28][29][30]: • Transparency and visibility in all the information shared among the different supply chain actors have become essential characteristics for a sustainable supply chain.

•
The textile product maintenance affects the durability and recyclability of the product. The maintenance takes place especially during processes such as washing, dyeing and drying. Product maintenance aspects must be shared with retailers, suppliers and consumers.

•
Reverse logistics processes must include waste management and the collection of used products.
An efficient inverse logistic system should make use of traceability mechanisms.

•
Market surveillance ensures that the products meet the proper standards and applicable laws, using data about the origin, history, raw material composition, etc. • Sales forecasting and production data management use records of real-time product data, enabling more effective and precise sales forecasts, production management, and also control.

•
Confidentiality and prevention of data leakages are some of the key concerns of the textile and clothes supply chain in terms of information security. In this respect, cryptographic protocols are one of the advantages of blockchain technology, as they guarantee the protection of data and avoid unauthorized changes.

•
Marketing activities are changing and consumers need more information about products. The capability to trace the history of garments helps to promote a positive brand image and increases sales.
In this context, the blockchain technology has surged as a new paradigm in the globally interconnected world [31,32]. There is a growing need for traceability both for foreign suppliers and domestic producers, so many companies are increasingly using blockchain in order to provide transparency, traceability, authenticity, and security to their supply chains [33], and for that reason blockchains are the ideal candidate for providing solutions to the problems of the Industry 4.0.
This paper presents an overview about the traceability (i.e., the capability to reconstruct the history of a product) and track ability (i.e., to "follow" a product in the downstream of the value chain) in the apparel industry, more specifically in the prêt à porter clothing supply chain. Moreover, a framework that is based on blockchain is proposed to assure the traceability of clothes during the garment manufacturing process.
This contribution is distributed as follows: Section 2 presents the most important concepts and definitions about blockchain technology and its applicability in tracking the supply chain. Section 3 focuses on the apparel industry, where guaranteeing the originality and authenticity of products has become a major challenge, and presents a traceability framework for the factory-made clothes industry. Section 4 includes a case study dealing with the manufacturing of a women's shirt. Finally, the conclusions are detailed in Section 5.

Introduction
From a general perspective, a blockchain can be defined as a protocol that allows to group data into blocks, linking together those blocks into a chain. Each block is unique, it depends on previous blocks and basically contains the identification transactions, the actual transaction's contents, and a pointer to the preceding block in the chain (see Figure 1). Due to the mathematical functions employed, the chain of data blocks is immutable, as no single element (i.e., the network nodes) can unilaterally modify the blocks content that have been previously agreed by all the nodes.
Almost as important as the immutability property, blockchain technology allows to determine the status of the entire chain at any moment. Thus, if any block of the chain was manipulated, it would be possible to detect the manipulation.
Blockchains can be categorized according to different criteria, and one of the most important ones differentiates public from private blockchains. In a public blockchain, anyone can join and participate in it. Public blockchains are truly decentralized in the sense that no particular node controls the whole network. In comparison, private blockchains usually put in place restrictions not only on who can join it, but also on the role of participants.
Another criteria that is also important allows to differentiate open from closed blockchains. This criterium refers to who is able to access the blockchain for reading purposes. Thus, using both criteria, it is possible to manage four categories: public and open, public and closed, private and open, private and closed. In the supply chain context, it makes more sense to manage private and open blockchains, as only the actors involved in the manufacturing process should have the permission to write into the blockchain, but anyone should be able to access that information.
Most blockchains use two consensus methods for validating new blocks and incorporating them into the blockchain. The first one is known as "proof of work", which represents some data which must be difficult to produce (in terms of time or computing power) but easy for others to verify. This consensus mechanism is employed for example in Bitcoin, where miners compete between them in order to obtain the solution to a hashing problem, as the winner, in addition to being the one to validate the block, receives a certain amount of bitcoins. The second one is a "proof of stake", where the node selected for validating a block is made randomly but giving greater probability to those who meet a series of criteria, as for example the amount of reserved criptocurrency or the time of participation in the network.
In order to implement the aforementioned features, blockchain technology uses some well-known elements in the cryptographic field, the most relevant being hashing functions, Merkle trees and digital signatures. The following subsections present the definitions and most important concepts associated to those elements.

Hash Functions
Hashing functions, also known as digest functions, are defined as functions that transform blocks of binary data and arbitrary length into a binary block of fixed size, which is referred to as the hash or digest of the data [34].
The first hash functions that were designed were intended for their usage in digital signature protocols, where signatures are created by using the digest of pieces of data instead of the actual element to be signed. As the hash is typically a much shorter element, protocols are more efficient when using hashes instead of the actual data and less bandwidth is needed during the transmission of the data.
Hash functions have also been used with the aim of checking the integrity of files, so corrupted data or malicious elements such as viruses can be detected in files.
From a mathematical standpoint, hashing functions use a concept known as Trapdoor One-Way Functions (TOWF), which are the set of functions f : X → Y, where x ∈ X and y ∈ Y, such that it must be relatively easy to calculate f (x) = y for all elements x ∈ X but, at the same time, it must be difficult to obtain x ∈ X taking as input y ∈ Y.
Using the above definition, hashing functions are unidirectional functions that can be applied to any message m of different size (where the message m belongs to the set of all possible messages, M), and generates an output m with a predetermined bit length, so f (m) = m.
A practical limitation of hash functions is that, since they transform messages of any length into blocks of predefined length, the number of potential hashes is much smaller than the number of potential messages. The unavoidable consequence is that, when using any hash function, there will always be different messages with the same digest, which is known as a collision.
Hashing functions for which collisions have been found are deemed weak, and their usage is not recommended. That is the case of MD5 (Message Digest 5) and SHA-1 (Secure Hash Algorithm 1), two of the hash functions heavily used in the 1990s. MD5 was proposed by Ron Rivest [35] and generates hashes of 128 bits, while SHA-1 was adopted by the National Institute of Standards and Technology (NIST) in 1995 [36] and generates 160-bit hashes.
As a replacement of MD5 and SHA-1, the SHA-2 (Secure Hash Algorithm 2) family of hash functions was standardized in 2001 by NIST. The SHA-2 specification includes four functions, namely SHA-224, SHA-256, SHA-384, and SHA-512, where the number indicates the length of the ouput in bits. They have become the most widely used hash functions in environments where security is paramount.

Digital Signatures
The digital signature of an electronic document is a piece of data that guarantees the document's authorship. During the first days of electronic messaging, it became clear that the identity of the sender of messages could be modified and that the content of the message could also be altered. Thus, digital signatures were created with the goal of preventing those two problems. Nowadays, many countries consider digital signatures as valid as handwritten signatures (from a legal point of view), and in many cases those digital signatures can be generated by using the national identity card of citizens. However, there is an important difference between both signatures: while handwritten signatures are more or less the same whenever they are generated, digital signatures totally depend on the binary document or message to be signed.
From a practical point of view, digital signatures must be easy to generate and, at the same time, difficult to falsify. Nowadays, digital signatures are created by using the RSA (Rivest-Shamir-Adleman) algorithm or elliptic curves. Precisely, the ECDSA (Elliptic Curve Discrete Logarithm Algorithm) [37] is the function used by Bitcoin and other cryptocurrencies for generating and validating digital signatures, though it is worth mentioning that there are other elliptic curve signature algorithms such as the Edwards-curve Digital Signature Algorithm (EdDSA) [38].
So far, "regular" signatures are the ones that have been mentiones, but it is important to notice that other types of digital signatures can also be used in blockchain: multisignatures and group signatures. Multisignatures are only valid when all group members participate in the signature process. In comparison, group signatures are employed when a member of the group signs in an anonymous way the message or document on behalf of the rest of the group [34].

Merkle Trees
Trees are graphs where all the nodes are connected (directly or indirectly) and that do not contain cycles. Due to that characteristics, in trees it is possible to hierarchically classify the nodes into three categories: a root, internal nodes and leaves. In that way, binary trees can be depicted as represented below, where each leaf has no predecessor and has a unique child, however internal nodes have two parent nodes and a single child node, and the root node has two predecessors and no childs.
Taking a step forward, a Merkle tree is a binary tree with the characteristic that leaves contain data and the remaining nodes represent the result of applying a hash function to the concatenation of the two preceding nodes.
The advantage of using Merkle nodes is that it is not necessary to access the data of all the tree blocks in order to guarantee the integrity of the information in a blockchain. Due to the way they are constructed, only a few hashing operations are needed for users willing to check if the copy of the blockchain that they possess is valid, and that is the main reason for his inclusion in many blockchain protocols.

Blockchain Distributed System for Tracking the Supply Chain
According to its anonymous author, blockchain is a Distributed Ledger Technology (DLT) in which all transactions are securely recorded [39]. In order to understand the process, let us consider a user who wants to build such a blockchain. That individual will digitally sign the final hash pointer of the chain, and will make it publicly available. The digital signature is the procedure that allows to assure that a piece of data comes from the legitimate sender [40,41]. Changes in the transactions that have already been integrated into the blockchain will be detected, as it will affect the successive blocks of the data chain. A DLT offers a new technique of storing data which is accessible by multiple parties.
By convention, consolidating the blockchain and accepting the past blocks generates an incentive for nodes to support the network, and provides a way for starting the distribution of the sensitive information and put it into circulation, since there is no central authority to handle them. In criptocurrencies, the incentive takes the form of new coins, but it could be different for other blockchains. To facilitate this task without breaking the block's hash, transactions are hashed in a Merkle tree [42], with only the root included in the block's hash.
In this article's context, nodes correspond to agents involved in the chain, i.e., any natural or legal person that participates in the chain of production, marketing, distribution, and sale, whose activity will be included in a registry of activities of the textile industry. Each node of the DLT is composed of basic information (characteristics of the agents) and supply-demand information (demand information, supply ability, historical information, etc.) [43].
In order to eliminate branches of the tree old blocks can be compacted, the advantage being that the inner hashes do not need to be recalculated [39].
Every internal block has the same structure, including a header containing the block version (which imply the set of rules to be followed), the parent block hash (a hash value that points to the previous block, typically performed with the SHA-256 function), the Merkle tree root (as the hash value of all the transactions in the block), a timestamp, and a nonce (a number used only once) [40]. In turn, the body of the block is composed by a transaction counter and one or more transactions [44]. Blockchain uses digital signatures based on asymmetric cryptography and also an asymmetric cryptography protocol to validate the authenticity of each transaction.

Textile Supply Chain
Within the manufacturing industry, textile and clothing is one of the oldest sectors and a very complex area, as it includes a large number of subsectors that cover the whole manufacturing cycle, from raw materials and intermediate outcomes, to the elaboration of the final products. This makes traceability almost imposible [45].
The textile industry is mainly made up of small and medium-sized heterogeneous companies, some of them very specialized in certain procedures. Among the factors that tend to increase its complexity, both the large amount of raw materials used in the preparation of fibres (e.g., wool, cotton, synthetic materials, etc.) and the diversity of manufacturing stages necessary to obtain them can be highlighted.
The textile productive chain is characterized by large production volumes, low prices and minimum response times. Unquestionably, China has become the world leader, while Turkey is considered the main supplier in Europe, and Bangladesh and Vietnam are the new actors. Major brands, typically based in developed countries, are the generators of tendencies, creating very exclusive garments, and carrying out the so-called "democratization of luxury". Their competitiveness is based on information flows, creating their own distribution networks. Logically, product design plays a very important role within the textile productive chain.
Roughly speaking, the activities in the textile supply chain could be considered as primary and secondary activities. The first one includes all matters related to logistics (operations, sales, receiving, collecting, storing, disseminating products), while the secondary activities include human resource management, technological development, accounting, planning, etc. [45].
The process of producing textile fabrics starts with the gathering of fibres, which can be natural or artificial. After the spinning process (when needed), textile flat structures are produced; woven, nonwoven, knitted, or mesh fabrics are previous step before clothing stage [46]. Thus, although some authors separate the apparel supply chain in four phases [47], for the ready-to-wear clothing industry we consider five well-separated networks: Raw material, fabric manufacture, garments assembly, distribution and sales, and the final consumers [48]. The proposed schema includes the following phases of transactions detailed in Figure 2: 1. Suppliers from the raw material network. This information also contains the origin of the material, and some physical properties such as the composition, fineness, fibre length, color, or color fastness. 2. Yarns that are woven or knitted into fabrics. The thickness, strength and elongation, colour, colour fastness and humidity level are also included in the spinning phase. In addition to the spinning process, the fabric manufacture also returns information on the weight or the pilling. Machinery suppliers act in the whole fabric manufacture because they are responsible for machinery certification and products validation. These companies certify the history or origin of garments manufacture through their networks for machines and software always connected. 3. Information about the production network with the corresponding steps through the garments.
The garment assembly is very important when working with prêt à porter clothing, as it includes the design, the data sheet, the basic pattern, data about the scaled clothing, and the industry's operations for the final assembly.
4. Buying offices, agents, domestic apparel companies, and distribution centres or speciality stores as part of the marketing network. 5. The retailer or customer that gets the product with some specific characteristics. Some processes can be adapted to the need of the country or the sellers. Thus, for example, Zara group usually orders uncoloured fabrics to allow the possibility of changing the colour depending on the trends. Garments are stored as "work-in-process" products awaiting configuration instructions [49].
In the textile industry, several operation diagrams that include the order of manufacture and each part of the garment are specified to speed up and simplify the work. Universal symbols are employed for making the confection easier to understand. The following types of phase analysis were considered for this development: • The operations diagram, which is simple, contains less information and specifies the parts, the assembly order and the type of machines to be used. Figure 3 shows one of these operations diagram that were used during our developments.

•
The list of phases that specifies the activity to be carried out in the packaging, as well as the frequency, the machine, the type of code of stitch in reference to the activity carried out, and the space for the necessary observations that have been made in the office and that will be passed on to the clothing workshop. It could also include the time per unit (TMU).  When the operations diagram and the list of phases are finished, the descriptive card of the product indicates the detailed description of the garment that will be produced. Figure 4 shows a descriptive card of a dress from designer Jesús Fernández de Toro and pattern-maker Cristina Muñoz.  Finally, a reliable apparel design software is used to get the apparel patterns. Figure 5 shows the patterns that are used for a jacket. Computer programs are very useful to work fast with easy-to-build garments, and to access to a large database of patterns that could be modified.

Traceability of Ready-to-Wear Clothing Manufacturing Industry
Several systems have been proposed to mark textile products and to solve problems of brand authentication and counterfeiting [27]. To prevent purchase of fake products and double spending, and to automatize textile and apparel processes a DLT was proposed in [50], where its authors discussed about the benefits of this distributed technology for achieving low carbon emissions during textile and apparel manufacturing.
The traceability of the clothing industry is becoming increasingly important as consumers want to know the origin, the history, components, and the perceived quality of marketed clothes (i.e., who, where, when, and how a product has been manufactured) [14]. The clothing industry transforms products from textile industry into finished garments.
In [51] a framework for textile traceability is proposed. The authors define a ICAM (Integrated Computer-Aided Manufacturing)-based model using UML (Unified Modeling Language) diagrams and XML files to store the information exchanged between all involved agents of the supply chain.
The traceability of the ready-to-wear clothing manufacturing industry takes into account that the fragmentation of the production chain affects traceability (see the involved processes in Figure 2). Moreover, constructing a decentralized process provides the capability of tracing each stage of the supply chain.
Agrawal and Pal have collected from the literature the essential traceability information of the textile and clothes supply chain, which should be stored and available to any interested party. They separate the data into 5 sets: product, quality, process, and social-environmental information [30]. For product information, the following characteristics are essential [51,52]: 1. The composition and origin of the product, including organic and non-organic compounds, and raw materials that were employed in the elaboration of the final products.
2. Detailed information about all the companies and all the suppliers that contribute to the lifecycle of the product. 3. Inbound and outbound specific information about material that is provided by suppliers. 4. Cost of the final product, calculated as sum of costs of raw material and all intermediate products. 5. Lot numbers to facilitate traceability. 6. Real-time sales data in different retail channels.
Quality information has become essential in supply chain management and development. Audit and test procedures reports at every step of the supply chain, quality certifications of raw material (origin, history, etc.) and product at each stage, and tracking data of each non-finished and finished product, will help to trace the complete lifecycle of the garment [30].
Process information is related to detailed information about all the manufacturing processes and timestamps of events through the complete lifecycle of products.
Finally, social-environmental information includes several social audit reports, product certifications, and also carbon footprint data of the garments [30,53].
For the apparel supply chain, we propose a distributed ledger in which each textile process is securely recorded as a block in the chain. Information integrity and authentication are critical components of a supply chain, therefore it is paramount that each supply chain contributor monitors the flow and safeguards confidential information [24]. The sequence of blocks holds a complete list of transactions like a conventional public ledger in such a way that any change in the recorded information will necessarily break the chain. Figure 6 includes an example of the specific information of a piece of clothing. An item of clothing could be made by cotton, manufactured as knitting, garment assembly made by stitching, and finally for distribution and sales, advertising and distribution to local shops are also included of the supply chain.  The first block of the blockchain should contain the suppliers and origin of the row material. After this block, each block must point to the immediately predecessor block via a hash value of that parent block. After this valid block, the second block contains the yarn information (flexibility, elasticity, tensile strength, specific gravity, fineness, length, hygroscopicity and the individual processes to get the yarn). This also includes information about fabrics, which is the process or finishing operations that are optimized or modified (dyeing or stamping, mechanical finishing, impregnation, coating, lamination).
The garment network makes up the third block, which is responsible for the transformation of the fabric into clothing. The finishing processes represent the fourth block, while the customer constitutes the last one.
These five blocks make a ledger, similar to a physical book where each page is filled up with new transactions from the supply chain that are timestamped, signed, and stored into the book [54].
A more detailed explanation of essential ready-to-wear garments information is detailed below: 1. Raw material and fibre manufacture: it is common to monitor plant growth parameters like temperature, blend, moisture and fertility. Furthermore, raw material and fibre manufacture are also responsible for the processes or period of getting the crops. Chain records should contain, at the very least, location, types of fibres, origin, treatments, and performance characteristics of fibres durability, strength, elasticity, and flexibility. 2. Fabric manufacture is the set of operations that allow to derive fabric from fibres. In order to ensure traceability, records of the processes and raw materials employed to create the fabric should be kept on the chain. This should include the suppliers' detailed information, the date provided, a description of the received products, types of fibres, records of internal procedures (e.g., carding and spinning), chemical composition (including additives), distribution records, etc. At this step, the fabric may be sent to a distributor or a clothing manufacturer. 3. Garment assembly: the clothing manufacturer is responsible for receiving fabrics from the producers or distributor and producing the garment. From the design of a garment to the packing of a finished product, several data elements are required. The information that should be recorded at this stage includes grading, pattern making, nesting, marking, cutting, sewing, quality inspection, pressing and packaging. Given that the identification and labelling of each garment is performed at this stage, it is important to ensure consistency of the information that appears on the label and the records stored on the blockchain.

Distribution and sales includes:
• Finished goods distributor: the load received by the goods distributor are dispatched to wholesalers or retailers. The responsibilities of goods distributor include receiving, storing, dispatching, and managing the inventory of finished goods. At this step of the process, if any re-packing or re-labelling is needed, the new details must be inserted into the blockchain. • Wholesalers, which receive the finished goods from distributors, dispatch them to retail stores. Wholesalers are responsible for the logistic process, with the reception of garments, storage in the corresponding warehouse, and finally, the dispatch of the goods. For that reason, they also need to maintain consistency of the information stored in the blockchain.

•
Retailers, which receive finished goods from wholesalers or the goods distributors, sell them to end customers. When a garment is sold, the information must be accordingly recorded in the blockchain. Retailers are responsible for managing the details of the items they have received and stored. After storing the information on the blockchain, consumers will be able to see the provenance of the purchased garment by entering the identification number on the website.

•
Other entities: In addition to the above mentioned entities, there are other participants in the supply chain that are not directly related to the production or processing of garments. Some of these stakeholders are machinery (thread suppliers, dye and chemical, and label suppliers), freight operators responsible for transporting goods, and importers that are responsible for buying goods from the original manufacturer and delivering them to the destination country.  Regarding the product, we consider unique identifications (ID), where the data for each product ID is stored in the Blockchain. The resulting log file of the transaction will include the information from each part of the apparel industry. So, the whole supply chain is fully traceable. At each stage of the supply chain all information is gathered and stored and will be available during the complete garment lifecycle.
The resulting hash (from the stored data) is encrypted using the private key and then attached, as a signature, to the original document. Eventually, the customers can verify the trustworthiness of the information.
This scheme allows to authenticate the final product, and also to trace clothes from the beginning of the production chain. Figure 8 shows an example of the i-th block in the distributed ledger, including some product data. As already stated, each block in the chain consists of the block header and also the body of the block.
The block header includes the following information [55]: 1. The block version indicating the set of rules to be followed.

Garment Traceability: A Case Study
Common labels in a ready-to-wear clothing such as a women's shirt are shown in Figure 9. These labels contains the following information: With the help of EPC, RFID, NFC, or even a QR code, a retail or final consumer could read the garment's labels and use a tracking procedure (see Algorithm 1) to access cloth information. This will allow to know where and how our clothes were made.
The algorithm for getting the garment information could be defined as follows: In the case of a women's shirt, bought at a local shop called Sfera, the information that will be available from the blockchain is related to Figure 2. Several raw materials could be used to make a garment. Cotton, synthetic materials, cellulosic fibres/viscose, wool, silk, leather, etc., are some of the different materials that are commonly used for that purpose. These materials could have several sources. Thus, as an example, crop cotton producing countries are India, United States, China, Brazil, etc. [56]. As synthetic material we can find polyester, nylon, acrylic, polypropylene, etc. Cellulose is extracted from natural resources and transformed into fibres, and viscose is the most common cellulosic fabric. Some characteristics of those materials are detailed in Section 3.2: origin, type of fibres, treatments, fibres durability, strength, elasticity, flexibility, etc.
After selecting the raw materials, the next step is the fabric manufacture. Depending on the materials, the process of fabric creation is different. As an example, in the case of cotton, the initial step is the preparation of the yarn for weaving or knitting. This is not the case of cellulose fibres, which are produced in a wet spinning process. A detailed description of this process could be found in ( [57], Chapter 2, Figure 2.39).
Once the fabric is manufactured, garment assembly is the next process, which includes assembling different parts of a garment (the front and the back body, yoke, sleeve, collar, etc., that can be appreciated in Figures 4 and 5).
In the final stage of distribution and sales, retailers, wholesalers, distributors and other intermediaries play an important role in this process of the textile supply chain. Logistics processes, circular economy and specific characteristics that this entails are also part of the detailed information of ready-to-wear clothes. Moreover, also locations add additional information. Sfera for example, has several stores in shopping areas in Spanish and also in other countries such as Portugal, Greece and Mexico. In addition, it has distribution centers in Saudi Arabia, Bahrain, Belgium, Egypt and Kuwait. Sfera operates with partners such as the Chilean company Ripley, the Peruvian group Oechsle, the Saudi Alhokair or the Mexican Liverpool.
As mentioned in Section 2, in the supply chain industry the approach that makes more sense is to use a private and open blockchain, where the nodes allowed to add blocks to the data chain would be the actors involved in the manufacturing process. A registry of agents participating in the textile production chain must then be created. Each of the registered agents are consequently assigned a unique identification code.
Every agent participating in the production, marketing, distribution, and commercialization chain must provide the following information when registering each textile unit in the traceability system: 1. Unique identification code for textile agents and their role within the production chain, marketing, distribution, and sale of the textile unit to be registered. 2. Location of the establishment where the textile unit is located at the time of registration. 3. Unique code and batch number of the textile unit. 4. All the intervening agents must corroborate the identity of their buyers and their suppliers, providing their unique identification code for textile agents, as well as certify the delivery or reception of the textile units to them. 5. Information on the following activities may be incorporated: Shipping and reception of the product in a state of return, deteriorated or destroyed code, stolen or lost product.
All this information will be incorporated into the traceability system database. The final consumers of the textile units must be able to identify the agents involved in each stage of the production, marketing, distribution, and sale chain when reading the unique code of the textile unit.
In order to add a block into the chain, the corresponding information (transaction) is broadcasted to the network. This transaction is verified by other network nodes. If a proof of work consensus protocol is used in such a blockchain, those nodes would need to solve some hashing problem before being able to validate the new block. A typical problem in this context is to find arbitrary data (for example, a numeric sequence) such that, when added to the block information, its hash has a given property, for instance a certain sequence of leading zeros in the hash of that block.
For the case study of the shirt, we have calculated the nonces that must be added to the information in order to obtain a different number of leading zeros when hashing the full string with SHA-256, as shown below. For each string, a character "#" has been added right after the nonce, so the hashes are calculated using as input the sequence data_string#nonce. We present here the first occurrence of the first two zeros, the first three zeros, etc., so it can be appreciated that the difficulty is increasing, where the calculations start with the nonce having value 0. When a possible solution to the hashing problem is identified by a network node, it broadcasts the result to the rest of the chain. When most of the parties agree on that result, the block is added to the chain [58]. We propose the use of blockchain to prevent counterfeiting and protect industrial property, that is, the creativity of the designer and the use of specific raw materials. In this case, the consensus method for validating a new block and incorporating it to the blockchain would be agreed between agents involved in the chain. The final goal of such a chain is attesting the characteristics of the product to consumers and creators.

Conclusions
During the Shanghai Fashion Week, in summer, 2017, Babyghost (an Indie fashion brand) worked with BitSe and VeChain to make possible the verification of its collection using Blockchain technology [59]. Providing transparency to fashion supply has become a key goal in the clothing production industry based on many different reasons, such as the disaster that took place at the Rana Plaza in 2003 [60].
In this paper, we have analyzed how Blockchain can help the clothing industry to address key traceability objectives. The use of such technology allows designers, sellers, and final customers to track the garments. In summary, a blockchain is an open, decentralized, and distributed database that keeps records of digital transactions, with a network of identical databases (nodes), in a peer-to-peer connection that is potentially visible to anyone within the specific network. A blockchain conveys a strong guarantee that the data has not been modified and that programs associated to the blockchain will continue to be executed in the specified way. The decentralized blockchain network allows people to trust each other and perform transactions by peers, making the need for intermediaries obsolete [61].
In recent years, several studies have been published related to product traceability (specifically in agriculture or food supply chains). However, the textile and clothing industry has not been well studied. We have proposed the usage of blockchain technology for authenticating and tracing the ready-to-wear clothing supply chain. A case study with the specific characteristics of a women's shirt was introduced. The supply chain that uses blockchain technology allows actors to add new blocks to the chain with the goal of tracing the garment. From every location and at any time, retailers, sellers, customers, and anyone in the supply chain would be able to trace the origin, production, and purchase history of each individual product (whenever that specific information is available), and a customer could verify the origin and authenticity of the purchased garment, tracking all its stages. Thus, the phases of each garment can be traced back to guarantee its validity. Collection traceability and treatment of raw materials could be guaranteed with the use of a distributed ledger in which all transactions are securely recorded.

Author Contributions:
The contribution of all authors of this paper was very similar, as all of them have collaborated in the elaboration, validation, reviewing edition, and the location of the used resources. All authors have read and agreed to the published version of the manuscript.