Product Authentication Technology Integrating Blockchain and Traceability Structure

: To tackle the problems of questioning the authenticity of products faced in e ‐ commerce live streaming and the low data integrity in the process of product transactions, the concept of trace ‐ ability and a product authentication scheme that integrates blockchain technology and traceability are proposed. The proposed scheme deploys the product authentication strategy on the Ethereum blockchain in the form of a smart contract and calls the product authentication method on the trace ‐ ability body by executing the smart contract to realize the authentication of product quality. A com ‐ bination of on ‐ chain and off ‐ chain is used to store private information to guarantee information integrity. Security analysis results show that the proposed scheme can make the risk of information leakage lower and data security higher under the premise of achieving product certification. A sys ‐ tem simulation experiment shows that the solution can meet product certification requirements and have a favorable impact on the live commerce industry.


Introduction
Product certification can reflect product quality, maintain product reputation, and protect the legitimate rights and interests of consumers. The advent of the Corona Virus Disease 2019  has led to the emergence of a large number of celebrities or internet influencers in China who sell products through live commerce. However, with the continuous increase in the number and types of products sold by live streamers, the possibility of consumers buying fake and shoddy products has gradually increased. This violates the consumers' legitimate rights and interests and leads consumers to question product brand reputation. Therefore, the market demand for product certification is constantly increasing. Blockchains [1] are distributed and decentralized databases. On a blockchain, both parties do not need to reach a consensus or rely on third-party agencies to conduct transactions. The transactions on the chain are traceable, undeniable, and nonmodifiable, which can well ensure the credibility of transactions. Currently, blockchains are widely used in different application scenarios, such as product certification, the Internet of Things, supply chain, and smart cities [2][3][4][5][6][7] to ensure data security and traceability.
Yang et al. [8] designed a traceability scheme for fruits, vegetables, and agricultural products by utilizing the characteristics of blockchains that a transaction cannot be tampered with and is traceable, which ensures the security and traceability of private data. Peng et al. [9] designed a new authentication data scheme and combined it with the blockchain system to ensure information privacy and data integrity and availability. Gao et al. [10] proposed a noninteractive, zero-knowledge proof protocol, SymmetreProof, to realize the confidential transmission of information in the blockchain transaction process. Casino et al. [11] tried to apply blockchain technology to the traceability process of dairy products, and proposed a blockchain-based FSC traceability framework, illustrating the rationality and feasibility of applying blockchains to the traceability process. To solve the problem that it is difficult to hold accountable traditional traceability systems, Chen Fei et al. [12] designed a pork traceability system based on the Ethereum blockchain, which not only facilitates consumers to trace pork information but also provides consumers with rights protection functions. Ruan et al. [13] proposed a new type of blockchain, Lineage-Chain, which can efficiently query information on the chain by skipping the list index. Ying et al. [14] proposed a blockchain-based distributed EHR fine-grained traceability scheme, which can not only avoid the common single point of failure problem in distributed systems but also realize the traceability of user identities on the chain. Wu et al. [15] proposed deploying VQL and data verification schemes in the cloud to ensure the security and credibility of the data on the chain, thus ensuring the reliability of the query results. Li et al. [16] designed a blockchain-based domain name system by combining DNS with the blockchain system to improve the security of the existing blockchain domain name system. Although the above research shows that the introduction of blockchain technology into the traceability authentication system increases the data security and traceability of traceability information, the requirements for directly storing traceability information on blockchains are high. On the one hand, the storage capacity of blockchains is limited; while on the other, with the increase of blockchain storage data, the retrieval speed of the blockchain will decrease. In response to this problem, many scholars have proposed to alleviate the pressure on blockchain storage by using the Interplanetary File System. Kumar et al. [17,18] used IPFS as a third-party data to store private data, reducing the pressure on blockchains to store data. The scheme only needs to verify the consistency of the data on and off the chain to determine whether the data has been tampered with, improving the data retrieval speed. However, the confidentiality of data in this scheme is not high, and private data is easily leaked. Based on this scheme, Yang et al. [19] stored encrypted private information, i.e., ciphertext, in IPFS, and the storage index of ciphertext was uploaded to a blockchain. Sun et al. [20] used attribute-based encryption algorithms to ensure the security of private information in IPFS and uploaded the ciphertext information to the chain. Kumar et al. [21] combined PKC, digital signatures, and the blockchain, and proposed a blockchain-based security framework based on public key encryption to improve the security and privacy of medical shared data. However, although these three schemes greatly improve the confidentiality of private information, there are a large number of encryption and decryption operations, and the computational overhead is large.
Overall, the existing blockchain-based product certification schemes [22][23][24] can trace product information to a certain extent and improve the security of private information, but there are still the following main problems: (1) When data are stored directly on a blockchain, the data query efficiency is low, which makes the product certification efficiency low; (2) blockchain technology has limitations such as being difficult to expand, low storage efficiency, and high cost. If all private information is stored on a blockchain, the amount of data is relatively large, which places relatively high requirements on that blockchain; (3) Existing product certification schemes consider a single element and only rely on product traceability information to obtain certification results, which cannot reflect consumers' views on product certification results.
Based on the above problems, this paper combines blockchain technology with the InterPlanetary File System (IPFS) and proposes a product authentication scheme that integrates the blockchain and a traceability structure. The main contributions are as follows: (1) The definition of the traceability structure is given and the product certification strategy is written through smart contracts, such that product certification can be completed without contacting real data, so as to solve the problems of low data security and data privacy of existing solutions; (2) Propose the use of blockchain technology and the InterPlanetary File System to realize the data storage method combining on-chain and off-chain, and realize the decentralized sharing and storage of product traceability information and consumer product evaluation information. The solution can ease the storage pressure on the blockchain and reduce the risk of data leakage; (3) For the product certification scenario, the product traceability information and consumer-review information are combined and applied to the product certification process to solve the problem of a single product certification method in existing certification schemes and implement the product certification scheme based on the Ethereum platform.
The rest of this paper is organized as follows: Section 2 introduces blockchain technology and IPFS and other related technologies involved in this method, as well as the definition and formal description of the traceability structure. Section 3 introduces the overall scheme, including the overall scheme architecture and product certification process design. Section 4 introduces the experimental environment, method implementation, and results from the analysis. Finally, Section 5 summarizes and looks forward to the work of this paper.

Blockchain
To solve the problems of opaque data and easy information leakage of centralized institutions in the process of product certification, this paper uses blockchain technology to realize the decentralized certification process and ensure the security and transparency of data. Blockchains [25,26] are a new type of database constructed by integrating cryptography, P2P (peer-to-peer), and other existing technologies. They can use P2P technology to avoid the appearance of third parties in transactions and ensure the security of information. The block structure [27] is shown in Figure 1. According to the different permissions, blockchains can be divided into permissioned and permissionless chains [28,29]. A permissionless chain refers to a blockchain in which anyone can join the blockchain network at any time and participate in the complete consensus bookkeeping process, often called a public chain. A permissioned chain refers to a blockchain that only users who meet the corresponding conditions can join. It is a semi-public blockchain, which is divided into two types: alliance chain and private chain. The alliance chain is jointly built by multiple alliances, and the alliance chain requires certain permissions to enter; so the alliance chain is more suitable for use within a group or an organization. Compared with the alliance chain, the private chain is usually constructed by a single organization; in such chains, all the above behaviors are controlled by the organization and thus, there are more suitable for internal use within the company.  A smart contract [30,31] is a program pre-written by the user on the blockchain, which cannot be modified once written. The smart contract program is distributed on all nodes in the blockchain network, and there is no centralized node, reducing the risk of a single point of failure. In addition, different blockchain platforms can provide different support for smart contracts. For example, the Bitcoin platform only allows users to develop contracts using a simple scripting language, while platforms such as Ethereum support higher-level languages to develop smart contracts.

InterPlanetary File System
The InterPlanetary File System [32,33] is a distributed file system that uses a P2P network topology to achieve the distributed storage of files, and uniquely identifies files through an independent hash generated by the file content, namely the Content Identifier (CID). Each upload will only be stored once, which avoids repeated storage, and any node can obtain the file content through the CID. The IPFS storage process is shown in Figure  2. In IPFS, it is only necessary to verify the hash to determine whether the file content has been tampered with. IPFS can exist as the infrastructure of a blockchain to jointly realize data storage protection. Therefore, this paper selects IPFS as the third-party database to alleviate the storage pressure faced by blockchains.

Elliptic Curve Cryptography
This paper uses the traditional elliptic curve cryptography (ECC) [34,35] to encrypt the traceability information of the whole production process. ECC is a kind of asymmetric encryption algorithm. A comparison with other encryption algorithms at the same strength is shown in Table 1. As shown in Table 1, the ECC algorithm has a smaller key, higher security, and faster encryption and decryption speed [36]. (1) Select the basic parameters; select the prime number p (p > 3) to determine the finite field GF(p); select the elements a, b (a,b∈E(p)) to determine the elliptic curve y 2 = x 3 + ax + b; select a large prime number n, and determine a base point G of order n; (2) The system randomly selects an integer d as the private key, calculates Q = dG as the public key, and sends Q to the privacy information uploader; (3) After receiving the Q, the uploader of the traceability information selects a random number r, and calculates rG and P(x,y) = rG; (4) The uploader of the traceability information will XOR the plaintext M with Px to obtain the ciphertext C, and then send C to the system; (5) The system calculates according to the private key d, and obtains F(x,y) = d(rG); (6) The system Fx XOR with the ciphertext C to get the plaintext M.
After the above steps, the system verifies that M + rQ -(rG) = M + r(dG) -d(rG) = M. If it does this means that the decryption is successful; otherwise, it is considered that the decryption has failed.

Traceability Structure
The traceability structure is defined in the smart contract, and the traceability structure attribute data are stored on the blockchain. In this paper, the traceability structure (TS) is an abstract description of the traceability information and consumer reviews of the whole process of product production, transaction, and circulation. A data structure is composed of operations (Operates, OPS), as shown in Figure 3. In the figure, ID refers to a series of codes that can uniquely identify the traceability structure; AS refers to the information that needs to be saved in the whole process of product production, transaction, and circulation and the evaluation information of consumers on the product, including the production process attribute (PA) and the product transaction process attribute (SaleAttribute, SA), product circulation process attribute (Transpor-tAttribute, TA) and consumer reviews attribute (ConsumerReviewsAttribute, CRA); MS refers to the method executed by the traceability structure itself, such as the traceability structure initialization method TSInit(), and the traceability structure attribute query method GetAS(); OPS refers to the operations assigned by the user to the traceability structure, such as the platform-side authentication operation PC(), and the consumer authentication operation XC(); and other methods and operations can be written according to actual needs.

System Overview
The product certification technology framework that integrates blockchain technology and the traceability structure proposed in this paper introduces blockchain technology on the traditional product certification level, transforms the traditional centralized certification process into a decentralized process, and builds a new type of trusted network product certification architecture. As shown in Figure 4, the architecture consists of six parts: producer, transaction party, circulation party, certification center, blockchain, and IPFS. As the smart contract registrants, the producer, the transaction party, and the circulation party are responsible for uploading the relevant information about the product; the certification center includes two modules: consumer certification and platform certification, responsible for initiating product certification and giving product certification results; the blockchain element uses the Ethereum blockchain to store the storage location of the encrypted traceability information in IPFS, the storage location of consumer reviews in IPFS, and formulate product authentication strategies in smart contracts; IPFS is responsible for storing the encrypted traceability information and consumers' opinions on products in which the evaluation information is consumer reviews. In addition, the architecture adopts a standardized data structure-the traceability structure-and uses this to standardize the traceability data and structure the product integrity verification information.  After the product enters the shopping platform, the product integrity verification information (that is, the product traceability information) generated by the three links of product production, transaction, and circulation, is encrypted by the elliptic curve cryptographic algorithm and stored on the IPFS. The IPFS storage location is stored on the Ethereum blockchain, and the consumer's product evaluation information is stored in the IPFS; the consumer's product evaluation information's hash value and its IPFS storage location are stored on the Ethereum blockchain, and then the smart contract is used to construct the data integrity of the Ethereum Verification scheme and dynamic data update scheme; thereby comprehensively certifying products through consumer certification and platform certification.

Design of the Certification Process
As shown in Figure 5, the realization of the product traceability certification method based on the alliance chain is completed by the certification center (CC), the Ethereum platform, and the IPFS. The certification center is responsible for initiating the product certification process and determining product certification. As a result, it includes two modules: consumer authentication and platform authentication. The underlying platform of the blockchain adopts the Ethereum platform based on the POW (Proof of work) consensus algorithm, and the Ethereum blockchain stores the consumer comment storage location, CRA, and the encrypted traceability information storage location, PA, SA, TA, and support, invoking the method in the traceability structure to realize product authentication, to ensure the privacy, integrity, and availability of data, and improve consumers' recognition of the authentication results. IPFS is responsible for storing consumer reviews and encrypting them with elliptic curve cryptographic algorithms. The traceability information of subsequent product production, transaction, and circulation link up to ensure data security.  Product certification is divided into two parts: platform certification and consumer certification. The final certification result is obtained by the certification center, CC. During certification, the platform-side certification and consumer certification are carried out in parallel. The final product certification results (PCR) include platform-side certification results (CR) and consumer certification results (CCR); with the platform certification being responsible for giving the platform's judgment that the product is true or possibly true, and the CCR being responsible for giving the consumer's recognition of the judgment given by the platform. If the CR is True, the PCR shows that the product is genuine, and X% of consumers agree that the product is genuine; if the CR is False, the PCR shows that the product may be genuine, and X% of consumers think the product is genuine or possibly genuine.

Consumer Certification Platform Certification
The detailed system flow of the method proposed in the actual scenario is shown in Figure 6. When a consumer applies for product certification, the certification process will be triggered only when the number of consumer certification applications reaches the preset value, or the current time is the systemʹs preset certification time. If the certification process is triggered, it will invoke the platform authentication contract, PC, and consumer authentication contract, XC. If the product certification request sent by the consumer does not reach the preset value, or the number of product certification applications does not reach the preset value within the preset time, the system continues to wait until the number of consumer certification applications reaches the preset value or reaches the system preset certification time.

Platform Certification
The platform authentication process calls the platform authentication contract, PC, implementation. The PC algorithm is shown in Algorithm 1. Firstly, the consumer enters the unique product ID and finds the unique identifier TS.ID of the traceability body corresponding to the ID in the smart contract. Secondly, the system obtains the attribute values of the traceability body, PA, SA, and TA (that is, the encrypted product production, transaction, and circulation, link traceability information hash value), and assigns attribute values to hash1, hash2, and hash3, respectively. Then, the system accesses the encrypted product production, transaction, and circulation link traceability information files stored in the IPFS, reviews the content of these files, and performs the hash operation. Finally, the system determines if hash1, hash2, and hash3 are consistent with the calculated hash value, and returns the traceability information status according to the comparison result. Taking product A as an example, the platform-side certification process is as follows: 1. The platform certification center, CC, invokes the smart contract, queries the traceability structure, TSA, according to the unique identifier IDA of product A, and invokes the platform-side certification contract, PC, to perform platform-side certification on product A; 3. The authentication process determines whether PAF, SAF, and TAF have been tampered with. If PAF, SAF, and TAF have not been tampered with, it is considered that the platform has passed the certification; otherwise, it is considered that the platform has not passed the certification, and finally the product A certification result is returned to the certification center, CC.

Consumer Certification
The consumer authentication process calls the implementation of the consumer authentication contract, XC. The XC contract is shown in Algorithm 2. First, the consumer enters the product's unique identifier ID and finds the traceability body unique identifier TS.ID corresponding to the ID in the smart contract. Then the system obtains the traceability body attribute value CRA (that is, the consumer comment hash value). Next, it accesses the consumer review file stored in the IPFS and puts the content of the file into the trained FastText model. Finally, the model returns the proportion of non-negative reviews to the total reviews. Taking product A as an example, the consumer authentication process is as follows: 1. The certification center, CC, invokes the smart contract, CEC, queries the traceability structure TSA according to the unique identifier IDA of product A, and triggers the consumer certification contract, XC, to conduct consumer certification for product A; + commit, and the test is performed in JavaScript in a VM environment. For the convenience of the experiment, five Ethereum addresses were set, and each address had 100 Ether as the initial balance.  In terms of block design, this paper stores the encrypted data in the private IPFS cluster to obtain the hash, and then stores the hash in the blockchain. The average data size of each transaction is 256 bits or 32 bytes, which can meet the data storage requirements on the Ethereum blockchain.

Method Implementation
Based on the product authentication technology integrating blockchain and traceability proposed in this paper, a product traceability authentication system is designed. Its implementation mainly includes three parts: system initialization, smart contract design, private IPFS cluster construction, and authentication system development. The system initialization part mainly refers to the initialization of the traceability structure and the initialization of the authentication process; for the smart contract part, this paper uses the Solidity language to design the contracts, such as PC and XC and sets the product certification period to 365 days. For the product certification submitted by the merchant, the request threshold is 1000; and in the IPFS part, this paper uses the go-ipfs client to build a local private IPFS cluster to store product traceability information files and consumer review files.
The product traceability information file upload interface and the consumer review file upload interface are shown in Figure 8, and the product certification operation interface is shown in Figure 9.

System Performance and Overheads Analysis
In this section, a detailed test of the system's performance is carried out. Compared with using a third-party database, the failure of the local IPFS node will not affect the normal operation of the system, and the traceability information and consumer review information can still be obtained normally, which has better robustness.
In addition, as shown in Figure 10, each user requests access 10 times within one second. With the increasing number of users, the number of request failures also increases, but the proportion of request failures in the total number of authentication requests is still less than or equal to 0.01. As shown in Figure 11, with the increase in the number of user visits, the average access time of users also increases, but it is still less than 800ms. This shows that the system is stable and can maintain the normal access requirements of users.

Comparative Analysis
As shown in Table 3, this paper adopts the method of comparative analysis and compares the solution in this paper with three related product certification solutions in related work and records whether each scheme is decentralized, the degree of storage decentralization, data confidentiality, and whether the product certification method is single or not. The advantages and disadvantages of the current scheme are analyzed in reference to the problems faced by the existing product certification scheme in Table 4.   [8] no low high single Kumar et al. [17] yes low high single Sun et al. [20] yes high high single This article yes high low not single Table 4. Problems facing current product certification schemes and countermeasures in this scheme.

Data Storage
Product privacy information is directly stored on the blockchain, which makes the storage pressure on the chain too large [14,[22][23][24] Using IPFS to store complete data, the blockchain only stores data hashes, which relieves the pressure of blockchain storage Privacy Protection The security of private information in the existing product certification scheme is not high, and there is a risk of information leakage [17] First, the private information is encrypted and stored in IPFS, and then uploaded to the blockchain to ensure data security and auditability; the traceability authentication method is used to realize product authentication and reduce the risk of information leakage Consumer Acceptance The single certification method makes consumers less reliable in the product certification results [22][23][24] Let consumers and platform parties participate in the product certification process at the same time, improve the authenticity of the certification results and consumers' recognition of the certification results It can be seen from Table 4 that the scheme proposed in this paper is optimal among the schemes considered, but still has room for improvement. For example, one can try to improve the encryption algorithm to make the privacy information more secure; try to optimize the performance of Ethereum, and accelerate the data access rate, thereby improving the efficiency of product certification.

Security Analysis
After encryption, the privacy information is stored on the IPFS. There are two ways for the encrypted data to be read by attackers. One is to crack the ciphertext by brute force and decrypt the ciphertext directly to obtain the private information; the other is to derive the private key from the public key. Since the creation of ECC is based on the points on the elliptic curve to define public and private keys, it is not feasible for attackers to obtain the ciphertext by means of brute force cracking. Moreover, it is very difficult to deduce the private key from the public key of known ECC; that is, it is safe to encrypt private information with ECC, so it is feasible to encrypt the private information with ECC in this paper.
Moreover, this paper uses Ethereum as the underlying platform, which has strong tamper resistance and traceability. The probability of a successful attack by attackers is very small, which can greatly reduce the possibility of data modification on the chain and ensure the security of private data.
In addition, this paper also uses tracers in the product certification process, so that the certification center will not be exposed to real data during the certification process, reducing the risk of data leakage, improving the availability and reliability of data, and further protecting data.

Conclusions
On the basis of existing product authentication schemes, this paper introduces the concept of a traceability structure and proposes a product authentication technology integrating blockchain technology and traceability. This technology implementation scheme can realize information privacy protection on the basis of traceability data sharing. The analysis shows that, compared with traditional product certification schemes, this scheme has higher data security and higher consumer recognition of the certification results. However, there are still some deficiencies in the proposed systems. Compared with the use of public chains, the degree of system decentralization is weak, in addition, at present, blockchain-related applications are mainly at the exploratory stage, so the research in this paper has certain limitations.
In future research, in order to improve the degree of decentralization of the system, the proposed scheme can be extended to the scenarios used by multiple live broadcast platforms. In this scenario, multiple live broadcast platforms can jointly build an alliance blockchain, and each live broadcast platform exists as one or more blockchain nodes. In this way, the degree of decentralization of the system can be improved. In addition, the feasibility of the scheme in combination with actual projects can be demonstrated.