A defense method against blockchain eclipse attacks
By recording the propagation capabilities of blockchain nodes and the differences in autonomous systems, a kernel matrix is constructed to optimize the selection of neighbor nodes, solving the defense problem against eclipse attacks in blockchain networks and achieving more efficient security and information propagation quality.
Patent Information
- Application Number
- CN202510156035.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-12
- Publication Date
- 2025-10-28
- Estimated Expiration
- 2045-02-12
AI Technical Summary
Existing technologies are insufficient to effectively defend against eclipse attacks in blockchain networks, especially during the node selection process, where randomness is insufficient to resist malicious attacks, thus threatening system security.
By recording the block propagation capabilities of nodes and the propagation differences of autonomous systems, a kernel matrix is constructed to optimize the neighbor node selection process. The differences between nodes are calculated by combining beta distribution and Wasserstein distance, and the propagation capabilities and diversity of neighbor nodes are adjusted to improve the system's defense capabilities.
It significantly enhances the blockchain network's ability to defend against eclipse attacks, ensures the flexibility and autonomy of node connections, and improves information reception efficiency and security.
Smart Images

Figure CN120017245B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of blockchain security technology, specifically a defense method for protecting blockchain nodes from eclipse attacks. Background Technology
[0002] Blockchain technology enhances the flexibility and autonomy of nodes in the network by employing a peer-to-peer connection mechanism. This characteristic gives blockchain systems a significant advantage over traditional centralized structures in avoiding single points of failure and improving overall network robustness. In a blockchain network, to ensure nodes can keep abreast of the system's latest state, they need to actively connect and communicate with other nodes to obtain critical information within the system. While traditional node selection methods incorporate randomness, in practical applications, this randomness is insufficient to completely defend against malicious attacks. Attackers can often use a series of carefully designed attack methods to interfere with or manipulate node selection strategies, thereby using malicious nodes to infiltrate and control all connections within the blockchain network, posing a serious threat to system security.
[0003] To address this challenge, from a security perspective, it is necessary to design an efficient and reliable method for selecting blockchain node neighbors to prevent security threats from adversaries. Currently, while some defensive methods attempt to ensure node security through data analysis or the introduction of diversity, these methods still have certain limitations. Specifically, data analysis methods often only become effective after an attack has occurred, offering relatively limited real-time protection for nodes. While introducing diversity can theoretically improve system security, in practice, it requires in-depth analysis of various node properties, and its computational methods must consider the dynamic characteristics of nodes.
[0004] Therefore, in order to more effectively deal with malicious attacks, especially blockchain eclipse attacks, and protect the security of blockchain networks, it is urgent to develop an innovative node neighbor selection method that can significantly improve the system's defense capabilities against malicious attacks while ensuring the flexibility and autonomy of node connections. Summary of the Invention
[0005] To overcome the shortcomings of existing technologies, a defense method against blockchain eclipse attacks is proposed. The blockchain system involved comprises several nodes, including a number of malicious attackers and regular benign nodes. Transaction messages are transmitted between nodes in a decentralized manner, and block information is continuously propagated among nodes during normal system operation.
[0006] The technical solution of the present invention is as follows:
[0007] A defense method against blockchain eclipse attacks includes the following steps:
[0008] Step 1. Blockchain nodes record the block information they receive from other nodes in the system, and calculate the block propagation capability of each node based on the timestamp of the message.
[0009] Step 2. Based on the propagation capabilities of other nodes, the blockchain node uses its own autonomous system as a reference and combines the block propagation capabilities of all nodes within the autonomous system to calculate the differences between nodes.
[0010] Step 3. Blockchain nodes construct a core matrix using the propagation capabilities and differences calculated in Steps 1 and 2.
[0011] Step 4. Select neighboring nodes based on the kernel matrix constructed in Step 3.
[0012] In step 1, the blockchain node records the content and corresponding timestamp of each message propagated by other nodes within the system. Next, for messages with the same content, the propagation performance of different nodes on that message is calculated. Finally, the propagation performance of each node across all information is accumulated to obtain the node's overall propagation performance. This data is provided in conjunction with a beta distribution, and the specific steps are as follows:
[0013] (1-1) Using the first notification message of the (b-1)th block as a reference, calculate the propagation capability of the bth block according to the following formula:
[0014]
[0015] in The ability of node n to propagate about the b-th block. Let n be the timestamp propagated with respect to the b-th block. and These represent the timestamps of the first INV message in the (b-1)th and bth blocks, respectively.
[0016] (1-2) Based on the propagation capabilities of each block, the actual block propagation performance of the node is cumulatively calculated. Specifically, suppose there are currently B blocks with propagation capability parameters, and the propagation performance q of node n is... n We can use the beta distribution for modeling, that is Its parameter α n ,β n The cumulative calculation is as follows:
[0017]
[0018] (1-3) Based on the propagation performance of nodes, an autonomous system (AS) propagation quality performance Q iSimilarly, beta distribution can be used for modeling, i.e. Its parameters The calculation is as follows:
[0019]
[0020] In step 2, several sets containing different numbers of beta distributions are obtained based on the propagation ability distributions of other nodes. The distance between the sets is calculated using Wasserstein distance to characterize the differences between nodes. The specific steps are as follows:
[0021] (2-1) Calculate the difference in propagation capability between nodes from different ASs, based on Euclidean distance. Let nodes u and v be from two different ASs. First, calculate the difference in propagation capability d(u,v) between them as follows:
[0022]
[0023] (2-2) Let a vector X represent the way nodes are transformed between different ASs. Then, according to the definition of Wasserstein distance, we have:
[0024]
[0025] in and Let AS represent the locations of nodes u and v, respectively. This indicates the number of nodes contained in the AS.
[0026] (2-3) Based on d and X, the minimum value of the distance W(i,j) between the i-th and j-th ASs can be calculated by solving the following optimization problem, which is used to describe the difference between the two ASs:
[0027]
[0028] In step 3, a kernel matrix is constructed based on the propagation capabilities and differences from steps 1 and 2. The specific steps are as follows:
[0029] (3-1) Using an exponential function, the distance W(i,j) between the i-th and j-th ASs is scaled to obtain E. i,j :
[0030] E i,j =e -W(i,j) (8)
[0031] (3-2) The number of ASs in the statistical system is denoted as N. The set of similar feature vectors φ containing each AS is calculated through normalization. Taking element i in the vector set φ as an example, consider element i and the remaining elements j in the set, and the elements φ in the vector set... i The calculation method is as follows:
[0032]
[0033] (3-3) Based on the elements φ in the feature vector set φ i With element φ j transpose Construct the following similarity matrix S:
[0034]
[0035] (3-4) To adjust the impact of propagation capability on neighbor node selection, a parameter θ is introduced into the propagation capability parameter Q. The construction method is as follows:
[0036]
[0037] (3-5) Finally, calculate Q * Together with S, they form the kernel matrix L. ij Its expression is as follows:
[0038]
[0039] In step 4, based on the kernel matrix L constructed in step 3, neighbor node selection is iteratively performed for k rounds. The specific steps are as follows:
[0040] (4-1) Let the set of all diagonal elements of the kernel matrix L be the set of candidate neighbor nodes. Let c i =[], Found one middle The largest element is added to the neighbor set Y, as shown below:
[0041]
[0042] (4-2) For all in For elements in Y that are not in Y, calculate their parameter c relative to the elements in Y. i and d i Its expression is as follows:
[0043]
[0044] (4-3) Based on c i and d i The updated value, in the absence of Y In the middle, select d. i The largest element is expressed as follows:
[0045]
[0046] Add the selected node j to Y.
[0047] (4-4) Repeat steps (4-2) and (4-3) k-1 times to obtain a set Y containing k nodes. The nodes in this set are the selected neighbor nodes.
[0048] Compared with the prior art, the technical effects of the present invention are as follows:
[0049] 1) This invention designs a model of node propagation capability and calculates the propagation capability of each AS. Based on this, the differences between ASs are calculated according to their propagation capabilities. The neighbor selection process combines these two methods to improve resistance to eclipse attacks.
[0050] 2) A quality adjustment parameter is introduced into the determinant point process method. This parameter can adjust the importance relationship between diversity and quality. This design allows blockchain nodes to make autonomous adjustments between security assurance and information reception efficiency. Attached Figure Description
[0051] Figure 1 Solar eclipse attacks and countermeasures.
[0052] Figure 2 Example of local data transmission record for a node.
[0053] Figure 3 Flowchart for selecting neighboring nodes.
[0054] Figure 4 This invention offers performance improvements compared to random selection.
[0055] Figure 5 The present invention demonstrates the effectiveness of resisting solar eclipses of varying intensities. Detailed Implementation
[0056] The present invention will be further explained below with reference to the accompanying drawings and embodiments, but this should not be construed as limiting the scope of protection of the present invention.
[0057] like Figure 1In the blockchain system shown, the potential neighbors for a blockchain node include normal, benign nodes and malicious nodes from AS1 to AS3. If a node indiscriminately selects a node from AS1 to AS3 during the neighbor connection process, it will be vulnerable to an eclipse attack by a malicious attacker. If a diversity of choices is made during the neighbor connection process, including the inclusion of normal nodes, the eclipse attack trap can be avoided.
[0058] like Figure 2 As shown, the transmission records collected by a blockchain node from other nodes consist of four parts. First, the identifier of the sending node is observable; this identifier serves as the node's identity information within the system. Second, when the information arrives locally, the target node timestamps it while recording its content and source, which is used for subsequent calculations of the propagation capabilities of each node. Finally, the target node obtains the AS information of the sender from the network information of the information, which is used to subsequently describe the propagation capabilities and differences between different ASs.
[0059] The workflow of this invention is as follows: Figure 3 As shown, the process consists of four steps:
[0060] Step 1: Extract the propagation records of all nodes and calculate the propagation performance of each node. The steps are as follows:
[0061] (1-1) The mathematical expression for calculating the performance of each node in propagating a single block based on the transmission records is as follows:
[0062]
[0063] For each node, its block propagation performance at all times is summed to obtain a parameter of the node's propagation capability, which is mathematically expressed as:
[0064]
[0065] (1-2) When solving for the AS propagation quality, the mathematical expression for summing the performance of all nodes it contains is:
[0066]
[0067] Step 2: When calculating the difference between different ASs, specific values are given for the combined differences in node propagation performance (d) and the transformation schemes (X) between different ASs. Details are as follows:
[0068] (2-1) Calculate the differences between different nodes, as follows:
[0069]
[0070] (2-2) Find the transformation scheme X between AS, which should satisfy the following constraints:
[0071]
[0072] (2-3) Find an X with the smallest inner product with d, and then regard this smallest inner product W as the difference between AS. Its mathematical expression is as follows:
[0073]
[0074] Step 3: Construct a kernel matrix containing parameter θ using the AS transmission quality calculated in Step 1 and the difference between ASs calculated in Step 2, as follows:
[0075] (3-1) Based on the differences between ASs calculated in step 2, the eigenvectors of each AS are obtained. The method is given by the following formula:
[0076]
[0077] (3-2) Based on the feature vectors of all AS, construct a similarity matrix S. The calculation method of each element of matrix S is as follows:
[0078]
[0079] (3-3) Combining the parameter θ, the propagation ability Q obtained in step 1, and the similarity matrix S, construct the kernel matrix L. The elements of the kernel matrix L are calculated as follows:
[0080]
[0081] Step 4: Based on the kernel matrix L from Step 3 and the number of neighboring nodes k to be connected, select the neighboring nodes as follows:
[0082] (4-1) First round selection setting c i =[], Then find all optional sets. middle The largest element is found as follows:
[0083]
[0084] Add the element to the neighbor set Y.
[0085] (4-2) Update the set of all remaining optional neighbor nodes. c of the middle element i With d i Parameters, find The largest element is found as follows:
[0086]
[0087] (4-3) Based on c i and d i The updated value, in the absence of Y In the middle, select d. i The largest element is expressed as follows:
[0088]
[0089] Add the selected node j to Y.
[0090] (4-4) Repeat steps (4-2) and (4-3) k-1 times to obtain a set Y containing k nodes. The nodes in this set are the selected neighbor nodes.
[0091] Figure 4 The superiority of the proposed method over a completely randomized scheme in propagation performance is evident. As shown in the figure, the proportion of low-quality propagation nodes among the selected neighbors is significantly reduced compared to random selection, with high-quality propagation nodes accounting for a larger proportion of the selected results. Furthermore, the proposed method does not concentrate all possible selections on the high-quality portion. This is because the method ensures diversity in selection while considering quality, thus guaranteeing the security of the target node.
[0092] Figure 5 The figure illustrates the number of malicious nodes selected by the present invention under different enemy attack capabilities. Assuming that some nodes with strong propagation capabilities have already been controlled by the enemy, this control range is considered the enemy's attack capability. During testing, this range is incremented by 10%, from 10% to 100%, to discuss the effectiveness of the present invention against eclipse attacks. The figure compares three different selection methods: (1) completely random selection; (2) greedy selection targeting only high-quality nodes; and (3) selection using the method of the present invention. It can be seen from the figure that the present invention and the random selection scheme are more secure than the greedy selection method. Furthermore, when adjusting the security parameter θ, the number of malicious nodes selected by the present design can be lower than that of the random selection scheme, meaning that the present invention can provide a more secure defense effect than random selection.
Claims
1. A defense method against blockchain eclipse attacks, characterized in that, The blockchain contains several malicious and benign nodes, and transaction messages are transmitted between nodes in a decentralized manner. The defense method includes the following steps: S1. Calculate the block propagation capability of each node in the blockchain network; S2. Based on the block propagation capability of the node, taking its autonomous system as a reference, and combining the block propagation capabilities of all nodes within the autonomous system, calculate the differences between nodes; S3. Based on the node block propagation capabilities and differences calculated in steps S1 and S2, construct the similarity feature vector of the autonomous system, construct the similarity matrix using the feature vectors of all autonomous systems, and multiply the propagation capability with each element in the similarity matrix to obtain the kernel matrix. S4. Select neighboring nodes based on the kernel matrix; S1. Calculating the block propagation capability of each node in the blockchain network specifically includes: In the S1.1 blockchain network, each node records the content of each message received from other nodes in the system and the timestamp corresponding to that message. S1.2 For messages with the same content, taking the first notification message of block b-1 as a reference, and based on the timestamp of node n's propagation with respect to block b, and the timestamps of the first INV messages of blocks b-1 and b, the propagation capability of node n with respect to block b is calculated using the following formula: in, The ability of node n to propagate about the b-th block. Let n be the timestamp propagated with respect to the b-th block. and These represent the timestamps of the first INV message in the (b-1)th and bth blocks, respectively. S1.3 Based on the propagation capabilities of each block, the actual block propagation performance of each node in the blockchain network is cumulatively calculated. Let there be B blocks with propagation capability parameters, and the propagation performance q of node n be... n Modeling is performed using beta distribution, i.e. The parameter α of the beta distribution is calculated by accumulating the block propagation capability parameter of each node. n ,β n The formula is as follows: S1.4 Based on the propagation performance of nodes, for an autonomous system propagation quality performance Q i Similarly, beta distribution is used for modeling, i.e. The parameters of the beta distribution of the autonomous system are calculated by accumulating the propagation performance parameters of all nodes within the autonomous system. The formula is as follows: Step S2, calculating the differences between nodes, specifically includes: S2.1 For two nodes u and v from different ASs, first calculate the difference in their respective propagation capabilities d(u,v), and then calculate the difference in propagation capabilities between the two nodes based on the Euclidean distance, as shown in the following formula: S2.2 Define a vector X to represent the node transformation method between different ASs. According to the definition of Wasserstein distance, calculate the difference in node propagation capability distribution between two ASs containing nodes u and v: in and Let AS represent the locations of nodes u and v, respectively. This indicates the number of nodes contained in the AS; S2.3 Based on d calculated in step S2.1 and X calculated in S2.2, calculate the minimum value of the distance W(i,j) between the i-th and j-th ASs by solving the following optimization problem, which is used to describe the difference in the distribution of node propagation capabilities between the two ASs: The specific steps of step S3 are as follows: S3.1 uses an exponential function to scale the distance W(i,j) between the i-th and j-th ASs to obtain E(i,j): AND i,j =and -W(i,j) S3.2 Count the number of ASs in the statistical system, denoted as N, and calculate the set of similar feature vectors Φ containing each AS through normalization; for element i in the vector set Φ, consider element i and the other elements j in the set, and the elements in the vector set Φ i The calculation method is as follows: S3.3 Based on the elements Φ within the feature vector set Φ i With element Φ j transpose Construct the following similarity matrix S: S3.4 To adjust for the impact of propagation capability on neighbor node selection, a parameter θ is introduced into the propagation capability parameter Q, and its construction method is as follows: S3.5 Finally, the calculation is performed by Q. * Together with S, they form the kernel matrix L. ij Its expression is as follows: Step S4. Based on the kernel matrix L constructed in step 3, neighbor node selection is iteratively performed for k rounds, with the specific steps as follows: S4.1 Let all diagonal elements of the kernel matrix L be the set of candidate neighbor nodes. Let c i =[], In the set of candidate neighbor nodes Find one The largest element is taken as the first neighbor node, and it is removed from the candidate neighbor set and added to the neighbor set Y, as shown below: S4.2 For all nodes in the candidate neighbor set For an element that is not in the set of neighboring nodes Y, calculate its parameter c relative to the elements in the set of neighboring nodes Y. i and d i The expression is as follows: c i ′ =[c i (L ji -<c j ,c i >) / d j ] S4.3 is based on c i and d i The updated value is in the set of candidate neighbor nodes that does not include the current neighbor node. In the middle, select d. i The largest element is taken as the next neighbor, expressed as follows: Remove the selected node j from the candidate neighbor set and add it to the neighbor set Y; S4.4 Repeat steps S4.2 and S4.3 a total of k-1 times until a set Y of neighboring nodes containing k nodes is obtained. The nodes in this set are the selected neighboring nodes.
Citation Information
Patent Citations
Reputation-based block chain daily erosion attack defense method
CN116055070A
Block chain-based solar erosion attack risk control method, storage medium and control system
CN117714026A