Ethereum node discovery method and device based on network protocol analysis and routing information detection

By adopting a node discovery method based on network protocol analysis and routing information detection in the Ethereum network, the problems of inaccurate and incomplete node discovery in the existing technology are solved, and accurate and comprehensive discovery of nodes in the Ethereum network is achieved, and network defense capabilities are enhanced.

CN119814638AActive Publication Date: 2025-04-11INSTITUTE OF INFORMATION ENGINEERING CHINESE ACADEMY OF SCIENCES
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202411810237.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-10
Publication Date
2025-04-11
Estimated Expiration
2044-12-10

AI Technical Summary

Technical Problem

The existing technology has problems of inaccuracy and incompleteness when discovering nodes in the Ethereum network, making it difficult to effectively regulate and defend against cyber attacks.

Method used

The Ethereum node discovery method based on network protocol analysis and routing information detection is adopted, and effective nodes in the blockchain network are actively discovered and verified through protocol connection verification, address storage mechanism and routing mechanism.

Benefits of technology

Accurate and comprehensive discovery of nodes in the Ethereum network has been achieved, network defense capabilities have been enhanced, and network supervision and security supervision have been supported.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119814638A_ABST
    Figure CN119814638A_ABST
Patent Text Reader

Abstract

The invention discloses an Ethereum node discovery method and device based on network protocol analysis and routing information detection, and belongs to the technical field of block chains. The method comprises the following steps: acquiring effective nodes in a block chain network; judging whether the effective node is an online node or not through protocol connection with the effective node; and under the condition that the effective node is an online node, acquiring a node IP address list of the online node, and acquiring a new effective node based on the node IP address list. According to the invention, the nodes in the Ethereum network are discovered by using the node discovery mechanism, the application protocol connection verification, the address storage mechanism and the routing mechanism in the block chain network, and the problem that the Ethereum nodes are inaccurately and incomprehensively discovered by the existing method is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of blockchain, and in particular to an Ethereum node discovery method and device based on network protocol analysis and routing information detection. Background Art

[0002] The blockchain network is a decentralized network composed of nodes. It uses blockchain technology to share, verify and record transactions to ensure the transparency, security and immutability of data. The blockchain has developed into the 2.0 programmable application era, expanding from the trusted payment application on digital currency to a decentralized application platform. The symbol of this stage is the birth of Ethereum. Ethereum provides a blockchain with a built-in Turing complete virtual machine. On the Turing complete virtual machine, users can use smart contract programming to create and use decentralized applications to adapt to more complex and flexible application scenarios. Although Ethereum blockchain technology has security features such as decentralization, tamper resistance, and transparency, due to the large number of networks, various Ethereum networks with different structures have emerged, which are difficult to fully supervise. Security incidents occur frequently, such as chain forks caused by BGP hijacking attacks, and nodes are unable to provide normal services due to malicious and illegal attacks. A series of security issues. In the context of the widespread application of the Ethereum network, the real-life scenarios of Ethereum network dynamic tracking, security supervision and management are in urgent need of being able to accurately detect the effective node scale of the network and analyze the actual status of the network. The vulnerable links in the network facing attacks can be discovered, thereby providing support for network supervision and network protection.

[0003] In recent years, people have conducted a lot of research on node discovery in blockchain networks. Node discovery is mainly based on active measurement, which can be divided into three methods: blockchain network port scanning, implanting detection tools into the blockchain network, and actively implanting nodes into the blockchain network for message monitoring and analysis.

[0004] The blockchain network port scanning method obtains node information using blockchain services by scanning the commonly used ports of the blockchain network. The underlying principle is to obtain the IP information of the nodes running specific protocols on special ports by regularly scanning these commonly used ports of the blockchain network, using the fingerprint rule script of the relevant protocol, and consider them as service nodes in the blockchain network. At the same time, the device information of the nodes can be obtained from the data packet traffic of the communication process. This method of actively scanning ports relies on common default ports, such as port 8333 used by the Bitcoin network or port 30303 used by the Ethereum network. Therefore, it is relatively accurate and efficient in identifying nodes on these default ports, and can obtain the IP and device information of nodes running blockchain protocols. However, for nodes using uncommon ports, the accuracy of port scanning is significantly reduced. Since nodes can run on non-standard ports, the scanner may miss these nodes, resulting in incomplete node discovery coverage and low accuracy in scanning nodes on uncommon ports.

[0005] The method of implanting detection tools into the network is to actively implant detection tools into the network and continuously send communication messages to the nodes in the network to obtain network data. There are two main forms of detection tools. One is a detector developed based on the network protocol, and the other is to "transform" the blockchain client into a detection tool by modifying the source code. This measurement method of actively sending information to connected nodes can well measure the scale of blockchain network nodes. Its advantage is that it can discover active nodes to a certain extent, and obtain additional information such as node address, reachability, message content, etc. by actively requesting nodes. However, the correctness of the nodes detected by the method of implanting detection tools into the network cannot be fully guaranteed, especially in the absence of identity authentication or on-chain verification, it is impossible to confirm whether these nodes are truly valid nodes in the blockchain network. This means that the detection tool may capture false or misleading information.

[0006] The method of actively implanting nodes for message monitoring and analysis obtains network information and performs node discovery by actively implanting nodes for message monitoring and analysis. The advantage of this method of actively monitoring the communication process is that the R&D cost is low, and the detection content is all real network information, which can ensure the authenticity and correctness of node discovery. However, the messages monitored by this method often contain less node information, especially in distributed and decentralized blockchain networks, where the message propagation path and range are limited, resulting in incomplete node discovery and difficulty in obtaining the node status of the entire network.

[0007] Therefore, for the various network structures with different structures in the real Ethereum network, it is necessary to propose an algorithm that fully utilizes the characteristics of the Ethereum blockchain network and its strong verification capabilities to discover valid nodes under Ethereum, and then achieve defense against malicious node attacks, enhance network defense capabilities, and maintain the security and stability of cyberspace. This is of great significance. Summary of the invention

[0008] In view of the problems existing in the prior art, the purpose of the present invention is to provide an Ethereum node discovery method for attribute parsing and routing information detection, which solves the problem that the existing methods are inaccurate and incomplete in Ethereum node discovery by utilizing the node discovery mechanism in the blockchain network, application protocol connection verification, address storage mechanism and routing mechanism to discover nodes in the Ethereum network.

[0009] To achieve the above objectives, the technical solution of the present invention includes the following contents.

[0010] An Ethereum node discovery method based on network protocol analysis and routing information detection is applied to a client node, and the method includes:

[0011] Get valid nodes in the blockchain network;

[0012] By performing a protocol connection with the valid node, determining whether the valid node is an online node;

[0013] In the case that the valid node is an online node, a node IP address list of the online node is obtained, and a new valid node is obtained based on the node IP address list.

[0014] Furthermore, before obtaining a valid node in the blockchain network, the source code of the client node is modified, including:

[0015] Modify the connection limit in the node discovery mechanism;

[0016] and,

[0017] Delete unnecessary node function codes; wherein, the unnecessary node function codes include: blockchain synchronization and data forwarding;

[0018] and,

[0019] Use the client's built-in logging mechanism to record the running process information.

[0020] Furthermore, obtaining valid nodes in the blockchain network includes:

[0021] Parse the default DNS seed node to find the bootstrap node, and use the bootstrap node to obtain the valid node in the blockchain network;

[0022] and / or,

[0023] Get the valid nodes in the blockchain network through the routing table.

[0024] Furthermore, when the valid node is an online node, the method further includes:

[0025] Parse and manage node attributes of online nodes carried in messages during connection; wherein the node attributes include: authentication attributes, connection attributes and network attributes.

[0026] Furthermore, when the valid node is an online node, the method further includes:

[0027] The address message of the online node is broadcasted.

[0028] Further, acquiring a new valid node based on the node IP address list includes:

[0029] Save the node IP address list in the routing table based on the Ethereum structure;

[0030] Based on the Ethereum structure corresponding to the routing table, the logical distance between the nodes is calculated, and according to the logical distance and the ID of the online node, a node is selected from the node IP address list as a valid node;

[0031] Re-execute the protocol connection with the valid node to determine whether the valid node is an online node.

[0032] An Ethereum node discovery device based on network protocol analysis and routing information detection, the device comprising:

[0033] The first acquisition module is used to acquire valid nodes in the blockchain network;

[0034] A second acquisition module is used to determine whether the valid node is an online node by performing a protocol connection with the valid node;

[0035] The third acquisition module is used to acquire a node IP address list of the online node when the valid node is an online node, and acquire a new valid node based on the node IP address list.

[0036] An electronic device, comprising: a processor and a memory storing computer program instructions; when the processor executes the computer program instructions, the Ethereum node discovery method based on network protocol analysis and routing information detection as described in any one of the above items is implemented.

[0037] A computer-readable storage medium having computer program instructions stored thereon, wherein the computer program instructions, when executed by a processor, implement any of the above-mentioned Ethereum node discovery methods based on network protocol parsing and routing information detection.

[0038] A computer program product, when the computer program product is run on a computer device, enables the computer device to execute any of the above-mentioned Ethereum node discovery methods based on network protocol parsing and routing information detection.

[0039] Compared with the prior art, the present invention integrates node routing information for active node discovery. Compared with the traditional port scanning-based method, it does not need to rely on fixed and active ports, can effectively discover nodes stored in the routing table from the network, and at the same time ensures the accuracy and comprehensiveness of node discovery.

[0040] The present invention deploys a detection program on the Ethereum network, performs 24-hour detection, and compares the results with Etherscan, the most mainstream blockchain information browser. The present invention finds 4917 online nodes within 24 hours, while the number of Etherscan nodes is 1956, which verifies the comprehensiveness and efficiency of the node discovery of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS

[0041] Figure 1 It is a node discovery framework for the Ethereum network. DETAILED DESCRIPTION

[0042] In order to enable those skilled in the art to better understand the technical solution of the present invention, the present invention will be further described in detail below through its specific embodiments and in conjunction with the accompanying drawings.

[0043] The technical solution adopted by the present invention is as follows:

[0044] The present invention is an Ethereum node discovery method based on network protocol analysis and routing information detection, comprising the following steps:

[0045] S1: Actively discover nodes based on the node discovery mechanism of the blockchain network.

[0046] The node discovery mechanism based on the blockchain network actively discovers nodes, which specifically includes the following steps:

[0047] Step S1-1 searches for valid nodes in the blockchain network. If the node enters the network for the first time, it searches for the bootstrap node by resolving the default DNS seed node to obtain a valid node. If the node reenters the network, it searches for a known connectable node through the routing table.

[0048] In another embodiment, obtaining the bootstrap node in step S1-1 may also be performed through an active seed node hard-coded in the source code.

[0049] Step S1-2 establishes a connection with a valid node in the network. The node sends its own address message to the other party. The connecting node broadcasts the address message so that the address of the newly added node is known to more nodes in the network.

[0050] In step S1-3, in order to maintain a more stable network connection relationship and quickly find new nodes after the existing connection fails, the blockchain node needs to actively discover the information of other nodes in the network, and actively request the connected node to return its known node IP address list by sending node discovery messages.

[0051] In step S1-4, the node saves the returned node IP address list information in its own routing table and attempts to connect until the connection maintained by the node reaches the limit and is stable enough.

[0052] In step S1-5, the node will periodically send ping and pong messages to determine whether the connection still exists. If the connection is disconnected, or there has been no data communication for a period of time, the node will consider the connection invalid and disconnect it, and start looking for a new node to connect to.

[0053] S2: Perform protocol connection on the discovered node to verify whether it is an online valid network node.

[0054] Step S2 performs protocol connection on the discovered nodes to verify whether they are online valid network nodes. The nodes discovered in step S1 are verified online. By using the node communication mechanism in the blockchain, it is considered that the nodes that can perform application protocol connection communication are online nodes, which are valid nodes in the blockchain network and can provide routing functions, thereby obtaining the effective node scale of the blockchain network.

[0055] S3: Use the client node management module to parse the node attributes carried in the connection message.

[0056] Step S3 uses the client node management module to parse the node attributes carried in the connection message. In the mutual authentication process of blockchain node connection, the authentication attribute information of the node can be extracted and managed by the client's node information management module. This module also includes other node attributes, such as connection attributes, network attributes, etc. By modifying the node information management module in the client, the attribute information exchanged by the node during the communication process can be extracted.

[0057] S4: Targeting the routing mechanism of the Ethereum network, detect node routing information to discover more nodes.

[0058] Step S4 detects node routing information based on the routing mechanism of the Ethereum network to discover more nodes. It specifically includes the following steps:

[0059] Step S4-1: Modify the source code of the Ethereum client, modify the connection restrictions in the node discovery mechanism, delete unnecessary node function codes, including blockchain synchronization, data forwarding, etc., and reduce unnecessary resource usage. Use the client's built-in logging mechanism to record the process information of the detector operation, including sending to the node, the node sending message process, etc.

[0060] Step S4-2 is based on the structured storage routing table of Ethereum. Through the logical distance between nodes and the ID of the detected node, the targetID of each findnode message request is calculated and generated. Relatively speaking, the detected node will return all routing nodes for the number of buckets in the K bucket each time.

[0061] In summary, the present invention can effectively discover nodes stored in the network routing table, and detect network nodes by actively sending messages to nodes in the blockchain network by modifying the blockchain client source code, thereby ensuring the correctness and comprehensiveness of node detection.

[0062] The present invention verifies actively discovered nodes online and confirms valid nodes in the blockchain network by applying protocol parsing, thereby providing more accurate node discovery.

[0063] In terms of Ethereum valid node discovery, the invention has significantly improved the discovery scale compared with the existing methods. This not only verifies the practical application value of the algorithm, but also highlights its effectiveness in complex networks.

[0064] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the present disclosure. The present disclosure is intended to cover any variations, uses or adaptations of the present disclosure, which follow the general principles of the present disclosure and include common knowledge or customary technical means in the art that are not disclosed in the present disclosure. The specification and examples are intended to be exemplary only, and the present disclosure is not limited to the precise structures described above and shown in the accompanying drawings, and various modifications and changes may be made without departing from the scope thereof.

Claims

1. An Ethereum node discovery method based on network protocol analysis and routing information detection, characterized in that: Applied to a client node, the method comprises: Get valid nodes in the blockchain network; By performing a protocol connection with the valid node, determining whether the valid node is an online node; In the case that the valid node is an online node, a node IP address list of the online node is obtained, and a new valid node is obtained based on the node IP address list.

2. The method according to claim 1, characterized in that Before obtaining a valid node in the blockchain network, modifying the source code of the client node includes: Modify the connection limit in the node discovery mechanism; and, Delete unnecessary node function codes; wherein, the unnecessary node function codes include: blockchain synchronization and data forwarding; and, Use the client's built-in logging mechanism to record the running process information.

3. The method according to claim 1, characterized in that Get valid nodes in the blockchain network, including: Parse the default DNS seed node to find the bootstrap node, and use the bootstrap node to obtain the valid node in the blockchain network; and / or, Get the valid nodes in the blockchain network through the routing table.

4. The method according to claim 1, characterized in that: In the case where the valid node is an online node, the method further includes: Parse and manage node attributes of online nodes carried in messages during connection; wherein the node attributes include: authentication attributes, connection attributes and network attributes.

5. The method according to claim 1, characterized in that In the case where the valid node is an online node, the method further includes: The address message of the online node is broadcasted.

6. The method according to claim 1, characterized in that The acquiring of a new valid node based on the node IP address list includes: The node IP address list is saved in a routing table based on the Ethereum structure; Based on the Ethereum structure corresponding to the routing table, the logical distance between the nodes is calculated, and according to the logical distance and the ID of the online node, a node is selected from the node IP address list as a valid node; Re-execute the protocol connection with the valid node to determine whether the valid node is an online node.

7. An Ethereum node discovery device based on network protocol analysis and routing information detection, characterized in that: The device comprises: The first acquisition module is used to acquire valid nodes in the blockchain network; A second acquisition module is used to determine whether the valid node is an online node by performing a protocol connection with the valid node; The third acquisition module is used to acquire a node IP address list of the online node when the valid node is an online node, and acquire a new valid node based on the node IP address list.

8. An electronic device, characterized in that: The electronic device comprises: a processor and a memory storing computer program instructions; when the processor executes the computer program instructions, the Ethereum node discovery method based on network protocol parsing and routing information detection as described in any one of claims 1 to 6 is implemented.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer program instructions, and when the computer program instructions are executed by the processor, the Ethereum node discovery method based on network protocol parsing and routing information detection as described in any one of claims 1 to 6 is implemented.

10. A computer program product, characterized in that When the computer program product runs on a computer device, the computer device executes the Ethereum node discovery method based on network protocol parsing and routing information detection as described in any one of claims 1 to 6.

Citation Information

Patent Citations

  • Network connection method of block chain node and related equipment

    CN110708383A

  • Method and device for obtaining all node information of block chain, and storage medium

    CN111314427A

  • Data processing method and system based on block chain

    CN114240433A

  • Ethereum network detection method and device based on simulation technology, equipment and medium

    CN115208767A

  • Optical burst signal routing system

    JP2003234764A