An optimization method for controllable anonymity of a blockchain smart contract
By employing hierarchical hashing, quantum annealing, threshold secret sharing protocol, and a three-layer GPU-accelerated architecture, combined with greedy coloring algorithm and bilinear pairing batch processing, the signature verification process of blockchain smart contracts is optimized, solving the problem of low efficiency in batch signature verification and achieving a low-cost, efficient, and controllable anonymity mechanism.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2026-02-02
- Publication Date
- 2026-04-07
AI Technical Summary
When blockchain smart contracts achieve controlled anonymity, the low efficiency of batch signature verification leads to excessively high on-chain computation costs, becoming a bottleneck in system performance.
By employing hierarchical hashing, quantum annealing, threshold secret sharing protocol, and a three-layer GPU-accelerated architecture, combined with greedy coloring algorithm and bilinear pairing batch processing, the signature verification process is optimized, enabling parallel computing and graph theory problem-solving.
It significantly reduces the gas consumption of a single transaction, improves the transaction processing capacity of the blockchain network, meets the needs of large-scale commercial scenarios, and maintains decentralization and security.
Smart Images

Figure CN121619175B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of blockchain smart contract technology, and specifically relates to an optimization method for controllable anonymity in blockchain smart contracts. Background Technology
[0002] In controlled anonymity applications of blockchain smart contracts, users need to allow regulatory agencies to trace their true identities while protecting their privacy. Traditional methods use identity-based cryptographic algorithms to independently verify each transaction signature and upload the identity hash value to the blockchain to achieve a balance between anonymity and traceability. However, in high-concurrency scenarios, smart contracts need to handle a large number of signature verification requests. The traditional one-to-one verification method requires each signature to undergo a complete bilinear pairing operation, which has extremely high computational complexity, resulting in gas consumption of millions per transaction. This on-chain identity authentication cost is unaffordable for ordinary users, and the transaction processing capacity of the blockchain network is severely limited, becoming a system performance bottleneck. In other words, existing technologies suffer from the technical problem of low efficiency in batch signature verification when achieving controlled anonymity in blockchain smart contracts, leading to excessively high on-chain computational costs. Summary of the Invention
[0003] In view of this, the present invention provides an optimized method for controllable anonymity of blockchain smart contracts, which can solve the technical problem in the prior art where the low efficiency of batch signature verification in blockchain smart contracts when achieving controllable anonymity leads to excessively high on-chain computing costs.
[0004] This invention is implemented as follows: It provides an optimized method for controllable anonymity of blockchain smart contracts, including: users registering with a distributed key generation center and completing identity verification through facial recognition; performing layered hashing on user identity information to generate a second-layer hash ciphertext; initiating a quantum annealing algorithm to detect hash collisions and, upon detection, adding salt perturbation through simulated annealing until the collision probability drops below a security threshold; initiating a three-layer GPU-accelerated architecture to execute a threshold secret sharing protocol to split the master private key into master private key fragments and distribute them to multiple nodes; reconstructing the complete master private key based on the collected master private key fragments; generating user private keys using an identity-identifying cryptographic algorithm based on the second-layer hash ciphertext; storing the correspondence between the original user identity information and the second-layer hash ciphertext in a regulatory center database; users signing smart contract call parameters using their private keys and sending the results to the blockchain network; blockchain nodes extracting all signatures from the transaction to construct a dependency graph and using a greedy coloring algorithm to color and group them into parallel verification groups; performing parallel verification on the signatures in each parallel verification group using bilinear pairing batch processing; and the regulatory user retrieving the original user identity information through the second-layer hash ciphertext.
[0005] The process of a user registering with a distributed key generation center involves the user submitting a registration request to the gateway of the distributed key generation center. The gateway then uses a verifiable random function to generate a random output and a verification certificate, performs a modulo operation on the random output to obtain the target key generation center's serial number, and forwards the registration request and verification certificate to the key generation center with the corresponding serial number.
[0006] The verifiable random function refers to the use of a private key to operate on an input seed to generate a random output and verification proof. Any third party holding the public key can verify the correctness of the random output but cannot predict or manipulate the result, thus ensuring the fairness and resistance to manipulation in the selection of the key generation center.
[0007] Specifically, the steps for completing identity verification through the face authentication service involve the target key generation center using the gateway's public key to verify the proof. After successful verification, the registration request is forwarded to the face authentication service, which then returns the user's identity information after completing the identity verification.
[0008] The layered hashing process refers to first using a fast hashing algorithm to generate a first-layer hash ciphertext, and then using a quantum-resistant hashing algorithm to generate a second-layer hash ciphertext. The first layer uses the BLAKE3 algorithm to provide high hash throughput, and the second layer uses a quantum-resistant hashing algorithm based on SPHINCS+ to ensure security strength under the threat of quantum computing.
[0009] Specifically, the step of the quantum annealing algorithm for detecting hash collisions involves transforming the collision problem into a quadratic unconstrained binary optimization problem when a hash collision is detected, constructing a binary perturbation variable vector and a perturbation weight matrix, adding salt perturbation to the user identity information through simulated annealing algorithm and rehashing, and iteratively searching until the collision probability drops below the safety threshold.
[0010] The first layer of the three-layer GPU acceleration architecture, the GPU thread grid, refers to the execution of the threshold secret sharing protocol to split the master private key into master private key fragments and distribute them to multiple key generation center nodes, generating fragment coordinate caches for subsequent reconstruction. The fragment coordinate cache is a contiguous memory region allocated in the GPU video memory that uses a structure array layout to store the master private key fragment coordinates.
[0011] The threshold secret sharing protocol refers to splitting the master private key into n master private key fragments and distributing them to each key generation center node. Only t nodes need to cooperate to reconstruct the complete master private key. The Shamir secret sharing scheme is used to construct a polynomial of degree t minus 1, with the constant term being the master private key. During reconstruction, the Lagrange interpolation formula is used to recover the master private key.
[0012] The second layer of the three-layer GPU acceleration architecture, the GPU thread grid, refers to reading the master private key shard coordinates from the shard coordinate cache of the first layer GPU thread grid, reconstructing the complete master private key based on the collected master private key shards and storing it in the master private key reconstruction cache, and accessing the shard coordinate cache through the shard coordinate cache pointer to realize direct data access in the GPU memory.
[0013] The third layer of the three-layer GPU acceleration architecture, namely the GPU thread grid, refers to reading the complete master private key from the master private key reconstruction cache, generating the user private key based on the second-layer hash ciphertext using the identity identification cryptography algorithm, mapping the second-layer hash ciphertext to points on the elliptic curve, and performing a point multiplication operation with the complete master private key to generate the user private key.
[0014] The identity identification cryptographic algorithm refers to the use of the national cryptographic SM9 algorithm to generate a public-private key pair based on user identity information. The key generation center holds the master private key and the master public key. The user identity identifier is hashed and mapped to a point on an elliptic curve. The user private key is calculated as the point product of the master private key and that point.
[0015] The specific steps for constructing the dependency graph are as follows: after receiving a transaction, the blockchain node extracts all the signatures in the transaction to construct the dependency graph. The signatures are used as nodes in the dependency graph, and the mathematical relationships between the signatures are used as edges in the dependency graph. If two signatures use the same public key or have common items in the pairing operation, then an edge is established to connect the corresponding nodes in the dependency graph.
[0016] The greedy coloring algorithm refers to assigning the smallest color number that does not conflict with adjacent dependency graph nodes to each dependency graph node, starting from the dependency graph node with the largest degree. After coloring, dependency graph nodes with the same color represent parallel verification groups, and the number of colors is the minimum number of parallel batches required.
[0017] The bilinear pairing batch processing refers to using the bilinear property of pairing operations to merge the pairing operations of multiple signatures in the same parallel verification group into a single calculation, summing multiple elliptic curve points separately and then performing pairing operations, and using the bilinear property to verify whether the chain multiplication equation is true.
[0018] In the bilinear pairing batch processing verification process, the intermediate results of elliptic curve point addition operations are stored in the GPU shared memory pointer. The first-layer GPU thread grid reads the intermediate results of elliptic curve point addition operations from the GPU shared memory pointer and allocates them to multiple GPU thread blocks for parallel point addition calculations. The second-layer GPU thread grid collects the point addition calculation results and stores them in the pairing operation accumulation cache. The third-layer GPU thread grid reads the accumulated point pairs from the pairing operation accumulation cache and performs the final pairing operation to complete the batch verification.
[0019] The regulatory center database refers to a database that stores the mapping relationship between the original user identity information and the second-level hash ciphertext using a key-value pair structure. The key is the second-level hash ciphertext, and the value is the encrypted form of the original user identity information. The original user identity information is encrypted using the AES-256 algorithm, and regulatory personnel can retrieve the corresponding original user identity information after multi-factor authentication.
[0020] This invention constructs a dependency graph to represent the mathematical relationships between signatures, uses a greedy coloring algorithm to group unrelated signatures into parallel verification groups, and leverages bilinear pairing batch processing to merge the pairing operations of multiple signatures within the same group into a single computation, significantly reducing computational complexity. This method maps signature relationships to a graph theory problem, avoiding the computational resource contention caused by traditional random grouping. The greedy coloring algorithm guarantees finding a near-optimal coloring scheme in polynomial time to maximize parallelism. Simultaneously, a three-layer GPU-accelerated architecture decomposes elliptic curve point addition operations into parallel processing at different levels, achieving efficient data transfer between layers through GPU shared memory pointers and pairing operation accumulation caches, eliminating data transmission bottlenecks. In summary, this invention solves the technical problem mentioned in the background art: the low efficiency of batch signature verification in blockchain smart contracts when achieving controllable anonymity, leading to excessively high on-chain computation costs. Attached Figure Description
[0021] Figure 1 This is a flowchart of the method of the present invention.
[0022] Figure 2 This is a graph showing the change in collision probability and annealing temperature during the iteration process of the quantum annealing algorithm.
[0023] Figure 3 A bar chart showing the degree distribution of nodes in the dependency graph and the results of greedy coloring grouping. Detailed Implementation
[0024] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below.
[0025] like Figure 1 The diagram shown is a flowchart of an optimized method for controllable anonymity of blockchain smart contracts provided by this invention. This method includes the following steps:
[0026] S01. The user submits a registration request to the gateway of the distributed key generation center. The gateway uses a verifiable random function to generate a random output and a verification certificate, performs a modulo operation on the random output to obtain the target key generation center serial number, and forwards the registration request and verification certificate to the key generation center with the corresponding serial number.
[0027] S02. The target key generation center uses the gateway public key to verify the verification certificate. After the verification is successful, the registration request is forwarded to the face authentication service. After the face authentication service completes the identity verification, it returns the user's identity information.
[0028] S03. The target key generation center performs layered hashing on the user identity information. First, it uses a fast hashing algorithm to generate the first layer of hash ciphertext. Then, it uses a quantum-resistant hashing algorithm to generate the second layer of hash ciphertext and starts a quantum annealing algorithm to detect hash collisions.
[0029] S04. When a hash collision is detected, the collision problem is transformed into a quadratic unconstrained binary optimization problem. A binary perturbation variable vector and a perturbation weight matrix are constructed. The user identity information is added with salt perturbation and rehashed using the simulated annealing algorithm. The search is iterated until the collision probability drops below the safety threshold. If no collision is detected, the process proceeds directly to the next step.
[0030] S05. The target key generation center initiates a three-layer GPU-accelerated architecture. The first-layer GPU thread grid executes a threshold secret sharing protocol, splits the master private key into master private key fragments, and distributes them to multiple key generation center nodes, generating fragment coordinate caches for subsequent reconstruction. The second-layer GPU thread grid reads the master private key fragment coordinates from the fragment coordinate cache of the first-layer GPU thread grid, reconstructs the complete master private key based on the collected master private key fragments, and stores it in the master private key reconstruction cache. The third-layer GPU thread grid reads the complete master private key from the master private key reconstruction cache and uses an identity identification cryptographic algorithm to generate a user private key based on the second-layer hash ciphertext.
[0031] S06. The target key generation center stores the correspondence between the original user identity information and the second-layer hash ciphertext in the supervision center database, and returns the user's private key and the second-layer hash ciphertext to the user through a secure channel.
[0032] S07. The user signs the smart contract call parameters using the user's private key and sends the smart contract call parameters, the second-layer hash ciphertext, and the signature to the blockchain network.
[0033] S08. After receiving a transaction, the blockchain node extracts all signatures from the transaction to construct a dependency graph. The signatures are used as nodes in the dependency graph, and the mathematical relationships between signatures are used as edges in the dependency graph. A greedy coloring algorithm is used to color the dependency graph. Nodes of the same color are grouped together to form a parallel verification group.
[0034] S09. Signatures in each parallel verification group are verified in parallel using bilinear pairing batch processing. The pairing operations of signatures in the same parallel verification group are merged into a single calculation. During the verification process, the intermediate results of the elliptic curve point addition operation of the bilinear pairing batch processing are stored in the GPU shared memory pointer. The first-layer GPU thread grid reads the intermediate results of the elliptic curve point addition operation from the GPU shared memory pointer and distributes them to multiple GPU thread blocks for parallel point addition calculation. The second-layer GPU thread grid collects the point addition calculation results of the first-layer GPU thread grid and stores them in the pairing operation accumulation cache. The third-layer GPU thread grid reads the accumulated point pairs from the pairing operation accumulation cache and performs the final pairing operation to complete the batch verification. After the verification is passed, the smart contract business logic is executed and the transaction is completed and put on the chain.
[0035] S10. When a user queries a transaction, the system extracts the second-layer hash ciphertext from the transaction parameters, retrieves the corresponding original user identity information from the regulatory center database, and completes the real-name identity verification.
[0036] Among them, the verifiable random function is used to achieve unpredictable and verifiable random allocation in the distributed key generation center network. Its generation process includes using the private key to operate on the input seed to generate random output and verification proof. Any third party holding the public key can verify the correctness of the random output but cannot predict or manipulate the result, thus ensuring the fairness and resistance to manipulation in the selection of the key generation center.
[0037] Layered hashing is a hybrid encryption architecture that combines high-speed computation with long-term security. The first layer uses the BLAKE3 algorithm to provide a hash throughput of millions of hashes per second for high-frequency authentication scenarios, meeting the performance requirements of large-scale user registration. The second layer uses a SPHINCS-based approach. The quantum-resistant hash algorithm performs secondary encryption on the first-layer hash ciphertext, ensuring a security strength of more than 256 bits even under the threat of quantum computing. The layered hashing process achieves an optimized balance between computational efficiency and security level in a GPU parallel computing environment.
[0038] Quantum annealing is an optimization algorithm that draws inspiration from the tunneling effect in quantum mechanics. When hash collisions occur, it models the conflict resolution problem as a quadratic unconstrained binary optimization problem seeking the minimum perturbation. The objective energy function is expressed as follows: [The algorithm then describes a process where the first binary perturbation variable is selected from the first binary perturbation variable vector.] The elements are denoted as The perturbation weight matrix will be the first... Line number Column elements are denoted as Target energy The dimensionless expression is a double summation of the products of the elements of each binary perturbation variable vector and the elements of the perturbation weight matrix, where A value of 0 or 1 indicates whether the first or second value is specified. Add perturbation to bit information The dimensionless coefficients in the perturbation weight matrix, reflecting the perturbation cost, are used to search for the global optimum in the solution space using simulated annealing. The initial temperature... Set to 100, annealing coefficient Set to 0.95, the temperature update formula is to... The temperature of the next iteration is expressed as the annealing coefficient and the... The product of the temperatures of each iteration, when the temperature is below the termination temperature. The iteration stops when the value is 0.01, representing the probability of accepting a new solution. The dimensionless expression is a natural exponential function, with the exponential term being the energy difference. Divide by Boltzmann constant With current temperature The negative value of the product, where The energy difference between the new and old solutions. With the Boltzmann constant set to 1, the quantum annealing algorithm, compared to the traditional brute-force rehashing method, can find an effective collision resolution scheme in the high-dimensional identity information space with fewer iterations, significantly reducing the impact of hash collisions on system performance, ensuring that each user's identity information is mapped to a unique second-level hash ciphertext, and avoiding identity confusion or authentication failure caused by collisions.
[0039] Threshold secret sharing is a cryptographic method that divides a secret into multiple fragments, splitting the identity cryptographic master private key into... The master private key is fragmented and distributed to each key generation center node, requiring only The complete master private key can be reconstructed through the collaboration of individual nodes for signing operations. The threshold value is usually set to Using the Shamir secret sharing scheme, construct A polynomial of degree 1 can be expressed as a constant term plus the coefficient of the first term multiplied by the independent variable and added to the first term. The coefficient of the secondary term multiplied by the independent variable The power is given by the constant term being the master private key, and the coefficient of the first term is randomly selected up to the power. The coefficient of the secondary term is calculated. The private key fragment is set to an independent variable ranging from 1 to 1. The polynomial function value at time 0 is used to reconstruct the master private key using the Lagrange interpolation formula, which expresses the function value when the independent variable is 0 as follows: The weighted sum of function values at known points, with weights calculated as the product of the x-coordinates of all points except the current point divided by the product of the differences between their x-coordinates. Combined with Byzantine fault-tolerant consensus, this ensures the system can still generate keys even if some nodes fail or act maliciously. Erasure coding further enhances the fragmentation fault tolerance capability, allowing for a maximum loss of [missing information - likely a number]. The master private key is fragmented without affecting key reconstruction. The threshold secret sharing protocol reduces the dependence on a single master private key and improves the decentralization and anti-attack capabilities of the distributed key generation center.
[0040] The three-layer GPU-accelerated architecture is a parallel computing architecture designed for the key generation process. The first layer, the GPU thread grid, contains... Each GPU thread block is responsible for generating the master private key fragment for one key generation central node. It uses CUDA parallel streaming to perform polynomial computations on the threshold secret sharing protocol. Each GPU thread block stores the calculated master private key fragment and its corresponding x-coordinate value into a fragment coordinate cache, which is a contiguous memory region allocated in the GPU memory and stored using a structure array layout. Each master private key shard coordinate occupies 64 bytes, including a 32-byte x-coordinate value and a 32-byte master private key shard value. The second-layer GPU thread mesh is then launched. Each GPU thread performs collaborative computation. Each GPU thread accesses the slice coordinate cache (a 64-bit memory address pointer pointing to the starting address of the slice coordinate cache) to read the master private key slice coordinates. After reading the master private key slice coordinates assigned to it from the slice coordinate cache, each GPU thread performs Lagrange interpolation calculations (numerator and denominator). Intermediate results are exchanged between GPU threads via shared memory, reducing reconstruction time from serial to sequential. Reduced to parallel The second-layer GPU thread grid stores the reconstructed complete master private key into a master private key reconstruction cache, which is a 32-byte contiguous memory area allocated in the GPU memory. The third-layer GPU thread grid calls the national cryptographic SM9 algorithm library to execute the identity identification cryptographic algorithm on the GPU. It reads the complete master private key from the master private key reconstruction cache, maps the second-layer hash ciphertext to points on an elliptic curve, and performs a dot multiplication operation with the complete master private key to generate the user private key. It uses the parallel characteristics of elliptic curve dot multiplication to accelerate the calculation of the user private key. The three-layer GPU acceleration architecture achieves a key generation throughput of thousands of times per second on the Tesla V100 GPU, which is two orders of magnitude higher than the CPU serial processing, meeting the performance requirements of large-scale user simultaneous registration. At the same time, through fine GPU memory management, the three layers share a memory pool to avoid duplicate data transmission and keep the PCIe bandwidth utilization rate below 30%.
[0041] A dependency graph is a directed graph data structure that represents the mathematical relationships between signatures. For a batch of signatures to be verified in a smart contract, if two signatures use the same public key or have common items in pairing operations, then dependency graph edges are established to connect the corresponding dependency graph nodes. The greedy coloring algorithm starts from the dependency graph node with the largest degree and assigns each dependency graph node the minimum color number that does not conflict with the adjacent dependency graph nodes. After coloring, dependency graph nodes with the same color represent parallel verification groups, and the number of colors is the minimum number of parallel batches required.
[0042] Bilinear paired batch processing is a technique that optimizes batch verification by utilizing the bilinear property of paired operations. Verifying a signature using traditional methods requires calculating... The pairing operation will... The elliptic curve point pairs corresponding to each signature are denoted as . and The pairing operation is denoted as The bilinear pairing batch processing method combines the pairing operations into a single calculation. Elliptic curve points Summation notation is ,Will Elliptic curve points Summing and pairing with the aforementioned sums, we use the bilinear property to verify whether the chain multiplication equation holds true, thus reducing the time complexity from... Down to Plus The point addition operation, since elliptic curve point addition is two orders of magnitude faster than pairing operation, the bilinear pairing batch processing can significantly improve verification efficiency. In the smart contract environment, the gas consumption of batch verification of 32 signatures is reduced from 32 million to 4.5 million, which is about 86% of the on-chain computing cost, making transactions requiring identity authentication practical in the public chain environment.
[0043] A GPU shared memory pointer is a memory address pointer that points to the GPU shared memory space. GPU shared memory is a high-speed cache area on the GPU chip, and its access latency is about one percent of that of global memory. During the elliptic curve point addition operation in bilinear paired batch processing, each GPU thread block in the first-layer GPU thread grid writes its calculated intermediate results of the elliptic curve point addition operation into the GPU shared memory. The GPU shared memory pointer records the starting address of the GPU shared memory. Subsequent GPU threads directly access the intermediate results of the elliptic curve point addition operation through the GPU shared memory pointer, avoiding the latency caused by data exchange through global memory. The GPU shared memory pointer is obtained through the CUDA dynamic shared memory allocation mechanism when the GPU kernel function starts, and the allocation size is dynamically adjusted according to the number of signatures in the parallel verification group.
[0044] The pairwise operation accumulation cache is a cache area in GPU memory used to store the accumulation results of elliptic curve point additions. The second-layer GPU thread grid collects the elliptic curve point addition calculation results from each GPU thread block from the first-layer GPU thread grid, and performs reduction and summation on the elliptic curve point addition calculation results to obtain the final accumulated point pairs, including... Point-to-point sum The point accumulation result is stored in the pairing operation accumulation cache, which is a 128-byte contiguous memory area, with the first 64 bytes storing the result. The result of dotted accumulation is stored in the last 64 bytes. The third-layer GPU thread grid accesses the pairing operation accumulation cache through the pairing operation accumulation cache pointer, reads the final accumulated point pair, and then performs a bilinear pairing operation to complete the batch signature verification.
[0045] The signature batch verification algorithm based on graph coloring theory maps signature associations to a graph theory problem, systematically organizing parallel verification tasks. This avoids the computational resource competition and redundant computations caused by traditional random grouping. The greedy coloring algorithm guarantees finding a near-optimal coloring scheme in polynomial time, maximizing parallelism. Combined with the mathematical characteristics of bilinear pairing batch processing, signatures within the same parallel verification group share the base point and public key in the pairing operation, transforming multiple independent verifications into single batch computations. The signature batch verification algorithm exhibits linear speedup in multi-core CPU or GPU environments. When the parallelism reaches 8, the throughput increases by nearly 8 times. For high-concurrency scenarios where smart contracts need to process hundreds of signatures, the signature batch verification algorithm can compress the total verification time to less than one-tenth of the original scheme, not only reducing the gas consumption of a single transaction but also enabling ordinary users to... While bearing the cost of on-chain identity authentication, the more important aspect is to improve the transaction processing capacity of the entire blockchain network, alleviate performance bottlenecks, and enable the controllable anonymity mechanism to support the actual needs of large-scale commercial scenarios. At the same time, it maintains the decentralized characteristics and security of the blockchain system. By decomposing the elliptic curve point addition operation of bilinear pairing batch processing into a three-layer GPU-accelerated architecture, the first layer GPU thread grid uses GPU thread block-level parallelism to complete distributed point addition, the second layer GPU thread grid achieves accumulation reduction through GPU thread-level collaboration, and the third layer GPU thread grid performs final pairing verification. The three-layer architecture is deeply coupled with bilinear pairing batch processing. GPU shared memory pointers and pairing operation accumulation caches efficiently transfer data between layers, eliminating data transmission bottlenecks between layers, and enabling the GPU acceleration efficiency of the signature batch verification algorithm to reach more than 85% of the theoretical peak performance.
[0046] The security threshold is defined as the upper limit of the probability of hash collisions. According to the birthday attack theory, for an output length of... Bit hash function, collision probability The dimensionless expression is 1 minus the natural exponential function, where the exponent is the hash function. Squared by 2 The power is then negative, where For the number of hashes, To determine the number of bits in the hash output, this scheme sets a security threshold of [value missing]. That is, one in ten trillion. For a 256-bit hash output, when the user scale reaches... If the collision probability is still below the safety threshold, and the collision probability is higher than the safety threshold after the quantum annealing algorithm iteration, then continue to add salt value perturbation until the safety requirements are met.
[0047] The regulatory center database is a secure database that stores the mapping relationship between the original user identity information and the second-layer hash ciphertext. It adopts encrypted storage and access control mechanisms, and only authorized regulatory personnel can retrieve the corresponding original user identity information through the second-layer hash ciphertext. The regulatory center database is designed as a key-value pair structure, where the key is the second-layer hash ciphertext and the value is the encrypted form of the original user identity information. The original user identity information is encrypted using the AES-256 algorithm, and the key is kept by the regulatory agency's hardware security module. When querying, regulatory personnel must pass multi-factor authentication. The system records audit logs of all query operations, including timestamps and operator identifiers, to prevent abuse of regulatory authority.
[0048] Identity-based cryptography is a cryptographic method that generates public-private key pairs based on user identity information. This scheme adopts the national standard SM9 algorithm, whose core is bilinear pairing operations. The key generation center holds the master private key. and the master key The master public key Master private key With base point The dot product result, where As the base point on the elliptic curve, the user's identity identifier is hashed and mapped to a point on the elliptic curve. , the point For identity verification Apply hash function The result is that the user's private key is calculated using the master private key formula. With point The result of the dot product is denoted as During signature verification, a pairing operation is used to verify whether two pairing results are equal. The first pairing is the user's private key. With base point The first pairing is a dot, the second pairing is a dot. With the master key The pairings, among which Using a base point on another elliptic curve, the identity cryptography algorithm eliminates the need for a certificate infrastructure, simplifying the key management process.
[0049] The slice coordinate cache pointer is a 64-bit memory address pointer that points to the starting address of the slice coordinate cache. The slice coordinate cache pointer is returned by the CUDA runtime system after the first-layer GPU thread grid completes the generation of the master private key slices. When the second-layer GPU thread grid starts, it passes the slice coordinate cache pointer as a kernel function parameter. Each GPU thread accesses the master private key slice coordinates assigned to it by adding an offset to the slice coordinate cache pointer. The offset is the GPU thread index multiplied by the number of bytes (64) of a single master private key slice coordinate. The slice coordinate cache pointer allows the second-layer GPU thread grid to access data directly in the GPU memory without having to read data from the host memory through the PCIe bus, thus reducing data transmission latency.
[0050] The pairwise operation accumulation cache pointer is a 64-bit memory address pointer pointing to the starting address of the pairwise operation accumulation cache. After completing the elliptic curve point addition reduction, the second-layer GPU thread grid passes the pairwise operation accumulation cache pointer along with the final accumulation point pair to the third-layer GPU thread grid. The third-layer GPU thread grid accesses the pairwise operation accumulation cache through the pairwise operation accumulation cache pointer and reads... Point-to-point sum After the point accumulation result is obtained, a bilinear pairing operation is performed. The pairing operation accumulation cache pointer remains valid in the GPU memory until the third-layer GPU thread grid completes the pairing verification, thus avoiding multiple copies of intermediate data between the GPU memory and the host memory.
[0051] Optionally, the present invention also provides a method for forming a controllable and anonymous optimization system for blockchain smart contracts through a computer, wherein the computer is provided with a readable storage medium, the readable storage medium stores program instructions, and the program instructions execute the above-described method when running in the computer.
[0052] The specific implementation methods of the above steps are described in detail below.
[0053] The specific implementation of step S01 is as follows: The user first initiates a registration request to the gateway of the distributed key generation center. This request includes the user's basic information and the identity identifier to be registered. After receiving the registration request, the gateway calls a verifiable random function to process the request. The verifiable random function uses the gateway's private key to perform cryptographic operations on the input seed to generate a random output value and a corresponding verification proof. This random output value has unpredictable and uniform distribution characteristics, ensuring that the selection of the key generation center is not manipulated by humans. The gateway performs a modulo operation on the generated random output value, where the modulus is the total number of key generation centers. The result of the modulo operation is the sequence number of the target key generation center. The gateway forwards the original registration request along with the verification proof to the key generation center with the corresponding sequence number. The purpose of this step is to achieve load balancing and prevent single points of failure through cryptographic means. At the same time, the existence of the verification proof allows subsequent nodes to verify the fairness of the allocation process.
[0054] The specific implementation of step S02 is as follows: After receiving the forwarded registration request and verification certificate, the target key generation center first verifies the verification certificate using the gateway's public key. The verification process is based on the mathematical properties of verifiable random functions. Through pairing operations or signature verification algorithms, it is confirmed that the random output value is indeed generated by the gateway's private key and has not been tampered with. After successful verification, the target key generation center forwards the registration request to the face authentication service interface. The face authentication service uses a deep learning model to perform liveness detection and feature comparison on the face image submitted by the user. After confirming the authenticity of the user's identity, it extracts the user's real identity information from the database of public security or authoritative institutions, including key information such as name and ID number, and returns this identity information to the target key generation center. The purpose of this step is to ensure the authenticity and uniqueness of the registered user's identity, providing a reliable real-name anchor for subsequent controllable anonymity.
[0055] The specific implementation of step S03 is that the target key generation center performs hierarchical hashing on the received user identity information. First, the BLAKE3 fast hashing algorithm is used to perform the first-level hash calculation on the original user identity information. The BLAKE3 algorithm is based on the HAIFA structure and ARX operation design, which can achieve a hash throughput of more than one million times per second while ensuring security, meeting the performance requirements of high-concurrency registration scenarios. The ciphertext generated by the first-level hash is 256 bits long. Then, the quantum-resistant hashing algorithm based on the SPHINCS hash signature scheme is used to perform the second-level hash calculation on the first-level hash ciphertext. This algorithm uses the one-wayness of the hash function to build a signature system, which can maintain a security strength of more than 256 bits even in a quantum computing environment. After the second-level hash is completed, the system starts the quantum annealing algorithm module. This module constructs a hash value set of all the generated second-level hash ciphertexts. By comparing and detecting whether the currently generated second-level hash ciphertext collides with the existing hash values in the set, the purpose of this step is to provide long-term security while ensuring computational efficiency. The hierarchical structure allows the system to flexibly adjust the security strategy according to the threat level.
[0056] The specific implementation of step S04 is as follows: When the quantum annealing algorithm detects a hash collision, the system transforms the collision resolution problem into a quadratic unconstrained binary optimization problem for solution. The goal of this problem is to find a solution that minimizes the perturbation added to the user identity information to eliminate the collision. The system constructs a binary perturbation variable vector, where each element corresponds to a bit of the user identity information. A value of 0 indicates that no perturbation is added to that bit, and a value of 1 indicates that a salt value perturbation is added to that bit. Simultaneously, a perturbation weight matrix is constructed, where the elements reflect the cost of perturbation at different positions and its contribution to collision resolution. The system uses a simulated annealing algorithm to search for the global optimum in the solution space. The initial temperature reference value is set to 100, and the annealing coefficient reference value is set to 0.95. After each iteration, the temperature is adjusted according to the annealing coefficient. The algorithm decays and stops iterating when the temperature drops to the termination temperature reference value of 0.01. During the search process, the system calculates the energy value of the new solution and calculates the probability of accepting the new solution based on the energy difference and the current temperature. This probability follows the Boltzmann distribution law, allowing the algorithm to accept solutions in both the optimization direction and non-optimization directions to escape local optima. After each iteration, the identity information with added salt perturbation is re-processed with hierarchical hashing until the generated second-layer hash ciphertext no longer collides with existing hash values and the collision probability drops below the safety threshold reference value of 10 to the power of -15. If no collision is detected, the algorithm directly proceeds to the next step. The purpose of this step is to efficiently solve the hash collision problem through intelligent optimization algorithms, which can significantly reduce the number of iterations and computational resource consumption compared to the traditional brute-force rehashing method.
[0057] The specific implementation of step S05 is as follows: The target key generation center starts a three-layer GPU-accelerated architecture to execute the key generation process. The first-layer GPU thread grid contains GPU thread blocks equal to the number of nodes in the key generation center. Each GPU thread block is responsible for executing the polynomial calculation task in the threshold secret sharing protocol. The threshold secret sharing protocol adopts the Shamir scheme, using the master private key of the identity cryptography algorithm as the constant term of the polynomial, and randomly generating other coefficients of the polynomial. The degree of the polynomial is 1 less than the threshold value. Each GPU thread block calculates the function value of the polynomial at different horizontal coordinate values as the master private key fragment, and stores the master private key fragment coordinates composed of the master private key fragment and its corresponding horizontal coordinate values into a fragment coordinate cache. This cache is a contiguous memory area allocated in the GPU video memory, using a structure array layout. The second-layer GPU thread grid starts a number of GPU threads equal to the threshold value. Each GPU thread accesses the fragment coordinate cache through the fragment coordinate cache pointer to read the master private key fragment coordinates, and then executes the Lagrange interpolation algorithm to reconstruct the data. The complete master private key is generated using Lagrange interpolation. The function value of the polynomial at any position is calculated using the known function values and x-coordinates of points. Each GPU thread computes the numerator and denominator of the interpolation formula in parallel, exchanging intermediate results via GPU shared memory. This reduces the reconstruction time from quadratic complexity in serial computation to linear complexity in parallel computation. The second-layer GPU thread grid stores the reconstructed complete master private key in the master private key reconstruction cache. The third-layer GPU thread grid reads the complete master private key from the cache, calls the SM9 national cryptographic algorithm library to execute the identity identification cryptographic algorithm, maps the second-layer hash ciphertext onto an elliptic curve to generate points, and then performs an elliptic curve multiplication operation with these points using the complete master private key to generate the user's private key. This elliptic curve multiplication operation is accelerated using the parallel computing capabilities of the GPU. The purpose of this step is to improve the security and fault tolerance of the key generation system through a threshold secret sharing protocol, while simultaneously achieving a key generation throughput of thousands of times per second through the GPU parallel computing architecture, meeting the performance requirements of large-scale simultaneous user registration.
[0058] The specific implementation of step S06 is as follows: The target key generation center stores the mapping relationship between the original user identity information and the second-layer hash ciphertext in the regulatory center database. This database adopts a key-value pair structure, with the second-layer hash ciphertext as the key and the encrypted form of the original user identity information as the value. Encryption uses the AES algorithm, and the key length is 256 bits. The key is kept by the hardware security module of the regulatory agency to ensure that only authorized regulatory personnel can decrypt and query it. The database is equipped with strict access control policies and audit log recording mechanisms. Then, the target key generation center returns the generated user private key and the second-layer hash ciphertext to the user through an encrypted secure channel. The secure channel is established using the TLS protocol to ensure the confidentiality and integrity of the data during transmission. The purpose of this step is to provide necessary traceability capabilities for regulation while protecting user privacy, and to achieve a balance between privacy protection and regulatory needs.
[0059] The specific implementation of step S07 is that when a user calls a smart contract, they use the received user private key to digitally sign the smart contract call parameters. The signature algorithm adopts the national cryptographic SM9 identifier cryptography algorithm. The user encapsulates the smart contract call parameters, the second-layer hash ciphertext, and the generated signature together as transaction data, and broadcasts it to various blockchain nodes through the P2P protocol of the blockchain network. The purpose of this step is to ensure the non-repudiation and integrity of the transaction, while the second-layer hash ciphertext is used to achieve anonymization of the user's identity. Only the hash ciphertext is displayed on the blockchain without exposing the real identity information.
[0060] The specific implementation of step S08 is as follows: after receiving a transaction, the blockchain node extracts all signatures to be verified from the transaction data. The system analyzes the mathematical relationships between the signatures to construct a dependency graph. The dependency graph is a directed graph data structure. Each node in the graph represents a signature. If two signatures use the same public key or have common items in the pairing operation, a directed edge is established between the corresponding nodes. After the construction is completed, the system uses a greedy coloring algorithm to color the dependency graph. The algorithm starts from the node with the largest degree and assigns each node the smallest color number that does not conflict with the color of its neighboring nodes. After coloring, nodes of the same color are divided into a group to form a parallel verification group. Groups of different colors can be processed in parallel without data competition. The purpose of this step is to systematically organize the signature verification task through graph theory, maximize the efficiency of parallel verification, and avoid the waste of computing resources caused by traditional random grouping.
[0061] The specific implementation of step S09 is that the system uses bilinear pairing batch processing technology to perform parallel verification of the signatures in each parallel verification group. Bilinear pairing batch processing utilizes the bilinear property of pairing operations to merge the pairing operations of multiple signatures into a single calculation. For multiple signatures within the same parallel verification group, the system first extracts the elliptic curve point pairs corresponding to each signature, then performs point addition operations on all first-type elliptic curve points to sum them up, and simultaneously performs point addition operations on all second-type elliptic curve points to sum them up. During the elliptic curve point addition operation, the system stores the intermediate results in GPU shared memory. GPU shared memory is a high-speed cache area on the GPU chip, and its access latency is much lower than that of global memory. Each GPU thread block in the first-layer GPU thread grid reads from the GPU shared memory pointer. Intermediate results are retrieved and distributed to multiple GPU threads for parallel point addition calculations. The second-layer GPU thread grid collects the point addition calculation results from the first-layer GPU thread grid and performs a reduction and summation operation, storing the final accumulated point pairs in the pairing operation accumulation cache. The third-layer GPU thread grid reads the accumulated elliptic curve point pairs from the pairing operation accumulation cache and performs the final bilinear pairing operation to complete batch verification. The pairing operation verifies the validity of the signature by verifying the equality of the two pairing results. After successful verification, the blockchain node executes the business logic of the smart contract and stores the transaction record on the chain. The purpose of this step is to significantly reduce the time complexity and computational cost of signature verification through mathematical methods and GPU parallel computing architecture, making large-scale identity authentication transactions practical in a public chain environment.
[0062] The specific implementation of step S10 is as follows: When a regulatory user needs to query the true identity of a transaction, the second-layer hash ciphertext is first extracted from the transaction data on the blockchain. Then, the hash ciphertext is used as the key to retrieve the data in the regulatory center database. The database returns the encrypted form of the corresponding user identity information. The regulatory user obtains the decryption key through a multi-factor authentication mechanism, uses the key to decrypt and obtain the original user identity information, and completes the real-name identity verification. The system records the audit log of the query operation, including information such as the query time, operator identification, and query purpose. The purpose of this step is to provide the regulatory agency with traceability capabilities when necessary, and at the same time, to prevent the abuse of regulatory authority through strict access control and auditing mechanisms, ensuring that user privacy is fully protected.
[0063] It should be noted that the key technical ideas of this invention include hierarchical hashing processing and a quantum annealing collision resolution mechanism. By providing high throughput in the fast hashing layer to meet real-time requirements, and providing long-term security in the quantum-resistant hashing layer to address future quantum threats, the quantum annealing algorithm is used to transform the problem into an optimization problem when a collision occurs. Compared to traditional brute-force rehashing methods, this can quickly find the optimal perturbation scheme in the high-dimensional solution space, significantly reducing the computational overhead of collision handling and ensuring that each user's identity is mapped to a unique hash value, avoiding the risk of identity confusion. The deep integration of threshold secret sharing and a three-layer GPU acceleration architecture achieves decentralization and fault tolerance by sharding the master private key across multiple nodes. Even if some nodes fail, the system can still operate normally. The three-layer GPU architecture optimizes polynomial computation, Lagrange interpolation reconstruction, and identity cryptographic dot multiplication operations for secret sharing. Efficient data flow within GPU memory eliminates inter-layer transmission bottlenecks, increasing key generation throughput by two orders of magnitude and meeting the performance requirements of simultaneous registration of a large number of users. The signature batch verification algorithm based on graph coloring theory, combined with bilinear pairing batch processing technology, systematically organizes signature associations through a graph-dependent system. The greedy coloring algorithm ensures that a near-optimal parallel grouping scheme is found in polynomial time, while bilinear pairing batch processing transforms multiple independent verifications into single batch computations. Combined with a three-layer GPU architecture for parallel acceleration of elliptic curve point addition and pairing operations, the time complexity and gas consumption of signature verification are significantly reduced, solving the performance bottleneck of controllable anonymity mechanisms in a blockchain environment. The synergistic effect of these technologies constructs a complete optimized chain from identity registration to key generation to transaction verification. Layered hashing ensures security, threshold sharing ensures reliability, GPU acceleration ensures high performance, and graph coloring batch verification ensures scalability. This multi-technology integration enables the system to meet the performance requirements of large-scale commercial scenarios while maintaining the decentralized nature and security of blockchain, achieving an organic balance between privacy protection and regulatory needs, and providing a feasible technical path for the practical application of blockchain smart contracts.
[0064] It should be noted that this invention also solves the following technical problem: In a distributed key generation center scenario, if the key generation center selection mechanism lacks unpredictability and verifiability, attackers can manipulate the selection result to send registration requests to malicious nodes that have been controlled, leading to the risk of user private key leakage. This invention uses a verifiable random function at the gateway to generate random output and verification proof, and performs modulo operations on the random output to obtain the target key generation center sequence number. Any third party holding the public key can verify the correctness of the random output but cannot predict or manipulate the result, ensuring the fairness and resistance to manipulation in the selection of the key generation center. Simultaneously, a threshold secret sharing protocol is used to split the master private key into multiple fragments and distribute them to different nodes. Only some nodes need to cooperate to reconstruct the complete master private key, reducing dependence on a single node. Even if some nodes fail or the system becomes malicious, it can still generate keys normally, improving the decentralization and attack resistance of the distributed key generation center.
[0065] Furthermore, in large-scale user registration scenarios, identity information hashing faces the risk of hash collisions. Traditional methods use brute-force rehashing to randomly add salt values until collisions are eliminated. This method involves too many iterations in the high-dimensional identity information space, leading to increased registration latency. This invention models the hash collision problem as a quadratic unconstrained binary optimization problem using a quantum annealing algorithm. It constructs an objective energy function and searches for the global optimum in the solution space using simulated annealing. This algorithm can find an effective collision resolution scheme with fewer iterations. The initial temperature and annealing coefficient control the convergence speed of the search process, and the probability mechanism for accepting new solutions avoids getting trapped in local optima. At the same time, it adopts a hierarchical hashing architecture combining the BLAKE3 fast hashing algorithm and a quantum-resistant hashing algorithm based on SPHINCS+. The first layer meets the performance requirements of high-frequency identity verification scenarios, while the second layer ensures long-term security under the threat of quantum computing. This significantly reduces the impact of hash collisions on system performance and ensures that each user's identity information is mapped to a unique hash ciphertext.
[0066] Specifically, the principle of this invention is as follows: The invention solves this technical problem because bilinear pairing operations possess the bilinear property, meaning the product of multiple pairing operations equals the sum of the pairing operations. Based on this mathematical property, multiple independent verifications can be transformed into a single batch computation. The dependency graph systematically organizes parallel verification tasks using graph theory methods. A greedy coloring algorithm assigns color tags based on the mathematical correlation between signatures; signatures of the same color represent parallel verifiable groups. Signatures within a group share common terms in the pairing operations, reducing the time complexity from linear to constant level plus the addition operation. The three-layer GPU-accelerated architecture utilizes the massively parallel computing capabilities of GPUs. The first layer performs distributed addition, the second layer implements cumulative reduction, and the third layer executes the final pairing verification. The low latency of GPU shared memory avoids global memory access overhead. This architecture parallelizes elliptic curve addition operations, which are two orders of magnitude faster than pairing operations. Therefore, the batch processing method can significantly reduce on-chain computation costs while ensuring verification correctness.
[0067] The following provides a specific embodiment 1 of the present invention, and the specific implementation of each step in this embodiment 1 is described in detail below.
[0068] The specific implementation of step S01 involves the user submitting a registration request to the gateway of the distributed key generation center. The gateway uses a verifiable random function to generate a random output and a verification certificate, performs a modulo operation on the random output to obtain the target key generation center's serial number, and forwards the registration request and verification certificate to the key generation center with the corresponding serial number. The generation process of the verifiable random function includes using the gateway's private key to perform operations on the input seed to generate a random output. and verification proof The formula for calculating the target key generation center sequence number is as follows:
[0069] ;
[0070] In the formula, Generate a central serial number for the target key, with a value ranging from 0 to... A dimensionless integer; The output of the verifiable random function is a dimensionless integer. The total number of key generation center nodes in the distributed key generation center network, with an empirical value of 10 to 50, dimensionless; The modulo operator; To verify the proof, it is used by a third party to verify the correctness of the random output.
[0071] The specific implementation of step S02 is the same as described above, and will not be repeated in detail here.
[0072] The specific implementation of step S03 involves the target key generation center performing layered hashing on the user identity information. First, a fast hash algorithm is used to generate the first-layer hash ciphertext. Then, a quantum-resistant hash algorithm is used on the first-layer hash ciphertext to generate the second-layer hash ciphertext, and a quantum annealing algorithm is initiated to detect hash collisions. The formula for generating the first-layer hash ciphertext is as follows:
[0073] ;
[0074] In the formula, This is the first-level hash ciphertext, and the output is a 256-bit binary string. This is the original user identity information, including personal information such as name and ID number; The fast hash algorithm function provides a hash throughput of millions of records per second. The formula for generating the second-level hash ciphertext is as follows:
[0075] ;
[0076] In the formula, This is the second-level hash ciphertext, and the output is a 256-bit binary string. This provides a hash function for a quantum-resistant signature algorithm based on hashing, offering a security strength of at least 256 bits. The formula for calculating the hash collision probability is as follows:
[0077] ;
[0078] In the formula, Let be the hash collision probability, which is dimensionless. The number of hashes generated so far is dimensionless. The hash output bit length is empirically 256, and is dimensionless. Natural exponential function; safety threshold Default is , dimensionless.
[0079] The specific implementation of step S04 is as follows: when a hash collision is detected, the collision problem is transformed into a quadratic unconstrained binary optimization problem. A binary perturbation variable vector and a perturbation weight matrix are constructed. The user identity information is then perturbed by adding a salt value and rehashed using a simulated annealing algorithm. The search is iteratively performed until the collision probability drops below a safe threshold. If no collision is detected, the process proceeds directly to the next step. The objective energy function is expressed as follows:
[0080] ;
[0081] In the formula, The target energy is dimensionless. The dimension of the binary perturbation variable vector has an empirical value of 128 to 512 and is dimensionless. The first in the binary perturbation variable vector The nth element, taking the value 0 or 1, is dimensionless and indicates whether the nth element is positive or negative. Add perturbation to bit information; The first in the binary perturbation variable vector Each element takes the value 0 or 1 and is dimensionless. The perturbation weight matrix is the first... Line number The column elements are dimensionless coefficients, with a default range of -1 to 1, reflecting the cost of perturbation. The temperature update formula for the simulated annealing algorithm is expressed as follows:
[0082] ;
[0083] In the formula, For the first The temperature of the next iteration is in K. For the first The temperature of the next iteration is in K. This is the initial temperature, which is 100K by default. The annealing coefficient, empirically valued at 0.95, is dimensionless; the termination temperature... The default value is 0.01K. The probability formula for accepting a new solution is as follows:
[0084] ;
[0085] In the formula, The probability of accepting a new solution is dimensionless. The energy difference between the new and old solutions is dimensionless. is the Boltzmann constant, usually taken as 1, and is dimensionless; The current temperature is in Kelvin (K). The reference temperature is the initial temperature, and the unit is K.
[0086] The specific implementation of step S05 is as follows: the target key generation center starts a three-layer GPU-accelerated architecture. The first layer, the GPU thread grid, executes the threshold secret sharing protocol, splits the master private key into master private key fragments, and distributes them to multiple key generation center nodes, generating fragment coordinate caches for subsequent reconstruction. The threshold secret sharing protocol adopts the Shamir secret sharing scheme, and its polynomial expression is as follows:
[0087] ;
[0088] In the formula, for Polynomial function values; The constant term is the master private key. ; For a randomly selected item to coefficient of the secondary term; The independent variable is dimensionless. This is the threshold value, usually set to... , dimensionless, of which This is the floor symbol. The formula for calculating master-private key fragmentation is as follows:
[0089] ;
[0090] In the formula, For the first Fragmentation of the master's private key; This is the fragment number, with a value ranging from 1 to... A dimensionless integer; Take the independent variable The polynomial function value at time. The second-layer GPU thread grid reads the master private key fragment coordinates from the fragment coordinate cache of the first-layer GPU thread grid, reconstructs the complete master private key based on the collected master private key fragments, and stores it in the master private key reconstruction cache. The Lagrange interpolation formula is expressed as follows:
[0091] ;
[0092] In the formula, For the reconstructed master private key; For the first The function values of each known point are the master private key fragments; For the first The x-coordinate of each known point, i.e. the sequence number corresponding to the master private key fragment, is dimensionless; For the first The x-coordinates of the known points are dimensionless. The symbol for multiplication; Exclusion when indicating multiplication In this case, the third-layer GPU thread mesh reads the complete master private key from the master private key reconstruction cache and generates the user private key based on the second-layer hash ciphertext using an identity-based cryptographic algorithm. The master public key calculation formula is as follows:
[0093] ;
[0094] In the formula, The master public key is a point on the elliptic curve. The primary private key, a scalar; Let be the base point on the elliptic curve. The identity mapping formula is expressed as follows:
[0095] ;
[0096] In the formula, Points on an elliptic curve that represent identity identifiers; A hash function that hashes to elliptic curve points; User identity identifier, i.e., second-layer hash ciphertext The formula for calculating the user's private key is as follows:
[0097] ;
[0098] In the formula, For the user's private key, a point on the elliptic curve; The primary private key, a scalar; These are the points on the elliptic curve that serve as identity mapping points.
[0099] The specific implementation methods of steps S06-S08 are the same as those described above, and will not be repeated in detail here.
[0100] The specific implementation of step S09 involves performing parallel verification of the signatures in each parallel verification group using bilinear pairing batch processing, merging the pairing operations of signatures within the same parallel verification group into a single computation. The elliptic curve point addition operation of bilinear pairing batch processing is described as follows:
[0101] ;
[0102] ;
[0103] In the formula, for Elliptic curve points The cumulative sum, points on the elliptic curve; for Elliptic curve points The cumulative sum, points on the elliptic curve; For the first The first elliptic curve point corresponding to each signature; For the first The second elliptic curve point corresponding to each signature; The number of signatures within the same parallel verification group, typically 8 to 64, is dimensionless; The summation symbol is used. The pairwise operation formula for batch verification is expressed as follows:
[0104] ;
[0105] In the formula, This is a bilinear pairing operation function that maps two elliptic curve points to elements on a finite field. The symbol represents a product; if the equation is true, the verification passes. The paired equation for signature verification is as follows:
[0106] ;
[0107] In the formula, For the user's private key, a point on the elliptic curve; It is the base point on another elliptic curve; For identity mapping points, points on the elliptic curve; The primary public key is a point on the elliptic curve. During the verification process, the intermediate results of the elliptic curve point addition operation in the bilinear pairing batch processing are stored in the GPU shared memory pointer. The first-layer GPU thread grid reads the intermediate results of the elliptic curve point addition operation from the GPU shared memory pointer and distributes them to multiple GPU thread blocks for parallel point addition calculation. The second-layer GPU thread grid collects the point addition calculation results of the first-layer GPU thread grid and stores them in the pairing operation accumulation cache. The third-layer GPU thread grid reads the accumulated point pairs from the pairing operation accumulation cache and performs the final pairing operation to complete the batch verification. After successful verification, the smart contract business logic is executed and the transaction is recorded on the blockchain.
[0108] The specific implementation of step S10 is the same as described above, and will not be repeated in detail here.
[0109] To better understand and implement this invention, the following is a specific application scenario of this invention, Example 2:
[0110] To verify the effectiveness of this invention, engineers built a test environment to evaluate system performance by simulating a large-scale, controlled, anonymous blockchain smart contract transaction scenario. The test environment deployed a distributed network containing eight key generation central nodes, each configured with a Tesla V100 GPU accelerator card. The blockchain network used an Ethereum-compatible testchain, and the smart contracts were written in Solidity and deployed on the testchain. The test scenario simulated 1000 users simultaneously initiating registration requests. Each user needed to complete identity authentication and generate a private key. Subsequently, these users submitted a total of 5000 transactions to the smart contract within 30 seconds. Each transaction included a user signature and a second-layer hash ciphertext.
[0111] During the user registration phase, technicians first tested the effectiveness of the verifiable random function in allocating key generation centers. Upon receiving a user registration request, the gateway uses the verifiable random function to generate a random output, a 256-bit hexadecimal value. This value is then modulo-8 to obtain the target key generation center's serial number, ranging from 0 to 7. Statistics from 1000 allocations show that the number of users allocated to the eight key generation centers were 126, 123, 127, 124, 125, 128, 122, and 125 respectively, with a standard deviation of 2.07. This indicates that the verifiable random function achieves approximately uniform load distribution, preventing any single node from becoming a performance bottleneck.
[0112] After receiving a registration request, the target key generation center forwards the user's submitted ID photo to the facial recognition service for verification. The facial recognition service uses a deep learning model to extract facial feature vectors, which are then compared with standard photos in the public security department's database, with a similarity threshold set at 0.92. Technicians recorded the authentication time for 100 samples, with an average time of 1.8 seconds, a minimum of 1.2 seconds, and a maximum of 2.5 seconds. Upon successful identity verification, the key generation center obtains the user's original identity information, including name and ID number.
[0113] Next, the layered hashing process begins. Technicians first use the BLAKE3 algorithm to generate the first layer of ciphertext from the original user identity information. This algorithm achieves a hashing speed of 3.2 GB per second on a single-core CPU; for identity information with an average length of 128 bytes, generating the first layer of ciphertext takes only 0.04 milliseconds. Then, a quantum-resistant hashing algorithm based on SPHINCS+ is used to generate the second layer of ciphertext. This step, accelerated by a GPU, takes approximately 12 milliseconds. The quantum annealing algorithm simultaneously detects hash collisions, detecting 3 collision events in 1000 samples. For example... Figure 2 As shown, technicians recorded the handling process of one of the collisions, with an initial temperature of... The value is set to 100, the annealing factor α is set to 0.95, the constructed binary perturbation variable vector has a dimension of 1024, and the perturbation weight matrix is... The symmetric matrix. After 47 iterations, the collision probability of the simulated annealing algorithm increases from the initial value. Down to Below the safety threshold During the iteration process, the temperature gradually decreases to the termination temperature of 0.01, and the energy function value also converges to the optimal solution as the iteration continues.
[0114] The key generation center initiates a three-layer GPU-accelerated architecture to execute a threshold secret sharing protocol. In the test, the threshold value t was set to 5, meaning that any 5 out of 8 nodes can collaborate to reconstruct the complete master private key. The first layer, the GPU thread grid, starts 8 GPU thread blocks, each responsible for generating master private key fragments for one node. A fourth-order polynomial is constructed using the Shamir secret sharing scheme, with the constant term being the 256-bit master private key and the remaining coefficients randomly generated. The master private key fragments and their x-coordinates calculated by each thread block are stored in a fragment coordinate cache, which occupies 512 bytes of GPU memory. The second layer, the GPU thread grid, starts 5 GPU threads to read data from the fragment coordinate cache, executes Lagrange interpolation calculations, exchanges intermediate results via GPU shared memory, reconstructs the complete master private key, and stores it in the master private key reconstruction cache. The third layer, the GPU thread grid, calls the SM9 national cryptographic algorithm library, reads the complete master private key from the master private key reconstruction cache, maps the second-layer hash ciphertext to points on a 256-bit elliptic curve, and performs a dot product operation with the master private key to generate the user's private key. The entire key generation process takes 3.6 milliseconds to execute on the GPU, a significant improvement over the 428 milliseconds required for CPU serial processing.
[0115] After obtaining the private key, the user uses it to sign the parameters of the smart contract call. In the test scenario, 5000 transactions arrived on the blockchain network within 30 seconds, and the blockchain nodes packaged these transactions into blocks for verification. Technicians extracted one block containing 320 signatures for detailed analysis. For example... Figure 3 As shown, the nodes first construct a dependency graph, using 320 signatures as nodes. By analyzing the public keys used in the signatures and the common terms of pairing operations, dependency graph edges are established between signatures with mathematical relationships. The final dependency graph contains 872 edges. The greedy coloring algorithm starts coloring from the node with the highest degree, which has a degree of 18, indicating a relationship with the other 18 signatures. The coloring process assigns a color number to each node sequentially, with adjacent nodes having no color conflicts. The final number of colors is 7, meaning the 320 signatures are divided into 7 parallel verification groups. The number of signatures in each group is shown in Table 1.
[0116] Table 1. Signature Distribution of Parallel Validation Groups
[0117]
[0118] Bilinear pairing batch verification is performed for each parallel verification group. Taking the 52 signatures in group 1 as an example, the traditional method requires 52 pairing operations, each of which takes about 8 milliseconds, for a total of 416 milliseconds. The bilinear pairing batch method sums the elliptic curve points corresponding to the 52 signatures separately, and sums the 52 P points to obtain the cumulative point. Sum the 52 Q points to get the cumulative point. Then, a single pairing operation is performed on the accumulated point pairs. Elliptic curve point addition is executed in parallel in a three-layer GPU-accelerated architecture. The first layer GPU thread grid starts 52 GPU threads, each responsible for the preprocessing of one point, storing the intermediate results of the point addition operation into the memory area pointed to by the GPU shared memory pointer. The latency of this shared memory is only one percent of the global memory. The second layer GPU thread grid collects the point addition results from each thread and performs reduction summation. A tree-shaped reduction strategy is used to decompose the summation of 52 points into 6 rounds of reduction. The intermediate results of each round of reduction are stored in the pairing operation accumulation cache. The third layer GPU thread grid reads the final accumulated point pairs from the pairing operation accumulation cache and performs bilinear pairing operation to complete batch verification. The entire process takes only 24 milliseconds, including 16 milliseconds for 52 point addition operations and 8 milliseconds for 1 pairing operation.
[0119] Technicians measured the verification times of seven parallel verification groups, which were 24 milliseconds, 22 milliseconds, 23 milliseconds, 21 milliseconds, 22 milliseconds, 20 milliseconds, and 18 milliseconds, respectively. Since the seven groups can execute in parallel, the total verification time depends on the longest group, i.e., 24 milliseconds. Compared to the traditional method of verifying 320 signatures one by one, which takes 2560 milliseconds, the solution of this invention shortens the verification time to 24 milliseconds. After the blockchain node completes the signature verification, it executes the business logic of the smart contract, and the transactions contained in the block are successfully uploaded to the chain and written to the blockchain ledger. Technicians measured the gas consumption during the execution of the smart contract. The traditional method consumes approximately 100,000 Gas per signature verification, totaling 32 million Gas for 320 signatures. However, with the bilinear pairing batch processing used in this invention, the batch verification of 320 signatures consumes only 4.5 million Gas, reducing gas consumption by approximately 86%.
[0120] During the regulatory process, authorized regulatory personnel log into the regulatory center system via multi-factor authentication and extract the second-layer hash ciphertext from a suspicious transaction. This hash ciphertext is a 64-bit hexadecimal string. The regulatory center database uses a key-value pair structure for storage and performs a retrieval using the second-layer hash ciphertext as the key. The query takes approximately 18 milliseconds and returns the corresponding encrypted user identity information. The system then uses the AES-256 decryption key in the hardware security module to decrypt the encrypted identity information. After decryption, the user's name, ID number, and other real identity information are obtained, completing the real-name identity verification for the suspicious transaction. The entire query and decryption process takes 52 milliseconds. The timestamp of the regulatory operation and the operator's identification are recorded in the audit log to prevent abuse of regulatory authority.
[0121] The technological advancements of this invention compared to traditional methods are reflected in several aspects. First, by transforming the signature verification problem into a graph coloring problem in graph theory, the greedy coloring algorithm can systematically identify sets of signatures that can be verified in parallel, avoiding the computational resource competition and redundant operations present in traditional random grouping methods, thus achieving the theoretically optimal parallelism. Second, bilinear pairing batch processing utilizes the bilinear property of pairing operations to merge multiple independent pairing operations into a single computation. Since the computational complexity of pairing operations is much higher than that of elliptic curve point addition operations, this method can significantly reduce the overall computational load. Furthermore, the high parallelizability of point addition operations makes it suitable for accelerated execution on GPU architectures. Third, the three-layer GPU-accelerated architecture, through meticulous task decomposition and memory management, performs distributed point addition in the first layer, cumulative reduction in the second layer, and pairing verification in the third layer. Data is efficiently transferred between layers through GPU shared memory and video memory cache, eliminating the PCIe bus data transmission bottleneck and bringing GPU acceleration efficiency close to the theoretical peak. Finally, the threshold secret sharing protocol, combined with a verifiable random function, ensures the security and decentralization of key generation in a distributed environment. The quantum annealing algorithm models the hash collision problem as an optimization problem and solves it using a simulated annealing strategy. Compared with brute-force rehashing methods, it can find an effective solution with fewer iterations. The synergy of these technologies enables blockchain smart contracts to achieve controllable anonymity while maintaining high performance and low cost, meeting the actual needs of large-scale commercial scenarios.
[0122] It should be noted that the variables involved in this invention are explained in detail in Table 2.
[0123] Table 2 Variable Explanation Table
[0124]
[0125] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any changes or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in the present invention should be included within the scope of protection of the present invention.
Claims
1. An optimized method for controllable anonymity in blockchain smart contracts, characterized in that, The process includes: users registering with a distributed key generation center and completing identity verification via facial recognition; performing layered hashing on user identity information to generate a second-layer hash ciphertext; initiating a quantum annealing algorithm to detect hash collisions and, upon detection, adding salt perturbation using a simulated annealing algorithm to re-hash until the collision probability drops below a security threshold; initiating a three-layer GPU-accelerated architecture to execute a threshold secret sharing protocol to split the master private key into master private key fragments and distribute them to multiple nodes; reconstructing the complete master private key based on the collected master private key fragments; generating user private keys using an identity-identifying cryptographic algorithm based on the second-layer hash ciphertext; storing the correspondence between the original user identity information and the second-layer hash ciphertext in the regulatory center's database; users signing smart contract call parameters using their private keys and sending the results to the blockchain network; blockchain nodes extracting all signatures from the transaction to construct a dependency graph and using a greedy coloring algorithm to color and group them into parallel verification groups; performing parallel verification on the signatures in each parallel verification group using bilinear pairing batch processing; and regulatory users retrieving the original user identity information through the second-layer hash ciphertext.
2. The optimized method for controllable anonymity of blockchain smart contracts according to claim 1, characterized in that, The steps for a user to register with a distributed key generation center are as follows: the user submits a registration request to the gateway of the distributed key generation center; the gateway uses a verifiable random function to generate a random output and a verification certificate; it performs a modulo operation on the random output to obtain the target key generation center number; and it forwards the registration request and verification certificate to the key generation center with the corresponding number.
3. The optimized method for controllable anonymity of blockchain smart contracts according to claim 2, characterized in that, The verifiable random function refers to the use of a private key to operate on an input seed to generate a random output and verification proof. Any third party holding the public key can verify the correctness of the random output but cannot predict or manipulate the result, thus ensuring the fairness and resistance to manipulation in the selection of the key generation center.
4. The optimized method for controllable anonymity of blockchain smart contracts according to claim 3, characterized in that, The steps to complete identity verification through the face authentication service are as follows: the target key generation center uses the gateway's public key to verify the proof. After successful verification, the registration request is forwarded to the face authentication service, which then returns the user's identity information after completing the identity verification.
5. The optimized method for controllable anonymity of blockchain smart contracts according to claim 4, characterized in that, The layered hashing process refers to first using a fast hashing algorithm to generate the first layer of hash ciphertext, and then using a quantum-resistant hashing algorithm to generate the second layer of hash ciphertext. The first layer uses the BLAKE3 algorithm to provide high hash throughput, and the second layer uses a quantum-resistant hashing algorithm based on SPHINCS+ to ensure security strength under the threat of quantum computing.
6. The optimized method for controllable anonymity of blockchain smart contracts according to claim 5, characterized in that, The steps of the quantum annealing algorithm for detecting hash collisions are as follows: when a hash collision is detected, the collision problem is transformed into a quadratic unconstrained binary optimization problem, a binary perturbation variable vector and a perturbation weight matrix are constructed, a salt perturbation is added to the user identity information through simulated annealing algorithm and the information is re-hashed, and the search is iteratively performed until the collision probability drops below the safety threshold.
7. The optimized method for controllable anonymity of blockchain smart contracts according to claim 6, characterized in that, The first layer of the three-layer GPU acceleration architecture, the GPU thread grid, refers to the execution of the threshold secret sharing protocol to split the master private key into master private key fragments and distribute them to multiple key generation center nodes, generating fragment coordinate caches for subsequent reconstruction. The fragment coordinate cache is a contiguous memory region allocated in the GPU video memory that uses a structure array layout to store the master private key fragment coordinates.
8. The optimized method for controllable anonymity of blockchain smart contracts according to claim 7, characterized in that, The threshold secret sharing protocol refers to splitting the master private key into n master private key fragments and distributing them to each key generation center node. Only t nodes need to cooperate to reconstruct the complete master private key. The Shamir secret sharing scheme is used to construct a polynomial of degree t minus 1, with the constant term being the master private key. During reconstruction, the Lagrange interpolation formula is used to recover the master private key.
9. The optimized method for controllable anonymity of blockchain smart contracts according to claim 8, characterized in that, The second layer of the three-layer GPU acceleration architecture, the GPU thread grid, refers to reading the master private key shard coordinates from the shard coordinate cache of the first layer GPU thread grid, reconstructing the complete master private key based on the collected master private key shards and storing it in the master private key reconstruction cache, and accessing the shard coordinate cache through the shard coordinate cache pointer to realize direct data access in the GPU memory.
10. The optimized method for controllable anonymity of blockchain smart contracts according to claim 9, characterized in that, The third layer of the three-layer GPU acceleration architecture, the GPU thread grid, refers to reading the complete master private key from the master private key reconstruction cache, generating the user private key based on the second-layer hash ciphertext using the identity identification cryptography algorithm, mapping the second-layer hash ciphertext to points on the elliptic curve, and performing a dot multiplication operation with the complete master private key to generate the user private key.
Citation Information
Patent Citations
Wire and cable online quality detection method and device, electronic equipment and storage medium
CN120298009A
KR20220077598A