Methods, devices, equipment and related products for generating electronic signature blocks
By using quantum random numbers and Poisson probability distribution algorithms to elect block nodes, the problem of high computing power consumption in node election in existing technologies is solved, thus achieving the effect of saving computing power and electricity.
Patent Information
- Application Number
- CN202411087722.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-08
- Publication Date
- 2025-10-31
- Estimated Expiration
- 2044-08-08
AI Technical Summary
In the existing electronic signature block generation process, node election requires a lot of computing power, and how to reduce computing power consumption has become a technical problem.
A Poisson probability distribution algorithm based on quantum random numbers is used to elect block nodes. By obtaining the quantum random numbers and winning random numbers of candidate blockchain nodes, the block-producing nodes are determined, avoiding reliance on the computing power competition of nodes.
This reduces the demand for computing power in the blockchain network, saves electricity consumption, and reduces the computing power investment of nodes in the election process.
Smart Images

Figure CN118802108B_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the field of electronic signature technology, and in particular relates to an electronic signature block generation method, apparatus, device, computer storage medium and product. Background Technology
[0002] In electronic signature platforms, blockchain technology may be used to improve platform security. Blockchain technology is used to generate new blocks, thereby recording newly generated electronic signatures and ensuring the reliability of electronic signature records.
[0003] In the process of generating electronic signature blocks, the first step is to elect nodes to generate blocks within the network. Existing node election schemes include those such as Proof of Work (PoW). PoW involves a computing power competition among all miner nodes, setting a challenging hash calculation problem. Whoever solves the problem first wins, with higher computing power having a higher probability of winning and lower computing power having a lower probability of winning. The computing power invested is reflected in the hash value, which can be verified across the entire network, allowing the selection of the chain containing the most computing power. However, since the selection of the leader node requires a significant amount of computing power, how to reduce the computing power required for leader node election is a technical problem that needs to be solved. Summary of the Invention
[0004] This application provides an electronic signature block generation method, apparatus, device, computer storage medium, and product to solve the technical problem of reducing computing power during the block generation process and the election of block-producing nodes.
[0005] On one hand, embodiments of this application provide a method for generating electronic signature blocks, the method comprising:
[0006] Obtain the set of candidate blockchain nodes; the set of candidate blockchain nodes includes the node identifiers of multiple candidate blockchain nodes;
[0007] Perform the following steps A through C for each candidate blockchain node:
[0008] Step A: Obtain the current quantum random number generated at the current moment, the electronic signature information within the current preset time period, and the quantum election proof and block label of the most recently generated first block;
[0009] Step B: Determine the winning random number based on the Poisson probability distribution algorithm, the quantum election proof of the first block, and the block production probability; the block production probability is determined based on the number of nodes in the candidate blockchain node set.
[0010] Step C: Based on the winning random number corresponding to each of the candidate blockchain nodes, select the target candidate blockchain node whose node identifier matches the winning random number from the candidate blockchain node set, and determine the target candidate blockchain node as the current block-producing node at the current moment;
[0011] The current block-producing node performs quantum election proof processing on the current quantum random number and the winning random number to obtain the quantum election proof of the new block;
[0012] The current block-producing node performs block signature processing on the block label of the first block to obtain the block label of the new block;
[0013] The current block-producing node writes the electronic signature information within the current preset time period, the quantum election proof of the new block, the block label of the new block, the current quantum random number, the winning random number, and the node information of the current block-producing node into the new block, generating a new block of the electronic signature blockchain.
[0014] In one feasible implementation, step B includes:
[0015] The quantum election proof within the first block is processed to obtain the first random number in decimal format;
[0016] The first random number is processed to obtain the random source;
[0017] The random source and the block probability are input into the Poisson probability distribution algorithm for calculation to obtain the winning random number.
[0018] In one feasible implementation, the quantum election proof within the first block is processed to obtain a first random number in decimal format, including:
[0019] The quantum election proof within the first block is hashed to obtain a binary hash result;
[0020] Convert the hash result to a decimal number to obtain the first random number.
[0021] In one feasible implementation, the random source and the block probability are input into a Poisson probability distribution algorithm to obtain the winning random number, including:
[0022] Set the number of iterations, and the initial values for the first and second temporary variables;
[0023] Repeat steps one through three until the random source is greater than or equal to the second temporary variable:
[0024] Step 1: Update the first temporary variable based on its initial value, block production probability, and the updated loop count.
[0025] Step 2: Update the second temporary variable based on its initial value and the updated first temporary variable;
[0026] Step 3: Set the initial value of the first temporary variable to the updated first temporary variable, set the initial value of the second temporary variable to the updated second temporary variable, and update the loop count by incrementing the loop count by one;
[0027] The number of iterations required to achieve a random source greater than or equal to the second temporary variable is determined as the winning random number.
[0028] In one feasible implementation, the current block-producing node performs quantum election proof processing on the current quantum random number and the winning random number to obtain the quantum election proof of the new block, including:
[0029] The first public-private key pair of the current block-producing node is generated using the quantum election proof algorithm;
[0030] The current quantum random number and the winning random number are encrypted using the private key from the first public-private key pair to obtain the quantum election proof tag of the new block.
[0031] In one feasible implementation, the current block-producing node performs block signing processing based on the block tag of the first block to obtain the block tag of the new block; including:
[0032] The second public-private key pair of the current block-producing node is generated using the block tagging algorithm;
[0033] The block label of the first block is encrypted using the private key from the second public-private key pair to obtain the block label of the new block.
[0034] In one feasible implementation, the new block also includes the public key from the first public-private key pair; after generating the new block of the electronic signature blockchain, the method further includes:
[0035] The current block-producing node sends the new block to the first target node, which is any node in the blockchain other than the current block-producing node.
[0036] The first target node performs the following operations:
[0037] Read the public key, current quantum random number, and winning random number from the first public-private key pair in the new block;
[0038] The quantum election proof is decrypted using the public key belonging to the first public-private key pair, and the decryption result is obtained.
[0039] Compare the decryption results with the current quantum random number and the winning random number to see if they are consistent.
[0040] If the results are consistent, the quantum election proof is deemed to have passed verification; otherwise, the quantum election proof is deemed to have failed verification.
[0041] In one feasible implementation, the new block also includes the public key of the current block-producing node belonging to the second public-private key pair. After generating the new block of the electronic signature blockchain, the method further includes:
[0042] The current block-producing node sends the new block to the second target node, which can be any node in the blockchain other than the current block-producing node.
[0043] The second target node performs the following operations:
[0044] Read the public key, current quantum random number, and winning random number from the second public-private key pair in the new block;
[0045] The block tag of the new block is decrypted using the public key in the second public-private key pair to obtain the decryption result;
[0046] Compare the decryption result with the block label of the latest block on the chain of the second target node to see if they match.
[0047] If the labels match, the block label verification of the new block is deemed successful; otherwise, the block label verification of the new block is deemed unsuccessful.
[0048] Secondly, embodiments of this application provide an electronic signature block generation apparatus, the apparatus comprising:
[0049] The data acquisition module is used to acquire a set of candidate blockchain nodes; the set of candidate blockchain nodes includes the node identifiers of multiple candidate blockchain nodes; and is used to acquire the current quantum random number generated at the current moment, the electronic signature information within the current preset time period, and the quantum election proof and block label of the most recently generated first block;
[0050] The block-producing node selection module is used to determine the winning random number based on the Poisson probability distribution algorithm, the quantum election proof of the first block, and the block-producing probability. The block-producing probability is determined based on the number of nodes in the candidate blockchain node set. The module is also used to select the target candidate blockchain node whose node identifier matches the winning random number from the candidate blockchain node set based on the winning random number corresponding to each candidate blockchain node, and to determine the target candidate blockchain node as the current block-producing node at the current moment.
[0051] The encryption module is used by the current block-producing node to perform quantum election proof processing on the current quantum random number and the winning random number to obtain the quantum election proof of the new block; and is also used by the current block-producing node to perform block signature processing based on the block label of the first block to obtain the block label of the new block.
[0052] The block generation module is used to write the electronic signature information within the current preset time period, the quantum election proof of the new block, the block label of the new block, the current quantum random number, the winning random number, and the node information of the current block-producing node into the new block, thereby generating a new block of the electronic signature blockchain.
[0053] Thirdly, embodiments of this application provide an electronic signature block generation device, the device including: a processor and a memory storing computer program instructions;
[0054] When the processor executes computer program instructions, it implements the electronic signature block generation method provided in any of the above embodiments.
[0055] Fourthly, embodiments of this application provide a computer storage medium on which computer program instructions are stored. When the computer program instructions are executed by a processor, they implement the electronic signature block generation method provided in any of the above embodiments.
[0056] Fifthly, embodiments of this application provide a computer program product in which instructions are executed by the processor of an electronic device, causing the electronic device to execute the electronic signature block generation method provided in any of the above embodiments.
[0057] The electronic signature block generation method, apparatus, device, computer storage medium, and product provided in this application embodiment have at least the following technical effects:
[0058] In the electronic signature block generation method provided in this application embodiment, the election of block-producing nodes is determined according to the Poisson probability distribution algorithm. The two inputs of the Poisson probability distribution algorithm are the quantum election proof of the first block and the block production probability. The block production probability is determined based on the number of nodes in the candidate blockchain node set. The quantum election proof is determined based on the quantum random number obtained by the block-producing node during the generation of the first block. Due to the randomness and unpredictability of the quantum random number, the winning random number obtained by matching the Poisson probability distribution algorithm is also a random and unpredictable result. Therefore, candidate blockchain nodes cannot increase their chances of being selected as block-producing nodes by increasing computing power. Thus, in the electronic signature block generation method provided in this application embodiment, the election of block-producing nodes does not depend on the computing power of blockchain nodes, thereby discouraging blockchain nodes from investing more computing power in the election process. Consequently, the electronic signature block generation method provided in this application embodiment can achieve the technical effect of saving computing power and electricity. Attached Figure Description
[0059] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings used in the embodiments of this application will be briefly introduced below. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0060] Figure 1 This is a schematic diagram of the structure of an electronic signature blockchain consensus system based on quantum random numbers, provided in one embodiment of this application.
[0061] Figure 2 This is a schematic diagram of the structure of an electronic signature block generation module provided in one embodiment of this application.
[0062] Figure 3 This is a schematic flowchart of an electronic signature block generation method provided in one embodiment of this application;
[0063] Figure 4 yes Figure 3 The flowchart shown is a schematic diagram of one implementation of step S303.
[0064] Figure 5 yes Figure 4 The flowchart shown illustrates one implementation of step S401.
[0065] Figure 6 yes Figure 4 The flowchart shown is a schematic diagram of one implementation of step S403.
[0066] Figure 7 yes Figure 3 The flowchart shown is a schematic diagram of one implementation of step S305.
[0067] Figure 8 yes Figure 3 The flowchart shown is a method for implementing step S306.
[0068] Figure 9 This is a flowchart illustrating a verification method for quantum election proof provided in one embodiment of this application.
[0069] Figure 10 This is a flowchart illustrating a block tag verification method provided in one embodiment of this application.
[0070] Figure 11 This is a schematic diagram illustrating the process of signing and verifying an electronic signature platform using a quantum random number-based electronic signature blockchain consensus system, as provided in one embodiment of this application.
[0071] Figure 12 This is a schematic diagram of an electronic signature block generation device provided in one embodiment of this application.
[0072] Figure 13 This is a schematic diagram of the structure of an electronic signature block generation device provided in one embodiment of this application. Detailed Implementation
[0073] The features and exemplary embodiments of various aspects of this application will be described in detail below. To make the objectives, technical solutions, and advantages of this application clearer, the application will be further described in detail below with reference to the accompanying drawings and specific embodiments. It should be understood that the specific embodiments described herein are only intended to explain this application and not to limit it. For those skilled in the art, this application can be implemented without some of these specific details. The following description of the embodiments is merely to provide a better understanding of this application by illustrating examples.
[0074] It should be noted that, in this document, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising..." does not exclude the presence of additional identical elements in the process, method, article, or apparatus that includes said element.
[0075] In this embodiment, the Poisson distribution refers to a discrete probability distribution commonly found in statistics and probability, published by the French mathematician Simeon-Denis Poisson in 1838. The Poisson distribution is suitable for describing the number of random events occurring per unit of time.
[0076] Electronic signatures are a form of electronic signature. For example, image processing technology can be used to transform electronic signature operations into the same visual effect as stamping paper documents. At the same time, electronic signature technology can be used to ensure the authenticity and integrity of electronic information and the non-repudiation of the signer.
[0077] The inventors discovered that in proof-of-work block-producing node election schemes, the election of block-producing nodes before each block production is based on the amount of work a node contributes during the election process. When the elected node generates a new block, it often receives rewards from other nodes in the network, such as the node that initiated the signature. Therefore, nodes in the network are incentivized to contribute more and more computing power to compete with other nodes in order to become block-producing nodes. This incentive leads to an ever-increasing amount of computing power being invested in the entire network, resulting in significant computational resource consumption and consequently, substantial energy waste.
[0078] Based on the above analysis of the existing technology, the inventors have proposed a method such as Figure 1 The diagram shows an electronic signature blockchain consensus system based on quantum random numbers. The system will be illustrated below using a blockchain node running this system as an example.
[0079] In the quantum random number-based electronic signature blockchain consensus system, the electronic signature block generation module 150 is responsible for electing block nodes and generating new blocks 180.
[0080] The electronic signature block generation module 150 obtains the quantum election proof and block tag of the first block through the first block information acquisition module 160. The first block refers to the latest block on the local blockchain of the blockchain node. The electronic signature block generation module 150 also obtains the set of candidate blockchain nodes participating in the election through the blockchain node registry 120, thereby determining the number of participating blockchain nodes and thus the average block production probability of all candidate blockchain nodes. This average block production probability is, for example, the reciprocal of the number of participating blockchain nodes.
[0081] The electronic signature block generation module 150 is used to execute an electronic signature block generation method provided in this application embodiment, thereby realizing the election of block-producing nodes and the generation of new blocks. The electronic signature block generation module 150 takes the quantum election proof of the first block and the aforementioned average block production probability as input to the Poisson probability distribution algorithm and runs the algorithm. After running the Poisson probability distribution algorithm, the blockchain node obtains a winning random number and determines the identity of the block-producing node based on this winning random number and the node identifiers of multiple candidate blockchain nodes in the candidate blockchain node set.
[0082] If a blockchain node determines that it is not a block-producing node, it will not produce a block. If a blockchain node determines that it is a block-producing node, it will package the signature information in the electronic signature information cache pool 140 within the preset time period into a new block. Furthermore, the blockchain node acting as a block-producing node will generate a quantum election proof and a block tag for the new block using the current quantum random number obtained by the quantum random number acquisition module 110 and the block tag obtained by the first block information acquisition module 160.
[0083] The new block 180 may include the current quantum random number, the winning random number, the quantum election proof, the block tag, the block-producing node name, the in-block signature, the quantum election proof public key, the block tag public key, and the block-producing node public key. The signature information packaged into the new block 180 is the in-block signature of the new block 180. If the generation cycle of the new block 180 is, for example, 30 seconds, then every 30 seconds, a blockchain node in the network will generate a block signature using the electronic signature block generation module 150. Figure 1 The new block 180 is shown.
[0084] The following provides a detailed introduction to each component of the electronic signature blockchain consensus system based on quantum random numbers.
[0085] The quantum random number acquisition module 110 may include a quantum random number platform and acquire quantum random numbers through this platform. In each new block generation cycle (e.g., 30 seconds), the quantum random number acquisition module 110 can call the RESTFUL interface of the quantum random number platform based on the block height BlockH to obtain a fixed-length 256-bit quantum random number. Then, the block height and the quantum random number can be combined to form a random beacon DrandBeancon{BlockH,DRAND}, which is then passed to the electronic signature block generation module 150.
[0086] The quantum random number platform, for example, uses a quantum cryptography center deployed as a SaaS (Software as a Service) solution as its core function. The electronic signature block generation module 150 can access this core function by connecting to the quantum random number platform via an encrypted communication network. The quantum random number platform addresses the security issues arising from encryption / decryption and secure communication based on computer-generated pseudo-random numbers. The platform supports both API calls and web page access to provide quantum random numbers.
[0087] The blockchain node registration module 120 may include, for example, a blockchain node registry. Each blockchain node in the blockchain network is added to the registry during initialization, registering its name, IP address, and the size of its encrypted storage space. The set of candidate blockchain nodes participating in the election can be obtained through the aforementioned blockchain node registry.
[0088] The electronic signature platform module 130 may, for example, consist of an identity authentication submodule, an intelligent signing submodule, a signature management submodule, an encrypted storage submodule, and a signature verification module.
[0089] The identity authentication submodule is used to authenticate the signer's identity and can support identity authentication for both individual and enterprise users. It ensures the authenticity of multiple identities of the signer through intelligent algorithms, CA authentication, and comparison with the authoritative database of the Ministry of Public Security.
[0090] The intelligent signing submodule supports multiple signing modes such as audio and video signing and batch document signing, and provides functions such as intelligent positioning, thereby comprehensively meeting the diverse needs of enterprises in different business scenarios. The seal management submodule is used to manage signatures, seals, and certificates in a unified manner, binding them with digital certificates to achieve dedicated seals for dedicated personnel, ensuring the consistency of people, seals, signatures, and certificates.
[0091] The signature verification module is used to verify the signature. The encrypted storage submodule is used to provide end-to-end data preservation, with signed documents forming independent encrypted data packets. After an electronic signature is completed and encrypted data is generated, an electronic signature information is generated and pushed to the electronic signature information cache pool module 140.
[0092] The post-signature file management module 170 manages signed files, which are encrypted data packets associated with electronic information entries within a specific block on the blockchain. Block-producing nodes generate new blocks 180 after confirming their block-producing rights. Non-block-producing nodes are identified only through the electronic signature block generation module 150.
[0093] Before generating a new block 180, the electronic signature block generation module 150 also generates the quantum election proof and block tag for the new block. Figure 2 An internal structure of the electronic signature block generation module 150 is shown.
[0094] The electronic signature block generation module 150 includes a block-producing node election module 151. This module executes a Poisson probability distribution algorithm to obtain a winning random number, and then uses this winning random number combined with the node identifiers of candidate blockchain nodes obtained from the blockchain node registry 120 to determine the identity of the block-producing node. If a blockchain node determines itself to be a block-producing node, it generates a quantum election proof for the new block 180 through the quantum election proof generation module 152, and generates a block label for the new block 180 through the block label generation module 153.
[0095] In the electronic signature block generation module 150, a new block 180 is generated by the block generation module 154. The block generation module 154 obtains signature information from the electronic signature information cache pool module 140, quantum election proofs from the quantum election proof generation module 152, and block tags from the block tag generation module 153. The block generation module 154 then writes the obtained information into the new block 180.
[0096] The following describes the electronic signature block generation method provided in the embodiment of this application, which is applied in the electronic signature block generation module 150.
[0097] Figure 3 This illustration shows a flowchart of an electronic signature block generation method provided in an embodiment of this application. Figure 3 As shown, the electronic signature block generation method provided in this application includes the following steps:
[0098] S301. Obtain the candidate blockchain node set; the candidate blockchain node set includes the node identifiers of multiple candidate blockchain nodes;
[0099] For each candidate blockchain node, perform the following steps S302 to S304 respectively:
[0100] S302. Obtain the current quantum random number generated at the current moment, the electronic signature information within the current preset time period, and the quantum election proof and block label of the most recently generated first block;
[0101] S303. Determine the winning random number based on the Poisson probability distribution algorithm, the quantum election proof of the first block, and the block production probability; the block production probability is determined based on the number of nodes in the candidate blockchain node set, and each candidate blockchain node has the same block production probability.
[0102] S304. Based on the winning random number corresponding to each of the candidate blockchain nodes, select the target candidate blockchain node whose node identifier matches the winning random number from the candidate blockchain node set, and determine the target candidate blockchain node as the current block-producing node at the current moment.
[0103] S305. The current block-producing node performs quantum election proof processing on the current quantum random number and the winning random number to obtain the quantum election proof of the new block.
[0104] S306. The current block-producing node performs block signature processing on the block label of the first block to obtain the block label of the new block;
[0105] S307. The current block-producing node writes the electronic signature information within the current preset time period, the quantum election proof of the new block, the block label of the new block, the current quantum random number, the winning random number, and the node information of the current block-producing node into the new block, thereby generating a new block of the electronic signature blockchain.
[0106] In the electronic signature block generation method provided in this application embodiment, the election of block-producing nodes is determined according to the Poisson probability distribution algorithm. The two inputs to the Poisson probability distribution algorithm are the quantum election proof of the first block and the block production probability. The block production probability is determined based on the number of nodes in the candidate blockchain node set. The quantum election proof is determined based on the quantum random number obtained by the block-producing node during the generation of the first block. Due to the randomness and unpredictability of the quantum random number, matching the Poisson probability distribution algorithm, the final winning random number is also a random and unpredictable result. Therefore, candidate blockchain nodes cannot increase their chances of being selected as block-producing nodes by increasing computing power. Thus, in the electronic signature block generation method provided in this application embodiment, the election of block-producing nodes does not depend on the computing power of blockchain nodes, thereby discouraging blockchain nodes from investing more computing power in the block-producing node election process. Consequently, the electronic signature block generation method provided in this application embodiment can achieve the technical effect of saving computing power and electricity.
[0107] The following describes the specific implementation of each step in the electronic signature block generation method provided in the embodiments of this application.
[0108] In some embodiments, the blockchain node set in step S301 includes information about the blockchain nodes participating in the current round of election. The blockchain node information includes, for example, the identifier of the blockchain node, which may be, for example, a label of the blockchain node. The candidate blockchain nodes appearing in the candidate blockchain node set will participate in the election of block-producing nodes. Which blockchain nodes participate as candidate blockchain nodes in the election of block-producing nodes in the current round can be selected based on the blockchain node's storage capacity, whether it is idle, and other manually set criteria.
[0109] As an example, all blockchain nodes locally determine whether their storage capacity meets the requirements for participating in the election. If a blockchain node determines that its storage capacity meets the requirements, it participates in the block-producing node election. This storage capacity requirement can be, for example, that the available storage space of a blockchain node is greater than or equal to a preset available storage space value.
[0110] As another example, all blockchain nodes will automatically participate in the election when they are idle and have not performed operations such as producing blocks or verifying new blocks on the chain.
[0111] There are multiple candidate blockchain nodes participating in the election, and each candidate blockchain node executes steps S301 to S304. This determines the block-producing node in a round of election and reaches a consensus among the multiple candidate blockchain nodes.
[0112] In some embodiments, the current quantum random number in step S302 is a quantum random number generated at a certain moment by the candidate blockchain node via the quantum random number module 110. Quantum random numbers are generated based on the state of a quantum system, and according to quantum mechanics, the state of a quantum system at each moment is an unpredictable, purely probabilistic event. Therefore, quantum random numbers are unpredictable, and no blockchain node can predict or forge the quantum random number obtained in this round of election.
[0113] In some embodiments, the electronic signature information in step S302 may include the username, public key, and file path of the electronic signature. There may be multiple electronic signature information entries.
[0114] In some embodiments, the block label in step S302 is used to represent a block. For example, the block label in the first block represents the first block, and the block label in the new block represents the new block. The block label is, for example, a VRF string.
[0115] In some embodiments, in step S303, the block production probability can be the reciprocal of the number of candidate blockchain nodes, and each candidate blockchain node has the same block production probability. The quantum election proof of the first block is obtained based on the quantum random number and the winning random number obtained during the election of the first block.
[0116] In some embodiments, in step S304, the node identifier of the candidate blockchain node may be, for example, a number or a range of numbers. The matching of the node identifier and the winning random number may be that the node identifier is equal to the winning random number, or the winning random number falls within the range of numbers of the node identifier.
[0117] Block nodes can be elected randomly through steps S301 to S304.
[0118] The following section describes the process in S303 of inputting the block probability and the quantum election proof of the first block into the Poisson probability distribution algorithm to obtain the winning random number.
[0119] In some embodiments, step S303 includes, for example: Figure 4 The steps shown are as follows:
[0120] S401. Process the quantum election proof in the first block to obtain the first random number in decimal format;
[0121] S402. Process the first random number to obtain the random source;
[0122] S403. Input the random source and the block probability into the Poisson probability distribution algorithm for calculation to obtain the winning random number.
[0123] By converting the quantum election proof into a random source for the Poisson probability distribution algorithm through steps S401 to S403, the technical effect of randomly obtaining the winning random number through the quantum election proof is achieved.
[0124] In some embodiments, step S401 includes, for example, Figure 5 The steps shown are as follows:
[0125] S501. Perform hash processing on the quantum election proof within the first block to obtain the binary hash processing result;
[0126] S502. Convert the hash processing result into a decimal number to obtain the first random number.
[0127] Step S501 converts the quantum election proof into an encrypted array for use in the subsequent Poisson probability distribution algorithm, and randomly generates the winning random number.
[0128] In some embodiments, in step S501, the hash processing may be, for example, the blake2b.Sum256 encryption algorithm, and the hash processing result obtained by the blake2b.Sum256 encryption algorithm is a 256-bit binary data.
[0129] In some embodiments, in step S502, the decimal number can be obtained through the BigFromBytes.Int function, which can convert 256-bit binary data into a decimal integer.
[0130] Let's take a concrete example to illustrate the process of obtaining the first random number from step S401.
[0131] The quantum election proof ElectionProof1 of the first block is input into the blake2b.Sum256 function to get h[:] = blake2b.Sum256(ElectionProof1);
[0132] Then, by using lhs[:] = BigFromBytes(h[:]).Int, the first random number converted to decimal is obtained.
[0133] In some embodiments, in step S402, the random source is, for example, equal to the first random number / (2^256-1). Therefore, the random source can be obtained by comparing the first random number with the maximum value obtainable by the blake2b.Sum256 function; thereby projecting the position of the first random number in the range of 2 to the power of 256 to a value in the range of 0 to 1.
[0134] After obtaining the random source through step S402, step S403 is executed to obtain the winning random number.
[0135] In some embodiments, step S403 includes, for example, Figure 6 The following steps are shown:
[0136] S610, Set the number of iterations, and the initial values of the first and second temporary variables;
[0137] S620. Determine whether the random source is greater than or equal to the second temporary variable;
[0138] If the result of the judgment is that the random source is less than the second temporary variable, the following steps S621 to S623 are executed repeatedly until the random source is greater than or equal to the second temporary variable:
[0139] S621. Update the first temporary variable based on its initial value, block production probability, and the updated number of cycles.
[0140] S622. Update the second temporary variable based on its initial value and the updated first temporary variable.
[0141] S623. Set the initial value of the first temporary variable to the updated first temporary variable, set the initial value of the second temporary variable to the updated second temporary variable, and update the loop count by incrementing the loop count by one.
[0142] If the result indicates that the random source is greater than or equal to the second temporary variable, proceed to step S630.
[0143] S630. The number of loops that satisfy the condition that the random source is greater than or equal to the second temporary variable is determined as the winning random number.
[0144] Through the aforementioned iterative steps, a winning random number is ultimately obtained. This winning random number is subsequently used to determine the block-producing node. Taking the genesis block as an example, all candidate blockchain nodes obtain the genesis block as their starting block and the quantum election proof of the genesis block as their random source, with each candidate blockchain node having an equal probability of producing a block. Therefore, during the generation of new blocks after the genesis block, when determining the block-producing node of the new block through the aforementioned iterative steps, any candidate blockchain node will obtain the same winning random number, thus achieving consensus among all candidate blockchain nodes and confirming who the block-producing node is. Once a candidate blockchain node in the network determines itself as the block-producing node through the winning random number, it will execute the subsequent operation of generating a new block. In the subsequent new block generation process, the election of the block-producing node in each round follows the above iterative steps, thus ensuring that consensus can be reached among the candidate blockchain nodes in each round of block-producing node election, thereby avoiding forks in the electronic signature blockchain network.
[0145] In some embodiments, the first temporary variable is, for example, pmf = exp(-lam); that is, the first temporary variable is the negative lam power of the natural exponent, where lam is the value of the block probability projected onto the range of 2 to the power of 256, for example, lam = (1 / M)*(2^256-1). M is, for example, the number of candidate blockchain nodes participating in the election.
[0146] In some embodiments, the second temporary variable is, for example, rhs = 1 - pmf. The number of iterations is represented by the loop variable j, which can be initially set to 0 and assigned a value of 1 in the first iteration. Of course, the initial value of j can also be set to other values.
[0147] In some embodiments, in step S621, the update of the first loop variable may be, for example, pmf = pmf * (lam / j).
[0148] As an example, lam in the term pmf = pmf * (lam / j) can be lam = (1 / M) * (2^256 - 1) as described above.
[0149] As another example, the lam in pmf = pmf * (lam / j) can also be chosen differently, for example, determined by the current block height and the number of candidate blockchain nodes. Here, lam is, for example, the product of the current block height and the number of candidate blockchain nodes, where the current block height is, for example, the height of the first block.
[0150] In some embodiments, in step S622, the update of the second loop variable may be, for example, rhs = rhs - pmf.
[0151] After the above loop, step S630 will output a winning random number. Then, step S304 will select a target candidate blockchain node whose node identifier matches the winning random number from the candidate blockchain node set as the block producing node, based on the winning random number output in step S630.
[0152] After the block-producing node is elected, it performs steps S305 and S306 to generate a quantum election proof and block tag for the new block. Finally, step S307 writes the signature record and all necessary information for block verification into the new block. After the new block is generated, the block-producing node sends it to other blockchain nodes in the network. These nodes, after verifying the new block's validity, add it to their local blockchains.
[0153] In some embodiments, step S305 includes, for example, Figure 7 The following steps are shown:
[0154] S701. Generate the first public-private key pair of the current block-producing node using the quantum election proof algorithm;
[0155] S702. Use the private key in the first public-private key pair to encrypt the current quantum random number and the winning random number to obtain the quantum election proof tag of the new block.
[0156] The quantum election proof of the new block can serve as the random source required by the Poisson probability distribution algorithm in the next round of elections. Furthermore, after the new block is sent from the block-producing node to other blockchain nodes in the network, these nodes can verify the legitimacy of the block-producing node by verifying whether the quantum election proof was generated from the current quantum random number and the winning random number.
[0157] In some embodiments, in step S701, the quantum election proof algorithm may include a key generation algorithm for generating a first public-private key pair. The quantum election proof algorithm can generate a quantum election proof through the VRF_proof function.
[0158] As an example, the first public-private key pair includes a first public key and a first private key. The first private key is used for encryption, for example, and the corresponding first public key is written into a new block and used by other blockchain nodes to decrypt it.
[0159] To give a concrete example, the key generation algorithm in the quantum election proof algorithm first generates a first public key PK1 and a first private key SK1. Then, the quantum election proof ElectionProof is generated using the VRF_proof function.
[0160] The code example is ElectionProof = P1 = VRF_proof(SK1, DRAND + WinCount); where DRAND represents the current quantum random number and WinCount represents the winning random number.
[0161] After generating the quantum election proof, the process also includes, for example, generating R1 = VRF_Hash(SK1, DRAND + WinCount), where R1 corresponds to the hash value of the quantum election proof. The quantum election proof and its hash value are used by other blockchain nodes to verify the block-producing node of the new block.
[0162] In some embodiments, step S306 includes, for example, Figure 8 The following steps are shown:
[0163] S801. Generate the second public-private key pair of the current block-producing node using the block tag algorithm;
[0164] S802. Use the private key in the second public-private key pair to encrypt the block label of the first block to obtain the block label of the new block.
[0165] The block tag of a new block allows other blockchain nodes to verify whether the new block was generated based on the previous block in their local blockchain. A new block is only added to the local blockchain of other blockchain nodes if the node that produced the new block is legitimate and the new block was generated based on the previous block in the local blockchain of those other blockchain nodes.
[0166] In some embodiments, the block tagging algorithm in step S801 may also include a key generation algorithm. The block tagging algorithm may be, for example, the VRF_proof function.
[0167] As an example, the key generation algorithm in the block labeling algorithm generates a second public key PK2 and a second private key SK2. The VRF_proof function then uses the second private key to generate the block label for the new block. The block label of the new block is P2 = VRF_proof(SK2, ticket), where ticket is the block label of the first block.
[0168] Following the example above, the block label algorithm may also include the VRF_Hash function to generate the block label hash value R2 = VRF_Hash(SK2, ticket) for the corresponding new block.
[0169] In one embodiment of this application, in step S802, the block label of the new block may carry information other than the block label of the first block. That is, the encryption object of the second private key may include the block label of the first block, the current quantum random number, and / or the signature information accumulated before the current block production. Accordingly, in the block label algorithm, the input quantities in the VRF_proof and VRF_Hash functions may include the current quantum random number, and / or the signature information accumulated before the current block production, in addition to the block label of the first block.
[0170] Following the example above, after obtaining the quantum election proof and block label of the new block, the block generation module 340 writes the quantum election proof and block label of the new block, along with their corresponding hash values, the first public key, and the second public key, into the new block.
[0171] In some embodiments, the new block also includes the first public key from the first public-private key pair. Following step S307, which generates a new block for the electronic signature blockchain, the electronic signature block generation method further includes, as follows: Figure 9 The steps shown are as follows:
[0172] S901. The current block-producing node sends the new block to the first target node, which is any node in the blockchain other than the current block-producing node.
[0173] The first target node performs the following operations:
[0174] S902. Read the first public key, the current quantum random number, and the winning random number from the first public-private key pair belonging to the new block;
[0175] S903. Use the first public key belonging to the first public-private key pair to decrypt the quantum election proof of the new block and obtain the decryption result;
[0176] S904. Compare whether the decryption result is consistent with the current quantum random number and the winning random number;
[0177] S905. If the results are consistent, the quantum election proof is deemed to have passed verification; if the results are inconsistent, the quantum election proof is deemed to have failed verification.
[0178] The first target node, for example, is a non-block-producing node in the current round of the network. After obtaining a new block, the first target node verifies the quantum election proof through the steps described above to verify whether the block-producing node of the new block is the same node elected in this round. Since the quantum random number obtained in this round of election is unpredictable, and the winning random number is based on the quantum election proof of the first block, verifying the quantum election proof of the new block can clearly determine whether the block-producing node of the new block is the same node elected in this round, and whether the new block was generated based on this round of election. This improves the security of the electronic signature block generation method.
[0179] In some embodiments, the new block may include the hash value of the quantum election proof. Before step S903, the first target block may verify, for example, whether the received hash value R1 and the quantum election proof correspond by first using the VRF_proof_to_hash function.
[0180] As an example, the specific code for verifying the hash value R1 and the quantum election proof is, for instance, VRF_proof_to_hash(ElectionProof), where ElectionProof is the quantum election proof for the new block. The output of VRF_proof_to_hash(ElectionProof) is a hash value. When this hash value matches the hash value R1, the received hash value R1 corresponds to the quantum election proof. Step S903 is only executed after the hash value R1 and the quantum election proof correspond.
[0181] In some embodiments, in step S903, the function used to decrypt the quantum election proof of the new block using the public key can be, for example, the VRF_verify function.
[0182] For a concrete example, in step S903, the code for verifying the quantum election proof of the new block is as follows: (TRUE, FALSE) = VRF_verify(PK1, DRAND + WinCount, ElectionProof). The VRF_verify function decrypts the quantum election proof ElectionProof using the first public key PK1, and compares the decrypted result with the strings of the current quantum random number DRAND and the winning random number WinCount. If they match, the output is TRUE, meaning the quantum election proof of the new block has been verified; otherwise, the output is FALSE, meaning the quantum election proof of the new block has failed verification.
[0183] After the quantum election proof of the new block is verified, the first target node may also include a step to verify the validity of the block label of the new block, and the new block will only be added to the local blockchain if both the quantum election proof and the block label of the new block are valid.
[0184] In some embodiments, the new block also includes the public key from the second public-private key pair. Following step S307, which generates a new block for the electronic signature blockchain, the electronic signature block generation method further includes, as follows: Figure 10 The steps shown are as follows:
[0185] S1001. The current block-producing node sends the new block to the second target node, which is any node in the blockchain other than the current block-producing node.
[0186] The second target node performs the following operations:
[0187] S1002, Read the first public key, the current quantum random number, and the winning random number belonging to the second public-private key pair from the new block;
[0188] S1003. Use the first public key in the second public-private key pair to decrypt the block tag of the new block to obtain the decryption result;
[0189] S1004. Compare whether the decryption result matches the block label of the latest block on the chain of the second target node;
[0190] S1005. If the results are consistent, the block label verification of the new block is confirmed to be successful; if the results are inconsistent, the block label verification of the new block is confirmed to be unsuccessful.
[0191] The first and second target nodes can be, for example, the same node, or they can be different nodes. Verifying the block tag of the new block confirms whether the electronic signature of the new block inherits the electronic signature record in the existing block; and whether the latest block on the local blockchain of the second target node is the same block as the first block mentioned above, that is, whether the blockchain of the second target node and the blockchain of the block-producing node are the same chain, thereby determining that the electronic signature information recorded by the two is the same, and the new block can be added to these two chains at the same time.
[0192] In some embodiments, the new block may include the hash value of the block label. Before step S1003, the second target block may, for example, first verify whether the received hash value R2 and the block label of the new block correspond by using the VRF_proof_to_hash function.
[0193] As an example, the specific code for verifying the hash value R2 and the block label is, for instance, VRF_proof_to_hash(P2), where P2 is the block label of the new block. The output of VRF_proof_to_hash(P2) is a hash value. When this hash value matches the hash value R2, then the received hash value R2 corresponds to the block label of the new block. Step S1003 is only executed after the hash value R2 and the block label of the new block correspond.
[0194] In some embodiments, in step S1003, the function used to decrypt the block tag of the new block using the public key may be, for example, the VRF_verify function.
[0195] For a concrete example, in step S1003, the code for verifying the block tag of the new block is as follows: (TRUE, FALSE) = VRF_verify(PK2, ticket2, P2). Here, ticket2 is the block tag of the latest block on the second target node's chain. The VRF_verify function decrypts the block tag P2 of the new block using the second public key PK2 and compares the decryption result with ticket2. If they match, it outputs TRUE, meaning the new block can be added to the second target node's chain and become the latest block; otherwise, it outputs FALSE, meaning the new block cannot be added to the second target node's chain.
[0196] In step S1003, the VRF_verify function verifies whether the block tag of the new block is generated by the block tag of the latest block on the chain of the second target node. That is, it verifies whether the latest block on the chain of the second target node and the first block in the block producing node are the same block, and whether the new block can be added to both blocks at the same time.
[0197] In summary, the quantum random number-based electronic signature blockchain consensus system provided in this application uses quantum random numbers as the random source for the block election algorithm and the Poisson probability distribution algorithm as an equal-chance lottery algorithm to randomly select the block-producing node for each round of election. This block-producing node records all electronic signature information within a preset time period into the newly generated block, thus generating a new block. The quantum random number-based electronic signature blockchain consensus system generates new blocks through the electronic signature block generation method provided in this application. The electronic signature block generation method obtains quantum random numbers for a preset time period from a quantum random number platform and uses these quantum random numbers as random beacons. The system registers all nodes in the blockchain into the blockchain node registry and selects block-producing nodes with equal probability using the Poisson probability distribution algorithm. The block-producing node uses the quantum random numbers as input to the quantum election proof algorithm to generate a quantum election proof. The quantum election proof serves as the proof marker for the block produced by the block-producing node. Simultaneously, the block-producing node takes the quantum random number and the quantum block tag of the previous block as input parameters, processes them through the block quantum signature algorithm, and generates the quantum block tag of the current block. The quantum block tag of the block serves as a marker of the block's identity. Then, the block-producing node writes all electronic signature information within a preset time period (e.g., username, user public key, and electronic signature file path for each electronic signature within 30 seconds), the quantum random number, the winning random number, the quantum election proof tag, the current block's block tag (e.g., the quantum block tag), the block-producing node name, the quantum election proof public key, and the quantum block signature public key into the block.
[0198] The electronic signature block generation method provided in this application obtains quantum random numbers from a quantum platform to ensure that the block is generated at the current moment, and uses these numbers to generate election proofs and block tags. Therefore, the electronic signature block generation method provided in this application ensures the randomness of the block-producing node, preventing blockchain nodes from forging themselves as block-producing nodes. This eliminates the need to compete on computing power and share, saving resources. Simultaneously, by obtaining quantum random numbers from a quantum platform to ensure that the block is generated at the current moment, and using these numbers to generate election proofs and block signatures, it prevents blockchain nodes from forging blocks and forging elections, deceiving other blockchain nodes, and causing network paralysis.
[0199] In the electronic signature block generation method provided in this application embodiment, the election process for block-producing nodes is random, thus ensuring that no node participating in each round of election can forge a block-producing node. Furthermore, due to the randomness of the election process, there is no incentive for blockchain nodes in the network to contribute more computing power. Therefore, compared to existing election schemes that obtain block-producing rights through proof-of-work, the electronic signature block generation method provided in this application embodiment does not require various blockchains to compete in computing power, thereby saving computing resources and avoiding electricity waste.
[0200] Furthermore, this application uses quantum random numbers to further enhance encryption strength and randomness, and then employs a Poisson probability distribution algorithm to elect block-producing nodes, ensuring that all participating blockchain nodes produce blocks equally. This not only improves security but also avoids wasting electricity.
[0201] The electronic signature block generation method provided in this application can be widely applied to blockchain-related application scenarios. Figure 1 and Figure 11 The example shown is an electronic signature blockchain consensus system based on quantum random numbers. In the scenario of image blind watermark electronic signatures, the quantum random number-based electronic signature blockchain consensus system generates new blocks based on the electronic signature block generation method. Each block can contain a random beacon at the current moment. The random beacon may include, for example, the quantum random number obtained during each round of new block generation and the current block height. The signature verification module of the electronic signature platform 230 reads the random beacon and writes it into the blind watermark of the original image data 1110, generating the signed image data. When signature verification is required, the signature verification module parses the random beacon from the blind watermark data in the signed image data 1120, and then verifies whether the random beacon exists on the blockchain. If it exists, the signature verification is successful.
[0202] One embodiment of this application also provides an electronic signature block generation apparatus. For example... Figure 12 As shown, the electronic signature block generation device includes:
[0203] The data acquisition module 1210 is used to acquire a set of candidate blockchain nodes; the set of candidate blockchain nodes includes the node identifiers of multiple candidate blockchain nodes; and is used to acquire the current quantum random number generated at the current moment, the electronic signature information within the current preset time period, and the quantum election proof and block label of the most recently generated first block;
[0204] The block-producing node selection module 1220 is used to determine the winning random number based on the Poisson probability distribution algorithm, the quantum election proof of the first block, and the block-producing probability; the block-producing probability is determined based on the number of nodes in the candidate blockchain node set; and it is used to select the target candidate blockchain node whose node identifier matches the winning random number from the candidate blockchain node set based on the winning random number corresponding to each of the candidate blockchain nodes, and determine the target candidate blockchain node as the current block-producing node at the current moment;
[0205] The encryption module 1230 is used by the current block-producing node to perform quantum election proof processing on the current quantum random number and the winning random number to obtain the quantum election proof of the new block; and is used by the current block-producing node to perform block signature processing based on the block label of the first block to obtain the block label of the new block.
[0206] The block generation module 1240 is used to write the electronic signature information within the current preset time period, the quantum election proof of the new block, the block label of the new block, the current quantum random number, the winning random number, and the node information of the current block-producing node into the new block, thereby generating a new block of the electronic signature blockchain.
[0207] In some embodiments, the block node selection module 1220 may include:
[0208] The first data processing submodule is used to process the quantum election proof within the first block to obtain the first random number in decimal format;
[0209] The second data processing submodule is used to process the first random number to obtain the random source;
[0210] The Poisson probability distribution algorithm submodule is used to input the random source and the block probability into the Poisson probability distribution algorithm for calculation to obtain the winning random number.
[0211] In some embodiments, the Poisson probability distribution algorithm submodule includes:
[0212] An initialization unit is used to set the loop count, the initial values of the first temporary variable and the second temporary variable. The initial value of the loop count is 0.
[0213] The loop unit is used to repeatedly execute steps one through three until the random source is greater than or equal to the second temporary variable:
[0214] Step 1: Update the first temporary variable based on its initial value, block production probability, and the updated loop count.
[0215] Step 2: Update the second temporary variable based on its initial value and the updated first temporary variable;
[0216] Step 3: Set the initial value of the first temporary variable to the updated first temporary variable, set the initial value of the second temporary variable to the updated second temporary variable, and update the loop count by incrementing the loop count by one;
[0217] The winning random number output unit is used to determine the winning random number by the number of iterations when the random source is greater than or equal to the second temporary variable.
[0218] In some embodiments, the encryption module 1230 includes:
[0219] Quantum Election Proof Key Generation Submodule: Used to generate the first public-private key pair of the current block-producing node using the quantum election proof algorithm;
[0220] Quantum Election Proof Generation Submodule: Used to encrypt the current quantum random number and the winning random number using the private key in the first public-private key pair to obtain the quantum election proof tag of the new block.
[0221] Block tag key generation submodule: used to generate the second public-private key pair of the current block-producing node using the block tag algorithm;
[0222] Block tag generation submodule: Used to encrypt the block tag of the first block using the private key in the second public-private key pair to obtain the block tag of the new block.
[0223] In some embodiments, the electronic signature block generation apparatus includes a quantum election proof verification module. The quantum election proof verification module includes:
[0224] The first verification data acquisition submodule is used to read the public key, the current quantum random number, and the winning random number belonging to the first public-private key pair from the new block;
[0225] The quantum election proof verification submodule uses the public key belonging to the first public-private key pair to decrypt the quantum election proof of the new block and obtain the decryption result; it is used to compare whether the decryption result is consistent with the current quantum random number and the winning random number; and it is used to determine whether the quantum election proof verification is successful if they are consistent, and whether the quantum election proof verification is unsuccessful if they are inconsistent.
[0226] In some embodiments, the electronic signature block generation apparatus includes a block label verification module. The block label verification module includes:
[0227] The second verification data acquisition submodule is used to read the public key, the current quantum random number, and the winning random number belonging to the second public-private key pair from the new block;
[0228] The block tag verification submodule is used to decrypt the block tag of the new block using the public key in the second public-private key pair to obtain the decryption result; and to compare whether the decryption result is consistent with the block tag of the latest block on the chain of the second target node; and to determine whether the block tag verification of the new block is successful if they are consistent, and whether the block tag verification of the new block is unsuccessful if they are inconsistent.
[0229] The electronic signature block generation device in this application embodiment can execute the electronic signature block generation method of any embodiment in this application and has the technical effects of the electronic signature block generation method as described above, so it will not be repeated here.
[0230] Figure 13 A schematic diagram of the hardware structure of the electronic signature block generation device provided in an embodiment of this application is shown.
[0231] The electronic signature block generation device may include a processor 1310 and a memory 1320 storing computer program instructions.
[0232] Specifically, the processor 1310 may include a central processing unit (CPU), an application-specific integrated circuit (ASIC), or one or more integrated circuits that can be configured to implement the embodiments of this application.
[0233] Memory 1320 may include mass storage for data or instructions. For example, and not limitingly, memory 1320 may include a hard disk drive (HDD), floppy disk drive, flash memory, optical disk, magneto-optical disk, magnetic tape, or Universal Serial Bus (USB) drive, or a combination of two or more of these. Where appropriate, memory 1320 may include removable or non-removable (or fixed) media. Where appropriate, memory 1320 may be internal or external to the integrated gateway disaster recovery device. In a particular embodiment, memory 1320 is non-volatile solid-state memory.
[0234] In a particular embodiment, memory 1320 includes read-only memory (ROM). Where appropriate, the ROM may be a mask-programmed ROM, a programmable ROM (PROM), an erasable PROM (EPROM), an electrically erasable PROM (EEPROM), an electrically rewritable ROM (EAROM), or flash memory, or a combination of two or more of these.
[0235] Memory may include read-only memory (ROM), random access memory (RAM), disk storage media devices, optical storage media devices, flash memory devices, and electrical, optical, or other physical / tangible memory storage devices. Therefore, typically, memory includes one or more tangible (non-transitory) computer-readable storage media (e.g., memory devices) encoded with software including computer-executable instructions, and when the software is executed (e.g., by one or more processors), it is operable to perform the operations described with reference to the methods according to one aspect of this disclosure.
[0236] The processor 1310 reads and executes computer program instructions stored in the memory 1320 to implement any of the electronic signature block generation methods in the above embodiments.
[0237] In one example, the electronic signature block generation device may also include a communication interface 1330 and a bus 1340. For example, Figure 3As shown, the processor 1310, memory 1320, and communication interface 1330 are connected through bus 1340 and complete communication with each other.
[0238] The communication interface 1330 is mainly used to realize communication between various modules, devices, units and / or equipment in the embodiments of this application.
[0239] Bus 1340 includes hardware, software, or both, that couples components of an online data traffic metering device together. For example, and not limitingly, the bus may include an Accelerated Graphics Port (AGP) or other graphics bus, an Enhanced Industry Standard Architecture (EISA) bus, a Front Side Bus (FSB), HyperTransport (HT) interconnect, an Industry Standard Architecture (ISA) bus, an Infinite Bandwidth Interconnect, a Low Pin Count (LPC) bus, a memory bus, a Microchannel Architecture (MCA) bus, a Peripheral Component Interconnect (PCI) bus, a PCI-Express (PCI-X) bus, a Serial Advanced Technology Attachment (SATA) bus, a Video Electronics Standards Association Local (VLB) bus, or other suitable buses, or combinations of two or more of these. Where appropriate, bus 1340 may include one or more buses. Although specific buses are described and illustrated in embodiments of this application, any suitable bus or interconnect is contemplated herein.
[0240] Furthermore, in conjunction with the electronic signature block generation method in the above embodiments, this application provides a computer program product. When the instructions of this computer program product are executed by the processor of an electronic device, they implement any of the electronic signature block generation methods in the above embodiments.
[0241] It should be clarified that this application is not limited to the specific configurations and processes described above and shown in the figures. For the sake of brevity, detailed descriptions of known methods are omitted here. In the above embodiments, several specific steps are described and shown as examples. However, the method process of this application is not limited to the specific steps described and shown. Those skilled in the art can make various changes, modifications, and additions, or change the order of steps, after understanding the spirit of this application.
[0242] The functional blocks shown in the above-described structural diagram can be implemented as hardware, software, firmware, or a combination thereof. When implemented in hardware, they can be, for example, electronic circuits, application-specific integrated circuits (ASICs), appropriate firmware, plug-ins, function cards, etc. When implemented in software, the elements of this application are programs or code segments used to perform the required tasks. Programs or code segments can be stored on a machine-readable medium or transmitted over a transmission medium or communication link via data signals carried on a carrier wave. "Machine-readable medium" can include any medium capable of storing or transmitting information. Examples of machine-readable media include electronic circuits, semiconductor memory devices, ROM, flash memory, erasable ROM (EROM), floppy disks, CD-ROMs, optical disks, hard disks, fiber optic media, radio frequency (RF) links, etc. Code segments can be downloaded via computer networks such as the Internet, intranets, etc.
[0243] It should also be noted that the exemplary embodiments mentioned in this application describe methods or systems based on a series of steps or apparatus. However, this application is not limited to the order of the above steps; that is, the steps can be performed in the order mentioned in the embodiments, or in a different order, or several steps can be performed simultaneously.
[0244] The aspects of this disclosure have been described above with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this disclosure. It should be understood that each block in the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing apparatus to produce a machine such that these instructions, executable via the processor of the computer or other programmable data processing apparatus, enable the implementation of the functions / actions specified in one or more blocks of the flowchart illustrations and / or block diagrams. Such a processor can be, but is not limited to, a general-purpose processor, a special-purpose processor, a special application processor, or a field-programmable logic circuit. It is also understood that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can also be implemented by special-purpose hardware performing the specified functions or actions, or can be implemented by a combination of special-purpose hardware and computer instructions.
[0245] The above description is merely a specific implementation of this application. Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, modules, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here. It should be understood that the protection scope of this application is not limited thereto. Any person skilled in the art can easily conceive of various equivalent modifications or substitutions within the technical scope disclosed in this application, and these modifications or substitutions should all be covered within the protection scope of this application.
Claims
1. A method for generating electronic signature blocks, characterized in that, The method includes: Obtain a set of candidate blockchain nodes; the set of candidate blockchain nodes includes node identifiers of multiple candidate blockchain nodes; Perform the following steps A through C for each candidate blockchain node: Step A: Obtain the current quantum random number generated at the current moment, the electronic signature information within the current preset time period, and the quantum election proof and block label of the most recently generated first block; Step B: Determine the winning random number based on the Poisson probability distribution algorithm, the quantum election proof of the first block, and the block production probability; the block production probability is determined based on the number of nodes in the candidate blockchain node set. Step C: Based on the winning random number corresponding to each of the candidate blockchain nodes, select a target candidate blockchain node whose node identifier matches the winning random number from the candidate blockchain node set, and determine the target candidate blockchain node as the current block-producing node at the current moment; The current block-producing node performs quantum election proof processing on the current quantum random number and the winning random number to obtain the quantum election proof of the new block; The current block-producing node performs block signature processing on the block label of the first block to obtain the block label of the new block; The current block-producing node writes the electronic signature information within the current preset time period, the quantum election proof of the new block, the block label of the new block, the current quantum random number, the winning random number, and the node information of the current block-producing node into the new block, thereby generating the new block of the electronic signature blockchain.
2. The electronic signature block generation method according to claim 1, characterized in that, Step B includes: The quantum election proof within the first block is processed to obtain a first random number in decimal format; The first random number is processed to obtain a random source; The random source and the block probability are input into the Poisson probability distribution algorithm for calculation to obtain the winning random number.
3. The electronic signature block generation method according to claim 2, characterized in that, The process of processing the quantum election proof within the first block to obtain a first random number in decimal format includes: The quantum election proof within the first block is hashed to obtain a binary hash result; The hash result is converted into a decimal number to obtain the first random number.
4. The electronic signature block generation method according to claim 2, characterized in that, The step of inputting the random source and the block probability into the Poisson probability distribution algorithm for calculation to obtain the winning random number includes: Set the number of iterations, and the initial values for the first and second temporary variables; Repeat steps one through three until the random source is greater than or equal to the second temporary variable: Step 1: Update the first temporary variable based on its initial value, the block production probability, and the updated number of iterations. Step 2: Update the second temporary variable based on its initial value and the updated first temporary variable; Step 3: Set the initial value of the first temporary variable to the updated first temporary variable, set the initial value of the second temporary variable to the updated second temporary variable, and update the loop count by incrementing the loop count by one; The number of iterations when the random source is greater than or equal to the second temporary variable is determined as the winning random number.
5. The method for generating electronic signature blocks according to any one of claims 1-4, characterized in that, The current block-producing node performs quantum election proof processing on the current quantum random number and the winning random number to obtain the quantum election proof of the new block, including: The first public-private key pair of the current block-producing node is generated using a quantum election proof algorithm; The current quantum random number and the winning random number are encrypted using the private key from the first public-private key pair to obtain the quantum election proof tag of the new block.
6. The method for generating electronic signature blocks according to any one of claims 1-4, characterized in that, The current block-producing node performs block signing processing based on the block tag of the first block to obtain the block tag of the new block; including: The second public-private key pair of the current block-producing node is generated using a block tagging algorithm; The block label of the first block is encrypted using the private key from the second public-private key pair to obtain the block label of the new block.
7. The electronic signature block generation method according to claim 5, characterized in that, The new block also includes the public key from the first public-private key pair; After generating the new block of the electronic signature blockchain, the method further includes: The current block-producing node sends the new block to the first target node, which is any node in the blockchain other than the current block-producing node. The first target node performs the following operations: Read the public key belonging to the first public-private key pair, the current quantum random number, and the winning random number from the new block; The quantum election proof of the new block is decrypted using the public key belonging to the first public-private key pair to obtain the decryption result; Compare the decryption result with the current quantum random number and the winning random number to see if they are consistent; If the results are consistent, the quantum election proof is deemed to have passed verification; if they are inconsistent, the quantum election proof is deemed to have failed verification.
8. The electronic signature block generation method according to claim 6, characterized in that, The new block also includes the public key of the current block-producing node belonging to the second public-private key pair. After generating the new block of the electronic signature blockchain, the method further includes: The current block-producing node sends the new block to the second target node, which is any node in the blockchain other than the current block-producing node. The second target node performs the following operations: Read the public key belonging to the second public-private key pair, the current quantum random number, and the winning random number from the new block; The block tag of the new block is decrypted using the public key in the second public-private key pair to obtain the decryption result; Compare whether the decryption result matches the block tag of the latest block on the chain of the second target node; If the results are consistent, the block label verification of the new block is determined to be successful; if the results are inconsistent, the block label verification of the new block is determined to be unsuccessful.
9. An electronic signature block generation device, characterized in that, include: The data acquisition module is used to acquire a set of candidate blockchain nodes; the set of candidate blockchain nodes includes node identifiers of multiple candidate blockchain nodes. It is used to obtain the current quantum random number generated at the current moment, the electronic signature information within the current preset time period, and the quantum election proof and block label of the most recently generated first block; The block-producing node selection module is used to determine the winning random number based on the Poisson probability distribution algorithm, the quantum election proof of the first block, and the block-producing probability; the block-producing probability is determined based on the number of nodes in the candidate blockchain node set. It is used to select a target candidate blockchain node whose node identifier matches the winning random number from the set of candidate blockchain nodes based on the winning random number corresponding to each of the candidate blockchain nodes, and to determine the target candidate blockchain node as the current block-producing node at the current moment; An encryption module is used by the current block-producing node to perform quantum election proof processing on the current quantum random number and the winning random number to obtain the quantum election proof of the new block; And it is used by the current block-producing node to perform block signing processing based on the block tag of the first block to obtain the block tag of the new block; The block generation module is used to write the electronic signature information within the current preset time period, the quantum election proof of the new block, the block label of the new block, the current quantum random number, the winning random number, and the node information of the current block-producing node into the new block, thereby generating the new block of the electronic signature blockchain.
10. An electronic device, characterized in that, The device includes: a processor and a memory storing computer program instructions; When the processor executes the computer program instructions, it implements the electronic signature block generation method as described in any one of claims 1-8.
11. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer program instructions, which, when executed by a processor, implement the electronic signature block generation method as described in any one of claims 1-8.
12. A computer program product, characterized in that, When the instructions in the computer program product are executed by the processor of the electronic device, the electronic device performs the electronic signature block generation method as described in any one of claims 1-8.
Citation Information
Patent Citations
Quantum blockchain construction method based on entrusting profit certification extension
CN110474765A
Network for improved verification speed with tamper resistant data
CN110832825A