Formal modeling and verification method and system for blockchain underlying protocol
Through the formal modeling and verification method oriented to the underlying protocol of the blockchain, the efficient and fully automatic verification of the underlying consensus protocol of the blockchain is realized, which solves the problems in the existing technology that manual verification relies on expert experience and is difficult to achieve automation, and improves the efficiency Verify efficiency and versatility.
Patent Information
- Application Number
- CN202310907943.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-07-24
- Publication Date
- 2024-10-29
- Estimated Expiration
- 2043-07-24
AI Technical Summary
The formal modeling of existing blockchain underlying protocols mainly relies on manual verification, which is difficult to automate and has limited applicability, resulting in high labor costs, low verification efficiency, and difficulty in conducting comprehensive analysis.
A formal modeling and verification method for the underlying protocol of the blockchain is proposed. By inputting the execution process of the consensus node and the attributes to be verified, the operating constraints are set, the consensus protocol model is established, and the built-in constraint solving rules are used for reverse reasoning. Detect ring structures and achieve fully automated verification.
Under the premise of ensuring correctness, it greatly reduces the state space that needs to be verified, avoids the state space explosion, realizes efficient and fully automatic verification of the underlying consensus protocol of the blockchain, and improves the efficiency of verification work.
Smart Images

Figure CN117041067B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of computer network protocol security analysis and provides a formal modeling and verification method and system for the underlying blockchain protocol. Background Art
[0002] Blockchain technology is considered to be a major breakthrough technology that can change the operation mode of business and institutions due to its excellent characteristics such as data immutability, openness and transparency, multi-party sharing and consistent decision-making. The consensus protocol for reaching data consistency between different nodes in the blockchain system is the core part of the normal operation of the entire blockchain system. With the research on consensus protocols in recent years, people have gradually focused on the challenging work of formal verification. In this field, there are many works that verify various protocols through different tools, including Palmskog et al. verifying some properties of Ethereum's CasperCBC in Isabelle / HOL; Rahli verified the security properties of PBFT in the Velisarios framework based on coq; and verified the security and activity of the muti-Paxos protocol in the IronFleet tool based on Dafny. Yackolley et al. proved the consistency, validity and termination of Tendermint consensus in a semi-synchronous system. Thin et al. used symbolic methods to formally analyze the Tendermint consensus protocol, used model checking CSP# to build a formal model of the protocol, and used PATmodelchecker to verify whether the protocol meets the given security properties.
[0003] However, these works all face some important problems. On the one hand, the existing formalization work of the underlying blockchain protocol mainly uses manual verification, and the formal modeling is highly dependent on expert experience, which is difficult to prove and difficult to automate. In addition, the application is limited and the labor cost is high, making it difficult to make a comprehensive analysis of the underlying blockchain system. Therefore, the present invention proposes a formal modeling and verification design for the underlying blockchain protocol. Summary of the invention
[0004] The purpose of the embodiments of the present invention is to provide a formal modeling and verification method for the underlying protocol of blockchain, aiming to solve the above-mentioned multiple defects or one of the defects caused by the prior art.
[0005] The embodiment of the present invention is implemented as follows: a formal modeling and verification method for the underlying protocol of blockchain, the method comprising the following steps:
[0006] Input the execution process description of each consensus node in the underlying blockchain protocol, and input the logical description of the consensus attribute to be verified;
[0007] Setting the operation constraints of the underlying protocol of the blockchain, which at least include network conditions and adversary models;
[0008] Based on the description of the execution process of each consensus node and the keywords related to the node group, the description of the execution logic of the node group is obtained, and the consensus protocol model is established;
[0009] Following the consensus attribute to be verified, reverse reasoning is performed through built-in constraint solving rules to determine whether there is a path in the execution of the consensus protocol model that violates the consensus attribute to be verified;
[0010] Detect the ring structure related to the execution round on the reasoning path, terminate the reasoning when the preset rules are met, and output the protocol verification result after the reasoning is terminated.
[0011] Another object of an embodiment of the present invention is to provide a formal modeling and verification system for the underlying blockchain protocol, the system comprising: a protocol input unit, a condition setting unit, a model generation unit, a model verification unit, and an inductive reasoning unit;
[0012] The protocol input unit is used to input the execution process description of each consensus node in the underlying blockchain protocol and the logical description of the consensus attribute to be verified;
[0013] The condition setting unit is used to set the operation constraint conditions of the underlying protocol of the blockchain, and the operation constraint conditions at least include network conditions and adversary models;
[0014] The model generation unit is used to obtain a description of the execution logic of the node group according to the execution process description of each consensus node and the keywords related to the node group, and establish a consensus protocol model;
[0015] The model verification unit follows the consensus attribute to be verified and reversely infers whether there is a path that violates the consensus attribute to be verified in the execution of the consensus protocol model through built-in constraint solving rules;
[0016] The inductive reasoning unit is used to detect the ring structure related to the execution round on the reasoning path, terminate the reasoning when the preset rules are met, and output the protocol verification result after the reasoning is terminated.
[0017] Another object of an embodiment of the present invention is to provide a computer device, comprising a memory and a processor, wherein a computer program is stored in the memory, and when the computer program is executed by the processor, the processor executes the steps of the formal modeling and verification method for the underlying blockchain protocol.
[0018] Another object of an embodiment of the present invention is to provide a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the processor executes the steps of the formal modeling and verification method for the underlying blockchain protocol.
[0019] The embodiment of the present invention provides a formal modeling and verification method for the underlying blockchain protocol. It uses a new modeling and verification idea based on the network node group. Compared with the existing formal modeling method, this method greatly reduces the state space that needs to be verified while ensuring correctness, avoids the problem of state space explosion, and ensures that the correct result is obtained within a limited time. At the same time, the solution can realize the full automation of the entire verification process without manual intervention, greatly improving the verification efficiency of the underlying consensus protocol of the blockchain. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] Figure 1 A flowchart of a formal modeling and verification method for the underlying blockchain protocol provided by an embodiment of the present invention;
[0021] Figure 2 A code implementation of a ring structure detection algorithm in an embodiment of the present invention;
[0022] Figure 3 A protocol model for describing the operating status of a single node in an embodiment of the present invention;
[0023] Figure 4 Generate group logic rule statements based on translation rules in an embodiment of the present invention;
[0024] Figure 5 Generate communication logic rule statements for network conditions preset based on the consensus protocol in the embodiment of the present invention;
[0025] Figure 6 An explanation of adding relevant constraints in group logic rule generation in an embodiment of the present invention;
[0026] Figure 7 This is the result of fully automatic verification of the model obtained in the embodiment of the present invention;
[0027] Figure 8 A structural block diagram of a formal modeling and verification system for the underlying blockchain protocol provided by an embodiment of the present invention;
[0028] Fig. 9 This is a structural principle diagram of a blockchain system in the prior art;
[0029] Fig.10 1 is a block diagram of the internal structure of a computer device in an embodiment of the present invention. DETAILED DESCRIPTION
[0030] In order to make the purpose, technical solution 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.
[0031] In this field, formal modeling and verification technology has been widely used in software, hardware, security protocols and other fields, and has achieved good market response. The introduction of formal methods can effectively improve users' trust in the security of blockchain systems. The embodiment of the present invention mainly solves the problem that the formalization of the underlying protocol of existing blockchains mainly uses manual verification, formal modeling is highly dependent on expert experience, and is difficult to prove and difficult to automate. In addition, it has limited applicability, high labor costs, and is difficult to make a comprehensive analysis of the underlying blockchain system.
[0032] like Figure 1 As shown in FIG. 1 , a flowchart of a formal modeling and verification method for a blockchain underlying protocol provided by an embodiment of the present invention can be specifically obtained by Figure 8 The system shown is implemented; the method may include the following steps S101 to S109;
[0033] S101. Input the execution process description of each consensus node in the underlying blockchain protocol, and input the logical description of the consensus attribute to be verified;
[0034] In this embodiment, the execution process description of this consensus node is implemented through program code, such as Figure 3 As shown, by entering Figure 3 The protocol model shown describes the operating status of a single consensus node and establishes a preliminary consensus protocol model.
[0035] This embodiment adopts a new modeling and verification idea based on the network node group. Compared with the existing formal modeling method, this method greatly reduces the state space that needs to be verified while ensuring correctness, thus avoiding the problem of state space explosion.
[0036] The above input can then be compiled, i.e. translated, to generate the core group logic rule statements;
[0037] S103. Setting the operation constraints of the underlying protocol of the blockchain, where the operation constraints at least include network conditions and adversary models;
[0038] In this step, the network conditions can be divided into a network with normal node communication and an asynchronous network with node downtime. The adversary model mainly indicates that there are participants sending malicious messages on the channels of some nodes, or that transmission resources are squeezed, isolated, or tampered with.
[0039] S105. According to the description of the execution process of each consensus node and the keywords related to the node group, a description of the execution logic of the node group is obtained, and a consensus protocol model is established;
[0040] In some specific scenarios of this step, the blockchain system can be modeled through the formal specification document of the blockchain system; it is necessary to select a modeling tool and a corresponding modeling language. For example, the SDL language can be used in this embodiment to describe the blockchain system according to the formal specification document generated above, thereby completing the modeling process.
[0041] like Fig. 9 As shown in the figure, in a conventional blockchain system, the consensus layer is one of the core layers of the blockchain system (or blockchain model), which defines the rules of the blockchain model, stipulates how to reach consensus between nodes (i.e., the consensus nodes mentioned above), how to backup, how to tolerate faults, and how to achieve a balance between data consistency, partition fault tolerance, and availability. The more commonly used public chains are PoW (Proof of Work), PoS (Proof of Stake), and DPoS (Delegate Proof of Stake); alliance chains and private chains generally use Byzantine fault tolerance algorithms and traditional consistency algorithms as their consensus; the more commonly used consensus algorithms are PBFT (Practical Byzantine Fault Tolerance), Paxos, Raft, etc., which will not be elaborated here.
[0042] S107, following the consensus attribute to be verified, reversely reasoning whether there is a path that violates the consensus attribute to be verified in the execution of the consensus protocol model through the built-in constraint solving rules;
[0043] In an example of this embodiment, following the consensus attribute to be verified, reversely reasoning whether there is a path that violates the consensus attribute to be verified in the execution of the consensus protocol model through built-in constraint solving rules; specifically includes:
[0044] Through the security attribute generator, the consensus attribute to be verified is followed, and the consensus protocol model is reversely inferred through the built-in constraint solving rules;
[0045] Through the validator, it is possible to verify whether there is a path that violates the consensus property to be verified during the execution of the consensus protocol model.
[0046] Generally speaking, if there is a solution to a constraint solving problem, then the corresponding consensus attribute does not hold, and the solution is a counterexample that violates its consensus attribute; conversely, if there is no solution, then the consensus attribute holds. The expression of constraint relations includes but is not limited to the following forms: propositional logic, first-order logic, higher-order logic, temporal logic, etc.
[0047] S109, detecting the ring structure related to the execution round on the reasoning path, terminating the reasoning when the preset rules are met, and outputting the protocol verification result after the reasoning is terminated.
[0048] The present embodiment provides a formal modeling and verification method for the underlying blockchain protocol. Compared with the prior art, the method is fully automated and does not require human intervention. Moreover, since the state space to be verified is greatly reduced, the verification can be completed in a relatively short time. Secondly, the method has good versatility for the underlying blockchain consensus protocol and can realize modeling and verification of a large class of underlying blockchain consensus protocols. The existing formal modeling methods for the underlying blockchain consensus protocols are highly dependent on expert experience, which is difficult to prove and difficult to automate. The present method proposes a new modeling strategy based on consensus node groups and uses a new inductive reasoning method in the system to realize efficient and fully automatic verification of different underlying blockchain consensus protocols. The introduction of this method greatly improves the efficiency of security verification of the underlying blockchain consensus protocol and provides strong support for building a secure and reliable blockchain-based data system.
[0049] In an example of this embodiment, the execution process description of each consensus node in the input blockchain underlying protocol and the logical description of the input consensus attribute to be verified are implemented by a formal model generator.
[0050] In an example of this embodiment, a ring structure detection algorithm is used to detect the ring structure related to the execution round on the path of the reasoning.
[0051] like Figure 2 As shown, the ring structure detection algorithm of this example is demonstrated; it is based on the mathematical induction method of the parameters with natural number structure in the model. By detecting the ring structure related to the execution round on the reasoning path, the induction rule is used to terminate the reasoning at the appropriate time and obtain the conclusion.
[0052] In this way, by summarizing the consensus execution rounds, we can avoid the state space explosion problem caused by infinite execution rounds in model verification and obtain the correct results in a limited time. At the same time, the entire verification process can be fully automated without manual intervention, greatly improving the verification efficiency of the underlying consensus protocol of the blockchain.
[0053] In an example of this embodiment, the validators each include: an option generator and a selection engine;
[0054] The option generator inputs the constraint solving problem and outputs a tree structure; the root of the tree represents the proposition corresponding to the verification target, the child nodes of each node represent an option proposition that can be used to verify whether the corresponding node is established, and the leaf nodes are propositions that are assumed to be established;
[0055] In this embodiment, the tree structure generation process is on-demand. When all child nodes of a node need to be obtained, its child nodes need to be calculated. Specifically, during the tree walk, when the child nodes of a node need to be explored, the relevant child nodes need to be constructed and then used for exploration; the purpose of this process is to reduce the computational and memory overhead of the tree generation process.
[0056] In this embodiment, the input of the selection engine is the tree structure and the child nodes of the currently explored node, and the output is the verification result; after selecting the child node of the currently explored node, it is equivalent to exploring one step. The selection engine is continuously used to continuously explore, and finally when the leaf node is reached, the exploration path formed is the verification result.
[0057] On this basis, identifying and terminating the key induction steps can avoid the state space explosion problem caused by infinite execution rounds.
[0058] The whole process of this embodiment is automated without manual intervention. Specifically, by effectively compressing and efficiently searching the state space, the problem of state space explosion can be solved to a certain extent, and the formal verification of large-scale software and hardware source codes can be completed within a limited time.
[0059] In one embodiment, after inputting Figure 3 The protocol model that describes the operating status of a single consensus node is shown in Figure 1. After the preliminary consensus protocol model is established, the core group logic rule statements are generated and translated or compiled; Figure 4 As shown:
[0060] The steps of obtaining a description of the execution logic of the node group according to the execution process description of each consensus node and the keywords related to the node group, and establishing a consensus protocol model specifically include:
[0061] Extract keywords related to the node group from the execution logic of a single consensus node;
[0062] Based on the translation rules, constraints are added to the specified part of the preset triple statement, that is, constraints are added to the action part of the tamarin triple statement to obtain the model statement, and then the consensus protocol model is established.
[0063] Specifically, the sentences related to the group keyword are extracted from the execution logic (or execution process description) of a single node, such as over1 / N and over2f+1, which correspond to the group constraints in the distributed system algorithm and the Byzantine algorithm respectively;
[0064] Then, based on the conventional translation rules, we add constraints to the action part of the tamarin triple sentence, and get Figure 4 The model statements shown in the figure are used to establish the consensus protocol model.
[0065] In one example, after generating the core group logic rule statement, the communication logic rule statement is generated:
[0066] For example, in the case of an asynchronous network with downtime nodes, adversaries on the channel, participants sending malicious messages, etc., it is also necessary to describe the logical rules for the communication process between different node groups in the protocol. In this example, the communication rules under normal network communication conditions and under the problem of information loss caused by asynchronous networks are described. Figure 5 shown.
[0067] In one embodiment, explanations are added to the relevant constraints, that is, in the generation of group logic rule statements, a series of unexplained constraint actions will be obtained, and constraint description statements explaining these constraint actions need to be added, such as Figure 6 As shown in the figure, in order to obtain a complete consensus protocol model.
[0068] In this embodiment, the obtained complete consensus protocol model can be automatically verified, such as Figure 7 As shown in , when the verification result is that the consensus attribute to be verified is not established, a verification work log can be generated; wherein, by viewing the verification work log, a path that violates the attribute can be obtained, such as Figure 7 As shown, the path complies with the input protocol logic and violates the given properties, and is a real path.
[0069] In one embodiment, the method further comprises:
[0070] Completing the consensus protocol model: Starting from the logic of a single consensus node, supplement the logical rules of triggering message sending and the relationship between receiving messages and sending messages.
[0071] Specifically, based on the description of the execution process of a single consensus node, the description of the execution logic of the node group can be obtained based on the keywords related to the consensus node group, which serves as the main part of the model. Starting from the logic of a single consensus node, some basic logical rules such as the triggering of message sending, the relationship between receiving messages and sending messages are supplemented, so that the main part of the model can be improved to complete the construction of the complete model.
[0072] like Figure 8 As shown, in another embodiment, a formal modeling and verification system for the underlying blockchain protocol, the system includes: a protocol input unit 210, a condition setting unit 220, a model generation unit 230, a model verification unit 240 and an inductive reasoning unit 250;
[0073] The protocol input unit 210 is used to input the execution process description of each consensus node in the underlying blockchain protocol and the logical description of the consensus attribute to be verified;
[0074] The condition setting unit 220 is used to set the operation constraint conditions of the underlying protocol of the blockchain, and the operation constraint conditions at least include network conditions and adversary models;
[0075] The model generation unit 230 is used to obtain a description of the execution logic of the node group according to the execution process description of each consensus node and the keywords related to the node group, and establish a consensus protocol model;
[0076] The model verification unit 240 follows the consensus attribute to be verified and reversely infers whether there is a path that violates the consensus attribute to be verified in the execution of the consensus protocol model through built-in constraint solving rules;
[0077] The inductive reasoning unit 250 is used to detect the ring structure related to the execution round on the reasoning path, terminate the reasoning when the preset rules are met, and output the protocol verification result after the reasoning is terminated.
[0078] In an example of this embodiment, the system further includes: a model supplement unit;
[0079] The model supplement unit is used to complete the consensus protocol model: starting from the logic of a single consensus node, supplement the logical rules of the triggering of message sending and the relationship between receiving messages and sending messages.
[0080] In this embodiment, the modeling of the underlying consensus protocol of the blockchain is achieved by modeling the behavior of the network node group. In this way, the state space that needs to be verified can be greatly compressed under the premise of ensuring correctness, and combined with the corresponding ring structure detection algorithm, the universality of the verification of the underlying consensus protocol of the blockchain can be guaranteed as much as possible, and it can be automated without human intervention.
[0081] like Fig.10As shown, in another embodiment, a computer device includes a memory and a processor, wherein a computer program is stored in the memory, and when the computer program is executed by the processor, the processor executes steps S101 to S109 of the formal modeling and verification method for the underlying blockchain protocol:
[0082] S101. Input the execution process description of each consensus node in the underlying blockchain protocol, and input the logical description of the consensus attribute to be verified;
[0083] S103. Setting the operation constraints of the underlying protocol of the blockchain, where the operation constraints at least include network conditions and adversary models;
[0084] S105. According to the description of the execution process of each consensus node and the keywords related to the node group, a description of the execution logic of the node group is obtained, and a consensus protocol model is established;
[0085] S107, following the consensus attribute to be verified, reversely reasoning whether there is a path that violates the consensus attribute to be verified in the execution of the consensus protocol model through the built-in constraint solving rules;
[0086] S109, detecting the ring structure related to the execution round on the reasoning path, terminating the reasoning when the preset rules are met, and outputting the protocol verification result after the reasoning is terminated.
[0087] In another embodiment, a computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the processor executes steps S101 to S109 of the formal modeling and verification method for the underlying blockchain protocol:
[0088] S101. Input the execution process description of each consensus node in the underlying blockchain protocol, and input the logical description of the consensus attribute to be verified;
[0089] S103. Setting the operation constraints of the underlying protocol of the blockchain, where the operation constraints at least include network conditions and adversary models;
[0090] S105. According to the description of the execution process of each consensus node and the keywords related to the node group, a description of the execution logic of the node group is obtained, and a consensus protocol model is established;
[0091] S107, following the consensus attribute to be verified, reversely reasoning whether there is a path that violates the consensus attribute to be verified in the execution of the consensus protocol model through the built-in constraint solving rules;
[0092] S109, detecting the ring structure related to the execution round on the reasoning path, terminating the reasoning when the preset rules are met, and outputting the protocol verification result after the reasoning is terminated.
[0093] As mentioned above, the computer device may be an independent physical server or terminal, or a server cluster composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud servers, cloud databases, cloud storage, and CDN.
[0094] The terminal may be a smart phone, a tablet computer, a laptop computer, a desktop computer, a smart speaker, a smart watch, etc., but is not limited thereto. The terminal and the computer device may be connected via a network, and the present invention does not limit this.
[0095] It should be understood that, although each step in the flow chart of each embodiment of the present invention is shown in sequence according to the indication of the arrow, these steps are not necessarily performed in sequence according to the order indicated by the arrow. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be performed in other orders. Moreover, at least a portion of the steps in each embodiment may include a plurality of sub-steps or a plurality of stages, and these sub-steps or stages are not necessarily performed at the same time, but can be performed at different times, and the execution order of these sub-steps or stages is not necessarily performed in sequence, but can be performed in turn or alternately with at least a portion of other steps or sub-steps or stages of other steps.
[0096] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the program can be stored in a non-volatile computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
[0097] 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 formal modeling and verification method for the underlying blockchain protocol, characterized in that: The method comprises the following steps: Input the execution process description of each consensus node in the underlying blockchain protocol, and input the logical description of the consensus attribute to be verified; Setting the operation constraints of the underlying protocol of the blockchain, which at least include network conditions and adversary models; Based on the description of the execution process of each consensus node and the keywords related to the node group, the description of the execution logic of the node group is obtained, and the consensus protocol model is established; Following the consensus attribute to be verified, reverse reasoning is performed through built-in constraint solving rules to determine whether there is a path in the execution of the consensus protocol model that violates the consensus attribute to be verified; Detect the ring structure related to the execution round on the reasoning path, terminate the reasoning when the preset rules are met, and output the protocol verification result after the reasoning is terminated; The steps of obtaining a description of the execution logic of the node group according to the execution process description of each consensus node and the keywords related to the node group, and establishing a consensus protocol model specifically include: Extract keywords related to the node group from the execution logic of a single consensus node; Based on the translation rules, constraints are added to the specified part of the preset triple statement to obtain the model statement, and then the consensus protocol model is established; Add explanations to related constraints: When generating group logic rule statements, a series of unexplained constraint actions will be obtained. It is necessary to add constraint description statements to explain these constraint actions in order to obtain a complete consensus protocol model.
2. According to the formal modeling and verification method for the underlying blockchain protocol of claim 1, it is characterized in that: The method further comprises: Completing the consensus protocol model: Starting from the logic of a single consensus node, supplement the logical rules of triggering message sending and the relationship between receiving messages and sending messages.
3. According to the formal modeling and verification method for the underlying blockchain protocol of claim 1, it is characterized in that: The ring structure related to the execution round on the detection reasoning path adopts a ring structure detection algorithm.
4. According to the formal modeling and verification method for the underlying blockchain protocol of claim 1, it is characterized in that: The input is a description of the execution process of each consensus node in the underlying protocol of the blockchain, and the input is a logical description of the consensus attribute to be verified through a formal model generator.
5. According to the formal modeling and verification method for the underlying blockchain protocol of claim 1, it is characterized in that: The following the consensus attribute to be verified, and reversely reasoning whether there is a path that violates the consensus attribute to be verified in the execution of the consensus protocol model through the built-in constraint solving rules; specifically includes: Through the security attribute generator, the consensus attribute to be verified is followed, and the consensus protocol model is reversely inferred through the built-in constraint solving rules; Through the validator, it is possible to verify whether there is a path that violates the consensus property to be verified during the execution of the consensus protocol model.
6. A formal modeling and verification system for the underlying blockchain protocol, characterized in that: The system comprises: a protocol input unit, a condition setting unit, a model generation unit, a model verification unit and an inductive reasoning unit; The protocol input unit is used to input the execution process description of each consensus node in the underlying blockchain protocol and the logical description of the consensus attribute to be verified; The condition setting unit is used to set the operation constraint conditions of the underlying protocol of the blockchain, and the operation constraint conditions at least include network conditions and adversary models; The model generation unit is used to obtain a description of the execution logic of the node group according to the execution process description of each consensus node and the keywords related to the node group, and establish a consensus protocol model; The model verification unit follows the consensus attribute to be verified and reversely infers whether there is a path that violates the consensus attribute to be verified in the execution of the consensus protocol model through built-in constraint solving rules; The inductive reasoning unit is used to detect the ring structure related to the execution round on the reasoning path, terminate the reasoning when the preset rules are met, and output the protocol verification result after the reasoning is terminated.
7. The formal modeling and verification system for the underlying blockchain protocol according to claim 6 is characterized in that: The system further comprises: a model supplement unit; The model supplement unit is used to complete the consensus protocol model: starting from the logic of a single consensus node, supplement the logical rules of the triggering of message sending and the relationship between receiving messages and sending messages.
8. A computer device, characterized in that: The method comprises a memory and a processor, wherein a computer program is stored in the memory, and when the computer program is executed by the processor, the processor executes the steps of the formal modeling and verification method for the underlying blockchain protocol as claimed in any one of claims 1 to 5.
9. A computer-readable storage medium, characterized in that: A computer program is stored on the computer-readable storage medium. When the computer program is executed by the processor, the processor executes the steps of the formal modeling and verification method for the underlying blockchain protocol as described in any one of claims 1 to 5.
