A multi-party cross-domain authentication method in a blockchain product anti-counterfeiting system
Through blockchain technology and smart contracts, a traceability anti-counterfeiting system is built to realize multi-party cross-domain authentication and reliable recording of traceability information, solving the problems of information untrustworthy and system unreliability in the existing technology, ensuring the transparency of the anti-counterfeiting system and the security of the anti-counterfeiting QR code.
Patent Information
- Application Number
- CN202311790500.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-22
- Publication Date
- 2025-03-21
- Estimated Expiration
- 2043-12-22
AI Technical Summary
The existing product anti-counterfeiting technology has problems such as information being untrusted and system unreliable. Due to the participation of multiple parties and information islands, the supply chain is low transparency, and the anti-counterfeiting QR code is easily copied and used for counterfeit products.
Blockchain technology is used to build a traceability anti-counterfeiting system, and through smart contracts and multi-party cross-domain authentication methods, multiple participants' identity authentication and reliable recording of traceability information are achieved. Merkle Tree and concurrent signature technology are used to prevent anti-counterfeiting QR codes from being copied.
It realizes the reliability of multi-party identity authentication in the anti-counterfeiting system, ensures the security and transparency of traceability information, and prevents the copying of anti-counterfeiting QR codes and the circulation of counterfeit products.
Smart Images

Figure CN117788011B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of commodity information security technology, and in particular to a multi-party cross-domain authentication method in a blockchain product anti-counterfeiting system that realizes source information tracing and prevents anti-counterfeiting two-dimensional codes from being copied based on blockchain. Background Art
[0002] Traditional product anti-counterfeiting and traceability platforms are usually based on centralized database systems, which are susceptible to human interference and tampering, which leads to unreliable information and unreliable systems. In addition, the multi-party participation and information island problems in the supply chain increase the difficulty of collaboration and reduce the transparency of the entire supply chain. With the development of blockchain technology, people use blockchain technology to achieve the immutability and traceability of anti-counterfeiting traceability data. Blockchain allows the entire life cycle of a product to be recorded in an unalterable ledger. Each product has a unique identifier, which is stored on the blockchain together with the relevant data, which makes it possible to trace the manufacturing, circulation and verification history of the product. However, for illegal participants, in the face of huge profits, they can still copy the anti-counterfeiting label and stick it on counterfeit products so that they can flow into the market. Summary of the invention
[0003] In order to solve the problems existing in the existing product anti-counterfeiting technology, the purpose of the present invention is to provide a multi-party cross-domain authentication method in a blockchain product anti-counterfeiting system. The method realizes the identity authentication of multiple participants in the anti-counterfeiting system based on blockchain technology, thereby realizing a reliable anti-counterfeiting function and having good application prospects.
[0004] The present invention achieves the above-mentioned purpose through the following technical solutions:
[0005] A multi-party cross-domain authentication method in a blockchain product anti-counterfeiting system, the method comprising:
[0006] Build a traceability and anti-counterfeiting system. The product manufacturer submits the identity certificate to the third-party coding system. The third-party coding system will call the identity authentication smart contract A. The third-party coding management system will invite the product manufacturer to join the traceability and anti-counterfeiting system based on the voting results of the smart contract A.
[0007] After the product manufacturer joins the traceability anti-counterfeiting alliance chain, the system parameters defined on the chain will be used to select a random number. As the private key in the anti-counterfeiting traceability system; calculate PK = a g, as the public key in the anti-counterfeiting traceability system and upload the public key to the blockchain;
[0008] After the product manufacturer joins the traceability and anti-counterfeiting system, it will serve as one of the nodes on the traceability and anti-counterfeiting alliance chain. At this time, the product manufacturer begins to build a traceability chain for its own products to verify the information of relevant participants. When the verification is passed, the participant is invited to join the traceability chain channel for its own products.
[0009] The invited participants select random numbers based on system parameters. As the private key in the anti-counterfeiting traceability system; calculate PK = r g, as the public key in the anti-counterfeiting traceability system and upload the public key to the blockchain;
[0010] After ensuring that the product manufacturer and its partners have entered the same blockchain channel, establish the anti-counterfeiting traceability of the goods; assume that the nodes that the current anti-counterfeiting traceability process of the goods needs to pass through are: manufacturers, transporters, and distributors; define the execution actions of each participant in the traceability process of a specific product to ensure that safe and authentic traceability information is recorded in the blockchain.
[0011] According to a multi-party cross-domain authentication method in a blockchain product anti-counterfeiting system provided by the present invention, the construction of the traceability anti-counterfeiting system includes: the traceability anti-counterfeiting system is constructed based on an alliance chain, and its initial state includes nodes of relevant government departments and nodes of a third-party coding management system, wherein the third-party coding management system node is the creator of the anti-counterfeiting traceability chain, and the system parameters are defined by the third-party coding management system: a cyclic addition group G, defining the generator and group order of G as g and p respectively, and a hash function and H2 = {0, 1} * →{0, 1} 256 .
[0012] According to a multi-party cross-domain authentication method in a blockchain product anti-counterfeiting system provided by the present invention, smart contract A is used to call upon the government agency node originally on the anti-counterfeiting traceability chain to verify the legitimacy of the identity credential. When the verification is passed, the approval vote is selected in smart contract A. If the verification is not passed, a negative vote is selected, and the voting result is signed and uploaded to smart contract A.
[0013] According to a multi-party cross-domain authentication method in a blockchain product anti-counterfeiting system provided by the present invention, the establishment of anti-counterfeiting traceability of goods includes:
[0014] Formulate a purchase agreement, use the private keys of the distributor and manufacturer to concurrently sign the agreement, encrypt the signed agreement and upload it to the blockchain, and then decrypt and publish it by the encryptor when a dispute arises;
[0015] Product manufacturers apply for anti-counterfeiting QR codes from the third-party coding management system based on the types of goods ordered by distributors and the number of boxes, single product box packaging, single product packaging outer code, and single product packaging inner code provided;
[0016] The third-party coding management system allocates boxes, single product box packaging and single product packaging according to the quantity provided by the distributor, and generates corresponding anti-counterfeiting QR codes. When the participating parties scan the anti-counterfeiting QR code of the box to add traceability information, the anti-counterfeiting QR code of each single product box packaging and single product packaging corresponding to the anti-counterfeiting QR code of the box will also add the traceability information.
[0017] According to a multi-party cross-domain authentication method in a blockchain product anti-counterfeiting system provided by the present invention, the third-party coding management system performs hash calculations on each generated anti-counterfeiting QR code coding sequence respectively, and uploads them to the blockchain in the order of box-single product box packaging-single product packaging outer code-single product packaging inner code, and uses the hash value calculated for each anti-counterfeiting QR code coding sequence as a Merkle Tree leaf node. The leaf node values form a set L to calculate the Merkle Tree root, and use a private key to sign the root, the set L and the next entity identity that can add traceability information to the QR code. Subsequently, the hash value corresponding to each anti-counterfeiting code is used as the primary key, and the third-party coding management system adds initial traceability information for each hash value, which includes the proof path corresponding to each hash value; finally, the root, the signature, each hash value and the corresponding traceability information are uploaded to the blockchain.
[0018] According to a multi-party cross-domain authentication method in a blockchain product anti-counterfeiting system provided by the present invention, after the product manufacturer receives the anti-counterfeiting QR code ciphertext, it uses the private key to decrypt it. The product manufacturer adds the anti-counterfeiting QR code to the product in the order of box-single product box packaging-single product packaging outer code-single product packaging inner code. After the product is assembled, log in to the traceability anti-counterfeiting system and scan the box anti-counterfeiting QR code to add traceability information. When the box anti-counterfeiting QR code is scanned to add information, the traceability anti-counterfeiting system automatically performs the related single product box packaging-single product packaging outer code-single product packaging inner code operations.
[0019] According to a multi-party cross-domain authentication method in a blockchain product anti-counterfeiting system provided by the present invention, after receiving a picture of a product manufacturer scanning an anti-counterfeiting QR code, the traceability anti-counterfeiting system automatically calculates the hash value of the anti-counterfeiting QR code, and uses the proof path stored in the initial traceability information of the anti-counterfeiting QR code to calculate the root' corresponding to the hash value of the anti-counterfeiting QR code, and checks whether the root corresponding to the hash value stored in the blockchain is equal; and the traceability anti-counterfeiting system determines whether the product manufacturer is authorized to add traceability information for the hash value according to the signature corresponding to the upper-level traceability party;
[0020] If all the above verifications are passed, the traceability anti-counterfeiting system allows the merchant to scan the anti-counterfeiting QR code to add the corresponding traceability information.
[0021] According to a multi-party cross-domain authentication method in a blockchain product anti-counterfeiting system provided by the present invention, the product manufacturer adds the traceability information corresponding to the batch in the anti-counterfeiting traceability system, that is, the traceability information of the batch is put on the chain, and the anti-counterfeiting traceability system regenerates the Merkle Tree according to the QR code scanned by the product manufacturer, where the leaf node is the hash value of the anti-counterfeiting QR code sequence used by the product manufacturer in the anti-counterfeiting QR code assigned by the third-party coding management system. At this time, all leaf nodes are formed into a set L1, where Calculate the new root, and use the private key to sign the root, L1, and the next entity identity that can add traceability information to the anti-counterfeiting QR code and upload it to the blockchain.
[0022] According to a multi-party cross-domain authentication method in a blockchain product anti-counterfeiting system provided by the present invention, the next participant who can add traceability information delegated by the product manufacturer is the transporter or distributor, who continues to add traceability information for the batch through the traceability anti-counterfeiting system.
[0023] According to a multi-party cross-domain authentication method in a blockchain product anti-counterfeiting system provided by the present invention, when scanning the anti-counterfeiting QR code, the identity is authorized to log in to the system, and the hash value corresponding to the anti-counterfeiting QR code sequence of the product is calculated by the traceability anti-counterfeiting system, and the verification path and root provided by the traceability information added by the last participant are calculated, and root' is compared with root. If they are equal, the overall traceability information is returned to the user, and finally the user decides to buy;
[0024] After purchase, the user scans the outer code of the product packaging again. After opening the product, the user scans the inner code of the product packaging. The traceability anti-counterfeiting system is used to determine whether the two anti-counterfeiting QR codes correspond one to one. If an incorrect match occurs, it is a counterfeit product.
[0025] It can be seen that, compared with the prior art, the present invention realizes the identity authentication of multiple participants in the anti-counterfeiting system based on blockchain technology, and proposes a scheme based on IPFS (Interplanetary File System), Merkle Tree (Merkle Tree) and concurrent signature technology to bind the traceability information and anti-counterfeiting traceability information with the identity of the participants to prevent the anti-counterfeiting QR code from being copied and used in counterfeit products. In addition, the present invention enables multiple participants to complete the calculation collaboratively, and the data is always saved in the local database during the entire calculation process to ensure the privacy of the data, and the correct calculation results of each party are returned after the calculation task is completed.
[0026] The present invention also provides an electronic device, comprising:
[0027] a memory storing computer executable instructions;
[0028] a processor configured to execute the computer executable instructions,
[0029] Among them, when the computer executable instructions are executed by the processor, the steps of any one of the above-mentioned multi-party cross-domain authentication methods in the blockchain product anti-counterfeiting system are implemented.
[0030] The present invention also provides a storage medium, on which a computer program is stored. When the computer program is executed by a processor, it is used to implement the steps of the multi-party cross-domain authentication method in any of the above-mentioned blockchain product anti-counterfeiting systems.
[0031] It can be seen that the present invention also provides an electronic device and storage medium for a multi-party cross-domain authentication method in a blockchain product anti-counterfeiting system, which includes: one or more memories, and one or more processors. The memory is used to store program code and intermediate data generated during program operation, storage of model output results, and storage of models and model parameters; the processor is used for processor resources occupied by code operation and multiple processor resources occupied when training models.
[0032] The present invention is further described in detail below in conjunction with the accompanying drawings and specific embodiments. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] Figure 1 It is a schematic diagram of an anti-counterfeiting and traceability system in an embodiment of a multi-party cross-domain authentication method in a blockchain product anti-counterfeiting system of the present invention.
[0034] Figure 2 It is a flow chart of an embodiment of a multi-party cross-domain authentication method in a blockchain product anti-counterfeiting system of the present invention.
[0035] Figure 3 It is a sequential flow chart of a multi-party cross-domain authentication algorithm in an embodiment of a multi-party cross-domain authentication method in a blockchain product anti-counterfeiting system of the present invention.
[0036] Figure 4 It is a schematic diagram of the MerkleTree technology in an embodiment of a multi-party cross-domain authentication method in a blockchain product anti-counterfeiting system of the present invention.
[0037] Figure 5 It is a sequential flow chart of an algorithm for uploading and verifying traceability information by multiple parties in an embodiment of a multi-party cross-domain authentication method in a blockchain product anti-counterfeiting system of the present invention. DETAILED DESCRIPTION
[0038] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0039] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.
[0040] Different types of blockchains provide solutions for different application scenarios. Public chains are completely open and anyone can participate, while private chains restrict participants and are more suitable for applications within specific organizations. Alliance chains are between the two and are jointly controlled by a group of organizations. The anti-counterfeiting traceability system provided in this embodiment uses an alliance blockchain. The consensus scheme of the alliance chain is usually determined by the alliance members, and the appropriate consensus mechanism is selected according to their needs and trust relationships. In the specific implementation, authoritative consensus is adopted. The authoritative consensus is that a pre-designated node or authoritative agency is responsible for verifying and adding new blocks. This method is fast and suitable for situations where there is a high degree of trust in alliance members. The members with high trust in the alliance blockchain of this embodiment are third-party coding management systems and manufacturers. This consensus model does not necessarily require a complex consensus algorithm because the authoritative node or agency has enough trust to perform these tasks. In this specific implementation, an authoritative signature algorithm is used. The authoritative signature means that a block needs to be signed by a specific authoritative signature before it can be added to the blockchain. In this way, only specific authoritative nodes have signing authority, and other nodes cannot add blocks directly. That is, the messages generated by other nodes need to be signed by the manufacturer to which they belong, and then verified by the third-party coding management system and added to the blockchain.
[0041] See also Figure 1 ,exist Figure 1In the example environment of the anti-counterfeiting traceability system shown, the participant devices 104, 106, and 108 are allowed to join the blockchain network 101 after verification by the device 102 represented by the third-party coding management system and the device 103 represented by the supervisory agency. The blockchain network 101 can select a public chain, a consortium chain, or a private chain. In this example of the network environment 100, it can include participant computing devices 102-108, agent computing devices 112-114, and a network 110. The network 110 can include a combination of a wide area network, the Internet, or a local area network, and is connected to a computing device. The participant computing device and the agent computing device can access the network 110 by wire or wirelessly.
[0042] In some cases, the proxy computing devices 112 and 114 can be considered as nodes of a cloud computing system, which means that they may be connected to a cloud computing platform that provides computing, storage and other services, allowing these devices to participate as part of the cloud computing system. Or the proxy computing devices 112 and 114 represent independent cloud computing systems, which means that they may be part of a distributed processing system that is interconnected through a network to jointly complete tasks and process data. The role of introducing proxy computing devices is that the anti-counterfeiting traceability system can provide higher scalability and flexibility with the help of the cloud computing system structure to adapt to different needs and scenarios.
[0043] The computing devices 104-108 of the participants, as well as the third-party coding management system device 102 and the supervisory agency device 103 are collectively referred to as physical computing devices, which may include but are not limited to laptops, large servers, smart phones, etc. They can act as nodes in the blockchain network 101 to perform product anti-counterfeiting and traceability related operations. That is, the computing devices 104-108 can belong to specific entities. Specifically, the specific entities refer to some actual participants or organizations in the example environment, which may be consumers, producers, transporters, distributors, etc. Physical computing devices are not only nodes in the network, but are also used to perform specific services. Services can be targeted at a specific entity or multiple entities, in order to meet the needs of different entities, or customized services according to different business scenarios, and also include managing transactions, processing data, executing smart contracts, etc. in the blockchain network.
[0044] This embodiment provides a multi-party cross-domain authentication method in a blockchain product anti-counterfeiting system. Figure 2 As shown, the method includes:
[0045] Step S1, building a traceability and anti-counterfeiting system. The product manufacturer submits the identity certificate to the third-party coding system. The third-party coding system will call the identity authentication smart contract A. The third-party coding management system invites the product manufacturer to join the traceability and anti-counterfeiting system according to the voting result of the smart contract A.
[0046] Step S2: After the product manufacturer joins the traceability anti-counterfeiting alliance chain, the system parameters defined on the chain will be used to select a random number. As the private key in the anti-counterfeiting traceability system; calculate PK = a g, as the public key in the anti-counterfeiting traceability system and upload the public key to the blockchain;
[0047] Step S3, after the product manufacturer joins the traceability and anti-counterfeiting system, it becomes one of the nodes on the traceability and anti-counterfeiting alliance chain; at this time, the product manufacturer begins to build a traceability chain for its own products to verify the information of relevant participants, and invites the participant to join the traceability chain channel for its own products after the verification is passed;
[0048] Step S4: The invited party selects a random number based on the system parameters. As the private key in the anti-counterfeiting traceability system; calculate PK = r g, as the public key in the anti-counterfeiting traceability system and upload the public key to the blockchain;
[0049] Step S5, after ensuring that the product manufacturer and its cooperative participants have entered the same blockchain channel, establish the anti-counterfeiting traceability of the product; it is assumed that the nodes that the current anti-counterfeiting traceability process of the product needs to pass through are: manufacturer, transporter, and distributor; define the execution actions of each participant in the traceability process of the specific product to ensure that safe and authentic traceability information is recorded in the blockchain.
[0050] In this embodiment, the construction of the traceability anti-counterfeiting system includes: the traceability anti-counterfeiting system is constructed based on the alliance chain, and its initial state includes the nodes of the relevant government departments and the nodes of the third-party coding management system, wherein the third-party coding management system node is the creator of the anti-counterfeiting traceability chain, and the system parameters are defined by the third-party coding management system: the cyclic addition group G, the generator and group order of G are defined as g and p respectively, and the hash function and H2 = {0, 1} * →{0, 1} 256 .
[0051] In this embodiment, smart contract A is used to call upon the government agency node originally on the anti-counterfeiting traceability chain to verify the legitimacy of the identity certificate. If the verification is passed, choose to approve the vote in smart contract A. If the verification is not passed, choose to deny the vote and sign the voting result and upload it to smart contract A.
[0052] This embodiment provides a multi-party cross-domain authentication algorithm. The role of this algorithm is reflected in how a product manufacturer can mutually authenticate with its commodity transporters, distributors, supervisory agencies, etc. and establish a cooperative relationship when it wants to use the blockchain-based anti-counterfeiting traceability system. The anti-counterfeiting traceability system is built on the alliance chain. The initial state includes nodes of relevant government departments and third-party coding management system nodes. The third-party coding management system node is the creator of the anti-counterfeiting traceability chain, and the system parameters are defined by the third-party coding management system: cyclic addition group G, define the generator and group order of G as g and p respectively, and the hash function and H2 = {0, 1} * →{0, 1} 256 .
[0053] In practical applications, such as Figure 3 As shown, the multi-party cross-domain authentication algorithm specifically includes the following steps:
[0054] Step S11: The product manufacturer submits the identity certificate to the third-party coding system. The third-party coding system will call the identity authentication smart contract A. Smart contract A will call on the government agency node originally on the anti-counterfeiting traceability chain to verify the legitimacy of the identity certificate. After the verification is passed, choose to agree to vote in smart contract A. If the verification is not passed, choose to deny the vote and sign your voting result and upload it to smart contract A. The third-party coding management system invites the product manufacturer to join the traceability and anti-counterfeiting system based on the voting result of smart contract A.
[0055] Step S12: After joining the anti-counterfeiting traceability chain, the product manufacturer will use the system parameters defined on the chain to select a random number As the private key in the anti-counterfeiting traceability system. Calculate PK = a g, as the public key in the anti-counterfeiting traceability system and upload the public key to the blockchain.
[0056] Step S13: After the product manufacturer joins the traceability and anti-counterfeiting system, it will serve as one of the nodes in the traceability and anti-counterfeiting alliance chain. The product manufacturer can start building the traceability chain of its own products from this step. The construction process flow chart is as follows Figure 4 As shown in the figure, the manufacturer receives the cooperation request and relevant company information from the participant, verifies the information of the relevant participant, and invites the participant to join the traceability chain channel of its own product after the verification is passed.
[0057] Step S14: The invited party can select a random number based on the system parameters As the private key in the anti-counterfeiting traceability system. Calculate PK = r·g, as the public key in the anti-counterfeiting traceability system and upload the public key to the blockchain.
[0058] After the manufacturer and its partners have entered the same blockchain channel, the anti-counterfeiting traceability of the goods can be established. When establishing the anti-counterfeiting traceability of the goods, a multi-party upload and verification algorithm for traceability information is provided. The nodes that the anti-counterfeiting traceability process of the current goods needs to pass through are: manufacturers (goods production), transporters (transporting goods to distributors), and distributors (divided into first-level distributors and second-level distributors, responsible for organizing sales of local goods). The algorithm strictly defines the execution actions of each participant in the traceability process of a specific product to ensure that safe and authentic traceability information is recorded in the blockchain. Note that the number of hash calculations performed by scanning the anti-counterfeiting QR code each time will be accumulated on the traceability information. Therefore, the number of scans at each level of "box code-single product box packaging code-single product packaging outer code-single product packaging inner code" is decreasing according to market principles, especially the single product packaging inner code, which can only be obtained by destroying the smallest packaging of the product, so it can generally only be scanned once by the manufacturer and the consumer. Therefore, after counting the number of scans by the manufacturer separately, except for the last step where the consumer can scan it, if any scanning occurs in the middle for hash calculation, pre-counterfeiting will definitely occur.
[0059] like Figure 5 As shown, the method comprises the following steps:
[0060] Step S21, the distributor and the manufacturer formulate a purchase agreement, and use the private keys of the distributor and the manufacturer to concurrently sign the agreement. Since the agreement involves privacy, it is only necessary to encrypt the signed agreement and upload it to the blockchain. When a dispute arises, the encryptor will decrypt and publish it;
[0061] Step S22, the product manufacturer applies for an anti-counterfeiting QR code from a third-party coding management system based on the types of goods ordered by the distributor and the number of boxes-single product box packaging-single product packaging outer code-single product packaging inner code provided;
[0062] Step S23, the third-party coding management system allocates the box-single product box packaging-single product packaging quantity according to the dealer, and generates corresponding anti-counterfeiting QR codes of box-single product box packaging-single product packaging outer code-single product packaging inner code. When the participating party scans the anti-counterfeiting QR code of the box to add traceability information, the anti-counterfeiting QR code of each single product box packaging and single product packaging corresponding to the anti-counterfeiting QR code of the box will also add the traceability information.
[0063] Step S24, the third-party coding management system performs hash calculation on each anti-counterfeiting QR code sequence generated, and uploads it to the blockchain in the order of box-single product box packaging-single product packaging outer code-single product packaging inner code. The hash value calculated for each anti-counterfeiting QR code sequence is used as the Merkle Tree leaf node, and the leaf node value forms a set L to calculate the Merkle Tree root, and the root, set L and the next entity identity that can add traceability information to the QR code are signed with a private key. Subsequently, the hash value corresponding to each anti-counterfeiting code is used as the primary key, and the third-party coding management system adds initial traceability information for each hash value, which includes the proof path corresponding to each hash value; finally, the root, signature, each hash value and the corresponding traceability information are uploaded to the blockchain. Starting from this step, all traceability information is uploaded with the hash value of the anti-counterfeiting QR code as the primary key. The purpose of this is to ensure that the QR code is not known to the public and causes QR code duplication problems. The generated anti-counterfeiting code is also packaged according to "box-single product box packaging-single product packaging outer code-single product packaging inner code", encrypted using the public key uploaded by the manufacturer, and sent to the manufacturer.
[0064] Step S25, after the product manufacturer receives the anti-counterfeiting QR code ciphertext, it uses the private key to decrypt it. The product manufacturer adds the anti-counterfeiting QR code to the product in the order of box-single product box packaging-single product packaging outer code-single product packaging inner code. After the product is assembled, log in to the traceability anti-counterfeiting system and scan the box anti-counterfeiting QR code to add traceability information. When the box anti-counterfeiting QR code is scanned to add information, the traceability anti-counterfeiting system automatically performs the relevant single product box packaging-single product packaging outer code-single product packaging inner code operations.
[0065] Step S26, after receiving the picture of the product manufacturer scanning the anti-counterfeiting QR code, the traceability anti-counterfeiting system automatically calculates the hash value of the anti-counterfeiting QR code, and uses the proof path stored in the initial traceability information of the anti-counterfeiting QR code to calculate the root' corresponding to the hash value of the anti-counterfeiting QR code, and checks whether the root corresponding to the hash value stored in the blockchain is equal; and the traceability anti-counterfeiting system determines whether the product manufacturer is authorized to add traceability information for the hash value based on the signature corresponding to the upper-level traceability party; if all the above verifications are passed, the traceability anti-counterfeiting system allows the merchant to scan the anti-counterfeiting QR code to add the corresponding traceability information.
[0066] Step S27, the product manufacturer adds the traceability information corresponding to the batch to the anti-counterfeiting traceability system, that is, the traceability information of the batch is put on the chain, and the anti-counterfeiting traceability system regenerates the Merkle Tree according to the QR code scanned by the product manufacturer, where the leaf node is the hash value of the anti-counterfeiting QR code sequence used by the product manufacturer in the anti-counterfeiting QR code assigned by the third-party coding management system. At this time, all leaf nodes are formed into a set L1, where Calculate the new root, and use the private key to sign the root, L1, and the next entity identity that can add traceability information to the anti-counterfeiting QR code and upload it to the blockchain. It should be noted that the anti-counterfeiting coding sequence corresponding to the hash value in the difference set of L1 and L is no longer valid. If these QR codes are scanned again, they will be cancelled QR codes and relevant information cannot be obtained.
[0067] In step S28, the next party delegated by the product manufacturer to add traceability information is the transporter or distributor, who continues to add traceability information for the batch through the traceability and anti-counterfeiting system, as in steps 16 and 17.
[0068] Step S29, when scanning the anti-counterfeiting QR code, the consumer logs into the system for identity authorization, and calculates the hash value corresponding to the anti-counterfeiting QR code sequence of the product through the traceability anti-counterfeiting system, as well as the verification path and root provided by the traceability information added by the last participant, and calculates root' and compares it with root. If they are equal, the overall traceability information is returned to the user, and the user finally decides to buy. After the purchase, the user scans the outer code of the product packaging again, and after opening the product, scans the inner code of the product packaging, and determines whether the two anti-counterfeiting QR codes correspond one to one through the traceability anti-counterfeiting system. If an incorrect match occurs, it is a counterfeit product.
[0069] In summary, this embodiment implements the identity authentication of multiple participants in the anti-counterfeiting system based on blockchain technology, and proposes a scheme based on IPFS (Interplanetary File System), Merkle Tree (Merkel Tree) and concurrent signature technology to bind the traceability information and anti-counterfeiting traceability information with the identity of the participants to prevent the anti-counterfeiting QR code from being copied and used in counterfeit products. In addition, this embodiment enables multiple participants to complete the calculation collaboratively, and the data is always saved in the local database during the entire calculation process to ensure the privacy of the data, and the correct calculation results of each party are returned after the calculation task is completed.
[0070] In one embodiment, an electronic device is provided, which may be a server. The computer device includes a processor, a memory, and a network interface connected via a system bus. Among them, the processor of the electronic device is used to provide computing and control capabilities. The memory of the electronic device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the electronic device is used to store data. The network interface of the electronic device is used to communicate with an external terminal via a network connection. When the computer program is executed by the processor, a multi-party cross-domain authentication method in a blockchain product anti-counterfeiting system is implemented.
[0071] Those skilled in the art will understand that the electronic device structure shown in this embodiment is only a partial structure related to the scheme of the present application, and does not constitute a limitation on the electronic device to which the scheme of the present application is applied. The specific electronic device may include more or fewer components than those shown in this embodiment, or combine certain components, or have a different arrangement of components.
[0072] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.
[0073] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory or optical memory, etc. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM).
[0074] In addition, the logic instructions in the above-mentioned memory can be implemented in the form of software functional units and can be stored in a computer-readable storage medium when sold or used as an independent product. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0075] It can be seen that this embodiment also provides an electronic device and storage medium for a multi-party cross-domain authentication method in a blockchain product anti-counterfeiting system, which includes: one or more memories, and one or more processors. The memory is used to store program code and intermediate data generated during program operation, storage of model output results, and storage of models and model parameters; the processor is used for processor resources occupied by code operation and multiple processor resources occupied when training models.
[0076] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0077] The above-mentioned embodiments are only preferred embodiments of the present invention and cannot be used to limit the scope of protection of the present invention. Any non-substantial changes and substitutions made by technicians in this field on the basis of the present invention shall fall within the scope of protection required by the present invention.
Claims
1. A multi-party cross-domain authentication method in a blockchain product anti-counterfeiting system, characterized in that: The method comprises the following steps: Build a traceability and anti-counterfeiting system. The product manufacturer submits the identity certificate to the third-party coding system. The third-party coding system will call the identity authentication smart contract A. The third-party coding management system will invite the product manufacturer to join the traceability and anti-counterfeiting system based on the voting results of the smart contract A. After the product manufacturer joins the traceability anti-counterfeiting alliance chain, the system parameters defined on the chain will be used to select a random number. , as the private key in the anti-counterfeiting traceability system; calculate , as the public key in the anti-counterfeiting traceability system and upload the public key to the blockchain; After the product manufacturer joins the traceability and anti-counterfeiting system, it will serve as one of the nodes on the traceability and anti-counterfeiting alliance chain. At this time, the product manufacturer begins to build a traceability chain for its own products to verify the information of relevant participants. When the verification is passed, the participant is invited to join the traceability chain channel for its own products. The invited participants select random numbers based on system parameters. , as the private key in the anti-counterfeiting traceability system; calculate , as the public key in the anti-counterfeiting traceability system and upload the public key to the blockchain; After ensuring that the product manufacturer and its partners have entered the same blockchain channel, establish the anti-counterfeiting traceability of the product; assume that the nodes that the current anti-counterfeiting traceability process of the product needs to pass through are: manufacturer, transporter, and distributor; define the execution actions of each participant in the traceability process of a specific product to ensure that safe and authentic traceability information is recorded in the blockchain; The establishment of anti-counterfeiting traceability of goods includes: Formulate a purchase agreement, use the private keys of the distributor and manufacturer to concurrently sign the agreement, encrypt the signed agreement and upload it to the blockchain, and then decrypt and publish it by the encryptor when a dispute arises; Product manufacturers apply for anti-counterfeiting QR codes from the third-party coding management system based on the types of goods ordered by distributors and the number of boxes, single product box packaging, single product packaging outer code, and single product packaging inner code provided; The third-party coding management system allocates the boxes, single product box packaging, and single product packaging quantities provided by the distributors, and generates corresponding anti-counterfeiting QR codes. When the participants scan the box anti-counterfeiting QR code to add traceability information, the anti-counterfeiting QR code of each single product box packaging and single product packaging corresponding to the box anti-counterfeiting QR code will also add the traceability information; The third-party coding management system performs hash calculations on each anti-counterfeiting QR code sequence generated, and uploads them to the blockchain in the order of box-single product box packaging-single product packaging outer code-single product packaging inner code. The hash value calculated for each anti-counterfeiting QR code sequence is used as the leaf node of the Merkle Tree, and the leaf node values form a set Calculate the Merkle Tree root and perform the root and set And delegate the next entity identity that can add traceability information to the QR code to sign with a private key. Subsequently, the hash value corresponding to each anti-counterfeiting code is used as the primary key, and the third-party coding management system adds initial traceability information for each hash value, which includes the proof path corresponding to each hash value; finally, the root, signature, each hash value and the corresponding traceability information are uploaded to the blockchain.
2. The method according to claim 1, characterized in that: The construction of the traceability anti-counterfeiting system includes: the traceability anti-counterfeiting system is built based on the alliance chain, and its initial state includes the nodes of relevant government departments and the nodes of the third-party coding management system, among which the third-party coding management system nodes are the creators of the anti-counterfeiting traceability chain, and the system parameters are defined by the third-party coding management system: Circular grouping ,definition The generators and group orders are and , hash function and .
3. The method according to claim 1, characterized in that: Smart Contract A is used to call upon the government agency nodes originally on the anti-counterfeiting traceability chain to verify the legitimacy of the identity certificate. If the verification is passed, the vote is approved in Smart Contract A. If the verification is not passed, the vote is rejected, and the voting result is signed and uploaded to Smart Contract A.
4. The method according to claim 1, characterized in that: After the product manufacturer receives the anti-counterfeiting QR code ciphertext, it uses the private key to decrypt it. The product manufacturer adds the anti-counterfeiting QR code to the product in the order of box-single product box packaging-single product packaging outer code-single product packaging inner code. After the product is assembled, log in to the traceability anti-counterfeiting system and scan the box anti-counterfeiting QR code to add traceability information. When the box anti-counterfeiting QR code is scanned to add information, the traceability anti-counterfeiting system automatically performs the relevant single product box packaging-single product packaging outer code-single product packaging inner code operations.
5. The method according to claim 4, characterized in that: After receiving the image of the anti-counterfeiting QR code scanned by the product manufacturer, the traceability anti-counterfeiting system automatically calculates the hash value of the anti-counterfeiting QR code, and uses the proof path stored in the initial traceability information of the anti-counterfeiting QR code to calculate the root' corresponding to the hash value of the anti-counterfeiting QR code, and checks whether the root corresponding to the hash value stored in the blockchain is equal; and the traceability anti-counterfeiting system determines whether the product manufacturer is authorized to add traceability information for the hash value based on the signature corresponding to the upper-level traceability party; If all the above verifications are passed, the traceability anti-counterfeiting system allows the merchant to scan the anti-counterfeiting QR code to add the corresponding traceability information.
6. The method according to claim 5, characterized in that: The product manufacturer adds the traceability information corresponding to the batch in the anti-counterfeiting traceability system, that is, the traceability information of the batch is put on the chain, and the anti-counterfeiting traceability system regenerates the Merkle Tree based on the QR code scanned by the product manufacturer, where the leaf node is the hash value of the anti-counterfeiting QR code sequence used by the product manufacturer in the anti-counterfeiting QR code assigned by the third-party coding management system. At this time, all leaf nodes are formed into a set ,in , calculate the new root, and then And delegate the next entity identity that can add traceability information to the anti-counterfeiting QR code to sign it with a private key and upload it to the blockchain.
7. The method according to claim 6, characterized in that: The next party delegated by the product manufacturer to add traceability information is the transporter or distributor, who continues to add traceability information for the batch through the traceability and anti-counterfeiting system.
8. The method according to claim 7, characterized in that: When scanning the anti-counterfeiting QR code, the user logs into the system through identity authorization. The traceability anti-counterfeiting system calculates the hash value corresponding to the anti-counterfeiting QR code sequence of the product and the verification path and root provided by the traceability information added by the last participant. The root' is calculated and compared with the root. If they are equal, the overall traceability information is returned to the user, and the user finally decides to buy. After purchase, the user scans the outer code of the product packaging again. After opening the product, the user scans the inner code of the product packaging. The traceability anti-counterfeiting system is used to determine whether the two anti-counterfeiting QR codes correspond one to one. If an incorrect match occurs, it is a counterfeit product.
Citation Information
Patent Citations
A wine product traceability anti-counterfeiting system and method based on a block chain
CN109345264A
Blue crab quality traceability system based on a block chain
CN113657909A
Alliance chain consensus identity authentication method
CN114499952A