An automated security assessment method for blockchain consensus mechanisms

By conducting multi-dimensional testing of the blockchain consensus mechanism through automated evaluation methods, the problem of low efficiency in existing technologies is solved, systematic security evaluation and performance comparison of the blockchain consensus mechanism is achieved, and the evaluation efficiency and accuracy are improved.

CN115271714BActive Publication Date: 2025-09-19GUANGZHOU UNIVERSITY
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210660286.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-06-13
Publication Date
2025-09-19
Estimated Expiration
2042-06-13

AI Technical Summary

Technical Problem

The security assessment methods of blockchain consensus mechanisms in existing technologies rely on manual participation, are inefficient, lack systematicity and depth, and are difficult to effectively evaluate the security and performance of consensus mechanisms.

Method used

This paper provides an automated security assessment method for blockchain consensus mechanisms. By deconstructing the consensus mechanism of the blockchain platform, it uses automated scripts and container technology to perform multi-dimensional testing, including evaluation of consensus record integrity, uninterruptibility, node fault tolerance, finality, tamper-proofing, consensus mechanism correctness, and attack prevention.

Benefits of technology

It has achieved systematic and automated security evaluation of the blockchain consensus mechanism, improved evaluation efficiency, and can quickly analyze the security functions of different blockchain platforms through the simulation platform, improving the accuracy and efficiency of the evaluation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115271714B_ABST
    Figure CN115271714B_ABST
Patent Text Reader

Abstract

The present invention discloses an automated security assessment method for a blockchain consensus mechanism, comprising the following steps: S1, opening the initial network of the blockchain system to be tested; S2, generating node configuration files and certificate files; S3, initiating a transaction or executing a contract on each blockchain platform; S4, detecting the integrity of the consensus record content; S5, detecting whether the blockchain consensus process cannot be interrupted independently and whether the consensus record cannot be tampered with; S6, detecting whether the consensus mechanism has node fault tolerance and the extent of the impact of node failure on the system; S7, detecting whether the consensus algorithm has finality within an acceptable limited time, whether the on-chain records are tamper-proof, and whether the on-chain transaction rollback can be prevented; S8, detecting the correctness and consistency of the consensus mechanism; and S9, detecting the consensus algorithm's ability to defend against attacks. The present invention enables the evaluation and comparison of the security and performance of different types of blockchain consensus mechanisms, thereby improving the evaluation efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of blockchain technology, and in particular relates to an automated security assessment method for a blockchain consensus mechanism. Background Art

[0002] Blockchain consensus mechanisms are key technologies for ensuring the performance, security, and reliability of blockchain-based application systems. Consensus mechanisms across different blockchain systems differ significantly in consistency, fault tolerance, and scalability due to their varying design priorities. This introduces significant complexity to the blockchain ecosystem, making it crucial to assess the security of consensus mechanisms.

[0003] Existing evaluation methods still primarily rely on white-box testing and penetration testing, requiring testers to develop specialized plans to conduct detailed reviews of large and complex blockchain code, resulting in low efficiency. Consensus mechanisms are the core mechanism in a blockchain that determines accounting rights and ensures data consistency among nodes. Current mainstream blockchain consensus mechanisms include PBFT, RAFT, PoW, and PoS. Currently, related work both domestically and internationally lacks systematic and in-depth security analysis of key mechanisms within various blockchains. In-depth security analysis of blockchains has become a critical issue that urgently needs to be addressed.

[0004] Compared to other security analysis methods, existing solutions not only require extensive manual effort to review the blockchain's base layer source code, but also require the targeted design of numerous complex test cases. These issues result in security assessment results being heavily reliant on the tester's experience, leading to low assessment efficiency. Summary of the Invention

[0005] In view of the above-mentioned defects of the prior art, the purpose of the present invention is to provide an automated security assessment method for the blockchain consensus mechanism, which solves the above-mentioned problems by deconstructing the consensus mechanism of the blockchain platform.

[0006] The technical solution provided by the present invention is:

[0007] An automated security assessment method for a blockchain consensus mechanism, comprising:

[0008] S1. Start the initial blockchain network for testing.

[0009] S2. Generate node configuration files and certificate files;

[0010] S3. Initiate transactions or execute contracts on each blockchain platform;

[0011] S4. Check the integrity of the consensus record content;

[0012] S5. Check whether the blockchain consensus process cannot be interrupted independently and whether the consensus record cannot be tampered with;

[0013] S6. Check whether the consensus mechanism is fault-tolerant and the impact of node failures on the system.

[0014] S7. Check whether the consensus algorithm is final within an acceptable time limit, whether the on-chain records are tamper-proof, and whether it can prevent on-chain transaction rollbacks;

[0015] S8. Check the correctness and consistency of the consensus mechanism;

[0016] S9. Detect the consensus algorithm’s ability to prevent attacks.

[0017] Furthermore, in step S4, checking the integrity of the consensus record content includes:

[0018] S41 is based on automated scripts and designs test functions for obtaining consensus records for different consensus mechanisms. It then obtains transaction consensus information based on specific test functions.

[0019] S42 uses an automated script to extract specific information from the transaction information to determine whether it contains event time, transaction content and initiator information.

[0020] Furthermore, in step S5, detecting whether the blockchain consensus process cannot be interrupted individually and whether the consensus record cannot be tampered with includes:

[0021] S51 designs deletion methods for different consensus mechanisms based on container technology, uses different methods in different blockchain platforms to delete users, and views previous consensus records;

[0022] S52 checks the consensus record of the deleted user using step S4 to determine whether the consensus record has been deleted or tampered with;

[0023] Furthermore, in step S6, detecting whether the consensus mechanism has node fault tolerance and the degree of impact of node failure on the system includes:

[0024] S61 uses the node suspension method provided in different blockchain platforms to gradually stop the maximum number of faulty nodes allowed by its consensus mechanism;

[0025] S62 designs methods for executing transfer transactions or contracts provided by the platform after stopping nodes for different consensus mechanisms. It uses smart contracts to send transactions and interact with the chain, input transfer parameters for transfer transactions, and use smart contracts to build asset management applications. After the construction is completed, enter the directory and execute the script to generate a contract address. Then use the registration function in the script to register assets for different transaction parties, and then use the transaction function in the script to transfer assets between the two parties.

[0026] S63 uses scripts to extract return fields related to node fault tolerance and node failure after executing transactions;

[0027] S64 determines whether the consensus mechanism meets the fault tolerance requirements of the platform based on the return fields of each step in the process of gradually stopping the node with the largest fault.

[0028] Furthermore, in step S7, detecting whether the consensus algorithm is final within an acceptable limited time, whether the on-chain records are tamper-proof, and whether the on-chain transaction rollback can be prevented includes:

[0029] S71 uses the transaction method provided by it to execute multiple transactions between nodes in different blockchain platforms;

[0030] S72 uses pipeline technology to extract the return fields related to finality of the transaction;

[0031] S73 determines whether the consensus algorithm has finality in the transaction based on the returned field;

[0032] S74 performs the deletion user operation as in step S51 and step S52, and is used to check whether the previous consensus records have been deleted or tampered with, and to check the readability and encryption properties of the block fields.

[0033] S75 uses corresponding methods according to different blockchain platforms to view the consensus algorithm used. Specifically, the method in the container is used to obtain the number of P2P nodes and organization nodes generated by the network, and compares them with the number of nodes generated by the consensus algorithm used at startup given in the official documentation. Then, an HTTP request constructed using an automated method is sent and a JSON-encoded request is entered. The evaluation case is input and the node status is judged based on the return value. Finally, the console method in the container is used to obtain the consensus algorithm used by querying the current chain configuration.

[0034] Furthermore, in step S8, detecting the correctness and consistency of the consensus mechanism includes:

[0035] S81 detects whether the requests of the normal operation nodes of the consensus system can reach a consistent and correct consensus within the specified time required by the system performance. The specific method of using the transaction method provided by different blockchain platforms to perform multiple transactions between nodes is as shown in step S62;

[0036] S82 uses corresponding methods on different blockchain platforms to check whether the transaction is successfully executed and whether the content changed after the transaction is consistent with the submitted content.

[0037] Furthermore, in step S9, the consensus attack prevention measures include:

[0038] S91 builds a detection method based on smart contract technology for deterministic consensus algorithms such as PBFT and RAFT, and implements prevention measures for deterministic algorithm replay attacks and deterministic algorithm power oppression attacks. It inputs the detection implementation, combines the characteristics of different consensus algorithms, and outputs the detection results.

[0039] S92 targets financial trading platforms based on different consensus mechanisms. It uses container technology to construct an automated method to detect the transaction output of various consensus algorithms, compare it with the on-chain transaction data, and output the consensus algorithm's ability to prevent double-flower attacks.

[0040] Beneficial effects of the present invention:

[0041] 1. By deconstructing the consensus mechanism of the blockchain platform and modeling the common basic elements in multiple dimensions, a systematic automated security assessment method for the consensus mechanism is constructed to evaluate and compare the security and performance of different types of blockchain consensus mechanisms.

[0042] 2. It realizes the automated detection of the consensus mechanism security functions of different blockchain platforms. Only simple operations on the simulation platform are required to conduct security analysis on a specific blockchain platform, which greatly improves the evaluation efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] Figure 1 This is a schematic diagram of the automated security assessment process for the blockchain consensus mechanism according to an embodiment of the present invention. DETAILED DESCRIPTION

[0044] The embodiments of the present invention are described in detail below. The following embodiments are implemented based on the technical solutions of the present invention, and provide detailed implementation methods and specific operating procedures. However, the protection scope of the present invention is not limited to the following embodiments.

[0045] Example

[0046] See attached Figure 1 The automated security assessment method for the blockchain consensus mechanism provided by the embodiment of the present invention assesses the four important functional modules of the blockchain consensus mechanism: consensus auditability, consensus fault tolerance, consensus finality, and consensus reliability. The execution process of the security assessment system includes the following steps:

[0047] S1. Start the initial blockchain network for testing.

[0048] S2. Generate node configuration files and certificate files;

[0049] S3. Initiate several transactions or execute contracts in each blockchain platform;

[0050] S4. Check the integrity of the consensus record content;

[0051] S5. Check whether the blockchain consensus process cannot be interrupted independently and whether the consensus record cannot be tampered with;

[0052] S6. Check whether the consensus mechanism is fault-tolerant and the impact of node failures on the system.

[0053] S7: Check whether the consensus algorithm has finality within an acceptable limited time, whether the on-chain records are tamper-proof, and whether it can prevent on-chain transaction rollbacks;

[0054] S8. Check the correctness and consistency of the consensus mechanism;

[0055] S9. Consensus attack prevention measures.

[0056] Furthermore, in step S4, checking the integrity of the consensus record content includes:

[0057] S41, based on automated scripts, designs test functions for obtaining consensus records for different consensus mechanisms, and then obtains transaction consensus information based on specific test functions;

[0058] S42, using an automated script to extract specific information from the transaction information to determine whether it contains event time, transaction content, initiator information, etc.

[0059] Furthermore, in step S5, detecting whether the blockchain consensus process cannot be interrupted individually and whether the consensus record cannot be tampered with includes:

[0060] S51, based on container technology, designs deletion methods for different consensus mechanisms, then uses different methods in different blockchain platforms to delete users and view previous consensus records;

[0061] S52, using step S4 to check the consensus record of the deleted user to determine whether the consensus record has been deleted or tampered with;

[0062] Furthermore, in step S6, detecting whether the consensus mechanism has node fault tolerance and the degree of impact of node failure on the system includes:

[0063] S61, using the node suspension method provided in different blockchain platforms to gradually stop the maximum number of faulty nodes allowed by their consensus mechanism. Specifically, use the container stop method and node name to stop the corresponding consensus node, or use the script in each node directory to stop the corresponding node;

[0064] S62: Design a method for executing transfer transactions or contracts provided by the platform after stopping the node for different consensus mechanisms. Use smart contracts to send transactions and interact with the chain, input transfer parameters to perform transfer transactions, and use smart contracts to build an asset management application. After the construction is completed, enter the directory and execute the script to generate a contract address. Then use the registration function in the script to register assets for different transaction parties, and then use the transaction function in the script to transfer assets between the two parties.

[0065] S63, using a script to extract return fields related to node fault tolerance and node failure after executing the transaction;

[0066] S64: Determine whether the consensus mechanism complies with the fault tolerance specified by the platform based on the return fields of each step in the process of gradually stopping the node with the largest fault.

[0067] S65: Some consensus mechanisms require that the number of nodes be an odd number. In this case, it is necessary to test the leader election algorithm to determine whether the system can operate normally. Specifically, the matching method in the container technology is used to evaluate the number of nodes generated by the test network (including the number of organization nodes and the number of P2P nodes). Then, it is determined whether it is an odd number to determine whether it complies with the leader election algorithm.

[0068] Furthermore, in step S7, detecting whether the consensus algorithm is final within an acceptable limited time, whether the on-chain records are tamper-proof, and whether the on-chain transaction rollback can be prevented includes:

[0069] S71, using the transaction methods provided by different blockchain platforms to execute multiple transactions between nodes;

[0070] S72, using pipeline technology to extract the return fields related to the finality of the transaction;

[0071] S73, judging whether the consensus algorithm has finality in the transaction based on the returned fields;

[0072] S74, performing the deletion user operation as in step S51 and step S52, is used to check whether the previous consensus records have been deleted or tampered with, and to check the readability and encryption properties of the block fields.

[0073] S75. Use the corresponding methods according to different blockchain platforms to view the consensus algorithm used. Specifically, use the method in the container to obtain the number of P2P nodes and organization nodes generated by the network, and compare them with the number of nodes generated by the consensus algorithm used at startup given in the official documentation. Then use the HTTP request constructed by the automated method and send the JSON-encoded request and enter the evaluation case. Judge the node status based on the return value. Finally, use the console method in the container to obtain the consensus algorithm used by querying the current chain configuration.

[0074] Furthermore, in step S8, detecting the correctness and consistency of the consensus mechanism includes:

[0075] S81, detect whether the consensus system can reach a consistent and correct consensus on the request of the normal operation node within the specified time required by the system performance. The specific method of executing multiple transactions between nodes using the transaction method provided by different blockchain platforms is as shown in step S62;

[0076] S82, using corresponding methods on different blockchain platforms to check whether the transaction is executed successfully and whether the content changed after the transaction is consistent with the submission. Specifically, use smart contracts in the transaction between transaction parties a and b. The content submitted for each transaction is the transfer amount from a to b. After the transaction is executed, call the method in the chain code to check the difference between the account balances of transaction parties a and b and the balance before the transfer for comparison. Then use the method and user name in the script to check the account balance, check the comparison before and after the transfer, and use the return value after calling the contract to judge the result.

[0077] Furthermore, in step S9, the consensus attack prevention measures include:

[0078] S91, for deterministic consensus algorithms such as PBFT and RAFT, builds a detection method based on smart contract technology to detect deterministic algorithm replay attacks and deterministic algorithm power oppression attacks. It inputs the detection implementation, combines the characteristics of different consensus algorithms, and outputs the detection results.

[0079] S92, for financial trading platforms based on different consensus mechanisms, uses container technology to construct an automated method to detect the transaction output of various consensus algorithms, compare it with the on-chain transaction data, and output the consensus algorithm's ability to prevent double-flower attacks.

[0080] The above describes in detail the preferred embodiments of the present invention. It should be understood that numerous modifications and variations based on the concepts of the present invention are possible by those skilled in the art without inventive effort. Therefore, any technical solution that can be derived by those skilled in the art through logical analysis, reasoning, or limited experimentation based on the concepts of the present invention and the prior art should be within the scope of protection defined by the claims.

Claims

1. An automated security assessment method for a blockchain consensus mechanism, characterized by: It includes the following steps: S1. Start the initial blockchain network for testing. S2. Generate node configuration files and certificate files; S3. Initiate transactions or execute contracts on each blockchain platform; S4. Check the integrity of the consensus record content; S5. Check whether the blockchain consensus process cannot be interrupted independently and whether the consensus record cannot be tampered with; S6. Check whether the consensus mechanism is fault-tolerant and the impact of node failures on the system. S7. Check whether the consensus algorithm is final within an acceptable time limit, whether the on-chain records are tamper-proof, and whether it can prevent on-chain transaction rollbacks; S8. Check the correctness and consistency of the consensus mechanism; S9, detect the consensus algorithm's ability to prevent attacks; In step S6, detecting whether the consensus mechanism has node fault tolerance and the impact of node failure on the system includes the following steps: S61, using the node suspension method provided in different blockchain platforms to gradually stop the maximum number of faulty nodes allowed by their consensus mechanism; S62: Design a method for executing transfer transactions or contracts provided by the platform after stopping the node for different consensus mechanisms. Use smart contracts to send transactions and interact with the chain, input transfer parameters to perform transfer transactions, and use smart contracts to build an asset management application. After the construction is completed, enter the deployment directory of the smart contract and execute the script to generate a contract address. Then use the registration function in the script to register assets for different transaction parties, and then use the transaction function in the script to transfer assets between the two parties. S63, using a script to extract return fields related to node fault tolerance and node failure after executing the transaction; S64, judging whether the consensus mechanism complies with the fault tolerance specified by the blockchain platform started in step S1 based on the return fields of each step in the process of gradually stopping the node with the largest fault; Step S7 detects whether the consensus algorithm is final within an acceptable limited time, whether the on-chain records are tamper-proof, and whether the on-chain transactions can be prevented from being rolled back, including the following steps: S71, using the transaction methods provided by different blockchain platforms to execute multiple transactions between nodes; S72, using pipeline technology to extract the return fields related to the finality of the transaction; S73, judging whether the consensus algorithm has finality in the transaction based on the returned fields; S74: Perform the deletion user operation as in step S51 and step S52 to check whether the previous consensus record has been deleted or tampered with, and to check the readability and encryption properties of the block field; S75. Use the corresponding methods according to different blockchain platforms to view the consensus algorithm used. Specifically, use the method in the container to obtain the number of P2P nodes and organization nodes generated by the network, and compare them with the number of nodes generated by the consensus algorithm used at startup given in the official documentation. Then, use the HTTP request constructed by the automated method and send the JSON-encoded request and enter the evaluation case. Judge the node status based on the return value. Finally, use the console method in the container to obtain the consensus algorithm used by querying the current chain configuration.

2. The automated security assessment method for the blockchain consensus mechanism according to claim 1 is characterized by: In step S4, checking the integrity of the consensus record content includes the following steps: S41, based on automated scripts, designs test functions for obtaining consensus records for different consensus mechanisms, and obtains transaction consensus information based on specific test functions; S42, using an automated script to extract specific information from the transaction information to determine whether it contains event time, transaction content and initiator information.

3. The automated security assessment method for the blockchain consensus mechanism according to claim 1 is characterized by: In step S5, checking whether the blockchain consensus process cannot be interrupted individually and whether the consensus record cannot be tampered with includes the following steps: S51, based on container technology, designs deletion methods for different consensus mechanisms, uses different methods in different blockchain platforms to delete users, and checks previous consensus records; S52: Utilize step S4 to detect the consensus record of the deleted user to determine whether the consensus record has been deleted or tampered with.

4. The automated security assessment method for a blockchain consensus mechanism according to claim 1, characterized in that: Step S8 includes detecting whether the consensus mechanism has node fault tolerance and the impact of node failure on the system. Detecting the correctness and consistency of the consensus mechanism includes the following steps: S81, detecting whether the requests of the normally operating nodes of the consensus system can reach a consistent and correct consensus within the specified time required by the system performance, and executing multiple transactions between nodes using the transaction methods provided by them in different blockchain platforms. The specific method is as follows: step S62; S82, using corresponding methods on different blockchain platforms to check whether the transaction is successfully executed and whether the content changed after the transaction is consistent with the submitted content.

5. The automated security assessment method for the blockchain consensus mechanism according to claim 1 is characterized by: In step S9, the consensus attack prevention measures include the following steps: S91, for the PBFT and RAFT deterministic consensus algorithms, builds a detection method based on smart contract technology to detect deterministic algorithm replay attacks and deterministic algorithm power oppression attacks. It inputs the detection implementation, combines the characteristics of different consensus algorithms, and outputs the detection results. S92, for financial trading platforms based on different consensus mechanisms, uses container technology to construct an automated method to detect the transaction output of various consensus algorithms, compare it with the on-chain transaction data, and output the consensus algorithm's ability to prevent double-spending attacks.

Citation Information

Patent Citations

  • Multi-round voting type fault-tolerant sorting consensus mechanism and method based on block chain

    CN112541758A

  • Method and Apparatus for Processing Mobile Payment Using Blockchain Techniques

    US20180197155A1