A method and system for full-chain information-based traceability management of traditional Chinese medicine
By using anti-collusion multi-party computation and certificateless threshold signature algorithms, dynamic delay parameters and block signatures are generated, solving the problems of high energy consumption and centralization risks in the traditional Chinese medicine traceability system, and achieving efficient and secure full-chain traceability management.
Patent Information
- Application Number
- CN202511165647.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-20
- Publication Date
- 2025-11-14
- Estimated Expiration
- 2045-08-20
AI Technical Summary
Existing traceability systems for traditional Chinese medicine suffer from problems such as high energy consumption, centralized risks, vulnerability to attacks, low security, and high communication overhead, making it difficult to achieve efficient and secure full-chain traceability management.
A shared RSA common modulus N is generated by adopting an anti-collusion multi-party computation protocol. The dynamic delay parameter T is calculated by combining a nonlinear mapping function. A verifiable delay function and a certificateless threshold signature algorithm are used. The proof is split by erasure coding and signed on multiple regulatory consensus nodes to generate and record the block signature.
It reduces reliance on trusted settings, improves the fairness of leader election and system security, reduces communication and storage burdens, and enhances the efficiency and security of the entire chain of traceability management for traditional Chinese medicine.
Smart Images

Figure CN120707174B_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the field of traceability, and in particular relates to a method and system for information-based traceability management of the entire chain of traditional Chinese medicine. Background Technology
[0002] The traditional Chinese medicine (TCM) industry chain is long and involves numerous links, from the planting, harvesting, and processing of medicinal materials to the production, warehousing, logistics, and final sales of finished medicines. Each link is crucial to the quality and safety of the medicines. Traceability systems often rely on centralized databases for information management, which suffers from problems such as data tampering, lack of transparency, and difficulty in defining responsible parties. Once a quality issue arises, it is difficult to quickly and accurately trace the source of the problem. In recent years, blockchain technology, with its decentralized, tamper-proof, and transparent characteristics, has become an ideal technical solution to the TCM traceability challenge. Existing blockchain-based traceability systems improve data credibility and traceability efficiency to some extent by recording information from each link on the chain. However, Proof-of-Work (PoW) consensus suffers from significant energy consumption and low transaction throughput, while Proof-of-Stake (PoS) faces the risk of centralization due to the wealthy accumulating wealth, and the predictability of the leader election process, making the traceability system vulnerable to targeted attacks such as Distributed Denial-of-Service (DDoS). Verifiable Delay Functions (VDFs) can generate a unique output that requires a specified time delay to compute but can be quickly verified, providing an effective way to achieve fair and random leader election. However, the core parameters of existing VDFs, such as the RSA modulus N, face a trust setting problem if the generation process relies on a single trusted entity. This single trusted entity may retain the trapdoor of prime factorization of N, possessing the ability to forge VDF proofs, posing a fundamental threat to the security of the entire system. Moreover, VDFs typically use fixed delay parameters, lacking flexibility and resilience in the face of network congestion or attacks. In the signature consensus phase of block generation, Public Key Infrastructure (PKI) schemes rely on Certificate Authorities (CAs), which are prone to single points of failure and key escrow risks. Simple multi-signature schemes suffer from high communication overhead and complex signature aggregation, making it difficult to efficiently meet the threshold signature requirements of large-scale regulatory nodes. Constructing a VDF scheme that does not require trust setting and combines an efficient and secure consensus signature mechanism is a technical bottleneck that urgently needs to be addressed in the field of traditional Chinese medicine traceability. Summary of the Invention
[0003] To address the aforementioned problems, this invention proposes a method for information-based traceability management of the entire traditional Chinese medicine supply chain, comprising the following steps:
[0004] Using the hash value of the initial batch identifier of Chinese medicine and the material control standard data of the medicine as a seed, a shared RSA common modulus N is generated among n initialization nodes through an anti-collusion multi-party computation protocol; for the current traceability link, the timestamp, height of the previous blockchain block and the node risk level assessed based on the current transaction data are extracted, and the dynamic delay parameter T is calculated through a nonlinear mapping function.
[0005] The delayed output of the previous block is hashed with the Merkle root of the current block to be added to the chain to obtain the input value x; the common modulus N, the dynamic delay parameter T, and the input value x are input into the verifiable delay function to obtain the delayed output y of the current block and the proof π of the verifiable calculation process; where the input x of the genesis block is the Merkle root of the genesis block itself;
[0006] After the proof π is encoded and segmented based on erasure coding, it is distributed to multiple regulatory consensus nodes along with the delayed output y. After each node verifies the validity of the received proof fragment locally, it uses a certificateless threshold signature algorithm based on bilinear pairing to sign the data digest containing the delayed output y of the current block and the Merkle root, generating its own partial signature.
[0007] Once a number of valid partial signatures reaching a preset threshold t are collected, the complete block signature is reconstructed using Lagrange coefficients. The block signature, along with the delayed output y and the proof π, is then recorded in the current block to complete the on-chain process.
[0008] Preferably, the step of using the hash value of the initial batch identifier of traditional Chinese medicine and the material control standard data of the medicine as a seed, and generating a shared RSA common modulus N among n initialization nodes through an anti-collusion multi-party computation protocol, includes:
[0009] The UTF-8 encoding of the initial batch identifier of Chinese medicine is concatenated with the SHA-256 hash value of the material control standard data file of the medicine to form a seed of fixed length;
[0010] Each initialization node generates a large prime number based on the seed and its own private random number;
[0011] Each node executes a secure multiplication protocol to jointly calculate the product of the prime numbers generated by all nodes without revealing their own prime numbers, which serves as the shared RSA common modulus N.
[0012] Preferably, the calculation of the dynamic delay parameter T through the nonlinear mapping function includes:
[0013] The node risk level r is defined as the ratio of the number of rejected transactions submitted by the node in the past preset period to the total number of submitted transactions, and the value of r ranges from [0,1].
[0014] The delay parameter T is calculated using the following function: ,in The base delay iteration count, where h is the height of the previous block. As a risk weighting factor, This is a risk sensitivity index.
[0015] Preferably, the step of distributing the proof π, after being encoded and segmented based on erasure coding, along with the delayed output y, to multiple regulatory consensus nodes includes:
[0016] The proof π of the verifiable delay function is treated as a byte sequence and encoded using Reed-Solomon codes. The encoding parameters are set to (k, m), where m is the total number of supervisory consensus nodes, and k is the minimum number of shards required to reconstruct the proof. t is the minimum number of signatures required for a threshold signature;
[0017] The proof of π is divided into k data blocks, generating mk verification blocks, forming a total of m encoded fragments;
[0018] The m encoded fragments are distributed one-to-one to the m regulatory consensus nodes.
[0019] Preferably, the certificateless threshold signature algorithm based on bilinear pairing is used to delay the output containing the current block. Sign the data digest with Merkel treeroot to generate their respective partial signatures, including:
[0020] Each regulatory consensus node obtains a partial private key based on its node identity from the key generation center, and each independently generates a secret value. The two are combined to form a complete signature private key.
[0021] The node uses its complete signing private key to sign the data digest based on the BLS12-381 curve, generating a point on the elliptic curve as a partial signature. .
[0022] Preferably, the step of reconstructing the complete block signature using Lagrange coefficients includes:
[0023] The signature aggregation node collects valid partial signatures from t different regulatory consensus nodes. Then, each signature and its corresponding node index are used to construct t points. ;
[0024] After the aggregation node collects t partial signatures, it calculates the corresponding Lagrange coefficients. ;
[0025] Through weighted summation, that is The complete block signature obtained .
[0026] Preferably, the data digest further includes the hash value of the previous block and the timestamp of the current block.
[0027] On the other hand, this invention also proposes a whole-chain information traceability management system for traditional Chinese medicine, including the following modules:
[0028] The dynamic delay parameter acquisition module uses the hash value of the initial batch identifier of Chinese medicine and the material control standard data of medicine as a seed. Through the anti-collusion multi-party computation protocol, it generates a shared RSA public modulus N through interaction among n initialization nodes. It extracts the timestamp, height and node risk level assessed based on the current transaction data of the previous on-chain block, and calculates the dynamic delay parameter T through a nonlinear mapping function.
[0029] The hash operation module performs a hash operation on the delayed output of the previous block and the Merkle root of the current block to be added to the chain to obtain the input value x; the common modulus N, the dynamic delay parameter T, and the input value x are input into the verifiable delay function to obtain the delayed output y of the current block and the proof π of the verifiable calculation process; where the input x of the genesis block is the Merkle root of the genesis block itself;
[0030] The signature generation module encodes and segments the proof π based on erasure coding, and distributes it along with the delayed output y to multiple regulatory consensus nodes. After each node verifies the validity of the received proof fragment locally, it uses a certificateless threshold signature algorithm based on bilinear pairing to sign the data digest containing the delayed output y of the current block and the Merkle root, generating its own partial signature.
[0031] The block signature reconstruction module, after collecting a preset threshold number of valid partial signatures, reconstructs the complete block signature using Lagrange coefficients, and records the block signature, along with the delayed output y and the proof π, in the current block to complete the on-chain process.
[0032] Preferably, the step of using the hash value of the initial batch identifier of traditional Chinese medicine and the material control standard data of the medicine as a seed, and generating a shared RSA common modulus N among n initialization nodes through an anti-collusion multi-party computation protocol, includes:
[0033] The UTF-8 encoding of the initial batch identifier of Chinese medicine is concatenated with the SHA-256 hash value of the material control standard data file of the medicine to form a seed of fixed length;
[0034] Each initialization node generates a large prime number based on the seed and its own private random number;
[0035] Each node executes a secure multiplication protocol to jointly calculate the product of the prime numbers generated by all nodes without revealing their own prime numbers, which serves as the shared RSA common modulus N.
[0036] Preferably, the calculation of the dynamic delay parameter T through the nonlinear mapping function includes:
[0037] The node risk level r is defined as the ratio of the number of rejected transactions submitted by the node in the past preset period to the total number of submitted transactions, and the value of r ranges from [0,1].
[0038] The delay parameter T is calculated using the following function: ,in The base delay iteration count, where h is the height of the previous block. As a risk weighting factor, This is a risk sensitivity index.
[0039] Preferably, the step of distributing the proof π, after being encoded and segmented based on erasure coding, along with the delayed output y, to multiple regulatory consensus nodes includes:
[0040] The proof of the verifiable delay function π is treated as a byte sequence and encoded using Reed-Solomon codes, with the encoding parameters set as follows. Where m is the total number of regulatory consensus nodes, k is the minimum number of shards required for the reconstruction proof, and t is the minimum number of signatures required for a threshold signature;
[0041] The proof of π is divided into k data blocks, generating mk verification blocks, forming a total of m encoded fragments;
[0042] The m encoded fragments are distributed one-to-one to the m regulatory consensus nodes.
[0043] Preferably, the step of employing a certificateless threshold signature algorithm based on bilinear pairing to sign the data digest containing the delayed output y of the current block and the Merkle root, generating their respective partial signatures, includes:
[0044] Each regulatory consensus node obtains a partial private key based on its node identity from the key generation center, and each independently generates a secret value. The two are combined to form a complete signature private key.
[0045] The node uses its complete signing private key to sign the data digest based on the BLS12-381 curve, generating a point on the elliptic curve as a partial signature. .
[0046] Preferably, the step of reconstructing the complete block signature using Lagrange coefficients includes:
[0047] The signature aggregation node collects valid partial signatures from t different regulatory consensus nodes. Then, each signature and its corresponding node index are used to construct t points. ;
[0048] After the aggregation node collects t partial signatures, it calculates the corresponding Lagrange coefficients. ;
[0049] Through weighted summation, that is The complete block signature obtained .
[0050] Preferably, the data digest further includes the hash value of the previous block and the timestamp of the current block.
[0051] This invention generates a VDF public modulus through an anti-collusion multi-party computation protocol, reducing reliance on trusted settings and ensuring the fairness of leader election and the underlying security of the system. Furthermore, the certificateless threshold signature scheme not only reduces reliance on Certificate Authorities (CAs), mitigating single points of failure and key escrow risks, but also reduces the communication and storage burden when large-scale regulatory nodes participate in consensus through efficient signature aggregation and erasure coding-based proof distribution. This enhances security and decentralization while achieving more efficient traceability management of the entire traditional Chinese medicine supply chain. Attached Figure Description
[0052] Figure 1 A flowchart of a specific embodiment;
[0053] Figure 2 A schematic diagram illustrating the process of traceability and registration for entry into the planting stage;
[0054] Figure 3 This is a diagram illustrating planting traceability information that is currently being registered.
[0055] Figure 4 This is an illustration of the planting traceability registration page.
[0056] Figure 5 A schematic diagram for generating the shared RSA modulus N;
[0057] Figure 6 This is a schematic diagram illustrating the calculation of the dynamic delay parameter T;
[0058] Figure 7 This is a schematic diagram illustrating the association between VDF calculation and block data;
[0059] Figure 8 This is a schematic diagram of signature aggregation and block on-chaining. Detailed Implementation
[0060] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of them. All other embodiments obtained by those skilled in the art based on the embodiments of this application without creative effort are within the scope of protection of this application.
[0061] In one embodiment, the present invention proposes a method for information-based traceability management of the entire chain of traditional Chinese medicine, such as... Figure 1 As shown, it includes the following steps:
[0062] S1 uses the hash value of the initial batch identifier of Chinese medicine and the material control standard data of medicine as a seed, and generates a shared RSA common modulus N through interaction among n initialization nodes through an anti-collusion multi-party computation protocol; for the current traceability link, the timestamp, height and node risk level assessed based on the current transaction data of the previous blockchain block are extracted, and the dynamic delay parameter T is calculated through a nonlinear mapping function.
[0063] The traceability management of Chinese medicinal materials includes the processes of planting, production, and sales. Complete traceability covers all of these processes, and each process includes multiple sub-stages. Figure 2 This is a schematic diagram of the "sowing" stage of the planting traceability registration process. Figure 3 This is an illustration of a list of planting traceability projects currently being registered. "Registered" indicates that the project is under review and / or awaiting addition to the blockchain. Users can fill in registration information or upload files, such as... Figure 4 As shown. n entities, such as medicinal herb suppliers, processing enterprises, and quality inspection agencies, are selected as initialization nodes. For example, batch number ZYC202401 of American ginseng is used as the initial batch identifier. The quality control standard data files for pesticide residues, heavy metal content, etc., of the American ginseng are hashed using SHA256, and the result is used as a public seed. All nodes execute the Boneh-Franklin anti-collusion RSA key generation protocol based on this seed, such as... Figure 5 As shown, each node generates a secret pair of prime numbers locally. Through multiple rounds of interactive computation, they collectively generate a common modulus N shared by all nodes. The two large prime factors p and q that constitute N remain unknown to any single node or fewer than a preset number of colluding nodes. In one embodiment, the common modulus N is updated periodically.
[0064] The timestamp of the previous block is obtained from the blockchain, for example, 1704038400, and the height is for example, 50000. Based on the historical behavior of the nodes involved in the current transaction, such as transaction frequency, amount, and whether there are any bad records, the risk level R of the node is calculated through a preset weighted scoring model, ranging from 1 to 5. Substituting this into a non-linear mapping function T, for example, T = base latency + α times the block interval duration + β times the logarithm of the height + γ times the square of the risk level, where α, β, and γ are system adjustment coefficients, the final latency parameter T is calculated. Figure 6 As shown, the difficulty of achieving latency varies with network conditions and security posture.
[0065] S2, perform a hash operation on the delayed output of the previous block and the Merkle root of the current block to be added to the chain to obtain the input value x; input the common modulus N, the dynamic delay parameter T and the input value x into the verifiable delay function to obtain the delayed output y of the current block and the proof π of the verifiable calculation process; where the input x of the genesis block is the Merkle root of the genesis block itself;
[0066] Delay the output of the previous block Merkle root generated from all transactions in the current block The input value x is generated by concatenating the elements and using the SHA256 hash algorithm; then, T consecutive modulo-square operations are performed. , until the result is calculated. During this calculation, the Wesolowski proof scheme is used simultaneously to generate a compact proof of π, such as... Figure 7 As shown, it is proven that π enables verifiers to quickly verify that y is indeed the correct result obtained by x through T iterations with a complexity of far less than T operations.
[0067] S3, after the proof π is encoded and segmented based on erasure coding, it is distributed to multiple regulatory consensus nodes along with the delayed output y; after each node verifies the validity of the received proof fragment locally, it uses a certificateless threshold signature algorithm based on bilinear pairing to sign the data digest containing the delayed output y of the current block and the Merkle root, generating its own partial signature.
[0068] The proof π is encoded into m data fragments using Reed-Solomon erasure coding and distributed to m different supervisory consensus nodes. The encoding scheme ensures that the complete proof π can be recovered from any k fragments. Each supervisory node reconstructs the complete proof π after collecting at least k fragments and uses the complete proof π to verify the correctness of the delayed output y. After successful verification, the node compares y with the Merkle root of the current block. After concatenation, a SHA256 hash value is calculated as the data digest. The BLS certificateless threshold signature algorithm is then used, with each fragment using its own private key to sign the data digest, generating a unique partial signature. Verifying the validity of the received proof fragment includes, but is not limited to, verifying the reliability of the fragment's source and / or the correctness of the fragment's signature, i.e., verifying that the fragment originates from a legitimate node.
[0069] S4. After collecting a number of valid partial signatures that reach the preset threshold t, the complete block signature is reconstructed using the Lagrange coefficients. The block signature, along with the delayed output y and the proof π, is then recorded in the current block to complete the on-chain process.
[0070] The block proposal node is responsible for collecting partial signatures broadcast in the network. After collecting t valid partial signatures from different nodes, it uses these signatures and the public information of the corresponding signing nodes to calculate on the exponent using Lagrange interpolation, and then aggregates and reconstructs a single and valid complete block signature. ; This complete signature The delayed output y and the complete verifiable proof π are packaged together into a specific field of the new block. After verification, the block is linked to the blockchain, completing a secure and reliable process of putting traceability information on the chain.
[0071] In an optional embodiment, the step of using the hash value of the initial batch identifier of traditional Chinese medicine and the material control standard data of the medicine as a seed, and generating a shared RSA common modulus N among n initialization nodes through an anti-collusion multi-party computation protocol, includes:
[0072] The UTF-8 encoding of the initial batch identifier of Chinese medicine is concatenated with the SHA-256 hash value of the material control standard data file of the medicine to form a seed of fixed length;
[0073] Each initialization node generates a large prime number based on the seed and its own private random number;
[0074] Each node executes a secure multiplication protocol to jointly calculate the product of the prime numbers generated by all nodes without revealing their own prime numbers, which serves as the shared RSA common modulus N.
[0075] Assume three initialization nodes participate in the generation process. The initial batch identifier for the traditional Chinese medicine is ZYYP20240520A01, with a corresponding UTF-8 byte sequence of B1. The material control standard data file is a PDF document containing testing items and indicators, with a SHA-256 hash value of H1. B1 and H1 are concatenated sequentially to form a unified seed S. Seed S is public and consistent for all participating nodes, ensuring a deterministic starting point for the prime number generation process and binding it to the specific batch and standard of the traditional Chinese medicine.
[0076] Each initialization node, such as node 1, node 2, and node 3, uses the common seed S and a private 32-byte random number, such as R1, R2, and R3, known only to itself, to calculate its own 1024-bit prime numbers P1, P2, and P3 using a deterministic large prime number generation algorithm. These three nodes then initiate a secure multiplication protocol resistant to collusion. Through multiple rounds of encrypted information exchange, they can jointly calculate N as the product of P1, P2, and P3. Throughout this process, no single node can know the prime numbers of the other nodes, ensuring the security of the subsequent verifiable delayed function calculations.
[0077] In an optional embodiment, the dynamic delay parameter is calculated using a nonlinear mapping function. ,include:
[0078] The node risk level r is defined as the ratio of the number of rejected transactions submitted by the node in the past preset period to the total number of submitted transactions, and the value of r ranges from [0,1].
[0079] The delay parameter T is calculated using the following function: ,in The base delay iteration count, where h is the height of the previous block. As a risk weighting factor, This is a risk sensitivity index.
[0080] Assuming a base delay is set For ten million iterations, risk weighting factor Five million, risk sensitivity index The risk level r is 2. The statistical period for the risk level r is the past 1000 blocks. The block currently being processed is number 80001, so the previous block height h was 80000. A well-performing node A has submitted 500 transactions in the past 1000 blocks, of which only 2 were rejected. The risk level r of these transactions is calculated to be 0.004.
[0081] According to the above settings, node A's delay iteration count is approximately 92,432,000. In contrast, a node B with abnormal behavior submitted 100 transactions during the same period, but 30 were rejected, resulting in a risk level r as high as 0.3. Its delay parameter T is approximately 147,225,000, far exceeding that of node A. This increases the block production cost for high-risk nodes, incentivizing all nodes to operate honestly and reliably. It should be noted that the above data is only for illustrating the process of this embodiment; specific data is not limited to the above example. For example, the delay parameter T can be uniformly divided by a certain number, such as 100,000, in which case node A's delay iteration count would be approximately 923. When the delay parameter T is not an integer, it needs to be rounded up or down. Preferably, Here, ceil() means rounding up.
[0082] In an optional embodiment, the step of proving that π is encoded and segmented based on erasure coding, and then distributed to multiple regulatory consensus nodes along with the delayed output y, includes:
[0083] The proof of the verifiable delay function π is treated as a byte sequence and encoded using Reed-Solomon codes, with the encoding parameters set as follows. Where m is the total number of regulatory consensus nodes, k is the minimum number of shards required for the reconstruction proof, and t is the minimum number of signatures required for a threshold signature;
[0084] The proof of π is divided into k data blocks, generating mk verification blocks, forming a total of m encoded fragments;
[0085] The m encoded fragments are distributed one-to-one to the m regulatory consensus nodes.
[0086] Assume the proof π generated by the verifiable delay function is a 1024-byte data. There are m equal to 15 vetting consensus nodes in the network, and the threshold signature scheme requires at least t equal to 10 nodes to participate in the signing. To ensure data availability is consistent with the signature threshold, the reconstruction threshold k of the Reed-Solomon code is also set to 10. Only any 10 fragments are needed to reconstruct the complete proof π.
[0087] The encoding process divides the 1024-byte proof π into k equal to 10 data blocks of size 102.4 bytes each, padding to integers, for example, 103 bytes per block. The encoding algorithm calculates m minus k equal to 5 verification blocks based on these 10 data blocks, each also 103 bytes. For example, this is generated using a polynomial of degree k-1, where the coefficients of the polynomial are k data blocks. This results in 15 encoded fragments. These 15 fragments are distributed one by one to 15 supervisory consensus nodes, with each node holding one. Even if up to 5 nodes go offline due to failure or maliciously fail to provide fragments, the remaining 10 nodes can still aggregate their fragments to successfully reconstruct the original 1024-byte proof π, ensuring that the block verification process is not interrupted by the failure of some nodes.
[0088] In an optional embodiment, the certificateless threshold signature algorithm based on bilinear pairing is used to sign the data digest containing the delayed output y of the current block and the Merkle root, generating their respective partial signatures, including:
[0089] Each regulatory consensus node obtains a partial private key based on its node identity from the key generation center, and each independently generates a secret value. The two are combined to form a complete signature private key.
[0090] The node uses its complete signing private key to sign the data digest based on the BLS12-381 curve, generating a point on the elliptic curve as a partial signature. .
[0091] A regulatory consensus node, with the node's identity ID RegNodeGov007. The Key Generation Center (KGC) uses the node's master key to calculate a portion of the private key bound to the ID. This information is sent to the oversight consensus node via a secure channel. Node RegNodeGov007 generates a random large integer as its secret value. The complete signing private key of the node is obtained by... and Together they constitute, among which Generated by an authoritative institution, By having the nodes control the keys themselves, this mechanism avoids the risk of a single entity having complete control over the keys.
[0092] When a 32-byte data digest M needs to be signed, node RegNodeGov007 uses the node's private key to... and The signature operation is performed on the specific elliptic curve BLS12-381. This maps the data digest M to a point on the curve, performs calculations using the private key information, and generates the result. It is an element on the curve G1 group and can be represented as a 96-byte data. Each other supervisory consensus node in the network that participates in signing independently executes the same process, using its own full private key to generate its own unique partial signature on the same data digest M.
[0093] In an optional embodiment, reconstructing the complete block signature using Lagrange coefficients includes:
[0094] The signature aggregation node collects valid partial signatures from t different regulatory consensus nodes. Then, each signature and its corresponding node index are used to construct t points. ;
[0095] After the aggregation node collects t partial signatures, it calculates the corresponding Lagrange coefficients. ;
[0096] Through weighted summation, that is The complete block signature obtained .
[0097] Assuming the signature threshold t is 10, a block proposal node, acting as a signature aggregator, successfully collects partial signatures from ten custodian consensus nodes at indices 1, 2, 3, 5, 6, 7, 8, 10, 11, and 12. These partial signatures are... , , , Ten elliptic curve points, such as Figure 8 As shown. The aggregator pairs these signatures with their indices, forming 10 data points; for example, point 1 is... Point 2 is And so on. For each index i in the set S={1,2,3,5,6,7,8,10,11,12}, calculate a corresponding Lagrange coefficient. This coefficient represents the weight of node i when interpolating at point 0. It is used to obtain the Lagrange coefficients. and partial signatures Then, the complete block signature can be obtained according to the formula above. Furthermore, during verification, it is not necessary to know which 10 nodes participated in the signing.
[0098] In an optional embodiment, the data digest may also include the hash of the previous block and the timestamp of the current block.
[0099] When constructing a new block, such as a block with a height of 58888, the generation of the block's data digest consists of three core parts. The first part is the Merkle root hash calculated from all transactions within the current block, for example, a 32-byte hash with a value of 0x1a2b3c... The second part is the overall hash value of its parent block, i.e., the block with a height of 58887, for example, 0x4d5e6f... The third part is the Unix timestamp generated when the current block was proposed, for example, 1678886400.
[0100] These three pieces of data—the Merkle root hash, the previous block hash, and the timestamp—are concatenated into a long byte string in a predefined order. A SHA-256 hash operation is then performed on this concatenated string to generate a 32-byte data digest. This data digest is the object that the oversight consensus nodes sign. Including the previous block hash achieves chain-locking of the entire historical ledger, ensuring tamper-proof characteristics. Including the timestamp provides definitive time-series information for the blocks, preventing replay attacks and other problems.
[0101] As can be seen from the above description of the embodiments, those skilled in the art can clearly understand that this application can be implemented by means of software plus necessary general-purpose hardware platforms. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in various embodiments or some parts of the embodiments of this application.
[0102] The various embodiments in this specification are described in a progressive manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, for system or system embodiments, since they are basically similar to method embodiments, the description is relatively simple, and relevant parts can be referred to the descriptions in the method embodiments. The systems and system embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without creative effort.
[0103] The method and electronic device for providing product object information provided in this application have been described in detail above. Specific examples have been used to illustrate the principles and implementation methods of this application. The descriptions of the above embodiments are only for the purpose of helping to understand the method and its core ideas. Furthermore, those skilled in the art will recognize that, based on the ideas of this application, there will be changes in the specific implementation methods and application scope. Therefore, the content of this specification should not be construed as a limitation of this application.
Claims
1. A method for information-based traceability management of the entire chain of traditional Chinese medicine, characterized in that, Includes the following steps: Using the hash value of the initial batch identifier of Chinese medicine and the material control standard data of the medicine as a seed, a shared RSA common modulus N is generated among n initialization nodes through an anti-collusion multi-party computation protocol; for the current traceability link, the timestamp, height of the previous blockchain block and the node risk level assessed based on the current transaction data are extracted, and the dynamic delay parameter T is calculated through a nonlinear mapping function. The delayed output of the previous block is hashed with the Merkle root of the current block to be added to the chain to obtain the input value x; the common modulus N, the dynamic delay parameter T, and the input value x are input into the verifiable delay function to obtain the delayed output y of the current block and the proof π of the verifiable calculation process; where the input x of the genesis block is the Merkle root of the genesis block itself; After the proof π is encoded and segmented based on erasure coding, it is distributed to multiple regulatory consensus nodes along with the delayed output y. After each node verifies the validity of the received proof fragment locally, it uses a certificateless threshold signature algorithm based on bilinear pairing to sign the data digest containing the delayed output y of the current block and the Merkle root, generating its own partial signature. Once a number of valid partial signatures reaching a preset threshold t are collected, the complete block signature is reconstructed using Lagrange coefficients. The block signature, along with the delayed output y and the proof π, is then recorded in the current block to complete the on-chain process.
2. The method according to claim 1, characterized in that, The process of using the hash value of the initial batch identifier of traditional Chinese medicine and the material control standard data as a seed, and generating a shared RSA common modulus N among n initialization nodes through an anti-collusion multi-party computation protocol, includes: The UTF-8 encoding of the initial batch identifier of Chinese medicine is concatenated with the SHA-256 hash value of the material control standard data file of the medicine to form a seed of fixed length; Each initialization node generates a large prime number based on the seed and its own private random number; Each node executes a secure multiplication protocol to jointly calculate the product of the prime numbers generated by all nodes without revealing their own prime numbers, and uses this product as the shared RSA common modulus N. 。 3. The method according to claim 1, characterized in that, The calculation of the dynamic delay parameter T through a nonlinear mapping function includes: The node risk level r is defined as the ratio of the number of rejected transactions submitted by the node in the past preset period to the total number of submitted transactions, and the value of r ranges from [0,1]. The delay parameter T is calculated using the following function: ,in The base delay iteration count, where h is the height of the previous block. As a risk weighting factor, This is a risk sensitivity index.
4. The method according to claim 1, characterized in that, The process of proving that π is encoded and segmented based on erasure coding, along with the delayed output y, is distributed to multiple regulatory consensus nodes, includes: The proof π of the verifiable delay function is treated as a byte sequence and encoded using Reed-Solomon codes. The encoding parameters are set to (k, m), where m is the total number of supervisory consensus nodes, and k is the minimum number of shards required to reconstruct the proof. t is the minimum number of signatures required for a threshold signature; The proof of π is divided into k data blocks, generating mk verification blocks, forming a total of m encoded fragments; The m encoded fragments are distributed one-to-one to the m regulatory consensus nodes.
5. The method according to claim 1, characterized in that, The algorithm employs a certificateless threshold signature based on bilinear pairing to sign the data digest containing the delayed output y of the current block and the Merkle root, generating their respective partial signatures, including: Each regulatory consensus node obtains a partial private key based on its node identity from the key generation center, and each independently generates a secret value. The two are combined to form a complete signature private key. The node uses its complete signing private key to sign the data digest based on the BLS12-381 curve, generating a point on the elliptic curve as a partial signature. .
6. The method according to claim 1, characterized in that, The process of reconstructing the complete block signature using Lagrange coefficients includes: The signature aggregation node collects valid partial signatures from t different regulatory consensus nodes. Then, each signature and its corresponding node index are used to construct t points. ; After the aggregation node collects t partial signatures, it calculates the corresponding Lagrange coefficients. ; Through weighted summation, that is The complete block signature obtained .
7. The method according to claim 1 or 5, characterized in that, The data digest also includes the hash value of the previous block and the timestamp of the current block.
8. A comprehensive information-based traceability management system for traditional Chinese medicine, characterized in that, Includes the following modules: The dynamic delay parameter acquisition module uses the hash value of the initial batch identifier of traditional Chinese medicine and the material control standard data of the medicine as a seed, and generates a shared RSA common modulus N through interaction among n initialization nodes via an anti-collusion multi-party computation protocol; for the current traceability link, it extracts the timestamp, height of the previous blockchain block and the node risk level assessed based on the current transaction data, and calculates the dynamic delay parameter T through a nonlinear mapping function. The hash operation module performs a hash operation on the delayed output of the previous block and the Merkle root of the current block to be added to the chain to obtain the input value x; the common modulus N, the dynamic delay parameter T, and the input value x are input into the verifiable delay function to obtain the delayed output y of the current block and the proof π of the verifiable calculation process; where the input x of the genesis block is the Merkle root of the genesis block itself; The signature generation module encodes and segments the proof π based on erasure coding, and distributes it along with the delayed output y to multiple regulatory consensus nodes. After each node verifies the validity of the received proof fragment locally, it uses a certificateless threshold signature algorithm based on bilinear pairing to sign the data digest containing the delayed output y of the current block and the Merkle root, generating its own partial signature. The block signature reconstruction module, after collecting a preset threshold number of valid partial signatures, reconstructs the complete block signature using Lagrange coefficients, and records the block signature, along with the delayed output y and the proof π, in the current block to complete the on-chain process.
9. The system according to claim 8, characterized in that, The process of using the hash value of the initial batch identifier of traditional Chinese medicine and the material control standard data as a seed, and generating a shared RSA common modulus N among n initialization nodes through an anti-collusion multi-party computation protocol, includes: The UTF-8 encoding of the initial batch identifier of Chinese medicine is concatenated with the SHA-256 hash value of the material control standard data file of the medicine to form a seed of fixed length; Each initialization node generates a large prime number based on the seed and its own private random number; Each node executes a secure multiplication protocol to jointly calculate the product of the prime numbers generated by all nodes without revealing their own prime numbers, which serves as the shared RSA common modulus N.
10. The system according to claim 8, characterized in that, The calculation of the dynamic delay parameter T through a nonlinear mapping function includes: Define node risk level This is the ratio of the number of rejected transactions submitted by a node in the past preset period to the total number of submitted transactions. The value range is [0,1]; The delay parameter T is calculated using the following function: ,in The base delay iteration count, where h is the height of the previous block. As a risk weighting factor, This is a risk sensitivity index.
Citation Information
Patent Citations
Cloud storage key security management method based on block chain
CN112906056A
Method based on cross-chain data traceability
CN119006015A