Block verification method, equipment, device and computer program product

By calculating and storing the status root of the block in advance after the block is constructed and storing it in the block, the problem of low block verification efficiency in the prior art is solved, and a faster block verification process is achieved.

CN119939672APending Publication Date: 2025-05-06HANGZHOU HIGH-TECH ZONE (BINJIANG) INSTITUTE OF BLOCKCHAIN & DATA SECURITY
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411755875.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-02
Publication Date
2025-05-06

AI Technical Summary

Technical Problem

In the prior art, the builder device and the verifier device take longer to calculate the block state root, resulting in less efficient block verification.

Method used

After the construction of block N is completed, the first state root of block N-M is stored in block N, and block N is sent to the verifier device to instruct the verifier device to verify block N-M according to the first state root.

Benefits of technology

By calculating and storing the status root of the block in advance, the builder device can send the block to the verifier device in a short time, thereby significantly improving the verification efficiency of the block.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119939672A_ABST
    Figure CN119939672A_ABST
Patent Text Reader

Abstract

The invention is suitable for the technical field of block chains, and provides a block verification method, equipment, a device and a computer program product. The method is applied to constructor equipment, and comprises the following steps: after a block N is constructed, storing a first state root of the block N-M in the block N; sending the block N to verifier equipment to indicate the verifier equipment to verify the block N-M according to the first state root; wherein the first state root is obtained through calculation according to the block N-M after the constructor equipment constructs the block N-M; n and M are integers greater than 0. In the method provided by the invention, after the constructor equipment constructs the block N and stores the state root of the block N-M in the block N, the block N can be sent to the verifier equipment for verification, and compared with a verification method in which the state root of the block N needs to be calculated after the block N is constructed, the method provided by the invention improves the verification efficiency of the block.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the field of blockchain technology, and in particular, relates to a block verification method, equipment, device and computer program product. Background Art

[0002] Currently, after the builder device completes the construction of any block, it needs to calculate the state root (stateRoot) of the block, store the state root of the block in the block header of the block, and finally send the block storing the state root of the block to the validator device.

[0003] After obtaining the block, the verifier device also needs to calculate the state root of the block and verify the block based on the state root calculated by itself and the state root stored in the block.

[0004] In the above process, the time required for the builder device to calculate the state root is often longer than the time required for the builder device to build a block, and the time required for the verifier device to calculate the state root is often longer than the time required to verify the block. It can be seen that both the builder device and the verifier device take more time to calculate the state root, which reduces the verification efficiency of the block. Summary of the invention

[0005] In view of this, the embodiments of the present application provide a block verification method, device, system and computer program product to solve the technical problem of low efficiency of existing block verification.

[0006] In a first aspect, an embodiment of the present application provides a block verification method, which is applied to a builder device, and the method includes:

[0007] After the block N is constructed, the first state root of the block NM is stored in the block N;

[0008] Send the block N to the verifier device to instruct the verifier device to verify the block NM according to the first state root; wherein the first state root is calculated according to the block NM after the builder device completes the construction of the block NM; N and M are both integers greater than 0.

[0009] Optionally, the first state root is determined in the following manner:

[0010] After the block NM is constructed, each transaction in the block NM is executed. After each transaction in the block NM is executed, the first state root is calculated.

[0011] Optionally, after building block N, it also includes:

[0012] According to the block N, calculating and storing a second state root of the block N;

[0013] After the block N+M is constructed, the second state root of the block N is stored in the block N+M.

[0014] In a second aspect, an embodiment of the present application provides a block verification method, which is applied to a verifier device, and the method includes:

[0015] After obtaining the block N sent by the builder device, the block NM is verified according to the first state root of the block NM stored in the block N; wherein the first state root is calculated by the builder device according to the block NM after the builder device completes the construction of the block NM; after the builder device completes the construction of the block N, the builder device stores the first state root in the block N; N and M are both integers greater than 0.

[0016] Optionally, after obtaining block N sent by the builder device, it also includes:

[0017] Calculate and store the second state root of the block N;

[0018] After obtaining the block N+M sent by the builder device, the block N is verified according to the third state root of the block N stored in the block N+M and the second state root.

[0019] Optionally, the verifying the block N according to the third state root of the block N stored in the block N+M and the second state root includes:

[0020] The third state root is compared with the second state root. If the comparison is consistent, it is determined that the block N has passed the verification.

[0021] In a third aspect, an embodiment of the present application provides a device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the block verification method as described in any one of the first aspect and the second aspect is implemented.

[0022] In a fourth aspect, an embodiment of the present application provides a block verification device, which is applied to a builder device, and the device includes:

[0023] A state root storage unit, configured to store the first state root of block NM in block N after the block N is constructed;

[0024] A block sending unit is used to send the block N to the verifier device to instruct the verifier device to verify the block NM according to the first state root; wherein the first state root is calculated according to the block NM after the builder device completes the construction of the block NM; N and M are both integers greater than 0.

[0025] In a fifth aspect, an embodiment of the present application provides a block verification device, which is applied to a verifier device, and the device includes:

[0026] A verification unit is used to verify the block NM according to the first state root of the block NM stored in the block N after obtaining the block N sent by the builder device; wherein the first state root is calculated by the builder device according to the block NM after the builder device completes the construction of the block NM; after the builder device completes the construction of the block N, the builder device stores the first state root in the block N; N and M are both integers greater than 0.

[0027] In a sixth aspect, an embodiment of the present application provides a block verification system, comprising a builder device as described in the third aspect and a verifier device as described in the fourth aspect.

[0028] In a seventh aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in the block verification method as described in any one of the first and second aspects above are implemented.

[0029] In an eighth aspect, an embodiment of the present application provides a computer program product. When the computer program product is run on a terminal device, the terminal device executes each step of the block verification method as described in any one of the first and second aspects above.

[0030] The block verification method, device, apparatus, and program product provided by the embodiments of the present application have the following beneficial effects:

[0031] The block verification method provided in the embodiment of the present application can be applied to a builder device, and specifically includes: after building block N, storing the first state root of block NM in block N; sending block N to the verifier device to instruct the verifier device to verify block NM according to the first state root; wherein the first state root is calculated according to block NM after the builder device builds block NM; N and M are both integers greater than 0. In the method of the present application, after the builder device completes the construction of block N and stores the first state root of block NM in block N, the builder device can send block N to the verifier device for verification. Since the first state root of block NM is calculated by the builder device according to block NM after the builder device completes the construction of block NM, the first state root of block NM has been basically calculated after the builder device completes the construction of block N. Based on this, after the builder device completes the construction of block N, the builder device can send block N to the verifier device in a shorter time to verify block NM. In the prior art, after the construction of block N, the builder device also needs to calculate the second state root of block N, so it takes a longer time to send block N to the verifier device for verification. Based on this, compared with the prior art, the block verification method of the present application improves the verification efficiency of the block. BRIEF DESCRIPTION OF THE DRAWINGS

[0032] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments or the description of the prior art 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 labor.

[0033] Figure 1 A flowchart of a block verification method provided in an embodiment of the present application;

[0034] Figure 2 A flowchart of a block verification method provided by another embodiment of the present application;

[0035] Figure 3 A schematic diagram of the structure of a builder device provided in an embodiment of the present application;

[0036] Figure 4 A schematic diagram of the structure of a verifier device provided in an embodiment of the present application;

[0037] Figure 5 A schematic diagram of the structure of a builder device provided in another embodiment of the present application;

[0038] Figure 6A schematic diagram of the structure of a verifier device provided in another embodiment of the present application. DETAILED DESCRIPTION

[0039] It should be noted that the terms used in the embodiments of the present application are only used to explain the specific embodiments of the present application, and are not intended to limit the present application. In the description of the embodiments of the present application, unless otherwise specified, "multiple" refers to two or more than two, and "at least one", "one or more" refers to one, two or more. The terms "first" and "second" are only used for descriptive purposes and cannot be understood as indicating or implying relative importance or implicitly indicating the number of indicated technical features. Thus, it is defined that the "first" and "second" features can explicitly or implicitly include one or more of the features.

[0040] References to "one embodiment" or "some embodiments" etc. described in this specification mean that a particular feature, structure or characteristic described in conjunction with the embodiment is included in one or more embodiments of the present application. Thus, the phrases "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. that appear at different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized in other ways.

[0041] The block verification method provided in the embodiment of the present application can be applied to the scenarios of building blocks and verifying blocks. When it is necessary to improve the verification efficiency of blocks, the various steps of the block verification method provided in the embodiment of the present application can be performed by the builder device and the verifier device.

[0042] The execution subject of the block verification method provided in the embodiment of the present application may include a builder device and a verifier device. The verifier device and the builder device may be included in electronic devices such as mobile phones, tablet computers, laptop computers, and desktop computers.

[0043] See also Figure 1 , Figure 1 The following is a flowchart of a block verification method provided in an embodiment of the present application. The block verification method provided in an embodiment of the present application can be applied to a builder device and can include steps S101 to S102, which are described in detail as follows:

[0044] In S101, after the block N is constructed, the first state root of the block NM is stored in the block N.

[0045] In the embodiment of the present application, after the builder device completes the construction of block N, it can store the first state root of block NM in block N.

[0046] Specifically, the builder device may store the first state root of block NM in the block header of block N.

[0047] Among them, the first state root of block NM is calculated according to block NM after the builder device completes the construction of block NM. Based on this, after the builder device completes the construction of block N, the builder device has basically completed the calculation of the first state root of block NM.

[0048] Specifically, the builder device can calculate the first state root of block NM according to block NM in the following way:

[0049] After the block NM is constructed, the builder device may execute each transaction in the block NM. After each transaction in the block NM is executed, the first state root is calculated based on the block NM after the transactions are executed.

[0050] Wherein, N and M are both integers greater than 0, and N is a variable and M is a quantitative value.

[0051] Exemplarily, M may be 1, based on which, after the builder device completes building block N, it may store the first state root of block N-1 in block N.

[0052] In practical applications, the specific value of M can be set according to actual needs. Specifically, the specific value of M can be determined according to the time of calculating the first state root of block NM. By reasonably setting the specific value of M, it can be ensured that after the construction of block N is completed, the first state root of block NM has been calculated, so that the builder device can immediately obtain the first state root of block NM after the construction of block N is completed, and store the first state root of block NM in block N.

[0053] Similarly, after completing the construction of block N, the builder device can also calculate and store the second state root of block N based on block N. Since the builder device calculates and stores the second state root of block N after completing the construction of block N, after the builder device completes the construction of block N+M, the builder device can store the second state root of block N in block N+M.

[0054] In S102, the block N is sent to the verifier device to instruct the verifier device to verify the block NM according to the first state root.

[0055] In an embodiment of the present application, after storing the first state root of block NM in block N, the builder device may send block N to the verifier device to instruct the verifier device to verify block NM according to the first state root of block NM stored in block N.

[0056] Similarly, after the builder device stores the second state root of block N in block N+M, the builder device can send block N+M to the verifier device to instruct the verifier device to verify block NM based on the second state root of block N stored in block N+M.

[0057] It can be seen from the above that the block verification method provided in the embodiment of the present application can be applied to the builder device, specifically including: after the construction of block N is completed, the first state root of block NM is stored in block N; the block N is sent to the verifier device to instruct the verifier device to verify the block NM according to the first state root; wherein the first state root is calculated according to the block NM after the builder device completes the construction of the block NM; N and M are both integers greater than 0. In the method of the present application, after the builder device completes the construction of block N and stores the first state root of block NM in block N, the builder device can send block N to the verifier device for verification. Since the first state root of block NM is calculated by the builder device according to block NM after the builder device completes the construction of block NM, the first state root of block NM has been basically calculated after the builder device completes the construction of block N. Based on this, after the builder device completes the construction of block N, the builder device can send block N to the verifier device in a shorter time to verify block NM. In the prior art, after the construction of block N, the builder device also needs to calculate the second state root of block N, so it takes a longer time to send block N to the verifier device for verification. Based on this, compared with the prior art, the block verification method of the present application improves the verification efficiency of the block.

[0058] See also Figure 2 , Figure 2 This is a flowchart of an implementation method of a block verification method provided by another embodiment of the present application. The block verification method provided by the embodiment of the present application can be applied to a verifier device and can include step S201, which is described in detail as follows:

[0059] In S201, after obtaining block N sent by the builder device, block NM is verified according to the first state root of block NM stored in block N.

[0060] In an embodiment of the present application, the verifier device can obtain the block sent by the builder. After obtaining the block N sent by the builder device, the verifier device can verify the block NM according to the first state root of the block NM stored in the block N.

[0061] Among them, the first state root of block NM is calculated by the builder device according to block NM after the builder device completes the construction of block NM, and is stored in block N after the builder device completes the construction of block N.

[0062] Wherein, N and M are both integers greater than 0, and N is a variable and M is a quantitative value.

[0063] Exemplarily, M may be 1. Based on this, after the verifier device obtains the block N sent by the builder device, it may verify the block N-1 according to the first state root of the block N-1 stored in the block N.

[0064] Specifically, after obtaining block NM, the verifier device can calculate and store the first state root of block NM. After obtaining block N sent by the builder device, the verifier device can compare the first state root of block NM stored in block N with the first state root calculated by the verifier device. If the first state root of block NM stored in block N is consistent with the first state root calculated by the verifier device, the verifier device can determine that block NM has passed the verification.

[0065] Similarly, after obtaining block N sent by the builder device, the verifier device can calculate and store the second state root of block N. After obtaining block N+M sent by the builder device, the verifier device can compare the second state root of block N stored in block N+M with the second state root calculated by the verifier device. If the second state root of block N stored in block N+M is consistent with the second state root calculated by the verifier device, the verifier device can determine that block N has passed the verification.

[0066] The following combination Figure 1 and Figure 2 The block verification method provided is described, and taking M equal to 1 as an example, the specific implementation method of the block verification method provided in the embodiment of the present application is described.

[0067] After the builder device completes the construction of block 1 (i.e., the first block to be constructed), the builder device can perform the following steps: calculate the state root of block 1; send block 1 to the verifier device; and construct block 2. It should be noted that the steps of calculating the state root of block 1 and sending block 1 to the verifier device can be performed simultaneously, and the builder device does not need to wait for the step of calculating the state root of block 1 to be completed before performing the step of sending block 1 to the verifier device.

[0068] After the builder device completes the construction of block 2, the builder device can perform the following steps: calculate the state root of block 2; store the state root of block 1 in block 2, and send block 2 storing the state root of block 1 to the verifier device; build block 3. Similarly, the steps of calculating the state root of block 2 and storing the state root of block 1 in block 2 and sending block 2 storing the state root of block 1 to the verifier device can be performed simultaneously.

[0069] Similarly, after the builder device completes the construction of block 3, the builder device can perform the following steps: calculate the state root of block 3; store the state root of block 2 in block 3, and send block 3 storing the state root of block 2 to the verifier device; build block 4. Similarly, the steps of calculating the state root of block 3 and storing the state root of block 2 in block 3 and sending block 3 storing the state root of block 2 to the verifier device can be performed simultaneously.

[0070] The steps that the builder device needs to perform after building block N can refer to the above description and will not be repeated here.

[0071] After the verifier device obtains block 1 sent by the builder device, the verifier device can perform the following steps: Calculate the state root of block 1.

[0072] After the verifier device obtains block 2 sent by the builder device, the verifier device can perform the following steps: calculate the state root of block 2; verify block 1 according to the state root of block 1 stored in block 2 and the state root of block 1 calculated by the verifier device.

[0073] After the verifier device obtains block 3 sent by the builder device, the verifier device can perform the following steps: calculate the state root of block 3; verify block 2 according to the state root of block 2 stored in block 3 and the state root of block 2 calculated by the verifier device.

[0074] The steps that the verifier device needs to perform after obtaining the block N sent by the builder device can refer to the above description and will not be repeated here.

[0075] The above provides a specific implementation of the block verification method provided in the embodiment of the present application. For comparison, the following continues to provide a specific implementation of the block verification method in the prior art:

[0076] After the builder device completes the construction of block 1, the builder device can perform the following steps: calculate the state root of block 1; store the state root of block 1 in block 1, and send block 1 to the verifier device; build block 2. It should be noted that the builder device needs to first perform the step of calculating the state root of block 1, and then perform the step of storing the state root of block 1 in block 1 and sending block 1 to the verifier device.

[0077] After the builder device completes the construction of block 2, the builder device can perform the following steps: calculate the state root of block 2; store the state root of block 2 in block 2, and send block 2 to the verifier device; build block 3. Similarly, the builder device needs to first perform the step of calculating the state root of block 2, and then perform the step of storing the state root of block 2 in block 2 and sending block 2 to the verifier device.

[0078] After the builder device completes the construction of block 3, the builder device can perform the following steps: calculate the state root of block 3; store the state root of block 3 in block 2, and send block 3 to the verifier device; build block 4. Similarly, the builder device needs to first perform the step of calculating the state root of block 3, and then perform the step of storing the state root of block 3 in block 3 and sending block 3 to the verifier device.

[0079] The steps that the builder device needs to perform after building block N can refer to the above description and will not be repeated here.

[0080] After the verifier device obtains block 1 sent by the builder device, the verifier device can perform the following steps: calculate the state root of block 1; verify block 1 according to the state root of block 1 stored in block 1 and the state root of block 1 calculated by the verifier device.

[0081] After the verifier device obtains block 2 sent by the builder device, the verifier device can perform the following steps: calculate the state root of block 2; verify block 2 according to the state root of block 2 stored in block 2 and the state root of block 2 calculated by the verifier device.

[0082] After the verifier device obtains block 3 sent by the builder device, the verifier device can perform the following steps: calculate the state root of block 3; verify block 3 according to the state root of block 3 stored in block 3 and the state root of block 3 calculated by the verifier device.

[0083] The steps that the verifier device needs to perform after obtaining the block N sent by the builder device can refer to the above description and will not be repeated here.

[0084] The above provides a specific implementation of the block verification method provided in the embodiment of the present application, and a specific implementation of the block verification method in the prior art. The following analyzes the technical effect of the block verification method provided in the embodiment of the present application by comparing the specific implementation of the block verification method in the prior art with the specific implementation of the block verification method in the prior art:

[0085] After building block 2, in the prior art, the builder device needs to first execute the step of calculating the state root of block 2, then execute the step of storing the state root of block 2 in block 2, and finally send block 2 to the verifier device. However, in the block verification method provided in the embodiment of the present application, after building block 2, the builder device needs to execute the step of storing the state root of block 1 in block 2, and send block 2 storing the state root of block 1 to the verifier device.

[0086] Since the state root of block 1 is calculated after the builder device completes the construction of block 1, the state root of block 1 has basically been calculated after the construction of block 2. Therefore, the time spent by the builder to execute the steps of storing the state root of block 1 in block 2 and sending block 2 storing the state root of block 1 to the verifier device will be significantly shorter than the time spent by the builder device in the prior art to first calculate the state root of block 2, then store the state root of block 2 in block 2, and finally send block 2 to the verifier device. Therefore, the block verification method provided in the embodiment of the present application can significantly improve the verification efficiency of the block.

[0087] Since the verification efficiency of a block has a significant impact on the generation efficiency of the block and the throughput of the blockchain network, the block verification method provided in the embodiment of the present application can not only significantly improve the verification efficiency of the block, but also improve the generation efficiency of the block and the throughput of the blockchain network.

[0088] Based on the block verification method provided in the above embodiment, the embodiment of the present application further provides a builder device and a verifier device for implementing the above method embodiment.

[0089] See also Figure 3 , Figure 3 A schematic diagram of the structure of a builder device provided in an embodiment of the present application is shown in FIG. Figure 3 As shown, the builder device 30 may include a block building unit 31 and a block sending unit 32, wherein:

[0090] The block construction unit 31 is used for storing the first state root of the block NM in the block N after completing the construction of the block N.

[0091] The block sending unit 32 is used to send the block N to the verifier device to instruct the verifier device to verify the block NM according to the first state root; wherein the first state root is calculated according to the block NM after the builder device completes the construction of the block NM; N and M are both integers greater than 0.

[0092] Optionally, the block construction unit 31 is specifically used for:

[0093] After the block NM is constructed, each transaction in the block NM is executed. After each transaction in the block NM is executed, the first state root is calculated.

[0094] Optionally, the block construction unit 31 is further configured to:

[0095] According to the block N, calculating and storing a second state root of the block N;

[0096] After the block N+M is constructed, the second state root of the block N is stored in the block N+M.

[0097] See also Figure 4 , Figure 4 A schematic diagram of the structure of a verifier device provided in an embodiment of the present application, such as Figure 4 As shown, the verifier device 40 may include a verification unit 41, wherein:

[0098] The verification unit 41 is used to verify the block NM according to the first state root of the block NM stored in the block N after obtaining the block N sent by the builder device; wherein the first state root is calculated by the builder device according to the block NM after the builder device completes the construction of the block NM; after the builder device completes the construction of the block N, the builder device stores the first state root in the block N; N and M are both integers greater than 0.

[0099] Optionally, the verifier device 40 may further include a computing unit.

[0100] The computing unit is specifically used for:

[0101] Calculate and store the second state root of the block N;

[0102] After obtaining the block N+M sent by the builder device, the block N is verified according to the third state root of the block N stored in the block N+M and the second state root.

[0103] Optionally, the verification unit 41 is specifically used for:

[0104] The third state root is compared with the second state root. If the comparison is consistent, it is determined that the block N has passed the verification.

[0105] See also Figure 5 , Figure 5 This is a schematic diagram of the structure of a builder device provided in another embodiment of the present application. Figure 5 As shown, the builder device 5 provided in this embodiment may include: a processor 50, a memory 51, and a computer program 52 stored in the memory 51 and executable on the processor 50. For example, a program corresponding to the block verification method. When the processor 50 executes the computer program 52, the steps in the above-mentioned verification method embodiment applied to the block are implemented, for example Figure 1 In S101 to S102 shown, the processor 50 executes the computer program 52 to implement the functions of each module / unit in the embodiment corresponding to the builder device 30, for example Figure 3 The functions of the units 31 to 32 are shown.

[0106] Exemplarily, the computer program 52 may be divided into one or more modules / units, one or more modules / units are stored in the memory 51 and executed by the processor 50 to complete the present application. One or more modules / units may be a series of computer program instruction segments that can complete specific functions, and the instruction segments are used to describe the execution process of the computer program 52 in the builder device 5. For example, the computer program 52 may be divided into a block building unit 31 and a block sending unit 32. The specific functions of each unit can be referred to in Figure 3 The relevant descriptions in the corresponding embodiments are not repeated here.

[0107] Those skilled in the art will understand that Figure 5 The builder device 5 is merely an example and does not constitute a limitation of the builder device 5 , and may include more or less components than shown in the figure, or combine certain components, or different components.

[0108] See also Figure 6 , Figure 6 This is a schematic diagram of the structure of a verifier device provided in another embodiment of the present application. Figure 6 As shown, the verifier device 6 provided in this embodiment may include: a processor 60, a memory 61, and a computer program 62 stored in the memory 61 and executable on the processor 60. For example, a program corresponding to a block verification method. When the processor 60 executes the computer program 62, the steps in the above-mentioned verification method embodiment applied to a block are implemented, for example Figure 2In S201 shown, the processor 60 executes the computer program 62 to implement the functions of each module / unit in the embodiment corresponding to the above-mentioned verifier device 40, for example Figure 4 The functionality of the unit 41 is shown.

[0109] Exemplarily, the computer program 62 may be divided into one or more modules / units, one or more modules / units are stored in the memory 61 and executed by the processor 60 to complete the present application. One or more modules / units may be a series of computer program instruction segments that can complete specific functions, and the instruction segments are used to describe the execution process of the computer program 62 in the verifier device 6. For example, the computer program 62 may be divided into the verification unit 41, and the specific functions of each unit may be referred to in Figure 4 The relevant descriptions in the corresponding embodiments are not repeated here.

[0110] Those skilled in the art will understand that Figure 6 The authenticator device 6 is merely an example and does not constitute a limitation on the authenticator device 6 , which may include more or less components than those shown in the figure, or may combine certain components, or may include different components.

[0111] The processor 60 and the processor 70 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or any conventional processor, etc.

[0112] The memory 61 and the memory 71 may be internal storage units of the verifier device 6 and the builder device 7, such as a hard disk or memory of the verifier device 6 and the builder device 7. The memory 61 and the memory 71 may also be external storage devices of the verifier device 6 and the builder device 7, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card or a flash card, etc., equipped on the verifier device 6 and the builder device 7. Further, the memory 61 and the memory 71 may also include both internal storage units and external storage devices of the verifier device 6 and the builder device 7. The memory 61 and the memory 71 are used to store computer programs and other programs and data required by electronic devices. The memory 61 and the memory 71 may also be used to temporarily store data that has been output or is to be output.

[0113] Those skilled in the art can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units is used as an example. In actual applications, the above-mentioned functions can be assigned to different functional units as needed, that is, the internal structure of the verifier device and the builder device can be divided into different functional units to complete all or part of the functions described above. The functional units in the embodiment can be integrated into a processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, which will not be repeated here.

[0114] An embodiment of the present application also provides a block verification system, and the blockchain transaction pre-confirmation verification system may include a verifier device and a builder device.

[0115] An embodiment of the present application further provides a computer-readable storage medium, in which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments can be implemented.

[0116] An embodiment of the present application provides a computer program product. When the computer program product is executed on a terminal device, the terminal device implements the steps in the above-mentioned various method embodiments.

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

[0118] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0119] The embodiments described above are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, a person skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.

Claims

1. A block verification method, characterized in that: Applied to a builder device, the method comprises: After the block N is constructed, the first state root of the block NM is stored in the block N; Send the block N to the verifier device to instruct the verifier device to verify the block NM according to the first state root; wherein the first state root is calculated according to the block NM after the builder device completes the construction of the block NM; N and M are both integers greater than 0.

2. The method according to claim 1, characterized in that The first state root is determined by: After the block NM is constructed, each transaction in the block NM is executed. After each transaction in the block NM is executed, the first state root is calculated.

3. The method according to claim 1 or 2, characterized in that: After building block N, it also includes: According to the block N, calculating and storing a second state root of the block N; After the block N+M is constructed, the second state root of the block N is stored in the block N+M.

4. A block verification method, characterized in that: Applied to a verifier device, the method comprises: After obtaining the block N sent by the builder device, the block NM is verified according to the first state root of the block NM stored in the block N; wherein the first state root is calculated by the builder device according to the block NM after the builder device completes the construction of the block NM; after the builder device completes the construction of the block N, the builder device stores the first state root in the block N; N and M are both integers greater than 0.

5. The method according to claim 4, characterized in that After obtaining block N sent by the builder device, it also includes: Calculate and store the second state root of the block N; After obtaining the block N+M sent by the builder device, the block N is verified according to the third state root of the block N stored in the block N+M and the second state root.

6. The method according to claim 5, characterized in that The verifying the block N according to the third state root of the block N stored in the block N+M and the second state root includes: The third state root is compared with the second state root. If the comparison is consistent, it is determined that the block N has passed the verification.

7. A device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, it implements the block verification method as described in any one of claims 1 to 3, or implements the block verification method as described in any one of claims 4 to 6.

8. A block verification device, characterized in that: Applied to a builder device, the device comprises: A state root storage unit, configured to store the first state root of block NM in block N after the block N is constructed; A block sending unit is used to send the block N to the verifier device to instruct the verifier device to verify the block NM according to the first state root; wherein the first state root is calculated according to the block NM after the builder device completes the construction of the block NM; N and M are both integers greater than 0.

9. A block verification device, characterized in that: Applied to a verifier device, the apparatus comprises: A verification unit is used to verify the block NM according to the first state root of the block NM stored in the block N after obtaining the block N sent by the builder device; wherein the first state root is calculated by the builder device according to the block NM after the builder device completes the construction of the block NM; after the builder device completes the construction of the block N, the builder device stores the first state root in the block N; N and M are both integers greater than 0.

10. A computer program product, when the computer program product is run on a computer device, enables the computer device to execute the block verification method according to any one of claims 1 to 3, or implement the block verification method according to any one of claims 4 to 6.