Method and device for discovering an Ethereum node based on network protocol analysis and routing information detection

By using methods based on network protocol parsing and routing information detection, the problem of inaccurate Ethereum network node discovery was solved, achieving comprehensive and accurate discovery of Ethereum network nodes and improving network security and stability.

CN119814638BActive Publication Date: 2026-04-21INSTITUTE OF INFORMATION ENGINEERING CHINESE ACADEMY OF SCIENCES
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
INSTITUTE OF INFORMATION ENGINEERING CHINESE ACADEMY OF SCIENCES
Filing Date
2024-12-10
Publication Date
2026-04-21

AI Technical Summary

Technical Problem

Existing Ethereum network node discovery methods lack accuracy and comprehensiveness, making it difficult to fully monitor and defend against malicious attacks.

Method used

By using network protocol parsing and routing information detection methods, and leveraging the node discovery mechanism of the blockchain network, valid nodes are obtained and protocol connection verification is performed. Node attributes are parsed, and more nodes are discovered using the routing mechanism. The client source code is modified to optimize the node discovery process.

Benefits of technology

It enables accurate and comprehensive discovery of Ethereum network nodes, improves network oversight and defense capabilities, and enhances network security and stability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119814638B_ABST
    Figure CN119814638B_ABST
Patent Text Reader

Abstract

This invention discloses an Ethereum node discovery method and apparatus based on network protocol parsing and routing information detection, belonging to the field of blockchain technology. The method includes: obtaining valid nodes in the blockchain network; determining whether the valid node is online by establishing a protocol connection with the valid node; if the valid node is online, obtaining a list of the node IP addresses of the online node, and obtaining new valid nodes based on the list of node IP addresses. This invention utilizes the node discovery mechanism in the blockchain network, applying protocol connection verification, address storage mechanism, and routing mechanism to discover nodes in the Ethereum network, solving the problems of inaccuracy and incompleteness in existing methods for Ethereum node discovery.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of blockchain technology, and in particular relates to an Ethereum node discovery method and apparatus based on network protocol parsing and routing information detection. Background Technology

[0002] A blockchain network is a decentralized network composed of nodes that uses blockchain technology to share, verify, and record transactions, ensuring data transparency, security, and immutability. Blockchain has evolved to the 2.0 era of programmable applications, expanding from trusted payment applications in digital currencies to decentralized application platforms. This stage is marked by the birth of Ethereum. Ethereum provides a blockchain with a built-in Turing-complete virtual machine, on which users can program smart contracts to create and use decentralized applications, adapting to more complex and flexible application scenarios. Although Ethereum blockchain technology possesses security features such as decentralization, tamper resistance, and transparency, the large number of networks has resulted in diverse Ethereum networks with varying structures, making comprehensive supervision difficult and leading to frequent security incidents. These include chain forks caused by BGP hijacking attacks and nodes suffering malicious and illegal attacks that render them unable to provide normal services. Given the widespread application of the Ethereum network, real-world scenarios such as dynamic tracking, security supervision, and management of the Ethereum network urgently require the ability to accurately detect the effective node scale of the network, analyze the actual state of the network, and identify vulnerabilities to attacks, thereby supporting network supervision and protection.

[0003] In recent years, extensive research has been conducted on node discovery in blockchain networks. Node discovery is primarily based on active measurement methods, which can be categorized into three approaches: blockchain network port scanning, implanting probe tools into the blockchain network, and actively implanting nodes into the blockchain network for message listening and analysis.

[0004] Blockchain network port scanning methods obtain information about nodes using blockchain services by scanning commonly used ports on the blockchain network. The underlying principle is to periodically scan these commonly used ports and use fingerprint rule scripts of relevant protocols to obtain the IP information of nodes running specific protocols on these ports, identifying them as service nodes in the blockchain network. Simultaneously, device information of nodes can be obtained from data packet traffic during communication. This proactive port scanning method 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, the accuracy of port scanning drops significantly for nodes using uncommon ports. Because 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 using uncommon ports.

[0005] The method of implanting probes into the network involves actively sending communication messages to nodes to obtain network data. There are two main types of probes: one is a probe developed based on the network protocol itself, and the other is a blockchain client modified by altering its source code. This measurement method, which actively sends information to connected nodes, is effective in measuring the scale of the blockchain network's nodes. Its advantage is that it can discover active nodes to some extent and obtain additional information such as node addresses, reachability, and message content by actively requesting nodes. However, the correctness of the nodes detected by this method cannot be completely guaranteed, especially without identity verification or on-chain verification. It cannot be confirmed whether these nodes truly belong to the valid nodes in the blockchain network. This means that the probes may capture false or misleading information.

[0006] The method of proactively implanting nodes for message listening and analysis obtains network information and performs node discovery by actively implanting nodes to listen to and analyze messages. The advantage of this proactive communication monitoring method is its low development cost and the fact that the probed content is all real network information, ensuring the authenticity and accuracy of node discovery. However, the messages monitored by this method often contain limited node information, especially in distributed, decentralized blockchain networks where message propagation paths and ranges are limited, leading to incomplete node discovery and difficulty in obtaining a comprehensive understanding of the entire network's node situation.

[0007] Therefore, it is of great significance to propose an algorithm that fully utilizes the characteristics and strong verification capabilities of the Ethereum blockchain network to discover valid nodes under the diverse network structures in the real Ethereum network, thereby achieving defense against malicious node attacks, enhancing network defense capabilities, and maintaining the security and stability of cyberspace. Summary of the Invention

[0008] To address the problems existing in the prior art, the present invention aims to provide an Ethereum node discovery method based on attribute parsing and routing information detection. By utilizing the node discovery mechanism in the blockchain network, applying protocol connection verification, address storage mechanism, and routing mechanism, the method discovers nodes in the Ethereum network, thus solving the problems of inaccuracy and incompleteness in the discovery of Ethereum nodes in existing methods.

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

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

[0011] Identify valid nodes in the blockchain network;

[0012] By establishing a protocol connection with the valid node, it is determined whether the valid node is an online node;

[0013] If the valid node is an online node, obtain the list of node IP addresses of the online node, and obtain new valid nodes based on the list of node IP addresses.

[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 restrictions in the node discovery mechanism;

[0016] and,

[0017] Remove unnecessary node function code; wherein, the unnecessary node function code includes: blockchain synchronization and data forwarding;

[0018] and,

[0019] The client's built-in logging mechanism is used to record process information during operation.

[0020] Furthermore, obtain valid nodes in the blockchain network, including:

[0021] The default DNS seed node is resolved to find the bootstrap node, and the valid node in the blockchain network is obtained using the bootstrap node;

[0022] And / or,

[0023] The valid nodes in the blockchain network are obtained through the routing table.

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

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

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

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

[0028] Furthermore, obtaining new valid nodes based on the list of node IP addresses includes:

[0029] The list of node IP addresses is stored in an Ethereum-based structured routing table;

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

[0031] The process is repeated by establishing a protocol connection with the valid node to determine whether the valid node is online.

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

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

[0034] The second acquisition module is used to determine whether the valid node is an online node by establishing a protocol connection with the valid node.

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

[0036] An electronic device includes: a processor and a memory storing computer program instructions; the processor, when executing the computer program instructions, implements the Ethereum node discovery method based on network protocol parsing and routing information detection as described above.

[0037] A computer-readable storage medium storing computer program instructions that, when executed by a processor, implement the Ethereum node discovery method based on network protocol parsing and routing information detection as described above.

[0038] A computer program product, when run on a computer device, causes the computer device to execute the Ethereum node discovery method based on network protocol parsing and routing information detection as described above.

[0039] Compared with existing technologies, this invention integrates node routing information for proactive node discovery. Compared with traditional port scanning methods, it does not rely on fixed and active ports and can effectively discover nodes stored in the routing table in the network, while ensuring the accuracy and comprehensiveness of node discovery.

[0040] This invention was used to deploy a probe program on the Ethereum network for 24 hours, and the results were compared with those of Etherscan, the most mainstream blockchain information explorer. This invention discovered 4917 online nodes within 24 hours, while Etherscan detected 1956, verifying the comprehensiveness and efficiency of the node discovery function of this invention. Attached Figure Description

[0041] Figure 1 It is the Ethereum network node discovery framework. Detailed Implementation

[0042] 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 specific embodiments and in conjunction with the accompanying drawings.

[0043] The technical solution adopted in this invention is as follows:

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

[0045] S1: The node discovery mechanism based on the blockchain network actively discovers nodes.

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

[0047] Step S1-1: Find valid nodes in the blockchain network. If a node is entering the network for the first time, it finds a bootstrap node by resolving the default DNS seed node, thus obtaining a valid node. If a node re-enters the network, it finds a known connectable node through the routing table.

[0048] In another embodiment, step S1-1, obtaining the bootstrap node, can also be achieved by hardcoding the active seed node in the source code.

[0049] Step S1-2 establishes a connection with a valid node in the network. The node will send its own address message to the other party. The connected node broadcasts the address message so that the address of the newly joined node can be known by more nodes in the network.

[0050] In order to maintain a more stable network connection and quickly find a new node after an existing connection fails, blockchain nodes need to actively discover information about other nodes in the network by sending node discovery messages and actively requesting the connected nodes to return their known list of node IP addresses.

[0051] In steps S1-4, the node saves the returned list of node IP addresses in its own routing table and attempts to connect until the node maintains a connection limit that is sufficiently stable.

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

[0053] S2: Connect to the discovered nodes using the protocol to verify whether they are valid online network nodes.

[0054] Step S2 establishes protocol connections with the discovered nodes to verify whether they are online and valid network nodes. The nodes discovered in Step S1 undergo online verification. Utilizing the node communication mechanism in the blockchain, nodes capable of application protocol connections are considered online nodes, valid nodes in the blockchain network, and capable of providing routing functions, thereby obtaining the effective node scale of the blockchain network.

[0055] S3: Utilize the client node management module to parse the node attributes carried in the messages of the connection.

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

[0057] S4: Targets the Ethereum network's routing mechanism, probes node routing information, and thus discovers more nodes.

[0058] Step S4 targets the Ethereum network's routing mechanism, probing node routing information to discover more nodes. Specifically, it includes the following steps:

[0059] Step S4-1 involves modifying the Ethereum client's source code, adjusting connection restrictions in the node discovery mechanism, and removing unnecessary node functionality code, including blockchain synchronization and data forwarding, to reduce unnecessary resource consumption. The client's built-in logging mechanism is then used to record information about the probe's operation, including messages sent to nodes and the process of nodes sending messages.

[0060] Step S4-2 uses Ethereum's structured storage routing table to calculate and generate the targetID for each request to findnode based on the ID of the node being probed, using the logical distance between nodes. In contrast, the node being probed will return all the routing nodes in the K buckets for each bucket number.

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

[0062] This invention provides more accurate node discovery by performing online verification of proactively discovered nodes and confirming valid nodes in the blockchain network through application protocol parsing.

[0063] In terms of discovering valid nodes on Ethereum, this invention significantly improves the discovery scale compared to existing methods. This not only verifies the practical application value of the algorithm but also highlights its effectiveness in complex networks.

[0064] Other embodiments of this disclosure will readily occur to those skilled in the art upon consideration of the specification and practice of this disclosure. This disclosure is intended to cover any variations, uses, or adaptations of this disclosure that follow the general principles of this disclosure and include common knowledge or customary techniques in the art not disclosed herein. The specification and embodiments are to be considered exemplary only, and this disclosure is not limited to the precise structures described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope.

Claims

1. An Ethereum node discovery method based on network protocol parsing and routing information detection, characterized in that, Applied to a client node, the method includes: Identify valid nodes in the blockchain network; By establishing a protocol connection with the valid node, it is determined whether the valid node is an online node; If the valid node is an online node, obtain a list of node IP addresses of the online node, and obtain new valid nodes based on the list of node IP addresses; Before obtaining a valid node in the blockchain network, the source code of the client node is modified, including: Modify the connection restrictions in the node discovery mechanism; and, Remove unnecessary node function code; wherein, the unnecessary node function code includes: blockchain synchronization and data forwarding; and, The client's built-in logging mechanism is used to record process information during operation; The process of obtaining new valid nodes based on the list of node IP addresses includes: The list of node IP addresses is stored in an Ethereum-based structured routing table; Based on the Ethereum structure corresponding to the routing table, the logical distance between nodes is calculated, and a node is selected as a valid node from the list of node IP addresses according to the logical distance and the ID of the online node. The process is repeated by establishing a protocol connection with the valid node to determine whether the valid node is online.

2. The method according to claim 1, characterized in that, To obtain valid nodes in the blockchain network, including: The default DNS seed node is resolved to find the bootstrap node, and the valid node in the blockchain network is obtained using the bootstrap node; And / or, The valid nodes in the blockchain network are obtained through the routing table.

3. The method according to claim 1, characterized in that, When the effective node is an online node, the method further includes: Parse and manage the node attributes of online nodes carried in messages within a connection; wherein the node attributes include: authentication attributes, connection attributes, and network attributes.

4. The method according to claim 1, characterized in that, When the effective node is an online node, the method further includes: The address message of the online node is broadcast.

5. An Ethereum node discovery device based on network protocol parsing and routing information detection, characterized in that, The device includes: The first acquisition module is used to acquire valid nodes in the blockchain network; The second acquisition module is used to determine whether the valid node is an online node by establishing a protocol connection with the valid node. The third acquisition module is used to acquire a list of node IP addresses of the online node when the effective node is an online node, and to acquire new effective nodes based on the list of node IP addresses. Before obtaining a valid node in the blockchain network, the source code of the client node is modified, including: Modify the connection restrictions in the node discovery mechanism; and, Remove unnecessary node function code; wherein, the unnecessary node function code includes: blockchain synchronization and data forwarding; and, The client's built-in logging mechanism is used to record process information during operation; The process of obtaining new valid nodes based on the list of node IP addresses includes: The list of node IP addresses is stored in an Ethereum-based structured routing table; Based on the Ethereum structure corresponding to the routing table, the logical distance between nodes is calculated, and a node is selected as a valid node from the list of node IP addresses according to the logical distance and the ID of the online node. The process is repeated by establishing a protocol connection with the valid node to determine whether the valid node is online.

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

7. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer program instructions, which, when executed by a processor, implement the Ethereum node discovery method based on network protocol parsing and routing information detection as described in any one of claims 1-4.

8. A computer program product, characterized in that, When the computer program product is run on a computer device, the computer device performs the Ethereum node discovery method based on network protocol parsing and routing information detection as described in any one of claims 1-4.

Citation Information

Patent Citations

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

    CN111314427A