Blockchain PoW consensus method, system and storage medium resistant to quantum attacks

By adopting a PoW consensus method of multivariable quadratic polynomial equation system and dual hashing operation in the blockchain system, combined with dynamic adjustment and confirmation committee mechanism, the problem of blockchain security under quantum computer attacks is solved, and high Security and fast consensus speed.

CN115426097BActive Publication Date: 2024-11-01SHANGHAI CHAOXI NETWORK TECH CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210949111.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-08-09
Publication Date
2024-11-01
Estimated Expiration
2042-08-09

AI Technical Summary

Technical Problem

The existing blockchain PoW consensus mechanism has insufficient security under quantum computer attacks, and hash algorithms are easy to be cracked, making it difficult to ensure the safe operation of the blockchain system.

Method used

Using the PoW consensus method based on multivariate quadratic polynomial equation system, the random quadratic polynomial equation system is generated and double hashing operation is performed, the random number is adjusted until the result is less than or equal to the hash target value, and the difficulty of the system of equations is dynamically adjusted. Hash the target value to adapt to the actual consensus time, and quickly verify and confirm with the confirmation committee mechanism.

Benefits of technology

Effectively resisting cracking attacks by quantum computers improves the security of blockchain systems, and significantly improves the consensus speed through deterministic consensus mechanism.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115426097B_ABST
    Figure CN115426097B_ABST
Patent Text Reader

Abstract

The present application discloses a blockchain PoW consensus method, system and storage medium that is resistant to quantum attacks. The method includes: obtaining PoW expected time value and PoW difficulty value, PoW difficulty value includes equation group difficulty value and hash target value, generating quadratic polynomial equation group based on equation group difficulty value and solving, the consensus node that successfully solves the equation group fills the solution of the equation group, PoW difficulty value and random number into the block header, and performs double hash operation on the block header, adjusts the random number in the block header until the result value of the double hash operation is less than or equal to the hash target value, and the consensus node that successfully performs double hash operation broadcasts the block composed of its block header and block body to other consensus nodes, and other consensus nodes verify the block based on the PoW difficulty value and random number in the block header; adjust the PoW difficulty value of the next cycle according to the actual average PoW consensus time of the current cycle. The present invention can improve the security of the blockchain system.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of blockchain technology, and more specifically, to a blockchain PoW consensus method, system and storage medium that are resistant to quantum attacks. Background Art

[0002] In a decentralized blockchain system, there is no need for a centralized accounting organization to ensure the consistency of each transaction on all accounting nodes, that is, to reach a consensus across the entire network. The blockchain system uses a consensus mechanism to solve the problem of consistency in accounting information. PoW (Proof of Work), or proof of workload, is the consensus mechanism used in Bitcoin and is also the consensus algorithm used in many current digital currency systems (such as Ethereum, Litecoin, Dogecoin, etc.). In layman's terms, in the current PoW consensus mechanism, consensus nodes use devices with computing power to perform hash calculations. The process of this calculation is the workload. By continuously calculating to obtain a hash value that meets the requirements of the blockchain system, this is the so-called problem solving. When a consensus node succeeds in solving the problem first, the consensus node can obtain the right to record, add new blocks and obtain system rewards; while other consensus nodes verify the new block and the accounting information contained therein, and accept the new block if there is no error, thereby achieving consistency in accounting information across the entire network. The goal of PoW is to find an answer that meets specific conditions. This answer is difficult to calculate but easy to verify. This is the core requirement of proof of workload.

[0003] With the rapid development of quantum computers, the existing blockchain operation mechanism is also facing great challenges. For example, the elliptic curve digital signature scheme ECDSA adopted by most blockchain systems, quantum computers have a very efficient SHOR attack algorithm for the ECDSA signature algorithm. The SHOR algorithm is suitable for solving difficult mathematical problems such as large integer decomposition and discrete logarithm inversion, which makes the ECDSA signature algorithm quite unsafe under quantum computer attacks. As for the hash solution adopted by the blockchain PoW mechanism, the most effective attack method for quantum computers against hash algorithms at this stage is the GROVER algorithm, which can reduce the attack complexity of hash algorithms from O(2n) to O(2n / 2), but by increasing the output length of the hash algorithm, it can still effectively resist this attack. In addition, in addition to the threat of quantum computer attacks, academic circles have also conducted endless research on traditional attacks and cracking of hash algorithms. Therefore, it is likely that relying solely on hash algorithms will not be able to continue to ensure the safe operation of blockchain systems in the future. A new PoW mechanism that can resist quantum computer attacks is urgently needed. Summary of the invention

[0004] In response to at least one defect or improvement need in the prior art, the present invention provides a blockchain PoW consensus method, system and storage medium that are resistant to quantum attacks, which can improve the security of the blockchain system.

[0005] To achieve the above objectives, according to a first aspect of the present invention, a blockchain PoW consensus method resistant to quantum attacks is provided, comprising:

[0006] The consensus node obtains the PoW expected time value and PoW difficulty value from the blockchain system. The PoW difficulty value includes the difficulty value of the equation group and the hash target value. Based on the difficulty value of the equation group, a quadratic polynomial equation group is generated and solved. The consensus node that successfully solves the equation group fills the solution of the equation group, the PoW difficulty value and the random number into the block header, and performs a double hash operation on the block header. The random number in the block header is adjusted until the result value of the double hash operation is less than or equal to the hash target value. The consensus node that successfully performs the double hash operation broadcasts the block consisting of its block header and block body to other consensus nodes, and other consensus nodes verify the block based on the PoW difficulty value and random number in the block header;

[0007] The PoW difficulty value is adjusted according to the actual average PoW consensus time and PoW expected time value of the current cycle, and the PoW consensus of the next cycle is carried out according to the adjusted PoW difficulty value.

[0008] Furthermore, adjusting the PoW difficulty value according to the actual average PoW consensus time and PoW expected time value of a cycle includes:

[0009] If the absolute value of the difference between the actual average PoW consensus time of the current cycle and the PoW expected time value is less than the first preset value, only the hash target value is adjusted;

[0010] If the absolute value of the difference between the actual average PoW consensus time of the current cycle and the PoW expected time value is greater than the second preset value, the difficulty value of the equation group and the hash target value are adjusted.

[0011] Furthermore, adjusting the PoW difficulty value according to the actual average PoW consensus time and the PoW expected time value of the current cycle also includes:

[0012] If after adjusting the PoW difficulty value, the ratio of the expected time for solving the set of equations to the expected time for double hashing operations in the next cycle is less than the third preset value or greater than the fourth preset value, the PoW difficulty value continues to be adjusted until the ratio of the expected time for solving the set of equations to the expected time for double hashing operations in the next cycle is within the preset range.

[0013] Furthermore, the calculation formula for adjusting only the hash target value is:

[0014]

[0015] t' is the hash target value of the next cycle, t is the hash target value of the current cycle, T is the average actual average PoW consensus time of the current cycle, and the ratio of the expected equation solution time to the expected double hash operation time of the current cycle is a / b.

[0016] Furthermore, the calculation formula of the difficulty value and the hash target value of the adjustment equation group is:

[0017]

[0018] t' is the hash target value of the next cycle, t is the hash target value of the current cycle, T is the average actual average PoW consensus time of the current cycle, the ratio of the expected equation solution time of the current cycle to the expected double hash operation time is a / b, and Δ represents the difficulty adjustment amplitude of the multivariable equation system in the next cycle.

[0019] Further, generating a quadratic polynomial equation system based on the difficulty value of the equation system and solving the equation system includes:

[0020] The difficulty value of the equation group includes the number of equations m and the number of variables n. The current chaos mapping function parameters are obtained, and the chaos mapping function parameters are updated regularly. According to the current chaos mapping function parameters, (n(n+1) / 2+n+1)×m multivariable equation group coefficients are generated. According to the generated multivariable equation group coefficients, a quadratic polynomial equation group containing m equations and n variables is generated and solved.

[0021] Furthermore, in each round of voting, all network nodes select P confirmation committee nodes, including 1 master node and P-1 slave nodes. The master node is rotated after every several blocks. The consensus node that successfully performs double hashing sends the block consisting of its block header and block body to the master node. The other consensus nodes verify the block based on the PoW difficulty value and random number in the block header, including:

[0022] The master node performs PoW confirmation and block content legitimacy confirmation on the block based on the PoW difficulty value and random number in the block header. After confirmation, the block and the "confirmed" information are broadcast to P-1 slave nodes. The P-1 slave nodes confirm that the block is correct based on the PoW difficulty value and random number in the block header, and then broadcast the "confirmed" information to the master node and other slave nodes respectively. When each confirmation committee node receives more than the preset proportion of "confirmed" information, the block is confirmed and written into the blockchain, and the block is broadcast to the entire network at the same time.

[0023] According to the second aspect of the present invention, a blockchain PoW consensus system resistant to quantum attacks is also provided, comprising a plurality of consensus nodes, wherein the PoW consensus method adopted between the consensus nodes comprises:

[0024] The consensus node obtains the PoW expected time value and PoW difficulty value from the blockchain system. The PoW difficulty value includes the difficulty value of the equation group and the hash target value. A random quadratic polynomial equation group is generated based on the difficulty value of the equation group and solved. The consensus node that successfully solves the equation group fills the solution of the equation group, the PoW difficulty value and a random number into the block header, and performs a double hash operation on the block header. The random number in the block header is adjusted until the result value of the double hash operation is less than or equal to the hash target value. The consensus node that successfully performs the double hash operation broadcasts the block consisting of its block header and block body to other consensus nodes, and broadcasts it to other consensus nodes. Other consensus nodes verify the block based on the PoW difficulty value and random number in the block header;

[0025] The PoW difficulty value is adjusted according to the actual average PoW consensus time and PoW expected time value of the current cycle, and the PoW consensus of the next cycle is carried out according to the adjusted PoW difficulty value.

[0026] Furthermore, adjusting the PoW difficulty value according to the actual average PoW consensus time of a cycle includes:

[0027] If the absolute value of the difference between the actual average PoW consensus time of the current cycle and the PoW expected time value is less than the first preset value, only the hash target value is adjusted;

[0028] If the absolute value of the difference between the actual average PoW consensus time of the current cycle and the PoW expected time value is greater than the second preset value, the difficulty value of the equation group and the hash target value are adjusted;

[0029] If after adjusting the PoW difficulty value, the ratio of the expected time for solving the set of equations to the expected time for double hashing operations in the next cycle is less than the third preset value or greater than the fourth preset value, the PoW difficulty value continues to be adjusted until the ratio of the expected time for solving the set of equations to the expected time for double hashing operations in the next cycle is within the preset range.

[0030] According to a third aspect of the present invention, there is also provided a storage medium storing a computer program executable by a processor, wherein when the computer program runs on the processor, the processor executes the steps of any one of the above methods.

[0031] In general, the above technical solutions conceived by the present invention can achieve the following beneficial effects compared with the prior art:

[0032] (1) The solution based on multivariable quadratic polynomial equations can resist the cracking attack of quantum computers and has high security. In addition, by dynamically adjusting the difficulty of solving multivariable equations and hashing, fine adjustment of consensus time can be achieved.

[0033] (2) The confirmation process of the proof-of-work system adopts a deterministic consensus mechanism, which greatly improves the consensus speed compared with the non-deterministic consensus (probabilistic consensus) mechanism. BRIEF DESCRIPTION OF THE DRAWINGS

[0034] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0035] Figure 1 A flowchart of a blockchain PoW consensus method that is resistant to quantum attacks provided in an embodiment of the present application;

[0036] Figure 2 A block diagram provided for an embodiment of the present application;

[0037] Figure 3 A schematic diagram of the principle of PoW consensus confirmation provided in the embodiment of the present application;

[0038] Figure 4 A schematic diagram of the block verification principle provided in an embodiment of the present application. DETAILED DESCRIPTION

[0039] In order to make the purpose, technical solutions and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention. In addition, the technical features involved in the various embodiments of the present invention described below can be combined with each other as long as they do not conflict with each other.

[0040] The terms "first", "second", "third", etc. in the specification and claims of this application and the above-mentioned drawings are used to distinguish different objects, rather than to describe a specific order. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or modules is not limited to the listed steps or modules, but optionally includes steps or modules that are not listed, or optionally includes other steps or modules inherent to these processes, methods, products or devices.

[0041] like Figure 1As shown, a quantum attack-resistant blockchain PoW consensus method according to an embodiment of the present invention comprises: (1) a consensus node obtains a PoW expected time value and a PoW difficulty value from a blockchain system, wherein the PoW difficulty value comprises a difficulty value of a set of equations and a hash target value, generates a set of quadratic polynomial equations based on the difficulty value of the set of equations and solves the set of equations, and the consensus node that successfully solves the set of equations fills the solution of the set of equations, the PoW difficulty value and the random number into a block header, and performs a double hash operation on the block header, adjusts the random number in the block header until the result value of the double hash operation is less than or equal to the hash target value, and the consensus node that successfully performs the double hash operation broadcasts the block consisting of its block header and block body to other consensus nodes, and broadcasts the block to other consensus nodes; (2) other consensus nodes verify the block based on the PoW difficulty value and the random number in the block header; (3) the PoW difficulty value is adjusted according to the actual average PoW consensus time and the PoW expected time value of the current cycle, and the PoW consensus of the next cycle is performed according to the adjusted PoW difficulty value.

[0042] The preferred implementation of each step is described in detail below.

[0043] Step (1) includes the following sub-steps:

[0044] (1.1) The blockchain system sets and regularly adjusts PoW-related parameters. For example, the PoW expected time (i.e., block generation time) is set to 10 minutes, with 10080 minutes (a week) as an adjustment cycle; the PoW difficulty value (including the number of variables n, the number of equations m, and the hash target value t) is regularly adjusted. The blockchain system also regularly adjusts the parameters of the chaos mapping function.

[0045] (1.2) The consensus node starts to assemble a new block. The block structure is as follows Figure 2 As shown, it consists of a block header and a block body.

[0046] The block contains transaction records and related information that have been verified by consensus nodes.

[0047] The block header contains four parts: "Solution of multivariable equations", "Random number", "Difficulty value", and "Other information". The "Difficulty value" contains the difficulty value of the multivariable equations "number of variables n and number of equations m" and "hash target value t".

[0048] “Other information” includes “parent block header hash value”, “timestamp”, “Merkle root hash value” and other information obtained before PoW consensus, collectively referred to as “other information” here.

[0049] (1.3) The consensus node obtains the PoW difficulty value related parameters from the blockchain system and fills them into the "difficulty value" part of the block header.

[0050] (1.4) The consensus node performs a SHA256 (a cryptographic hash function algorithm standard) hash operation on the "other information" in the block header to obtain a hash value Hs.

[0051] (1.5) The consensus node generates a multivariable equation system based on the difficulty value of the multivariable equation system given by the blockchain system, "the number of variables n and the number of equations m" and the parameters of the chaos mapping function, and substitutes the hash value Hs.

[0052] The blockchain system stipulates that the finite field GF(2) is used to construct a multivariable equation system. The element value in the GF(2) field is (0, 1), and each operation in the GF(2) field can be performed modulo (mod 2) to keep the result 0 or 1.

[0053] The format of a quadratic polynomial f with n variables is as follows, where the sum of the number of coefficients of the three types a, b, and c is: n(n+1) / 2+n+1.

[0054]

[0055] m quadratic polynomials f can form a multivariable quadratic polynomial equation system, as shown in formula (1):

[0056]

[0057] Therefore, before solving the multivariable equations of formula (1), the consensus node needs to generate (n(n+1) / 2+n+1)×m multivariable equation coefficients.

[0058] The consensus node uses the chaos mapping function to randomly generate the required multivariable equation coefficients. In order to enhance security, the blockchain system will periodically and randomly update the chaos mapping function type and related parameters.

[0059] In this example, the logistic chaotic mapping function is used to randomly generate the coefficients of the multivariable equation system. As shown in formula (2):

[0060] X i+1 =μX i (1-X i )i=1,2,3... (2)

[0061] Among them, μ∈(3.5699,4], initial value X1∈(0,1), are randomly selected parameters. The blockchain system will update (reselect parameter values) regularly to ensure the security of the system.

[0062] In this example, the consensus node sets i=Hs in formula (2), that is, the hash value Hs of the block header "other information" is used to determine the logistic chaotic mapping function from which iteration to generate random multivariable equation coefficients. In this way, the same multivariable equation coefficients can be generated at any time based on the "other information" and "difficulty value" of the block header for PoW confirmation.

[0063] Since the coefficients generated by the logistic chaotic mapping function are all decimals less than 1, and the coefficients in the multivariable equation system can only be 0 or 1. Therefore, after the random coefficients are generated, they need to be transformed.

[0064] As in this example, the logistic chaotic mapping function is calculated with float type variables, and after the coefficient is generated, it is transformed according to the parity of the first decimal place (i.e., the tenth place). If the first decimal place of the coefficient is an odd number, the coefficient becomes 1; if the first decimal place of the coefficient is an even number, the coefficient becomes 0.

[0065] For example, suppose the currently calculated X i+1 =0.74324560000, the first decimal point is 7, which is an odd number, then according to the above rule X i+1 =1.

[0066] This generates coefficients of random multivariable equations that meet the requirements.

[0067] The relevant pseudo code is as follows:

[0068]

[0069]

[0070] (1.6) The consensus node solves the multivariable equations and, if successful, fills the solution into the "Solution of Multivariable Equations" section of the block header.

[0071] After the consensus nodes sequentially generate (n(n+1) / 2+n+1)×m multivariable equations, they solve the multivariable equations. That is, they obtain a set of (x1,...,x n ), so that equation (1) holds. If the solution is successful, then (x1,...,x n ) Fill in the "Solution of Multivariable Equations" section of the block header.

[0072] The relevant pseudo code is as follows:

[0073]

[0074]

[0075] For ease of understanding, a simple example is given below:

[0076] Assume n=3, m=2, then we need to generate (3×(3+1) / 2+3+1)×2, a total of 20 equation system coefficients. The coefficients with a value of 0 are not displayed. Then we can get the following example equation system:

[0077]

[0078] Solving the example system of equations, we can obtain (x1=1, x2=1, x3=1), which is the "solution to the multivariable system of equations" (substituting the solution into the system of equations, we can obtain 6mod 2=0).

[0079] (1.7) The consensus node fills a random value into the "random number" part of the block header and performs a double SHA256 hash operation on the entire block header (i.e. SHA256(SHA256(Block_Header))).

[0080] (1.8) The consensus node compares the double hash result value with the "hash target value t". If it is less than or equal to the target value t, it obtains the right to record the new block. Otherwise, continue to adjust the "random number" part until the conditions are met.

[0081] The relevant pseudo code is as follows:

[0082]

[0083] like Figure 3 As shown, in step (2), block verification preferably uses a "confirmation committee" mechanism to achieve rapid confirmation of new blocks. All network nodes vote to select P confirmation committee nodes every cycle (such as every day), including 1 master node and P-1 slave nodes. After the current master node has confirmed several blocks, it will rotate and replace a slave node to become the new master node. Any node has the opportunity to be selected as the master node. The consensus node that obtains the right to record sends the new block to the master node. The master node performs PoW confirmation and regular block content legitimacy confirmation on the new block. After confirmation, the new block and "confirmed" information are broadcast to P-1 slave nodes. After the P-1 slave nodes also confirm the new block with PoW, they broadcast "confirmed" information to the master node and other slave nodes respectively. When each confirmation committee node receives more than 3P / 4 "confirmed" information (including the node's own "confirmed" information), the new block is confirmed and written into the node's blockchain, and the new block is broadcast to the entire network. Other nodes in the entire network do not need to confirm again, and directly reach a consensus, and the transactions contained in the new block can take effect quickly. This confirmation scheme has a certain degree of robustness, and even if 1 / 4 of the confirmation committee nodes are malicious nodes or invalid nodes, the confirmation process can still be completed.

[0084] Based on the "solution of the multivariable equation system" and "random number" information in the block header, the confirmation committee node can quickly confirm whether the new block meets the PoW consensus conditions.

[0085] like Figure 4 As shown, the PoW confirmation process of the master node and the slave node is as follows:

[0086] (2.1) Confirm that the committee node generates the corresponding multivariable equation set according to the "other information" and "difficulty value" of the block header according to the method of step (1.5).

[0087] (2.2) Confirm that the committee node substitutes the "solution to the multivariable equation system" in the block header into the generated multivariable equation system. If it is a correct answer, proceed to the next step. Otherwise, reject the block.

[0088] (2.3) Confirm that the committee node double-hashes the entire block header. If the double-hashing result value is less than or equal to the hash target value t, the block is recognized as meeting the PoW consensus condition; otherwise, the block is rejected.

[0089] In the above PoW confirmation process, hash operations, chaotic mapping functions, and the generation and verification of multivariable equations all require very low time complexity, so the PoW confirmation of new blocks can be quickly realized. At the same time, compared with the confirmation mechanism of blockchains such as Bitcoin, the "Confirmation Committee" mechanism in this confirmation scheme is a deterministic consensus scheme that does not require full network confirmation and can avoid the bifurcation problem existing in non-deterministic consensus schemes. Therefore, after the new block is confirmed, the transactions contained in the block can take effect immediately (while the Bitcoin mechanism needs to wait for 6 blocks to be confirmed before the transaction can take effect), with high overall execution efficiency.

[0090] In step (3), the specific implementation of the blockchain system setting and regularly adjusting the PoW difficulty value is as follows.

[0091] (3.1) Set the initial PoW difficulty value. Assume that the PoW expected time (i.e., block generation time) is set to 10 minutes, with an adjustment cycle of 10080 minutes (one week). Based on the current average computing power of the entire network, the blockchain system simulates and tests the multivariable method and the hash method, and gives the initial multivariable equation group difficulty value and hash target value based on a certain initial expected ratio. For example, if the initial expected ratio is set to 2:1 (ideal value), the initial difficulty value given by the system will make the multivariable method solution time expectation 6.67 minutes, and the hash method solution time expectation 3.33 minutes, which is still 10 minutes in total. In each new cycle thereafter, the expected ratio will be recalculated.

[0092] (3.2) The principle of adjusting the difficulty value of a multivariable equation system: the number of variables n and the number of equations m.

[0093] If we want to adjust the difficulty of a system of multi-variable equations, we cannot simply increase or decrease the number of variables \(n\) or the number of equations \(m\) alone. Because there is a problem: when the number of equations \(m\) is greater than the number of variables \(n\), the equations have too many restrictive conditions on the variables, which is an overdetermined system of equations, and generally there is no solution for an overdetermined system of equations; when the number of equations \(m\) is less than the number of variables \(n\), this is an underdetermined system of equations, and an underdetermined system of equations usually has solutions. Therefore, simply increasing or decreasing the number of variables \(n\) or the number of equations \(m\) will affect the structure of the system of equations and lead to more complex solution difficulties.

[0094] In the embodiments of the present invention, when adjusting the difficulty of a system of multi-variable equations, it is chosen to increase or decrease the number of variables \(n\) and the number of equations \(m\) simultaneously, so that the structure of the system of equations will not be changed; and it is stipulated that \(m < n\) to ensure that the system of multi-variable equations is an underdetermined system of equations (when \(m\) and \(n\) take relatively large values, the system of multi-variable equations not only has a high resistance to quantum attacks, but also has no solution possibility only in theory). At the same time, the finite field used is GF(2), that is, the variable values can only be 0 or 1, so increasing or decreasing the number of variables \(n\) and the number of equations \(m\) simultaneously will double or halve the solution difficulty (for example, if one variable is added and \(n\) becomes \(n + 1\), then the solution difficulty changes from \(2n\) to \(2n + 1\)). The change range of the corresponding difficulty of the system of multi-variable equations is relatively large, so it is necessary to combine the hash method to achieve fine-tuning of the PoW difficulty.

[0095] (3.3) Hash target value adjustment method.

[0096] Since the goal of the hash method is to find a number smaller than the hash target value, the smaller the hash target value, the higher the solution difficulty. Let the actual average PoW consensus time of all blocks generated in the current period be \(T\), and the ratio of the expected time for solving the multi-variable method to the expected time for solving the hash in the current period be \(a:b\).

[0097] 1) If the absolute value of the difference between the actual average PoW consensus time in the current period and the PoW expected time value is less than the first preset value, only adjust the hash target value;

[0098] For the case of only adjusting the hash target value, the calculation formula is:

[0099]

[0100] 2) If the absolute value of the difference between the actual average PoW consensus time in the current period and the PoW expected time value is greater than the second preset value, adjust the difficulty value of the system of equations and the hash target value.

[0101] For the case of adjusting the difficulty value of the multi-variable system of equations and the hash target value simultaneously, the calculation formula is:

[0102]

[0103] t' is the hash target value of the next cycle, t is the hash target value of the current cycle, and Δ represents the difficulty adjustment amplitude of the multivariable equation group of the next cycle. For example, if the difference between the actual average PoW consensus time and the PoW expected time value of the current cycle is greater than the second preset value, Δ=1 / 2; if the difference between the PoW expected time value and the actual average PoW consensus time of the current cycle is greater than the second preset value, Δ=2.

[0104] (3.4) Specific adjustment plan. Calculate the actual average consensus time of the current cycle. If the actual average consensus time is greater than or equal to 7.5 minutes and less than 15 minutes ([7.5,15)), only adjust the hash target value. If the actual average consensus time is less than 7.5 minutes or greater than or equal to 15 minutes, adjust the multivariable equation difficulty value and hash target value at the same time.

[0105] For example, if the actual average consensus time of the current cycle is 9 minutes, and the expected ratio a:b of the current cycle is 2:1, then the corresponding multivariate method solution time expectation is 6 minutes, and the hash method solution time expectation is 3 minutes. Then adjust the hash target value (i.e. the hash target value of the current cycle * (3 / 4)) separately, so that the hash method solution time expectation is 4 minutes. At the same time, the expected ratio a:b of the next cycle becomes 3:2.

[0106] For example, if the actual average consensus time in the current cycle is 15 minutes, and the expected ratio a:b in the current cycle is 3:2, then the corresponding multivariable method solution time expectation is 9 minutes, and the hash method solution time expectation is 6 minutes. Then, the "number of variables n and number of equations m" of the multivariable method are reduced by 1, so that the multivariable method solution time expectation is 4.5 minutes; at the same time, adjust the hash target value (that is, the hash target value of the current cycle * (6 / 5.5)), so that the hash method solution time expectation is 5.5 minutes. At the same time, the expected ratio a:b in the next cycle becomes 4.5:5.5.

[0107] (3.5) Special Adjustment. If after adjusting the PoW difficulty value, the ratio of the expected time for solving the set of equations to the expected time for double hashing operation in the next cycle is less than the third preset value or greater than the fourth preset value, the PoW difficulty value will continue to be adjusted until the ratio of the expected time for solving the set of equations to the expected time for double hashing operation in the next cycle is within the preset range.

[0108] Because the frequency of adjusting the hash target value to achieve fine-tuning is relatively high, there is a possibility that the expected time of the hash method solution will be raised or lowered continuously, which will make the expected ratio too low or too high. If the expected ratio is too low, the advantage of the multivariate method in resisting quantum attacks will not be brought into play, and if the expected ratio is too low, it will be difficult to achieve the fine-tuning ability of the hash method. Therefore, for example, when the expected ratio of the next cycle is less than or equal to 1:2, the ratio is readjusted to 2:1; when the expected ratio of the next cycle is greater than or equal to 9:1, the ratio is readjusted to 4.5:5.5.

[0109] For example, if the expected ratio of the next cycle after adjusting the difficulty value is 1:2, then the corresponding multivariable method solution time expectation is 3.33 minutes, and the hash method solution time expectation is 6.67 minutes. Then, add 1 to the "number of variables n and number of equations m" of the multivariable method, so that the multivariable method solution time expectation is 6.67 minutes; at the same time, adjust the hash target value (that is, the hash target value of this cycle * (6.67 / 3.33)), so that the hash method solution time expectation is 3.33 minutes. That is, the expected ratio of the next cycle is updated to 2:1.

[0110] A quantum attack-resistant blockchain PoW consensus system according to an embodiment of the present invention includes a plurality of consensus nodes, and a PoW consensus method adopted between consensus nodes includes: the consensus node obtains a PoW expected time value and a PoW difficulty value from the blockchain system, the PoW difficulty value includes a difficulty value of a set of equations and a hash target value, generates a random quadratic polynomial set of equations based on the difficulty value of the set of equations and solves it, the consensus node that successfully solves the set of equations fills the solution of the set of equations, the PoW difficulty value and a random number into a block header, and performs a double hash operation on the block header, adjusts the random number in the block header until the result value of the double hash operation is less than or equal to the hash target value, the consensus node that successfully performs the double hash operation broadcasts a block consisting of its block header and block body to other consensus nodes, and broadcasts it to other consensus nodes, and the other consensus nodes verify the block based on the PoW difficulty value and the random number in the block header; adjusts the PoW difficulty value according to the actual average PoW consensus time and the PoW expected time value of the current cycle, and performs PoW consensus for the next cycle according to the adjusted PoW difficulty value.

[0111] The implementation principle of the system is similar to the above method and will not be repeated here.

[0112] The present application also provides a storage medium storing a computer program executable by a processor, which, when executed on the processor, causes the processor to execute any of the steps of the above-mentioned quantum attack-resistant blockchain PoW consensus method. The computer-readable storage medium may include, but is not limited to, any type of disk, including a floppy disk, an optical disk, a DVD, a CD-ROM, a microdrive, and a magneto-optical disk, a ROM, a RAM, an EPROM, an EEPROM, a DRAM, a VRAM, a flash memory device, a magnetic card or an optical card, a nanosystem (including a molecular memory IC), or any type of medium or device suitable for storing instructions and / or data.

[0113] It should be noted that, for the aforementioned method embodiments, for the sake of simplicity, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the described order of actions, because according to the present application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present application.

[0114] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0115] The above is only an exemplary embodiment of the present disclosure, and the scope of the present disclosure cannot be limited thereto. That is, any equivalent changes and modifications made according to the teachings of the present disclosure are still within the scope of the present disclosure. After considering the specification and practicing the disclosure here, those skilled in the art will easily think of the implementation scheme of the present disclosure. This application is intended to cover any modification, use or adaptation of the present disclosure, which follows the general principles of the present disclosure and includes common knowledge or customary technical means in the technical field not recorded in the present disclosure. The description and examples are regarded as exemplary only, and the scope and spirit of the present disclosure are defined by the claims.

[0116] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0117] It will be easily understood by those skilled in the art that the above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the protection scope of the present invention.

Claims

1. A blockchain PoW consensus method that is resistant to quantum attacks, characterized in that: include: The consensus node obtains the PoW expected time value and PoW difficulty value from the blockchain system. The PoW difficulty value includes the difficulty value of the equation group and the hash target value. Based on the difficulty value of the equation group, a quadratic polynomial equation group is generated and solved. The consensus node that successfully solves the equation group fills the solution of the equation group, the PoW difficulty value and the random number into the block header, and performs a double hash operation on the block header. The random number in the block header is adjusted until the result value of the double hash operation is less than or equal to the hash target value. The consensus node that successfully performs the double hash operation broadcasts the block consisting of its block header and block body to other consensus nodes, and other consensus nodes verify the block based on the PoW difficulty value and random number in the block header; Adjust the PoW difficulty value based on the actual average PoW consensus time and PoW expected time value of the current cycle, and conduct PoW consensus for the next cycle based on the adjusted PoW difficulty value; The adjustment of the PoW difficulty value according to the actual average PoW consensus time and PoW expected time value of the current cycle includes: If the absolute value of the difference between the actual average PoW consensus time of the current cycle and the PoW expected time value is less than the first preset value, only the hash target value is adjusted; If the absolute value of the difference between the actual average PoW consensus time of the current cycle and the PoW expected time value is greater than the second preset value, the difficulty value of the equation group and the hash target value are adjusted; The adjustment of the PoW difficulty value according to the actual average PoW consensus time and PoW expected time value of the current cycle also includes: If after adjusting the PoW difficulty value, the ratio of the expected time for solving the system of equations to the expected time for double hashing operations in the next cycle is less than the third preset value or greater than the fourth preset value, the PoW difficulty value is continuously adjusted until the ratio of the expected time for solving the system of equations to the expected time for double hashing operations in the next cycle is within the preset range; The generating and solving of a quadratic polynomial equation system based on the difficulty value of the equation system comprises: The difficulty value of the equation group includes the number of equations m and the number of variables n. The current chaos mapping function parameters are obtained, and the chaos mapping function parameters are updated regularly. According to the current chaos mapping function parameters, (n(n+1) / 2+n+1)×m multivariable equation group coefficients are generated. According to the generated multivariable equation group coefficients, a quadratic polynomial equation group containing m equations and n variables is generated and solved.

2. The blockchain PoW consensus method according to claim 1, characterized in that: The calculation formula for adjusting only the hash target value is: t' is the hash target value of the next cycle, t is the hash target value of the current cycle, T is the average actual average PoW consensus time of the current cycle, and the ratio of the expected equation solution time to the expected double hash operation time of the current cycle is a / b.

3. The blockchain PoW consensus method according to claim 1, characterized in that: The calculation formula for adjusting the difficulty value and the hash target value of the equation group is: t' is the hash target value of the next cycle, t is the hash target value of the current cycle, T is the average actual average PoW consensus time of the current cycle, the ratio of the expected equation solution time of the current cycle to the expected double hash operation time is a / b, and Δ represents the difficulty adjustment amplitude of the multivariable equation system in the next cycle.

4. The blockchain PoW consensus method according to claim 1, characterized in that: In each round of voting, all network nodes select P confirmation committee nodes, including 1 master node and P-1 slave nodes. The master node is rotated after every several blocks. The consensus node with successful double hash operation sends the block consisting of its block header and block body to the master node. The other consensus nodes verify the block based on the PoW difficulty value and random number in the block header, including: The master node performs PoW confirmation and block content legitimacy confirmation on the block based on the PoW difficulty value and random number in the block header. After confirmation, the block and "confirmed" information are broadcast to P-1 slave nodes. P-1 slave nodes confirm that the block is correct based on the PoW difficulty value and random number in the block header, and then broadcast "confirmed" information to the master node and other slave nodes respectively. When each confirmation committee node receives more than the preset proportion of "confirmed" information, the block is confirmed and written into the blockchain, and the block is broadcast to the entire network at the same time.

5. A blockchain PoW consensus system resistant to quantum attacks, comprising a plurality of consensus nodes, characterized in that: The PoW consensus methods used between consensus nodes include: The consensus node obtains the PoW expected time value and PoW difficulty value from the blockchain system. The PoW difficulty value includes the difficulty value of the equation group and the hash target value. A random quadratic polynomial equation group is generated based on the difficulty value of the equation group and solved. The consensus node that successfully solves the equation group fills the solution of the equation group, the PoW difficulty value and a random number into the block header, and performs a double hash operation on the block header. The random number in the block header is adjusted until the result value of the double hash operation is less than or equal to the hash target value. The consensus node that successfully performs the double hash operation broadcasts the block consisting of its block header and block body to other consensus nodes, and broadcasts it to other consensus nodes. Other consensus nodes verify the block based on the PoW difficulty value and random number in the block header; Adjust the PoW difficulty value based on the actual average PoW consensus time and PoW expected time value of the current cycle, and conduct PoW consensus for the next cycle based on the adjusted PoW difficulty value; The adjustment of the PoW difficulty value according to the actual average PoW consensus time and PoW expected time value of the current cycle includes: If the absolute value of the difference between the actual average PoW consensus time of the current cycle and the PoW expected time value is less than the first preset value, only the hash target value is adjusted; If the absolute value of the difference between the actual average PoW consensus time of the current cycle and the PoW expected time value is greater than the second preset value, the difficulty value of the equation group and the hash target value are adjusted; If after adjusting the PoW difficulty value, the ratio of the expected time for solving the system of equations to the expected time for double hashing operations in the next cycle is less than the third preset value or greater than the fourth preset value, the PoW difficulty value is continuously adjusted until the ratio of the expected time for solving the system of equations to the expected time for double hashing operations in the next cycle is within the preset range; The generating and solving of a quadratic polynomial equation system based on the difficulty value of the equation system comprises: The difficulty value of the equation group includes the number of equations m and the number of variables n. The current chaos mapping function parameters are obtained, and the chaos mapping function parameters are updated regularly. According to the current chaos mapping function parameters, (n(n+1) / 2+n+1)×m multivariable equation group coefficients are generated. According to the generated multivariable equation group coefficients, a quadratic polynomial equation group containing m equations and n variables is generated and solved.

6. A storage medium, characterized in that: The device stores a computer program, and when the computer program is run on a processor, the processor is enabled to execute the steps of the method according to any one of claims 1 to 4.