A reputation-based blockchain eclipse attack defense method

By calculating the node reputation value and combining random and fixed-point eviction mechanisms, the problem of malicious nodes filling up the Tried Table in blockchain eclipse attacks is solved, achieving the effect of reducing the success rate of eclipse attacks and improving the credibility of neighboring nodes.

CN116055070BActive Publication Date: 2025-09-23山西清众科技股份有限公司
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202110872922.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-07-30
Publication Date
2025-09-23
Estimated Expiration
2041-07-30

AI Technical Summary

Technical Problem

Existing technologies are difficult to effectively reduce the success probability of blockchain eclipse attacks, especially during the node connection process, when malicious nodes can easily fill up the Tried Table, causing normal nodes to be attacked.

Method used

A reputation-based blockchain eclipse attack defense method is adopted. By calculating the real reputation value of the node and combining random and fixed-point eviction mechanisms, neighbor nodes are selected and IP tables are managed to ensure that the node's reputation value exceeds the threshold before it is selected as a neighbor. Random eviction is used when the IP table is full, and fixed-point eviction is used in the Tried table to evict the IP with the smallest reputation value.

Benefits of technology

It significantly reduces the success probability of eclipse attacks, improves the credibility of neighboring nodes, and ensures the time efficiency and security of node connections.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116055070B_ABST
    Figure CN116055070B_ABST
Patent Text Reader

Abstract

The present invention belongs to the field of blockchain security defense technology, specifically a reputation-based blockchain eclipse attack defense method. The method comprises the following steps: S100: A node entering a blockchain system for the first time obtains the IP information of active nodes on the blockchain system from a DNS seeder and stores the IP and timestamp information in a local New table; S200: The node randomly selects an IP from the New table for connection and then obtains the public key of the connected node; S300: The node calculates the true reputation value of the node based on the public key, the period, and the reputation value of the current period; S400: Based on the true reputation value, it determines whether the connected node can become a neighbor node; S500: After the node restarts, if an IP is selected from the New table for connection, its public key is obtained and its reputation value is calculated; if an IP is selected from the Tried table for connection, the connection is established; S600: The IP in the New table is expelled, and the IP in the Tried table is expelled.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of blockchain security defense technology, and specifically provides a reputation-based blockchain eclipse attack defense method. Background Art

[0002] At present, methods to reduce the success probability of eclipse attacks in the field of blockchain technology include deterministic random eviction method, pre-eviction test method, adding IP bucket method, suspicious timestamp detection method, etc.

[0003] The deterministic random eviction method and pre-eviction test method (Heilman, E. et al. "Eclipse Attacks on Bitcoin's Peer-to-Peer Network." USENIX Security Symposium (2015)) is an eviction method in which, when a node attempts to store a public IP address in its Tried Table or New Table, if the corresponding bucket is full, the old IP address is evicted and a new one is stored. The random eviction process splits the IP address into two parts, each consisting of 16 bits. The first 16 bits are hashed, and four of the 64 buckets in the Tried Table are selected based on the hash result. These buckets are then sorted by bucket number. The last 16 bits are then hashed modulo 4 to obtain a number between 0 and 3, which is then stored in the bucket with that number. If the corresponding bucket is full, four IPs are randomly taken out of the bucket, the IP with the oldest timestamp is found, and the new IP is replaced with it; if the IP to be stored is already in the Tried Table, its timestamp is updated; if the IP already exists in the bucket, its node actively sends VERSION, ADDR, PING and other messages to the storage node, then the storage node updates the timestamp of the node. The deterministic random eviction process builds on the random eviction process by adding a checksum to the eviction process. It evicts nodes that meet specific criteria rather than randomly. This method makes it more difficult for an attacker to eclipse a healthy node. Experiments have shown that using random eviction, an attacker only needs 4,200-4,500 attacking IP addresses to completely eclipse a healthy node's Tried Table (an attacker can easily fill the New Table; when a node connects to an attacking node, it adds all the addresses in the attacking node's IP table to its own New Table). Using deterministic random eviction, an attacker would need to use around 10,000 attacking IP addresses to completely fill the Tried Table (the Tried Table has 64 buckets, each holding 64 IP addresses, for a total of 4,096 IP addresses). The pre-eviction test method builds on the random eviction method. After selecting a node to be evicted, it first tests whether it can connect. If not, it is evicted. If so, the random eviction process is repeated, selecting another node. This method only evicts unconnected IP addresses; it does not necessarily evict the attacking node's IP address.

[0004] The method of increasing IP buckets (J. Lind, O. Naor, I. Eyal, F. Kelbert, PR Pietzuch, and EG Sirer. Teechain: Reducing storage costs on the blockchain with offline payment channels. In 11th ACM International Systems and Storage Conference, 2018.) aims to increase the number of IP addresses that a node can store. This increases the difficulty for attackers to fill up the Tried Table and New Table of a node by requiring more attacking IP addresses.

[0005] The suspicious timestamp detection method (Alangot, Bithin et al. “Decentralized Lightweight Detection of Eclipse Attacks on Bitcoin Clients.” 2020 IEEE International Conference on Blockchain (Blockchain) (2020): 337-342.) works based on the principle that when a node is attacked by an eclipse, the entire blockchain system is split into multiple nodes, resulting in a decrease in the computing power of each node, leading to longer block times. Based on this reason and a probabilistic model, it is possible to determine whether a node is under eclipse attack and take defensive measures, thereby reducing the adverse effects of the eclipse attack. Summary of the Invention

[0006] The purpose of the present invention is to increase the difficulty of successfully implementing an eclipse attack and provide a reputation-based blockchain eclipse attack defense method.

[0007] The present invention adopts the following technical solution: a reputation-based blockchain eclipse attack defense method, comprising the following steps: S100~a node entering the blockchain system for the first time obtains the IP information of active nodes on the blockchain system from a DNS seeder, and stores the IP and timestamp information in a local New table; S200~the node randomly selects an IP from the New table for connection, and then obtains the public key of the connected node; S300~calculates the true reputation value of the node based on the public key, period, and reputation value of this period; S400~determines whether the connected node can become a neighbor node based on the true reputation value; S500~after the node is restarted, if an IP is selected from the New table for connection, its public key is obtained and its reputation value is calculated; if an IP is selected from the Tried table for connection, the connection is established; S600~determines whether the New table or Tried table corresponding to the IP is full. If not, the IP is directly stored in the corresponding New table or Tried table. If full, the IP in the corresponding New table or Tried table is expelled, and the IP is stored in the corresponding New table or Tried table.

[0008] In step S200, the neighboring node sends "verification information," "public key," and "private key-encrypted verification information." This verification information can be anything and serves as verification in the following steps. The public key refers to the neighboring node's public key; private key-encrypted verification information refers to information obtained by encrypting the verification information with the neighboring node's private key. After receiving this information, the node decrypts the encrypted information with the public key and compares the decrypted result with the verification information. If they match, the neighboring node is honest and the obtained public key is the neighboring node's public key. The node then proceeds to the next step. If they differ, the obtained public key is not the neighboring node's public key, and the public and private keys do not match, indicating that the neighboring node is dishonest. The node then disconnects from the neighboring node and reconnects by randomly selecting an IP address from the New table.

[0009] The method for obtaining the real reputation value in step S300 is: find all transaction information and packaged block information of the neighbor node in the blockchain according to the public key; according to the formula = + + Calculate the current real reputation value of the node. is the current real reputation value, It is the impact of the reputation value of all previous cycles on the current reputation value. is the reputation value generated through transactions in this cycle, It is the reputation value generated by packaging block information in this cycle.

[0010] The total reputation value provided in each cycle is recorded as This value is provided by the system and is a constant value. 30% of this value is allocated to the reputation value generated by transactions in the blockchain system, and the remaining 70% is allocated to the reputation value generated by mining in the blockchain system.

[0011] The calculation method is:

[0012] = 30% /

[0013] in, It is the reputation value gained by a node from transactions in this cycle. is the total amount of all transactions conducted by the node in this cycle, It is the total amount of all transactions conducted by all nodes in this cycle.

[0014] The calculation method is:

[0015] = 70% /

[0016] in, It is the reputation value gained by the node based on the number of packed blocks in this cycle. It is the number of blocks that the node successfully packages in this cycle. It is the number of blocks successfully packaged by all nodes in this cycle.

[0017] The calculation method is:

[0018] S301~When the node registers, it obtains the initial reputation value ; Every time a node conducts a transaction, a certain reputation value is added according to the transaction amount; When a node successfully packs a block, a certain reputation value is added;

[0019] S302~Reputation value is calculated based on the period. The reputation value of the past period cannot have a full impact on the current reputation value. At the end of the first calculation period, the reputation value of the node in the first period is for:

[0020] = + +

[0021] It is the reputation reward that a node receives when it conducts the tth transaction in this cycle. It is calculated based on the transaction amount. =0; is the number of transactions performed by the node in this cycle; It is the reputation reward that the node obtains each time it successfully packages; k is the number of times the node successfully packages within this week.

[0022] S303~Assume that after the end of the nth cycle, the reputation value of a node in this cycle is , then the reputation value of the node in the mth (m≥n) cycle is:

[0023] ;

[0024] ;

[0025] The first term in the formula is the impact of the previous reputation value on the current reputation value. is the reputation value gained through transactions in the mth cycle, It is the reputation value gained by packaging blocks in the mth cycle.

[0026] In step S400, if the real reputation value is greater than the reputation value threshold , then the node can be used as a neighbor node, otherwise it cannot. If the node can be used as a neighbor node, its IP address is stored in the Tried table, otherwise its IP address is deleted from the New table.

[0027] The reputation value threshold is the boundary value of the node's reputation. When the reputation is lower than the threshold, the node is untrustworthy, which means that the node will not be selected as a neighbor node by other nodes. On the contrary, when the reputation is higher than the threshold, the node is trustworthy and can be selected as a neighbor node by other nodes. The calculation method of the reputation value threshold is as follows:

[0028]

[0029] in, All reputation values ​​are not equal to the initial reputation value The reputation value of the node, is the average of these reputation values.

[0030] In step S600, the IP in the New table is expelled by random expulsion, and the IP is stored in the New table. If the IP to be stored is not in the New table and the bucket corresponding to the group where the IP is located is full, then an IP is randomly selected from the bucket for removal and the IP is placed in the bucket.

[0031] Use the fixed-point eviction method to evict IPs from the Tried table. Store IPs in the Tried table. If the IP to be stored is not in the Tried table and the bucket corresponding to the group where the IP belongs is full, then calculate the reputation values ​​of all IPs in the bucket, select the IP with the smallest reputation value to evict, and then add the IP to the bucket.

[0032] Compared with the prior art, the present invention has the following beneficial effects:

[0033] 1. When connecting to a neighboring node, request the public key of the neighboring node to clearly know the transaction and packaging status of the neighboring node.

[0034] 2. The real-time reputation value of the node is calculated using a time period method to ensure the fairness of the results.

[0035] 3. The neighbor nodes are selected by verifying the reputation value, which greatly reduces the probability that the neighbor nodes are malicious nodes.

[0036] 4. When the IP in the New table is full, the IP in the New table is randomly evicted to ensure time efficiency.

[0037] 5. When the IP in the Tried table is full, the IP is deterministically expelled at a fixed point, ensuring that the nodes in the Tried table are normal nodes and reducing the probability of a successful eclipse attack. BRIEF DESCRIPTION OF THE DRAWINGS

[0038] Figure 1 The method for selecting neighbor nodes when a node first enters the blockchain system in the method of the present invention;

[0039] Figure 2 The method for selecting neighbor nodes after a node restarts and enters the blockchain system in the method of the present invention;

[0040] Figure 3 How to update the IP in New and Tried tables for nodes;

[0041] Figure 4 The result of the solar eclipse attack before the method of the present invention is executed;

[0042] Figure 5 This is the result of the solar eclipse attack after the method of the present invention is executed. DETAILED DESCRIPTION

[0043] The purpose of this invention is to increase the difficulty of successfully implementing an eclipse attack. It proposes an eclipse attack defense method based on node reputation, which combines random node expulsion and fixed-point node expulsion methods. This method is applicable to blockchain technology and can greatly reduce the probability of successfully implementing an eclipse attack.

[0044] In summary, the method of the present invention includes: (1) adding an attribute named "reputation value" to a node in the blockchain and providing a method for calculating the node's "reputation value", which is used to determine whether the node is a normal node or a malicious node; (2) according to the size of the reputation value, the node selects neighbor nodes, and randomly or fixedly evicts nodes from the bucket.

[0045] The basis for calculating the "reputation value" is: during an eclipse attack, it is often a small number of malicious actors who control the majority of public IPs (nodes) to attack normal nodes. Therefore, after these malicious actors enter the blockchain, the probability of them conducting transactions and packaging blocks is very small, and most of the work is placed on surrounding normal nodes. Therefore, the reputation value of a node can be defined by the transactions conducted by the node in the blockchain network and the number of blocks packaged and released by the node.

[0046] Reputation is calculated as follows:

[0047] When a node registers, it obtains an initial reputation value ; Every time a node conducts a transaction, a certain reputation value is added according to the transaction amount; When a node successfully packs a block, a certain reputation value is added;

[0048] Reputation is calculated based on the period, because the reputation value of the past period cannot have a full impact on the current reputation value. At the end of the first calculation period, the reputation value of the node for:

[0049] ,

[0050] It is the reputation reward that a node receives when conducting transactions of different amounts; is the number of transactions performed by the node in this cycle; n is the number of times the node successfully packages in this cycle.

[0051] According to the laws of real life, the earlier the event, the smaller the impact on the current event, and conversely, the later the event, the greater the impact on the current event. Therefore, in order to reasonably calculate the impact of past behaviors on the current reputation value, a method of periodic calculation of reputation value is introduced, which makes it possible to reasonably calculate the impact of past reputation values ​​on the current reputation value.

[0052] Suppose that after the end of the nth cycle, the reputation value of a node is , then in the mth cycle (any period of the cycle), the calculation method of the node reputation value is:

[0053] ;

[0054] ;

[0055] The first item is the impact of past reputation values ​​on the current reputation value. A decreasing factor is introduced in the calculation method of this value. The purpose is to make the weight of past reputation values ​​decrease over time and reasonably calculate their impact on the current reputation value. The impact of past reputation values ​​on the current reputation value is: .

[0056] After adding the "reputation value", the way a node selects neighbor nodes is as follows:

[0057] A node entering the blockchain system for the first time can access the DNS seeder, obtain the IP addresses stored there, and store them in a local New table. When selecting neighboring nodes, it selects eight IP addresses from the New table for external connections. First, it checks whether all inbound connections for these IP addresses are full. If so, it selects another IP from the New table and reconnects, retesting until a connection is successful. Second, it obtains the public keys of these eight nodes. Public keys uniquely identify a user, and therefore can be linked to that user's reputation. Public keys are obtained by requesting a request from a neighboring node. The neighboring node sends back a message containing verification information, a public key, and verification information encrypted with a private key. The node verifies this message by decrypting the verification information encrypted with the private key using its public key and comparing the result with the original verification information. If they match, the public key sent by the neighboring node is valid; otherwise, it is false. (Blockchains were designed with the assumption that all people are rational and act solely for the purpose of achieving greater self-interest. Therefore, this step is often taken to determine whether the node they are connected to or that is connected to them is malicious.) According to the public key and the block data that has been formed, the reputation value of these nodes is calculated. When the node reputation value is greater than the reputation value threshold When the node is not connected, the node is retained as a neighbor node and its IP is stored in the Tried table. Otherwise, the IP is deleted from the New table, and another IP is selected for connection and reputation value calculation until the reputation value also meets the conditions.

[0058] After the node restarts, all previously connected IPs are disconnected, and it selects IPs from the New table and Tried table to reconnect. First, it selects the table to select the IP, and then takes the IP from the table to connect. The connection steps are also "first determine whether the IP can be successfully connected, and then determine whether the reputation value of the public key corresponding to the IP meets the set conditions" until all eight neighbor nodes are successfully selected.

[0059] The eviction process works as follows: If an IP address is not in the New table and the bucket for the group it belongs to is full, a random IP address is removed from that bucket and placed in the bucket. This is because nodes can store both the IP address in the ADDR message and the IP address obtained by accessing the DNS server in the New table. This means that the IP addresses in the New table are frequently updated, and verifying each one individually would be tedious. Therefore, random eviction is used when updating IP addresses in the New table.

[0060] If you want to store an IP in the Tried table, but the IP is not in the Tried table, and the bucket corresponding to the group where the IP belongs is full, then calculate the reputation values ​​of all IPs in the bucket, select the IP with the smallest reputation value to evict, and then add the IP to the bucket.

[0061] This embodiment provides an example of a blockchain node selecting a neighbor node and deleting an old node in an IP table using the method of the present invention.

[0062] In this embodiment, the nodes deployed in the actual scenario are divided into two categories: one is normal nodes, which conduct transactions, information dissemination, and information packaging in the blockchain system; the other is malicious nodes, which carry out eclipse attacks on normal nodes in the blockchain system, including sending false information to normal nodes and maliciously blocking the dissemination of information on normal nodes.

[0063] After a new node enters the blockchain system, it first accesses the DNS server, obtains the IP address in its IP table, and stores it in the local New table. It selects 8 IP addresses from the New table to connect to, making them neighbor nodes, and stores these 8 IP addresses in the Tried table (if the 117 inbound connections of an IP address are full, another IP address is selected from the New table to continue connecting until the connection is successful). These neighbor nodes are tested and their reputation values ​​are calculated. If the result is lower than the reputation value threshold, , then disconnect, delete the IP in the New and Tried tables, and reconnect to another IP in the New table until the reputation values ​​of all neighbor nodes are greater than or equal to the reputation value threshold.

[0064] During the transaction process, every time a node connects to a new IP or a new public key, it must check its reputation value to see if it meets the conditions to become a neighbor node.

[0065] After a node restarts for some reason, all external and internal connections are disconnected. At this time, 8 IPs are selected from the New or Tried table to reconnect. First, check whether all the internal connections of these 8 IPs are vacant. If so, the connection is successful. If not, reselect new IPs to connect until the connection is successful. Second, calculate the reputation value of these neighbor nodes. If it is greater than , it is retained as a neighbor node, otherwise another IP in the IP table is selected and the reputation value is recalculated until the reputation values ​​of all neighbor nodes meet the conditions.

[0066] The way to evict old nodes is as follows:

[0067] When the node connects to a node, it can obtain all the IPs in the IP table of the connected node through the ADDR message. This information will be stored in the New table. If the IP in the corresponding bucket to be stored is full, it will be evicted at this time.

[0068] If the IP to be stored is already in the New table, the timestamp of the IP in the table is updated. If not, the IP in the corresponding bucket is randomly selected for eviction and the new IP is stored in the New table.

[0069] If the IP to be stored is already in the Tried table, the timestamp of the IP in the table is updated. If not, the IP with the smallest reputation value in the corresponding bucket is selected for eviction and the new IP is stored in the bucket.

Claims

1. A reputation-based blockchain eclipse attack defense method, characterized by: The following steps are included: S100: The node that enters the blockchain system for the first time obtains the IP information of the active node on the blockchain system from the DNS seeder and stores the IP and timestamp information in the local New table; S200~ The node randomly selects an IP from the New table to connect to, and then obtains the public key of the connected node; S300~Calculate the real reputation value of the node based on the public key, cycle and reputation value of this cycle; The method for obtaining the real reputation value in step S300 is: finding all transaction information and packaged block information made by the neighbor node in the blockchain based on the public key; According to the formula C=C m +C t +C p Calculate the current real reputation value of the node, C is the current reputation value, C m is the impact of the reputation value of all previous cycles on the current reputation value, C t is the reputation value generated by transactions in this cycle, C p It is the reputation value generated by packaging block information in this cycle; The total reputation value provided in each cycle is recorded as C T , this value is provided by the system and is a constant value. 30% of this value is allocated to the reputation value generated by transactions in the blockchain system, and the other 70% is allocated to the reputation value generated by mining in the blockchain system. C t =T tp 30% C T / T tt , Among them, C t is the reputation value of a node obtained from transactions in this cycle, T tp is the total amount of all transactions conducted by the node in this cycle, T tt It is the total amount of all transactions conducted by all nodes in this cycle; C p The calculation method is: C p =B tp ·70%·C T / B mt Among them, C p is the reputation value gained by the node by the number of packed blocks in this cycle, B tp is the number of blocks that the node successfully packages in this cycle, B mt It is the number of blocks successfully packaged by all nodes in this cycle; C m The calculation method is: S301~When a node registers, it obtains an initial reputation value C0; each time the node makes a transaction, a certain reputation value is added according to the transaction amount; when the node successfully packs a block, a certain reputation value is added; S302~Reputation value is calculated based on the cycle. The reputation value of the past period cannot have a full impact on the current reputation value. At the end of the first calculation cycle, the reputation value of the node in the first cycle is C1: V t It is the reputation reward that the node receives when conducting transactions of different amounts; t1 is the number of transactions conducted by the node in this cycle; n is the number of successful packaging by the node in this cycle; S303~Assume that after the end of the nth cycle, the reputation value of a node is C n , then the reputation value of the node in the mth cycle is: ; ; In the formula, the first term is the impact of the previous reputation value on the current reputation value; S400~Determine whether the connected node can become a neighbor node based on the real reputation value; In step S400, if the real reputation value is greater than the reputation value threshold C th , then the node can be used as a neighbor node, otherwise it cannot. If the node can be used as a neighbor node, its IP is stored in the Tried table, otherwise its IP is deleted from the New table; the reputation value threshold is the boundary value of the node's reputation. When the reputation is lower than the threshold, the node is an untrustworthy node, which means that the node will not be selected as a neighbor node by other nodes. On the contrary, when the reputation is higher than the threshold, the node is a credible node and can be selected as a neighbor node by other nodes. Among them, T i is the reputation value of all nodes whose reputation value is not equal to the initial reputation value, C0, is the average of these reputation values; S500~After the node restarts, if you select an IP from the New table to connect, you will get its public key and calculate its reputation value; if you select an IP from the Tried table to connect, you will be connected; S600~Determine whether the New table or Tried table corresponding to the IP is full. If not, directly store the IP in the corresponding New table or Tried table. If full, evict the IP in the corresponding New table or Tried table and store the IP in the corresponding New table or Tried table.

2. The reputation-based blockchain eclipse attack defense method according to claim 1 is characterized in that: In step S200, the method for obtaining the public key of the connected node is to have the neighboring node send "verification information", "public key" and "verification information encrypted with the private key". This verification information can be any information and serves as verification in the following steps; The public key refers to the public key of the neighboring node, and the private key-encrypted verification information refers to the information obtained by encrypting the verification information with the private key of the neighboring node. After the node obtains this information, it first decrypts the encrypted information with the public key and compares the decrypted result with the verification information. If they are the same, it means that the obtained public key is the public key of the neighboring node and the neighboring node is an honest node. Then it proceeds to the next step. If they are different, it means that the obtained public key is not the public key of the neighboring node, the public and private keys do not match, that is, the neighboring node is dishonest, then the connection with the neighboring node is disconnected, and a random IP is selected from the New table to connect again.

3. The reputation-based blockchain eclipse attack defense method according to claim 1, characterized in that: In the step S600, the IP in the New table is expelled by random expulsion, and the IP is stored in the New table. If the IP to be stored is not in the New table and the bucket corresponding to the group where the IP is located is full, then an IP is randomly selected from the bucket for removal and the IP is placed in the bucket; the IP in the Tried table is expelled by fixed-point expulsion, and the IP is stored in the Tried table. If the IP to be stored is not in the Tried table and the bucket corresponding to the group where the IP is located is full, then the reputation values ​​of all IPs in the bucket are calculated, and the IP with the smallest reputation value is selected for expulsion, and then the IP is added to the bucket.

Citation Information

Patent Citations

  • Transaction and consensus combined intelligent service transaction blockchain reputation management method and system

    CN111241114A

  • System and method of blockchain consensus mechanism with custom hardware based on geographic distribution, density, node asset and reputation

    US20200162261A1