Electronic signature block generation method and device, equipment and related product
The Poisson probability distribution algorithm and quantum random numbers are used to elect block nodes in the electronic signature blockchain, which solves the problem of computing power consumption caused by node election relying on computing power, achieves the effect of saving computing power and electricity, and improves The security of the blockchain.
Patent Information
- Application Number
- CN202411087722.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-08
- Publication Date
- 2024-10-18
- Estimated Expiration
- 2044-08-08
AI Technical Summary
In the existing electronic signature block generation process, node election relies on computing power competition, resulting in a large amount of computing power consumption and power waste. How to reduce computing power has become a technical challenge.
The Poisson probability distribution algorithm is used to determine the block node through quantum random numbers and the number of blockchain nodes to avoid relying on the computing power of the blockchain node, thus discouraging the investment of more computing power in the blockchain node election process. .
It achieves the effect of saving computing power and electricity, avoids the waste of electricity caused by computing power competition in the blockchain network, and improves the security and randomness of the blockchain.
Smart Images

Figure CN118802108A_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of electronic signature technology, and in particular, relates to an electronic signature block generation method, device, equipment, computer storage medium and product. Background Art
[0002] In the electronic signature platform, blockchain technology may be applied to improve the security of the platform. New blocks can be generated through blockchain technology to record newly generated electronic signatures and ensure the reliability of electronic signature records through blockchain technology.
[0003] In the process of generating electronic signature blocks, it is first necessary to elect nodes in the network to generate blocks. Existing node election schemes include schemes such as PoW (Proof of Work). The PoW scheme is to let all miner nodes compete in computing power and set a difficult problem to calculate the hash. Whoever calculates it first wins. The probability of winning is high for those with high computing power, and the probability of winning is low for those with low computing power. The computing power invested can be reflected in the hash value, so that the entire network can verify and select the chain with the most computing power. However, since the above-mentioned leader selection node requires a lot of computing power, how to reduce the computing power in the election of the leader node is a technical problem that needs to be solved at present. Summary of the invention
[0004] The embodiments of the present application provide a method, apparatus, device, computer storage medium and product for generating an electronic signature block, so as to solve the technical problem of how to reduce computing power during the block generation node election process during the electronic signature block generation process.
[0005] On the one hand, an embodiment of the present application provides a method for generating an electronic signature block, the method comprising:
[0006] Obtain a set of candidate blockchain nodes; the set of candidate blockchain nodes includes node identifiers of multiple candidate blockchain nodes;
[0007] Perform the following steps A to 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 certificate and block label of the first block generated most recently;
[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 probability; the block probability is determined based on the number of nodes in the candidate blockchain node set;
[0010] Step C: According to the winning random numbers corresponding to all candidate blockchain nodes, a target candidate blockchain node whose node identifier matches the winning random number is selected from the candidate blockchain node set, and the target candidate blockchain node is determined 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 tag of the first block to obtain the block tag of the new block;
[0013] The current block-producing node writes the electronic signature information within the current preset time period, the quantum election certificate 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 to generate a new block of the electronic signature blockchain.
[0014] In one practicable implementation, step B includes:
[0015] Process the quantum election certificate in the first block to obtain a first random number in decimal format;
[0016] Processing the first random number to obtain a random source;
[0017] The random source and 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 certificate in the first block is processed to obtain a first random number in a decimal format, including:
[0019] Hash the quantum election certificate in the first block to obtain a binary hash result;
[0020] The hash processing result is converted into a decimal number to obtain a first random number.
[0021] In one achievable implementation, the random source and the block probability are input into the Poisson probability distribution algorithm for calculation to obtain the winning random number, including:
[0022] Set the number of loops, the initial values of the first temporary variable and the second temporary variable;
[0023] The following steps 1 to 3 are executed repeatedly until the random source is greater than or equal to the second temporary variable:
[0024] Step 1: Update the first temporary variable according to its initial value, block probability and updated number of cycles;
[0025] Step 2: updating the second temporary variable according to the initial value of the second temporary variable and the updated first temporary variable;
[0026] Step 3: determine the initial value of the first temporary variable as the updated first temporary variable, determine the initial value of the second temporary variable as the updated second temporary variable, and update the number of loops, so that the number of loops increases by one;
[0027] The number of loops when the random source is greater than or equal to the second temporary variable is determined as a winning random number.
[0028] In an achievable 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] Generate the first public and private key pair of the current block-producing node through the quantum election proof algorithm;
[0030] The current quantum random number and the winning random number are encrypted using the private key in the first public-private key pair to obtain the quantum election proof tag of the new block.
[0031] In an achievable implementation, the current block producing node performs block signature processing according to the block tag of the first block to obtain the block tag of the new block; including:
[0032] Generate the second public and private key pair of the current block-producing node through the block label algorithm;
[0033] The block tag of the first block is encrypted using the private key in the second public-private key pair to obtain the block tag of the new block.
[0034] In one possible implementation, the new block also includes the public key in 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 except 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 belonging to the first public-private key pair from the new block;
[0038] Decrypt the quantum election certificate using the public key in the first public-private key pair to obtain a decryption result;
[0039] Compare the decryption result with the current quantum random number and the winning random number to see if they are consistent;
[0040] In the case of consistency, it is determined that the quantum election proof verification has passed. In the case of inconsistency, it is determined that the quantum election proof verification has failed.
[0041] In one practicable 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 is any node in the blockchain except the current block-producing node.
[0043] The second target node performs the following operations:
[0044] 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;
[0045] Decrypt the block tag of the new block using the public key in the second public-private key pair to obtain a 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 are consistent;
[0047] In the case of consistency, it is determined that the block tag verification of the new block has passed. In the case of inconsistency, it is determined that the block tag verification of the new block has failed.
[0048] In a second aspect, an embodiment of the present application provides an electronic signature block generation device, the device comprising:
[0049] A 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; 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 certificate and block label of the first block generated most recently;
[0050] The block node selection module is used to determine the winning random number according to the Poisson probability distribution algorithm, the quantum election proof of the first block and the block probability; the block probability is determined according to the number of nodes in the candidate blockchain node set; and is used to select the target candidate blockchain node whose node identifier matches the winning random number from the candidate blockchain node set according to the winning random numbers corresponding to all candidate blockchain nodes, and determine the target candidate blockchain node as the current block node at the current moment;
[0051] The encryption module is used for 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 for the current block-producing node to perform block signature processing according to 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 of the current block-producing node within the current preset time period, the quantum election certificate 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 to generate a new block of the electronic signature blockchain.
[0053] In a third aspect, an embodiment of the present application provides an electronic signature block generation device, the device comprising: a processor and a memory storing computer program instructions;
[0054] When the processor executes the computer program instructions, the electronic signature block generation method provided in any one of the above embodiments is implemented.
[0055] In a fourth aspect, an embodiment of the present application provides a computer storage medium, on which computer program instructions are stored. When the computer program instructions are executed by a processor, the electronic signature block generation method provided in any one of the above embodiments is implemented.
[0056] In a fifth aspect, an embodiment of the present application provides a computer program product. When the instructions in the computer program product are executed by a processor of an electronic device, the electronic device executes the electronic signature block generation method provided in any one of the above embodiments.
[0057] The electronic signature block generation method, device, equipment, computer storage medium and product provided in the embodiments of the present application have at least the following technical effects:
[0058] In the electronic signature block generation method provided in the embodiment of the present application, the election of the block-generating node is determined according to the Poisson probability distribution algorithm; the two input quantities of the Poisson probability distribution algorithm are the quantum election certificate of the first block and the block probability; the block probability is determined according to the number of nodes in the candidate blockchain node set; the quantum election certificate is determined according to the quantum random number obtained by the block-generating node of the first block during the generation period; due to the randomness and unpredictability of the quantum random number, the winning random number finally obtained by matching the Poisson probability distribution algorithm is also a random and unpredictable result; therefore, the candidate blockchain node cannot increase its chance of being selected as a block-generating node by increasing its computing power; therefore, in the electronic signature block generation method provided in the embodiment of the present application, the election of the block-generating node does not depend on the computing power of the blockchain node, and thus the blockchain node will not be encouraged to invest more computing power in the election process of the block-generating node; and thus the electronic signature block generation method provided in the embodiment of the present application can achieve the technical effect of saving computing power and electricity. BRIEF DESCRIPTION OF THE DRAWINGS
[0059] In order to more clearly illustrate the technical solution of the embodiments of the present application, the following is a brief introduction to the drawings required for use in the embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0060] Figure 1 It is a structural diagram of an electronic signature blockchain consensus system based on quantum random numbers provided by an embodiment of the present application.
[0061] Figure 2 It is a structural diagram of an electronic signature block generation module provided by an embodiment of the present application.
[0062] Figure 3 This is a flowchart of a method for generating an electronic signature block provided by an embodiment of the present application;
[0063] Figure 4 yes Figure 3 The flowchart of one implementation method of step S303 is shown.
[0064] Figure 5 yes Figure 4 The flowchart of one implementation method of step S401 is shown.
[0065] Figure 6 yes Figure 4 The flowchart of one implementation method of step S403 is shown.
[0066] Figure 7 yes Figure 3 The flowchart of one implementation method of step S305 is shown.
[0067] Figure 8 yes Figure 3 The flowchart of one implementation method of step S306 is shown.
[0068] Fig. 9 It is a flowchart of a method for verifying a quantum election certificate provided by an embodiment of the present application.
[0069] Fig.10 It is a flowchart of a block label verification method provided by an embodiment of the present application.
[0070] Fig.11 It is a flowchart of an electronic signature platform provided by an embodiment of the present application using an electronic signature blockchain consensus system based on quantum random numbers for signing and verifying signatures.
[0071] Fig.12 It is a structural diagram of an electronic signature block generation device provided by an embodiment of the present application.
[0072] Fig.13 It is a structural diagram of an electronic signature block generation device provided by an embodiment of the present application. DETAILED DESCRIPTION
[0073] The features and exemplary embodiments of various aspects of the present application will be described in detail below. In order to make the purpose, technical solutions and advantages of the present application clearer, the present application will be further described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be understood that the specific embodiments described herein are only intended to explain the present application, rather than to limit the present application. For those skilled in the art, the present application can be implemented without the need for some of these specific details. The following description of the embodiments is only to provide a better understanding of the present application by illustrating the examples of the present application.
[0074] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the statement "include..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.
[0075] In the embodiments of the present application, Poisson distribution refers to a discrete probability distribution commonly seen in statistics and probability, which was published by French mathematician Simeon-Denis Poisson in 1838. Poisson distribution is suitable for describing the number of random events that occur per unit time.
[0076] Electronic signature is a form of electronic signature. For example, image processing technology is used to convert the electronic signature operation into the same visual effect as the paper document stamping operation. At the same time, electronic signature technology is used to ensure the authenticity and integrity of electronic information and the non-repudiation of the signer.
[0077] The inventor discovered that in the proof-of-work scheme for electing block nodes, the election of block nodes before each block is based on the workload invested by the node in the election process. When the elected node generates a new block, it often receives rewards from other nodes in the network, such as the signature initiator node. Therefore, in order to become a block node, the nodes in the network will be motivated to invest more and more computing power to compete with other nodes and become block nodes. This motivation will increase the computing power invested by the entire network, resulting in a large amount of computing power occupation, and thus a large amount of electricity waste.
[0078] Based on the above analysis of the prior art, the inventor proposes a method as follows Figure 1 The electronic signature blockchain consensus system based on quantum random numbers is shown. The following is an example of a blockchain node equipped with this system.
[0079] In the electronic signature blockchain consensus system based on quantum random numbers, the electronic signature block generation module 150 is responsible for selecting block nodes and generating new blocks 180 .
[0080] The electronic signature block generation module 150 will obtain the quantum election certificate and block label 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 will also obtain the set of candidate blockchain nodes participating in the election through the blockchain node registry 120, and thereby determine the number of blockchain nodes participating in the election, thereby determining the average block probability of all candidate blockchain nodes. The average block probability is, for example, the reciprocal of the number of blockchain nodes participating in the election.
[0081] The electronic signature block generation module 150 is used to execute an electronic signature block generation method provided in an embodiment of the present application, so as to realize the election of block nodes and the generation of new blocks. The electronic signature block generation module 150 uses the quantum election certificate of the first block obtained and the above-mentioned average block probability as the input of the Poisson probability distribution algorithm, and runs the Poisson probability distribution algorithm. After running the Poisson probability distribution algorithm, the blockchain node will obtain a winning random number, and determine the identity of the block node based on the winning random number and the node identifiers of multiple candidate blockchain nodes in the candidate blockchain node set.
[0082] If the blockchain node determines that it is not a block-producing node, it will not produce a block. If the blockchain node determines that it is a block-producing node, the blockchain node will pack the signature information in the electronic signature information cache pool 140 within a preset time period into a new block. And the blockchain node as a block-producing node will generate a quantum election certificate and a block label of the new block through the current quantum random number obtained by the quantum random number acquisition module 110 and the block label 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 certificate, the block label, the name of the block node, the block signature, the quantum election certificate public key, the block label public key and the block node public key. The signature information packaged into the new block 180 is the block signature in 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 the following information through the electronic signature block generation module 150: Figure 1 New block 180 is shown.
[0084] The following is a detailed introduction to the various components 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 obtain quantum random numbers through the quantum random number platform. The quantum random number acquisition module 110 may call the RESTFUL interface of the quantum random number platform based on the block height BlockH in each new block generation cycle (for example, 30 seconds) to obtain a quantum random number with a fixed length of 256 bits; then the block height and the quantum random number may form a random beacon DrandBeancon{BlockH, DRAND} together, and pass it to the electronic signature block generation module 150.
[0086] Among them, the quantum random number platform is a quantum cryptography center deployed in the form of SaaS (Software as a Service) as a core function, and the electronic signature block generation module 150 can use this core function by accessing the quantum random number platform through an encrypted communication network. The quantum random number platform is used to solve the security problems caused by encryption and decryption and confidential communication based on computer pseudo-random numbers. The quantum random number platform supports two ways of calling: API interface call and Web page to provide quantum random numbers.
[0087] The blockchain node registration module 120 may include, for example, a blockchain node registry. When each blockchain node of the blockchain network is initialized, it will be added to the blockchain node registry to register the name, IP address, and encrypted storage space size of the blockchain node. The set of candidate blockchain nodes participating in the election can be obtained through the above blockchain node registry.
[0088] The electronic signature platform module 130 may be composed of, for example, an identity authentication submodule, a smart signing submodule, a signature management submodule, an encryption storage submodule and a signature verification module.
[0089] The identity authentication submodule is used for the identity authentication of the signatory, and can support the identity authentication of individual users and corporate users. It ensures the authenticity of the signatory's multiple identities through intelligent algorithms, CA authentication and comparison with the authoritative database of the Ministry of Public Security.
[0090] The smart signature submodule can support multiple signing modes such as audio and video signing, batch document signing, and can provide functions such as smart positioning, so as to fully meet the various needs of enterprises in different business scenarios. The signature and seal management submodule is used to uniformly manage signatures, seals, and certificates, bind them with digital certificates, and realize the use of special seals for special people, ensuring the uniformity of people, seals, signatures, and certificates.
[0091] The signature verification module is used to verify the signature. The encryption storage submodule is used to provide data security throughout the process, and the signed document forms an independent encrypted data package. When an electronic signature is completed and encrypted data is generated, an electronic signature information will be generated, and the generated electronic signature information will be pushed to the electronic signature information cache pool module 140.
[0092] The post-signature file management module 170 is used to manage the signed files, which are encrypted data packets associated with electronic information entries in a block on the blockchain. The block-producing node will generate a new block 180 after confirming that it has the right to produce a block. Non-block-producing nodes correspondingly only confirm the block-producing node through the electronic signature block generation module 150.
[0093] Before generating a new block 180 , the electronic signature block generation module 150 also generates a quantum election certificate and a block label 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 node election module 151. The block node election module executes the Poisson probability distribution algorithm to obtain a winning random number, and determines the identity of the block node according to the winning random number combined with the node identifier of the candidate blockchain node obtained from the blockchain node registry 120. If the blockchain node determines that it is a block node, it will generate a quantum election certificate for the new block 180 through the quantum election certificate generation module 152, and generate a block label for the new block 180 through the block label generation module 153.
[0095] In the electronic signature block generation module 150, the new block 180 is generated by the block generation module 154. The block generation module 154 obtains the signature information from the electronic signature information buffer pool module 140, obtains the quantum election certificate from the quantum election certificate generation module 152, and obtains the block label from the block label generation module 153. The block generation module 154 writes the above information obtained into the new block 180.
[0096] The following is an introduction to the electronic signature block generation method applied in the electronic signature block generation module 150 provided in an embodiment of the present application.
[0097] Figure 3 FIG. 1 is a flow chart showing a method for generating an electronic signature block provided in an embodiment of the present application. Figure 3 As shown, the electronic signature block generation method provided in the embodiment of the present application includes the following steps:
[0098] S301. Obtain a set of candidate blockchain nodes; the set of candidate blockchain nodes includes node identifiers of multiple candidate blockchain nodes;
[0099] The following steps S302 to S304 are performed for each candidate blockchain node:
[0100] S302, obtaining the current quantum random number generated at the current moment, the electronic signature information within the current preset time period, and the quantum election certificate and block label of the first block generated most recently;
[0101] S303. Determine the winning random number according to the Poisson probability distribution algorithm, the quantum election proof of the first block, and the block probability; the block probability is determined according to the number of nodes in the candidate blockchain node set, and the block probability of each candidate blockchain node is the same;
[0102] S304. According to the winning random numbers corresponding to all candidate blockchain nodes, a target candidate blockchain node whose node identifier matches the winning random number is selected from the candidate blockchain node set, and the target candidate blockchain node is determined 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 tag of the first block to obtain a block tag of a new block;
[0105] S307. The current block-producing node writes the electronic signature information within the current preset time period, the quantum election certificate 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 to generate a new block of the electronic signature blockchain.
[0106] In the electronic signature block generation method provided in the embodiment of the present application, the election of the block node is determined according to the Poisson probability distribution algorithm. The two input quantities of the Poisson probability distribution algorithm are the quantum election certificate of the first block and the block probability. The block probability is determined according to the number of nodes in the candidate blockchain node set. The quantum election certificate is determined according to the quantum random number obtained by the block node of the first block during the generation period. Due to the randomness and unpredictability of the quantum random number, the winning random number finally obtained by matching the Poisson probability distribution algorithm is also a random unpredictable result. Therefore, the candidate blockchain node cannot increase its chance of being selected as a block node by increasing the computing power. Therefore, in the electronic signature block generation method provided in the embodiment of the present application, the election of the block node does not depend on the computing power of the blockchain node, so that the blockchain node will not be encouraged to invest more computing power in the election process of the block node. Furthermore, the electronic signature block generation method provided in the embodiment of the present application can achieve the technical effect of saving computing power and electricity.
[0107] The following introduces the specific implementation method of each step in the electronic signature block generation method provided in the embodiment of the present application.
[0108] In some embodiments, the blockchain node set in step S301 includes information about blockchain nodes participating in the current round of elections. The blockchain node information includes, for example, an identifier of the blockchain node, which identifier may be, for example, a number of the blockchain node. The candidate blockchain nodes that appear in the candidate blockchain node set will elect block-producing nodes. Among them, which blockchain nodes participate in the election of block-producing nodes in the current round as candidate blockchain nodes can be screened based on the storage capacity of the blockchain node itself, whether it is idle, and other artificially set criteria.
[0109] As an example, all blockchain nodes will locally determine whether their own storage capacity meets the requirements for participating in the election. If the blockchain node determines that its own storage capacity meets the requirements for participating in the election, it will participate in the block node election. This requirement for storage capacity can be, for example, that the available storage space of the 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 not performing operations such as block generation and new block verification.
[0111] There are multiple candidate blockchain nodes participating in the election, and each candidate blockchain node will execute steps S301 to S304, thereby determining the block-producing node in a round of election and reaching 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 and obtained by the candidate blockchain node via the quantum random number module 110. Quantum random numbers are generated based on the state of the quantum system, and according to the theory of quantum mechanics, the state of the quantum system at each moment is an unpredictable pure probabilistic event. Therefore, quantum random numbers are unpredictable, and no blockchain node can predict and forge the quantum random number obtained in this round of elections in advance.
[0113] In some embodiments, the electronic signature information in step S302 may include the user name, user public key, and electronic signature file path of the electronic signature. The number of electronic signature information may be multiple.
[0114] In some embodiments, the block tag in step S302 is used to represent a block. For example, the block tag in the first block represents the first block, and the block tag in the new block represents the new block. The block tag is, for example, a VRF string.
[0115] In some embodiments, in step S303, the block generation probability may be the inverse of the number of candidate blockchain nodes, and each candidate blockchain node has the same block generation probability. The quantum election certificate 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 digital range, etc. The matching of the node identifier and the winning random number may be that the node identifier and the winning random number are equal, or that the winning random number falls within the digital range of the node identifier.
[0117] Through steps S301 to S304, a block node can be selected in a random manner.
[0118] The following is an introduction to the process of inputting the block probability and the quantum election proof of the first block into the Poisson probability distribution algorithm in S303 to obtain the winning random number.
[0119] In some embodiments, step S303 includes: Figure 4 Steps shown:
[0120] S401, processing the quantum election certificate in the first block to obtain a first random number in a decimal format;
[0121] S402, processing the first random number to obtain a random source;
[0122] S403: Input the random source and the block probability into the Poisson probability distribution algorithm for calculation to obtain a winning random number.
[0123] Through steps S401 to S403, the quantum election certificate is converted into a random source of the Poisson probability distribution algorithm, thereby achieving the technical effect of randomly obtaining a winning random number through the quantum election certificate.
[0124] In some embodiments, step S401 includes: Figure 5 Steps shown:
[0125] S501, hashing the quantum election certificate in the first block to obtain a binary hashing result;
[0126] S502: Convert the hash processing result into a decimal number to obtain a first random number.
[0127] Through step S501, the quantum election certificate can be converted into an encrypted array for use in the subsequent Poisson probability distribution algorithm, and a winning random number can be obtained randomly.
[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] A specific example is given 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 obtain h[:]=blake2b.Sum256(ElectionProof1);
[0132] Then, the first random number converted into decimal is obtained by lhs[:]=BigFromBytes(h[:]).Int.
[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 that can be obtained by the blake2b.Sum256 function; thereby projecting the position of the first random number within the value range of 2 to the power of 256 to a value within the value range of 0 to 1.
[0134] After obtaining the random source in step S402, step S403 is performed to obtain a winning random number.
[0135] In some embodiments, step S403 includes: Figure 6 The following steps are shown:
[0136] S610, setting the number of loops, the initial values of the first temporary variable and the second temporary variable;
[0137] S620, determining 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 in a loop until the random source is greater than or equal to the second temporary variable:
[0139] S621, updating the first temporary variable according to the initial value of the first temporary variable, the probability of generating a block, and the updated number of cycles;
[0140] S622, updating the second temporary variable according to the initial value of the second temporary variable and the updated first temporary variable;
[0141] S623, determining the initial value of the first temporary variable as the updated first temporary variable, determining the initial value of the second temporary variable as the updated second temporary variable, and updating the number of loops, so that the number of loops increases by one;
[0142] If the judgment result is that the random source is greater than or equal to the second temporary variable, step S630 is executed.
[0143] S630: Determine the number of cycles when the random source is greater than or equal to the second temporary variable as a winning random number.
[0144] Through the above-mentioned loop steps, a winning random number can be finally obtained. The winning random number is subsequently used to determine the block node. Taking the genesis block as an example, all candidate blockchain nodes will obtain the genesis block as the starting block, and obtain the quantum election certificate of the genesis block as the random source, and the block probability of each candidate blockchain node is equal. Therefore, in the process of generating a new block after the genesis block, when the block node of the new block is determined through the above-mentioned loop steps, the winning random number obtained by any candidate blockchain node is the same, so that all candidate blockchain nodes will reach a consensus and confirm who the block node is. When a candidate blockchain node in the network determines that it is a block node through the winning random number, it will perform the subsequent operation of generating a new block. In the subsequent new block generation process, the election of each round of block nodes is determined according to the above loop steps, so that the election of each round of block nodes can reach a consensus among the candidate blockchain nodes, thereby avoiding the existence of a fork of the electronic signature blockchain in the network.
[0145] In some embodiments, the first temporary variable is, for example, pmf=exp(-lam); that is, the first temporary variable is the negative power of the natural exponential lam, where lam is the value of the block probability projected into 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 loops is represented by the loop variable j, and the initial value of j can be 0, and the value is assigned to 1 at the beginning of the first round of the loop. 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 item pmf=pmf*(lam / j) may be lam=(1 / M)*(2^256-1) as mentioned above.
[0149] As another example, lam in the item pmf=pmf*(lam / j) may also be determined by other means, for example, 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, and 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 cycle, 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 a block-producing node according to the winning random number output by step S630.
[0152] After the block-producing node is determined by the election, the block-producing node will perform steps S305 and S306 to generate the quantum election certificate and block label of the new block, and finally write the signature record and various information required for block verification into the new block through S307. After the new block is generated, the block-producing node will send the new block to other blockchain nodes in the network. After verifying the legitimacy of the new block, other blockchain nodes will add the new block to the local blockchain.
[0153] In some embodiments, step S305 includes: Figure 7 The following steps are shown:
[0154] S701. Generate the first public and private key pair of the current block-producing node through 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 a quantum election certification tag for the new block.
[0156] The quantum election proof of the new block can be used as the random source required by the Poisson probability distribution algorithm in the next round of elections. After the new block is sent from the block-producing node to other blockchain nodes in the network, other blockchain nodes can verify the legitimacy of the block-producing node of the new block by verifying whether the quantum election proof is generated by 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 may generate a quantum election proof through a 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, and the corresponding first public key is written into a new block and used for decryption by other blockchain nodes.
[0159] To give a specific example, the key generation algorithm in the quantum election proof algorithm first generates the first public key PK1 and the first private key SK1. Then the quantum election proof ElectionProof is generated through 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 the quantum election certificate is generated, it also includes, for example, generating R1=VRF_Hash(SK1, DRAND+WinCount), where R1 corresponds to the hash value of the quantum election certificate. The quantum election certificate and the hash value of the quantum election certificate are used by other blockchain nodes to verify the block node of the new block.
[0162] In some embodiments, step S306 includes: Figure 8 The following steps are shown:
[0163] S801. Generate a second public-private key pair of the current block-producing node through a block label algorithm;
[0164] S802: Use the private key in the second public-private key pair to encrypt the block tag of the first block to obtain the block tag of the new block.
[0165] The block tag of the new block can accordingly allow other blockchain nodes to verify whether the new block is generated based on the previous block in the local blockchain. Only when the block-producing node of the new block is legitimate and the new block is generated based on the previous block of the local blockchain of other blockchain nodes, the new block will be added to the local blockchain of other blockchain nodes.
[0166] In some embodiments, the block tag algorithm in step S801 may also include a key generation algorithm. The block tag algorithm may be, for example, a VRF_proof function.
[0167] As an example, the key generation algorithm in the block tag algorithm generates a second public key PK2 and a second private key SK2. Then the VRF_proof function uses the second private key to generate a block tag for the new block. The block tag of the new block P2 = VRF_proof (SK2, ticket), where ticket is the block tag of the first block.
[0168] Continuing with the above example, the block tag algorithm may further include a VRF_Hash function to generate a block tag hash value R2=VRF_Hash(SK2, ticket) corresponding to the new block.
[0169] In one embodiment of the present application, in step S802, the block tag of the new block may carry information other than the block tag of the first block, that is, the encryption object of the second private key may include the block tag of the first block and the current quantum random number, and / or the signature information accumulated before the current round of block generation, etc. Correspondingly, in the block tag algorithm, the input amount in the VRF_proof and VRF_Hash functions may include the current quantum random number, and / or the signature information accumulated before the current round of block generation, etc., in addition to the block tag of the first block.
[0170] Continuing with the above example, after obtaining the quantum election certificate and block tag of the new block, the block generation module 340 writes the quantum election certificate and block tag of the new block and 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 in the first public-private key pair. After generating a new block of the electronic signature blockchain in step S307, the electronic signature block generation method further includes: Fig. 9 Steps shown:
[0172] S901, the current block-producing node sends the new block to the first target node, where the first target node is any node in the blockchain node except the current block-producing node;
[0173] The first target node performs the following operations:
[0174] S902, reading the first public key in the first public-private key pair, the current quantum random number, and the winning random number from the new block;
[0175] S903, using the first public key in the first public-private key pair to decrypt the quantum election certificate of the new block to obtain a decryption result;
[0176] S904, comparing the decryption result with the current quantum random number and the winning random number to see if they are consistent;
[0177] S905. If the verification is consistent, it is determined that the verification of the quantum election certificate has passed. If the verification is inconsistent, it is determined that the verification of the quantum election certificate has failed.
[0178] The first target node is, for example, a non-block-producing node in this round of the network. After obtaining a new block, the first target node verifies the quantum election certificate through the above steps to verify whether the block-producing node of the new block is the block-producing node generated by this round of election. Since the quantum random number obtained by this round of election is unpredictable, and the winning random number is obtained based on the quantum election certificate of the first block. Therefore, the verification of the quantum election certificate of the new block can clarify whether the block-producing node of the new block is the block-producing node elected in this round, and whether the new block is generated after this round of election. This improves the security of the electronic signature block generation method.
[0179] In some embodiments, the new block may include a hash value of the quantum election proof. Before step S903, the first target block may verify whether the received hash value R1 and the quantum election proof correspond by, for example, first using a VRF_proof_to_hash function.
[0180] As an example, the specific verification code of the hash value R1 and the quantum election proof is VRF_proof_to_hash(ElectionProof), where ElectionProof is the quantum election proof of the new block. The output of VRF_proof_to_hash(ElectionProof) is a hash value. When the hash value is consistent with the hash value R1, the received hash value R1 corresponds to the quantum election proof. And only after the hash value R1 corresponds to the quantum election proof, step S903 is executed.
[0181] In some embodiments, in step S903, the function used to decrypt the quantum election proof of the new block using the public key may be, for example, a VRF_verify function.
[0182] To give a specific example, in step S903, the code for verifying the quantum election certificate of the new block is, for example: (TRUE, FALSE) = VRF_verify (PK1, DRAND + WinCount, ElectionProof). The VRF_verify function decrypts the quantum election certificate ElectionProof through the first public key PK1, and compares the decrypted result with the current quantum random number DRAND and the winning random number WinCount string. When the two are consistent, the output is TRUE, that is, the quantum election certificate of the new block has passed the verification; otherwise, the output result is FALSE, and the quantum election certificate of the new block has not passed the verification.
[0183] After the quantum election certificate of the new block is verified, the first target node may also include a step of verifying the legitimacy of the block label of the new block, and only when both the quantum election certificate and the block label of the new block are legal, will the new block be added to the local blockchain.
[0184] In some embodiments, the new block also includes the public key in the second public-private key pair. After generating a new block of the electronic signature blockchain in step S307, the electronic signature block generation method further includes: Fig.10 Steps shown:
[0185] S1001. The current block-producing node sends the new block to the second target node, where the second target node is any node in the blockchain node except the current block-producing node;
[0186] The second target node performs the following operations:
[0187] S1002, reading 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, using the first public key in the second public-private key pair to decrypt the block tag of the new block to obtain a decryption result;
[0189] S1004, comparing the decryption result with the block label of the latest block on the chain of the second target node to see if they are consistent;
[0190] S1005. If they are consistent, determine that the block tag verification of the new block has passed; if they are inconsistent, determine that the block tag verification of the new block has failed.
[0191] The first target node and the second target node can be, for example, the same node, but can also be different nodes. The verification of the block tag of the new block realizes the confirmation of 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 and the above-mentioned first block are the same block, that is, whether the blockchain of the second target node and the blockchain of the block-producing node are the same chain, and then determine that the electronic signature information recorded by the two is the same, and the new block can be added to the two chains at the same time.
[0192] In some embodiments, the new block may include a hash value of a block tag. Before step S1003, the second target block may verify whether the received hash value R2 corresponds to the block tag of the new block by, for example, first using a VRF_proof_to_hash function.
[0193] As an example, the specific verification code of the hash value R2 and the block tag is VRF_proof_to_hash(P2), where P2 is the block tag of the new block. The output of VRF_proof_to_hash(P2) is a hash value. When the hash value is consistent with the hash value R2, the received hash value R2 corresponds to the block tag of the new block. And only after the hash value R2 corresponds to the block tag of the new block, step S1003 is executed.
[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, a VRF_verify function.
[0195] To give a specific example, in step S1003, the code for verifying the block tag of the new block is, for example: (TRUE, FALSE) = VRF_verify(PK2, ticket2, P2). Among them, ticket2 is the block tag of the latest block on the chain of the second target node. The VRF_verify function decrypts the block tag P2 of the new block through the second public key PK2, and compares the decrypted result with ticket2. When the two are consistent, the output is TRUE, that is, the new block can be added to the chain of the second target node and become the latest block; otherwise, the output result is FALSE, and the new block cannot be added to the chain of the second target node.
[0196] In step S1003, the VRF_verify function is used to verify 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, to verify 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 these two blocks at the same time.
[0197] In summary, the electronic signature blockchain consensus system based on quantum random numbers provided in the embodiment of the present application adopts quantum random numbers as the random source of the block election algorithm, and the Poisson probability distribution algorithm as the equal opportunity lottery algorithm. The block node for each round of election is randomly selected, and the block node records all electronic signature information within a preset time period into the newly generated block to generate a new block. The electronic signature blockchain consensus system based on quantum random numbers realizes the generation of new blocks through the electronic signature block generation method provided in the embodiment of the present application. The electronic signature block generation method obtains the quantum random number of the preset time period from the quantum random number platform, and uses the quantum random number as a random beacon. The system registers all nodes in the blockchain into the blockchain node registry, and selects the block node according to equal probability using the Poisson probability distribution algorithm. The block node uses the quantum random number as the input of the quantum election proof algorithm to generate a quantum election certificate. The quantum election certificate serves as a proof mark for the block node to produce a block. At the same time, the block node takes the quantum random number and the quantum block tag of the previous block as input parameters, and generates the quantum block tag of this block through the block quantum signature algorithm. The quantum block tag of the block is used as a mark of the block identity. Then, the block node writes all the electronic signature information within the preset time period (for example, the user name, user public key, and electronic signature file path of each electronic signature within 30 seconds), quantum random number, winning random number, quantum election proof tag, block tag of the current block (for example, quantum block tag), block node name, quantum election proof public key, and quantum block signature public key into the block.
[0198] The electronic signature block generation method provided in the embodiment of the present application obtains quantum random numbers from the quantum platform to ensure that the block is generated at the current moment, and is used to generate election certificates and block labels. Therefore, the electronic signature block generation method provided in the embodiment of the present application ensures the randomness of the block-producing node, so that the blockchain node cannot be forged as a block-producing node. In this way, there is no need to compete in computing power and share, saving resources. At the same time, by obtaining quantum random numbers from the quantum platform, it is used to ensure that the block is generated at the current moment, and is used to generate election certificates and block signatures, preventing blockchain nodes from forging blocks and elections, deceiving other blockchain nodes, and causing network paralysis.
[0199] In the electronic signature block generation method provided in the embodiment of the present application, the election process of the block-producing node is random, so that the nodes participating in each round of election cannot forge the block-producing node. At the same time, due to the randomness of the election process, there is no incentive for the blockchain nodes in the network to invest more computing power. Therefore, compared with the existing election scheme that obtains the right to produce blocks through proof of work, the electronic signature block generation method provided in the embodiment of the present application does not require each blockchain to compete in computing power, thereby saving computing resources and avoiding power waste.
[0200] In addition, this application uses quantum random numbers to further improve encryption strength and randomness, and then adopts the Poisson probability distribution algorithm to elect block-producing nodes, so that blockchain nodes participating in the election can produce blocks equally, which not only improves security but also avoids electricity waste.
[0201] The electronic signature block generation method provided in the embodiment of the present application can be widely applied to blockchain-related application scenarios. Figure 1 and Fig.11 Take the electronic signature blockchain consensus system based on quantum random numbers as an example. In the blind watermark electronic signature scenario of the image. The electronic signature blockchain consensus system based on quantum random numbers generates a new block based on the electronic signature block generation method, and each block may contain a random beacon at the current moment. The random beacon includes, 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 the random beacon into the blind watermark of the original image data 1110 to generate the signed image data. When verification is required, the signature verification module parses the random beacon in the blind watermark data from the signed image data 1120, and then verifies whether the random beacon exists on the blockchain. If so, the verification passes.
[0202] An embodiment of the present application also provides a device for generating an electronic signature block. Fig.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 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 certificate and block label of the first block generated most recently;
[0204] The block node selection module 1220 is used to determine the winning random number according to the Poisson probability distribution algorithm, the quantum election proof of the first block and the block probability; the block probability is determined according to the number of nodes in the candidate blockchain node set; and is used to select a target candidate blockchain node whose node identifier matches the winning random number from the candidate blockchain node set according to the winning random numbers corresponding to all candidate blockchain nodes, and determine the target candidate blockchain node as the current block node at the current moment;
[0205] The encryption module 1230 is used for 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 for the current block-producing node to perform block signature processing according to 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 of the current block-producing node within the current preset time period, the quantum election certificate 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 to generate a new block of the electronic signature blockchain.
[0207] In some embodiments, the block node selection module 1220 may include:
[0208] A first data processing submodule, used to process the quantum election certificate in the first block to obtain a first random number in a decimal format;
[0209] The second data processing submodule is used to process the first random number to obtain a random source;
[0210] The Poisson probability distribution algorithm submodule is used to input the random source and 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, used to set the number of loops, the initial value of the first temporary variable and the second temporary variable, the initial value of the number of loops being 0;
[0213] The loop unit is used to loop through the following steps 1 to 3 until the random source is greater than or equal to the second temporary variable:
[0214] Step 1: Update the first temporary variable according to its initial value, block probability and updated number of cycles;
[0215] Step 2: updating the second temporary variable according to the initial value of the second temporary variable and the updated first temporary variable;
[0216] Step 3: determine the initial value of the first temporary variable as the updated first temporary variable, determine the initial value of the second temporary variable as the updated second temporary variable, and update the number of loops, so that the number of loops increases by one;
[0217] The winning random number output unit is used to determine the number of cycles when the random source is greater than or equal to the second temporary variable as the winning random number.
[0218] In some embodiments, the encryption module 1230 includes:
[0219] Quantum election proof key generation submodule: used to generate the first public and private key pair of the current block-producing node through 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 label key generation submodule: used to generate the second public and private key pair of the current block-producing node through the block label algorithm;
[0222] The block label generation submodule is used to encrypt the block label of the first block using the private key in the second public-private key pair to obtain the block label of the new block.
[0223] In some embodiments, the electronic signature block generation device 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] Quantum election certificate verification submodule: uses the public key belonging to the first public-private key pair to decrypt the quantum election certificate of the new block to obtain the decryption result; and is used to compare whether the decryption result is consistent with the current quantum random number and the winning random number; and is used to determine that the quantum election certificate verification has passed if they are consistent, and determine that the quantum election certificate verification has failed if they are inconsistent.
[0226] In some embodiments, the electronic signature block generation device includes a block tag verification module. The block tag verification module includes:
[0227] The second verification data acquisition submodule is used to read the public key, current quantum random number and 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 a 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 that the block tag verification of the new block has passed if they are consistent, and determine that the block tag verification of the new block has failed if they are inconsistent.
[0229] The electronic signature block generation device in the embodiment of the present application can execute the electronic signature block generation method of any embodiment of the present application, and has the technical effects of the electronic signature block generation method as described above, so it will not be repeated here.
[0230] Fig.13 A schematic diagram of the hardware structure of an electronic signature block generation device provided in an embodiment of the present 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), or an application specific integrated circuit (ASIC), or may be configured to implement one or more integrated circuits of the embodiments of the present application.
[0233] The memory 1320 may include a large capacity memory for data or instructions. By way of example and not limitation, the memory 1320 may include a hard disk drive (HDD), a floppy disk drive, a flash memory, an optical disk, a magneto-optical disk, a magnetic tape, or a universal serial bus (USB) drive or a combination of two or more of these. In appropriate cases, the memory 1320 may include a removable or non-removable (or fixed) medium. In appropriate cases, the memory 1320 may be inside or outside the integrated gateway disaster recovery device. In a specific embodiment, the memory 1320 is a non-volatile solid-state memory.
[0234] In certain embodiments, memory 1320 includes a read-only memory (ROM). The ROM may be a mask-programmed ROM, a programmable ROM (PROM), an erasable PROM (EPROM), an electrically erasable PROM (EEPROM), an electrically alterable ROM (EAROM), or flash memory, or a combination of two or more of the above, where appropriate.
[0235] The memory may include read-only memory (ROM), random access memory (RAM), magnetic disk storage media devices, optical storage media devices, flash memory devices, electrical, optical or other physical / tangible memory storage devices. Thus, typically, the 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 method according to an aspect of the present disclosure.
[0236] The processor 1310 implements any one of the electronic signature block generation methods in the above embodiments by reading and executing computer program instructions stored in the memory 1320 .
[0237] In one example, the electronic signature block generation device may further include a communication interface 1330 and a bus 1340. Figure 3As shown, the processor 1310, the memory 1320, and the communication interface 1330 are connected via a bus 1340 and communicate with each other.
[0238] The communication interface 1330 is mainly used to implement communication between various modules, devices, units and / or equipment in the embodiments of the present application.
[0239] Bus 1340 includes hardware, software or both, and the parts of online data flow billing equipment are coupled to each other. For example, but not limitation, bus may include accelerated graphics port (AGP) or other graphics bus, enhanced industrial standard architecture (EISA) bus, front side bus (FSB), hypertransport (HT) interconnection, industrial standard architecture (ISA) bus, infinite bandwidth interconnection, low pin count (LPC) bus, memory bus, micro channel architecture (MCA) bus, peripheral component interconnection (PCI) bus, PCI-Express (PCI-X) bus, serial advanced technology attachment (SATA) bus, video electronics standard association local (VLB) bus or other suitable bus or two or more of these combinations. In appropriate cases, bus 1340 may include one or more buses. Although the present application embodiment describes and shows a specific bus, the present application considers any suitable bus or interconnection.
[0240] In addition, in combination with the electronic signature block generation method in the above embodiment, the embodiment of the present application provides a computer program product. When the computer program product instructions are executed by a processor of an electronic device, any one of the electronic signature block generation methods in the above embodiment is implemented.
[0241] It should be clear that the present application is not limited to the specific configuration and processing described above and shown in the figures. For the sake of simplicity, a detailed description of the known method is omitted here. In the above embodiments, several specific steps are described and shown as examples. However, the method process of the present application is not limited to the specific steps described and shown, and those skilled in the art can make various changes, modifications and additions, or change the order between the steps after understanding the spirit of the present application.
[0242] The functional blocks shown in the above-described block diagram can be implemented as hardware, software, firmware or a combination thereof. When implemented in hardware, it can be, for example, an electronic circuit, an application specific integrated circuit (ASIC), appropriate firmware, a plug-in, a function card, etc. When implemented in software, the elements of the present application are programs or code segments that are used to perform the required tasks. The program or code segment can be stored in a machine-readable medium, or transmitted on a transmission medium or a communication link by a data signal carried in 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, optical fiber media, radio frequency (RF) links, etc. The code segment can be downloaded via a computer network such as the Internet, an intranet, etc.
[0243] It should also be noted that the exemplary embodiments mentioned in this application describe some methods or systems based on a series of steps or devices. 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 embodiment, or in a different order from the embodiment, or several steps can be performed simultaneously.
[0244] Aspects of the present disclosure are described above with reference to the flowchart and / or block diagram of the method, device (system) and computer program product according to the embodiment of the present disclosure. It should be understood that each box in the flowchart and / or block diagram and the combination of each box in the flowchart and / or block diagram 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 device to produce a machine so that these instructions executed by the processor of the computer or other programmable data processing device enable the implementation of the function / action specified in one or more boxes of the flowchart and / or block diagram. 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 can also be understood that each box in the block diagram and / or flowchart and the combination of boxes in the block diagram and / or flowchart can also be implemented by dedicated hardware that performs a specified function or action, or can be implemented by a combination of dedicated hardware and computer instructions.
[0245] The above is only a specific implementation of the present application. Those skilled in the art can clearly understand that for the convenience and simplicity of description, the specific working processes of the systems, modules and units described above can refer to the corresponding processes in the aforementioned method embodiments, and will not be repeated here. It should be understood that the protection scope of the present application is not limited to this. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed in this application, and these modifications or replacements should be included in the protection scope of this application.
Claims
1. A method for generating an electronic signature block, It is characterized in that The method comprises: 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 to 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 certificate and block label of the first block generated most recently; Step B: Determine the winning random number according to the Poisson probability distribution algorithm, the quantum election proof of the first block and the block probability; the block probability is determined according to the number of nodes in the candidate blockchain node set; Step C: According to the winning random numbers corresponding to all candidate blockchain nodes, a target candidate blockchain node whose node identifier matches the winning random number is selected from the candidate blockchain node set, and the target candidate blockchain node is determined 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 a quantum election proof for a new block; The current block producing node performs block signature processing on the block tag of the first block to obtain a block tag of a new block; The current block-producing node writes the electronic signature information within the current preset time period, the quantum election certificate 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 to generate the new block of the electronic signature blockchain.
2. The electronic signature block generation method according to claim 1, It is characterized in that The step B comprises: Processing the quantum election certificate in the first block to obtain a first random number in a decimal format; Processing the first random number 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, It is characterized in that The processing of the quantum election certificate in the first block to obtain a first random number in a decimal format includes: Performing hash processing on the quantum election certificate in the first block to obtain a binary hash processing result; The hash processing result is converted into a decimal number to obtain a first random number.
4. The electronic signature block generation method according to claim 2, It is 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 loops, the initial values of the first temporary variable and the second temporary variable; The following steps 1 to 3 are executed in a loop until the random source is greater than or equal to the second temporary variable: Step 1: Update the first temporary variable according to the initial value of the first temporary variable, the block probability and the updated number of cycles; Step 2: updating the second temporary variable according to the initial value of the second temporary variable and the updated first temporary variable; Step 3: determining the initial value of the first temporary variable as the updated first temporary variable, determining the initial value of the second temporary variable as the updated second temporary variable, and updating the number of loops to increase the number of loops by one; The number of cycles when the random source is greater than or equal to the second temporary variable is determined as a winning random number.
5. The method for generating an electronic signature block according to any one of claims 1 to 4, It is 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: Generate the first public-private key pair of the current block-producing node through the quantum election proof algorithm; The current quantum random number and the winning random number are encrypted using the private key in the first public-private key pair to obtain a quantum election certification tag for the new block.
6. The method for generating an electronic signature block according to any one of claims 1 to 4, It is characterized in that The current block producing node performs block signature processing according to the block tag of the first block to obtain the block tag of the new block; including: Generate a second public-private key pair of the current block-producing node through a block label algorithm; The block tag of the first block is encrypted using the private key in the second public-private key pair to obtain a block tag of a new block.
7. The method for generating an electronic signature block according to claim 5, It is characterized in that The new block also includes the public key in 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 a first target node, where the first target node is any node in the blockchain node except the current block-producing node; The first target node performs the following operations: Reading the public key in the first public-private key pair, the current quantum random number, and the winning random number from the new block; Decrypting the quantum election certificate of the new block using the public key in the first public-private key pair to obtain a decryption result; Comparing the decryption result with the current quantum random number and the winning random number to see if they are consistent; In the case of consistency, it is determined that the verification of the quantum election certificate has been passed; in the case of inconsistency, it is determined that the verification of the quantum election certificate has failed.
8. The method for generating an electronic signature block according to claim 6, It is 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 a second target node, where the second target node is any node in the blockchain node except the current block-producing node; The second target node performs the following operations: Reading the public key in the second public-private key pair, the current quantum random number, and the winning random number from the new block; Decrypting the block label of the new block using the public key in the second public-private key pair to obtain a decryption result; Comparing the decryption result with the block label of the latest block on the chain of the second target node to see whether they are consistent; In the case of consistency, it is determined that the block tag verification of the new block has passed; in the case of inconsistency, it is determined that the block tag verification of the new block has failed.
9. An electronic signature block generation device, It is characterized in that include: A data acquisition module, 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 also 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 certificate and block label of the first block generated most recently; A block node selection module, used to determine a winning random number according to a Poisson probability distribution algorithm, the quantum election certificate of the first block, and a block probability; the block probability is determined according to the number of nodes in the candidate blockchain node set; And used to select a target candidate blockchain node whose node identifier matches the winning random number from the candidate blockchain node set according to the winning random numbers corresponding to all candidate blockchain nodes, and determine the target candidate blockchain node as the current block producing node at the current moment; An encryption module is used for the current block-producing node to perform quantum election proof processing on the current quantum random number and the winning random number to obtain a quantum election proof of a new block; The current block-producing node performs block signature processing according to the block label of the first block to obtain the block label of the new block; The block generation module is used to write the electronic signature information of the current block-producing node within the current preset time period, the quantum election certificate 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 to generate the new block of the electronic signature blockchain.
10. An electronic device, It is characterized in that The device comprises: a processor and a memory storing computer program instructions; When the processor executes the computer program instructions, the electronic signature block generation method as described in any one of claims 1-8 is implemented.
11. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores computer program instructions, and when the computer program instructions are executed by the processor, the electronic signature block generation method according to any one of claims 1 to 8 is implemented.
12. A computer program product, It is characterized in that When the instructions in the computer program product are executed by a processor of an electronic device, the electronic device executes the electronic signature block generation method as described in any one of claims 1 to 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
Electronic signature method, system and device based on blockchain and readable storage medium
CN112507391A
Block chain consensus system based on post-quantum threshold signature
CN114710514A
Power block chain cloud deployment method and device based on proof of rights and interests
CN115766017A
