Multi-view feature Ethereum phishing node detection model construction method and system

Through multi-view features and dynamic graph neural networks, combined with micro, macro and logical attribute features, the problem of low accuracy and poor scalability in detecting Ethereum phishing nodes in the existing technology is solved, achieving higher classification accuracy and Model adaptability.

CN118784284APending Publication Date: 2024-10-15GUANGZHOU UNIVERSITY
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202410821559.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-24
Publication Date
2024-10-15

AI Technical Summary

Technical Problem

When detecting Ethereum phishing nodes, the existing technology lacks the mining of transaction sub-calls and underlying structural information, and traditional graph neural networks only focus on static transaction features, making it difficult to capture dynamic transaction relationships and potential patterns, resulting in low classification accuracy and expansion Poor sex.

Method used

The Ethereum phishing node detection model uses multi-view features. By obtaining the label address data set, a directed graph structure is constructed, the multi-view feature matrix is ​​calculated, and the dynamic graph neural network of multi-time slices is input for training, combining micro, macro and logic. Attribute features use dynamic graph neural networks to perform convolution operations and residual connections to improve the model's classification capabilities.

Benefits of technology

It improves the accuracy of phishing node detection and the robustness of the model, can better adapt to the development of Ethereum, quickly identify new types of phishing fraud transactions, and enhances the security of on-chain transactions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118784284A_ABST
    Figure CN118784284A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a multi-view feature Ethereum phishing node detection model construction method and system, and the method comprises the steps: obtaining an Ethereum label address data set, and dividing the data set into a training set and a verification set; constructing a directed graph structure for the training set, and calculating a multi-view feature matrix based on the directed graph structure; wherein the multi-view feature matrix comprises an embedded Embedding feature matrix, a transaction feature density matrix, a degree matrix, an adjacent matrix, a weight matrix and an offset matrix; and inputting the obtained feature matrix into a multi-time slice dynamic graph neural network model for training, optimizing the network model through a loss function to obtain a phishing node detection model, and verifying the phishing node detection model by using a verification set to obtain a final Ethereum phishing node detection model. According to the embodiment of the invention, the method has high expansion capability in the development of Ethereum address types, and can quickly adapt to the classification requirements of developed Ethereum.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a method and system for constructing an Ethereum phishing node detection model with multi-view features. Background Art

[0002] In the current digital era, blockchain, as a decentralized distributed ledger technology, has become the backbone of promoting social and technological change. Through its unique ledger design, it can achieve systematic transaction endorsement and management without relying on centralized institutions. Among many blockchain systems, Ethereum has become a major innovation in the field of cryptocurrency by supporting smart contracts, setting off a wave of DeFi such as staking and auctions. While bringing many advantages, it has also been favored by phishing attackers, especially the Ethereum system that can register account addresses without user identity authentication and cost. Although transactions initiated by addresses can be obtained through blockchain browsers, only transaction information between addresses can be seen. This is also the anonymity of blockchain, and the address label reflects all the attributes of this address. Through labels, the anonymity of blockchain can be reduced to a certain extent, and the recognition of transaction features can be improved, especially malicious addresses. Therefore, the blockchain address label is actually an important attribute of an address, such as Figure 1 Shown is a tag cloud of supported addresses on the Ethereum browser etherscan.io.

[0003] Phishing attacks on Ethereum can be divided into two categories: (1) Stealing user account credentials (passwords, private keys, etc.): by sending legitimate-looking emails or similar fake websites to the owner of the wallet key, after the user clicks on the fake link, the user will be prompted to enter sensitive information such as wallet account credentials, and finally use the user's wallet account and other sensitive information to transfer to the wallet address controlled by the user; (2) On Ethereum, when a Dapp project is released, many network attackers will take advantage of the information gap, forge and deploy similar projects for phishing fraud, and maximize the similarity of the Dapp project by deploying front-end web pages. Ordinary users cannot recognize the hidden logic behind it at all. Users can authorize users to call token contracts. Attackers will induce victims to authorize phishing smart contracts. At this time, the phishing contract can transfer your tokens or native assets ETH (Ether). The difference between Ethereum phishing attacks and traditional phishing attacks is that Ethereum phishing attackers can not only steal users' sensitive information and funds through phishing websites, but also directly spread phishing addresses to victims through emails, websites, and Twitter. Its main characteristics are short-term and one-time, and they use contract vulnerabilities to attack victims.

[0004] At present, the methods for labeling addresses can be summarized into two categories. One is to embed graphs based on Ethereum transaction features, and send the generated node embedding vectors to the classifier to classify the addresses. It mainly abstracts the addresses as nodes and the transactions as edges to construct a transaction graph. The design model uses a biased sampling strategy to learn to extract the transaction frequency, transaction time, transaction amount between accounts, etc. to obtain the embedding vector, and then the classifier is used to classify the addresses. This method mainly obtains the data set through the API or RPC provided by the blockchain browser EtherScan to synchronize the blockchain ledger (the main contents of the transaction record data fields include: starting transaction address, destination transaction address, block height, transaction amount, etc.), and then performs random walks to obtain the transaction feature embedding learning of the address. The first is to use the computational judgment of class features (such as judging according to the transaction out-degree and in-degree ratio of a certain address) to classify the address; the second is to use the deep learning algorithm to predict the address label according to the transaction behavior of a certain address. There are mainly the following forms of deep learning methods: one is to use LSTM for classification, such as using the LSTM neural network model to identify whether an address is a fraudulent address, or identify whether an address is a phishing address; the second is to use the graph neural network model for identification. In general, the addresses and transactions on the chain are respectively used as nodes and edges of the graph structure, and the attribute values ​​of the addresses and transactions are attached to the nodes and edges of the graph. In this way, learning and training can be carried out through the constructed graph structure. The training result is no longer a vector representation of the node, but a direct output of the prediction result.

[0005] For example, Trans2vec, an improved graph embedding algorithm with a random walk strategy proposed in the prior art, combines the latest transaction timestamp and the total transaction amount to balance and control the search bias parameters and optimize the biased sampling strategy of nodes in the transaction network. Optimizing the sampling strategy is a major technical difficulty in graph embedding learning. However, the design of the transaction measurement method between nodes in the graph embedding algorithm still remains at the shallow transaction feature mining of the network of node feature engineering, lacking the mining of transaction sub-calls and underlying structural information. In addition, a time transaction aggregation graph network TTAGN is proposed. The model aggregates manual node features (i.e., the static properties of the snapshot graph, including the transaction frequency of the account, the time of the transaction, the amount of the transaction, etc.), structural features (after serializing the transaction, the edge features of the node are aggregated into the node to obtain more expressive topological features) and transaction graph features (addresses are abstracted as nodes, transactions are abstracted as edges, and a transaction graph is constructed), and the transactions are serialized and represented according to the transaction timestamp, and LSTM is used to capture the features of transaction serialization. At the same time, GCN is used to aggregate the edge representations from the nodes to enhance the representation ability of the nodes and identify phishing addresses. It should be noted that Ethereum is a blockchain system that is updated in real time. Traditional graph neural networks only learn and focus on the transaction feature information presented by the transaction snapshot before a certain moment. This lack of fine-grainedness hinders the deep mining of transaction relationships between Ethereum nodes. Although the feature extraction and detection of fraudulent nodes in phishing transaction graphs are crucial for the detection of phishing nodes, this model only relies on snapshot graphs for feature extraction of static transaction attributes, which is prone to lose the global features presented by the dynamic changes of the transaction network and may ignore the potential transaction patterns of Ethereum phishing addresses. Summary of the invention

[0006] The purpose of the present invention is to provide a method and system for constructing an Ethereum phishing node detection model with multi-view features, aiming to solve the above-mentioned problems in the prior art.

[0007] The embodiment of the present invention provides a method for constructing an Ethereum phishing node detection model with multi-view features, including:

[0008] Obtain an Ethereum label address dataset, and divide the dataset into a training set and a validation set;

[0009] Constructing a directed graph structure for the training set, and calculating a multi-view feature matrix based on the directed graph structure; wherein the multi-view feature matrix includes an embedding feature matrix, a transaction feature density matrix, a degree matrix, an adjacency matrix, a weight matrix, and an offset matrix;

[0010] The obtained feature matrix is ​​input into a dynamic graph neural network model of up to multiple time slices for training, and the dynamic graph neural network model is optimized by a loss function to obtain a fishing node detection model, and the fishing node detection model is verified using the verification set to obtain a final Ethereum fishing node detection model.

[0011] The embodiment of the present invention provides a multi-view feature Ethereum fishing node detection model construction system, including:

[0012] A data module, used to obtain an Ethereum tag address data set and divide the data set into a training set and a validation set;

[0013] A calculation module, used to construct a directed graph structure for the training set, and calculate a multi-view feature matrix based on the directed graph structure; wherein the multi-view feature matrix includes an embedding feature matrix, a transaction feature density matrix, a degree matrix, an adjacency matrix, a weight matrix, and an offset matrix;

[0014] A construction module is used to input the obtained feature matrix into a dynamic graph neural network model of up to multiple time slices for training, and optimize the dynamic graph neural network model through a loss function to obtain a fishing node detection model, and use the verification set to verify the fishing node detection model to obtain the final Ethereum fishing node detection model.

[0015] An embodiment of the present invention also provides an electronic device, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program, when executed by the processor, implements the steps of the method for constructing an Ethereum fishing node detection model with the above-mentioned multi-perspective features.

[0016] An embodiment of the present invention also provides a computer-readable storage medium, on which a program for implementing information transmission is stored. When the program is executed by a processor, the steps of the method for constructing an Ethereum fishing node detection model with the above-mentioned multi-perspective features are implemented.

[0017] The use of the embodiments of the present invention can include the following beneficial effects: The embodiments of the present invention improve many parameters in the graph neural network process: in terms of feature acquisition, in addition to conventional attributes, such as the out-degree and in-degree of the address (the number of transactions), the out-degree and in-degree transaction amounts; fine-grained features of micro-attributes are also added, such as the transaction command type of the address, the type of digital asset and other feature expressions; at the same time, macro-attributes are also added, such as the transaction network density, clustering coefficient, life cycle and other macro-feature expressions of the address; in addition, logical attribute features are added, the logical feature types of transactions (control flow graph Control Graph, data flow graph Data Graph, fusion feature graph Mix Graph), that is, fusion feature graph (formed by the fusion of control flow graph and data flow graph) and other logical feature expressions. At the same time, a multi-time slice transaction network is also utilized, and the aggregation of information such as the micro-features, macro-features, and logical features of the address is completed through the method of dynamic graph neural network, making the embedding matrix more expressive and the model more robust. The transaction features and embedding expressions selected by the model are combined with the improved convolutional layer operation formula, so that the classification function of the embodiment of the present invention has a strong expansion capability when facing the development of Ethereum address types, and can quickly adapt to the classification needs of the developing Ethereum. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] In order to more clearly illustrate one or more embodiments of this specification or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in this specification. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.

[0019] Figure 1 This is a schematic diagram of a tag cloud diagram of a blockchain browser according to an embodiment of the present invention;

[0020] Figure 2 It is a flow chart of a method for constructing an Ethereum phishing node detection model with multi-view features according to an embodiment of the present invention;

[0021] Figure 3 is a schematic diagram of the logic characteristics of an embodiment of the present invention;

[0022] Figure 4 is an example model and a schematic diagram of a convolutional layer design according to an embodiment of the present invention;

[0023] Figure 5 Schematic diagram of convolution and residual connection design of an embodiment of the present invention;

[0024] Figure 6 is a model operation flow chart of an embodiment of the present invention;

[0025] Figure 7 It is a schematic diagram of a system for constructing an Ethereum phishing node detection model with multi-view features according to an embodiment of the present invention. DETAILED DESCRIPTION

[0026] In order to enable those skilled in the art to better understand the technical solutions in one or more embodiments of this specification, the following will be combined with the drawings in one or more embodiments of this specification to clearly and completely describe the technical solutions in one or more embodiments of this specification. Obviously, the described embodiments are only part of the embodiments of this specification, not all of the embodiments. Based on one or more embodiments of this specification, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of this document.

[0027] Method Embodiment

[0028] According to an embodiment of the present invention, a method for constructing an Ethereum phishing node detection model with multi-view features is provided. Figure 2 : is a flow chart of a method for constructing an Ethereum phishing node detection model with multi-view features according to an embodiment of the present invention. Figure 2 As shown, the method for constructing an Ethereum fishing node detection model with multi-view features according to an embodiment of the present invention specifically includes:

[0029] Step S201, obtaining an Ethereum tag address data set, and dividing the data set into a training set and a validation set;

[0030] Step S202, constructing a directed graph structure for the training set, and calculating a multi-view feature matrix based on the directed graph structure; wherein the multi-view feature matrix includes an embedding feature matrix, a transaction feature density matrix, a degree matrix, an adjacency matrix, a weight matrix and an offset matrix; specifically including:

[0031] The Embedding feature matrix of each node is constructed according to the conventional attributes of each node in the directed graph structure, and the transaction feature density matrix of each node is calculated by formula 1 according to the micro-attributes, macro-attributes and logical attributes of each node in the directed graph structure; wherein the conventional attributes include the total degree, out-degree, in-degree, total transaction amount, outgoing transaction amount, incoming transaction amount, total number of neighbors, inverse of transaction frequency, percentage of neighbors with all transactions being zero, and number of transactions of the most frequently traded neighbors; the micro-attributes include the transaction command type and digital asset type of the address; the macro-attributes include the transaction network density shown in formula 2, the transaction clustering coefficient shown in formula 3, and the node life cycle shown in formula 4; the logical attributes include the control flow graph and data flow graph obtained based on the operation code generated during the transaction execution process, and the fusion feature graph obtained by fusion of the control flow graph and the data flow graph;

[0032]

[0033]

[0034] Among them, G tean represents the transaction feature density matrix, F static Indicates general attributes, F dynamic represents the macroscopic properties, F logic Represents logical attributes, i' and j' represent the maximum number of nodes and edges in each time slice subnetwork, node i represents the i-th node, edge j represents the jth edge; density(G,T) represents the average network density of phishing accounts at different times calculated by integrating time slices and weighted edges, w ij,T represents the weight of the edge from node i to node j in the time window T, |V T | is the number of active transaction nodes in the time window T, is the sum of the weights of all edges in the time window T, |V T |*(|V T |-1) Calculate the maximum number of possible connections between nodes; N i represents the set of first-order neighboring nodes of node i, t uv Indicates that the transaction between nodes u and v occurs within a specific time window T, w uv represents the weight of the transaction between nodes u and v, δ(t uv ,T) indicates whether the transaction between nodes u and v occurs within the time window T, maxw uv is the maximum transaction weight that may occur in the neighborhood of node i, Represents the local clustering coefficient; LifeCyclephish Represents the life cycle of a node, t last and t first Represents the timestamps of the last transaction and the first transaction of the fishing node respectively;

[0035] Step S203, input the obtained feature matrix into the dynamic graph neural network model of the most time slices for training, and optimize the dynamic graph neural network model through the loss function to obtain a fishing node detection model, and use the verification set to verify the fishing node detection model to obtain the final Ethereum fishing node detection model, specifically including:

[0036] The obtained feature matrix is ​​input into the dynamic graph neural network model of multiple time slices and convolution operation is performed according to Formula 5. In each layer of convolution operation, residual connection is introduced and ReLU activation function is used for nonlinear transformation. The training is continuously iterated and updated until the training is completed.

[0037]

[0038] Wherein, σ is a nonlinear activation function, T is a time slice transaction network set, t is an element of the time slice transaction network set, E is a transaction command type set, e is an element of the transaction command set, A is a digital asset type set, a is an element of the digital asset type set, N is a transaction logic feature set, n is an element of the transaction logic feature set, is the transaction feature density matrix, is the degree matrix, is the adjacency matrix, H (l) is the output of the l-th layer neural network, H (l+1) is the output of the l+1th layer of the neural network, is the weight matrix of the l-th layer graph neural network, is the bias term of the l-th layer graph neural network, α t is the attention weight of each time slice, e t =TAN(H (l) ,t),e t is the attention score of time slice t, It represents the sum of the exponential values ​​of the importance scores of all time slices t', which serves as the normalization term of the softmax function;

[0039] The method further comprises:

[0040] The phishing nodes in the Ethereum network are detected by the Ethereum phishing node detection model.

[0041] The above technical scheme of the embodiment of the present invention is described in detail below in combination with the specific situation of the method for constructing an Ethereum phishing node detection model with multi-view features in the embodiment of the present invention.

[0042] There are two main existing methods for detecting phishing nodes:

[0043] 1. Graph embedding algorithm detection method: Simply changing the random walk strategy to perform biased sampling learning to classify nodes has great limitations. It is essentially impossible to learn the structure of the graph. The embedding vector representation of the node sequence formed by random walk is also a linear structure, so the "graph" structure cannot be learned. As a result, the dynamic interaction network of accounts and potential transaction patterns may not be fully captured. In contrast, graph neural networks only need to extract surface features (calculate the in-and-out degrees of account addresses, transaction amounts, transaction frequencies, etc.) and integrate them with neural networks to learn nodes at a deeper level. The first method of implementing classification algorithms requires algorithm designers to have a very deep understanding of transaction behaviors on Ethereum, and to design very efficient and targeted biased sampling. Then, the skip-gram and hierarchical softmax algorithms are used to learn the target nodes from superficial transaction features (such as in-and-out degrees, etc.) in a fine-grained manner (for example, a large number of comparisons and observations of other addresses may be required to determine the node type) to obtain an embedding vector. Therefore, the overall classification detection effect is relatively limited. In addition, the attacker's intention can be induced by deliberately confusing attacks to confuse the detection of blockchain security companies. Therefore, the node detection classification of this method has a lag.

[0044] 2. Deep learning algorithm detection method: Due to the rapid increase of smart contracts and financial products on Ethereum, the contract logic behind the products has become increasingly complex and rich, resulting in insufficient feature and structure capture, and the classification accuracy does not meet current needs. Some existing models have significant differences from the graphs formed by the endless smart contract address transactions in the current network due to feature capture issues. Specifically, the LSTM method is essentially a sequence-based cyclic learning model, and its application in graph structure learning on the trading network has the following main defects: Because of its sequence-based characteristics, the selection of input is particularly important. The graph structure is different from data models with "absolute sequences" such as text sequences or development trends. In the operation of generating an input sequence for the neighbor nodes of a certain node, there is a phenomenon that the selection of the starting node is not unique. Therefore, the content learned may be very different according to different methods of selecting the sequence, resulting in the model failing to meet expectations. Therefore, the LSTM model is not suitable for learning graph structures. For graph neural networks for recognition, although the graph structure can be better expressed than the first two, the selection and processing of parameters when generating the embedding of feature values ​​can be improved. Although the static features presented by the snapshot transaction graph at a certain moment are considered, the potential feature presentation at the micro and macro levels in real-time transaction networks such as Ethereum is not considered (micro features refer to the neighborhood features of the account, and macro features refer to the dynamic changes presented by the transaction network over time). That is, the idea of ​​aggregating topological information from the reasoning and real-time update changes of multiple snapshot graphs is not cited to better learn the entire transaction network around a certain node. This is also where the embodiments of the present invention make improvements.

[0045] In summary, most of the existing graph embedding methods focus on node feature engineering and static snapshot graph feature learning, which cannot effectively adapt to the address attributes possessed and generated by the rapidly developing Ethereum. Judging by the data features and character features of address transactions will lead to insufficient granularity in the division of addresses. It has poor scalability and lags in Ethereum phishing fraud detection, and the algorithm relies on high manpower and time costs. Most of the current graph neural network models also have limitations and low accuracy, which are not satisfactory technical problems. Therefore, the embodiment of the present invention uses a dynamic graph neural network based on time slicing to analyze the micro-transaction features and global network structure features (transaction network density, transaction clustering coefficient, node life cycle) of the phishing account transaction graph from the micro to the macro level. Through this multi-perspective cascade graph learning new features, it fills the gap that has always been based on Relying on the static snapshot graph results in the loss of the global features presented by the dynamic update changes of the potential transaction network. At the same time, through a method based on the Ethereum client, the operation code information generated during the transaction execution process is collected, and then a fusion feature graph (data flow graph, control flow graph) is constructed based on the operation code information, and the logical attribute characteristics of the node transaction network are obtained to enrich the topological features presented by the complex business logic behind it. With the help of these improvements, the address type recognition of phishing addresses and higher accuracy classification results are achieved from a finer-grained level. At the same time, because the selected micro-features, macro-feature expressions and fusion feature graphs are feature expressions that are not easy to change on the chain (essentially the business code implementation logic and transaction mode hidden behind the fraudulent transactions), the model of the embodiment of the present invention has good scalability and can better adapt to the development of Ethereum.

[0046] The embodiment of the present invention builds a graph neural network to learn the transaction behaviors of phishing addresses and non-phishing addresses, thereby achieving the purpose of Ethereum network phishing address classification. In this process, the fine-grained sub-networks of multiple time slices are selected by using a static braking strategy, and the GCN algorithm is used to learn the nodes and their neighborhood nodes and topological structures of each time slice transaction network graph to achieve information aggregation of address node similarity. At the same time, a large number of address attribute features are used. In addition to conventional attributes, such as the out-degree and in-degree of the address (the number of transactions), the out-degree and in-degree transaction amounts, fine-grained features are introduced, such as the address transaction command type, digital asset type and other feature expressions. At the same time, macro attributes are also added, such as the address transaction network density, clustering coefficient, life cycle and other macro feature expressions. In addition, logical features are added, such as new features of logical feature expressions such as fusion feature graphs, such as feature representation based on control flow graphs, feature representation based on data flow graphs, feature representation based on fusion feature graphs, etc. The use of these features enables different types of nodes to be represented more clearly, thereby increasing the learning accuracy and refinement of the model. In addition, the use of dynamic graph neural networks for node classification can achieve rapid expansion in the identification of malicious addresses of new types of phishing fraud transactions generated during the development of Ethereum, effectively adapting to the development of Ethereum and realizing the classification function of Ethereum phishing addresses.

[0047] The embodiment of the present invention is an Ethereum phishing address classification technology, which aims to identify and classify phishing addresses in Ethereum according to the transaction behavior of the addresses in Ethereum and the attribute characteristics of the transactions through a graph neural network, and ensure that the method is easy to expand as the types of Ethereum addresses are added. Such address recognition can have a strong ability to improve the security of on-chain transactions.

[0048] In the embodiment of the present invention, the crawled transaction data is organized into a csv file, and the information such as the transaction initiator address, the transaction recipient address, the transaction amount, the transaction timestamp, etc. is constructed as a directed graph. In the graph structure, the Ethereum account address is a node, and the transaction record is a directed edge. The features captured in the training process include but are not limited to conventional attributes (the total degree of the node, the out-degree, the in-degree, the total transaction amount, the outgoing transaction amount, the incoming transaction amount, the total number of neighbors, the inverse of the transaction frequency, the percentage of neighbors with all transactions being zero, and the number of transactions of the most frequently trading neighbors), as well as the micro attributes (the type of digital assets traded, the type of transaction command), and the macro attributes (the transaction network density of the address, the local clustering system) proposed in the embodiment of the present invention. Number, life cycle) and logical attributes (the fused feature graph of the node, formed by the aggregation of the control flow graph and the data flow graph). Since the graph neural network in the embodiment of the present invention adopts a semi-supervised learning method, it is necessary to first use the Labelled tag cloud graph provided by EtherScan and the label address of the fishing node provided by XBlock as the training set and verification set to obtain a data set of transaction records around these addresses, and abstract the obtained data set into a graph structure. Then, the Embedding feature extraction and construction of the graph structure and the calculation matrix can be performed to form the input of the multi-time slice dynamic graph neural network, and then the output is performed after training in the graph neural network to finally complete the task of fishing address classification.

[0049] First, the data set acquired by the embodiment of the present invention is a publicly labeled address data set from the Ethereum browser EtherScan and Xblock. Of course, other methods can also be used, including but not limited to manually labeling after obtaining the original data through crawlers. The embodiment of the present invention uses the API provided by EtherScan to crawl data. At the same time, considering that EtherScan may not synchronize the database in time and the transaction data fails to reach a consensus in time, resulting in differences in the number of transaction data, Alchemy is also used to provide RPC to directly synchronize all blockchain ledger chain data of the address set to ensure data consistency. The elements of the acquired data set are stored in the form of transaction records. The main table items of each transaction record include the starting node address of the transaction, the target node address of the transaction, the amount of the transaction, the starting node address label of the transaction, the target node address label of the transaction, etc.

[0050] After obtaining the data set, the graph structure needs to be embedded and the feature matrix needs to be constructed. Embedding is to map the graph structure to a data structure that is convenient for network model calculation. For example, in machine learning for image recognition, the image naturally has the element of pixels, so it can be directly regarded as a matrix. The nodes and edges in the graph structure do not have an absolute position expression, so the graph needs to be preprocessed and its information is mapped to data structures such as vectors or matrices. This forms a data type that is convenient for network model calculations, so that the graph features can be learned using dynamic graph neural networks. The GCN method used in the embodiment of the present invention represents the structural similarity of address nodes, that is, the graph structure similarity between nodes is expressed using data. For each time slice transaction network, the learned graph structure similarity value is combined with the node's in-degree and out-degree, and the node's transaction amount to form the graph's Embedding matrix. In terms of the feature matrix, the embodiment of the present invention expands the transaction command type (call, create, transfer, represented by E), the type of digital asset of the transaction (native currency eth, ERC20 token, NFT non-fungible token, represented by A), the logical feature type of the transaction (control flow graph Control Graph, data flow graph Data Graph, fusion feature graph Mix Graph, represented by L, such as Figure 3 As shown in the figure, the operations of these three pairs of feature matrices are subjected to 27 independent classifications. In the calculation of each category, the transaction feature density matrix (realized by calculating the micro-attributes, macro-attributes, and logical attribute characteristics of the node) is used as a new feature as a constituent element of the feature matrix to achieve fine-grained feature learning of the graph.

[0051] 1. Macro attributes

[0052] (1) The sparsity and density of the transaction network not only reflect the changing trend of the network, but also imply the closeness of the connection between nodes. The density of the phishing transaction network is defined as:

[0053]

[0054] Among them, density(G,T) calculates the average network density of phishing accounts at different times by integrating time slices and weighted edges, which better captures the time sensitivity of phishing transaction behaviors and their dynamic changes in the transaction network. ij,T represents the weight of the edge from node i to node j in the time window T, |V T | is the number of active transaction nodes in the time window T, is the sum of the weights of all edges in the time window T, |V T |*(|V T|-1) Calculate the maximum number of possible connections between nodes.

[0055] (2) In order to quantify the closeness of the relationship between the neighborhood nodes in the phishing transaction network and the difference from the normal transaction network, the embodiment of the present invention introduces nodes with weighted and dynamic factors. The local clustering coefficient is often used to measure the sparseness of the local structure of the Ethereum transaction network. In the transaction graph network, the local clustering coefficient is defined as:

[0056]

[0057] Among them, N i represents the set of first-order neighboring nodes of node i, t uv Indicates that the transaction between nodes u and v occurs within a specific time window T, w uv represents the weight of the transaction between nodes u and v, δ(t uv ,T) indicates whether the transaction between nodes u and v occurs within the time window T, maxw uv is the maximum transaction weight that may appear in the neighborhood of node i. The normalization operation of the clustering coefficient makes Keep it in the range [0, 1].

[0058] (3) In order to quantify the activity of phishing accounts and capture the differences in life cycles between phishing nodes and normal nodes, the embodiment of the present invention introduces a life cycle to understand the activity of phishing activities. The life cycle formula of a phishing node is calculated as follows:

[0059]

[0060] Among them, t last and t first They represent the timestamps of the last transaction and the first transaction of the fishing node respectively. These features are combined into a feature heterogeneous graph as the input of the dynamic graph neural network model.

[0061] The graph neural network model generally adopts a hierarchical structure. The calculation at each layer can be regarded as the operation of an equation. All transactions are divided into 27 categories for calculation. The embodiment of the present invention takes one of the calculation processes as an example to illustrate the specific implementation process of the network. There are six matrices that need to be calculated in the network model of the embodiment of the present invention: one is the transaction feature density matrix, represented by G, which contains the network topology representation of the historical transaction network belonging to a certain category of each address node (realized by calculating the micro-attributes, macro-attributes, and logical characteristics of the node); the second is the degree matrix, represented by D. The matrix is ​​a diagonal matrix. The diagonal elements of the degree matrix (the embodiment of the present invention uses directed edges, so the degree matrix is ​​not a diagonal matrix) are all the total degrees of a certain type of transactions of the corresponding node (including out-degree and in-degree), and the values ​​of other elements are all 0. After the degree matrix is ​​generated, the inverse operation is performed on each element. This ensures that a normalized effect is achieved after multiplication with the adjacency matrix. The matrix after taking the inverse can be expressed as D (-1) ; The third is the adjacency matrix, represented by A, and each element represents the number of transaction records of a certain type between nodes in the directed graph; the fourth is the output matrix of the first layer of the neural network. The input of the first layer is the embedded feature matrix (each row is the out-degree and in-degree of a certain type of transaction of the node, the number of transaction amounts of a certain type of transaction of the node, and the similarity representation number of a certain type of transaction calculated by GCN), represented by H (l) Indicates; the fifth is the weight matrix of the lth layer, represented by W (l) The sixth is the offset matrix, denoted by B. It should be noted that the time density matrix is ​​a point-by-point multiplication operation with the matrix behind it. Regarding point-by-point multiplication, assuming that both P and Q are matrices of m⊙m, and the result matrix of point-by-point multiplication is E, then E ij =(P ij )⊙(Q ij ), where ⊙ represents point-by-point multiplication. In summary, the operation in the convolution layer can be regarded as multiplying the transaction feature density matrix (micro attributes, macro attributes, logical attributes), Embedding feature matrix (conventional attributes, embedding generated by Embedding method), adjacency matrix and weight matrix W of the acquired transaction network graph of a certain time slice, and then adding it with the offset B. The calculated result is nonlinearly transformed through a nonlinear activation function. After the training is completed, the training results of each round must be updated by the optimizer to update W and B to improve the classification and recognition accuracy of the model, and finally realize the construction of the model. The calculation formula of the convolution layer in the multi-time slice dynamic graph neural network is expressed as follows:

[0062]

[0063] Wherein, σ is a nonlinear activation function, T is a time slice transaction network set, t is an element of the time slice transaction network set, E is a transaction command type set, e is an element of the transaction command set, A is a digital asset type set, a is an element of the digital asset type set, N is a transaction logic feature set, n is an element of the transaction logic feature set, is the transaction feature density matrix, is the degree matrix, is the adjacency matrix, H (l) is the output of the l-th layer neural network, H (l+1) is the output of the l+1th layer of the neural network, is the weight matrix of the l-th layer graph neural network, is the bias term of the l-th layer graph neural network, e t is the attention score of time slice t, α t is the attention weight of each time slice, indicating the importance of each time slice in the overall feature fusion, F static Indicates general attributes, F dynamic represents the macroscopic properties, F logic represents a logical attribute, and the time slice t' represents a transaction sub-network. represents the sum of the exponential values ​​of the importance scores of all time slices t', which is used as the normalization term of the softmax function. i' and j' represent the maximum number of nodes and edges in each time slice sub-network. Sub-networks of different time slices have different numbers of nodes and edges. i represents the i-th node, edge j The above formula constructs a convolutional design of a hierarchical and progressive dynamic graph neural network from the underlying business logic to the time slice transaction network.

[0064] 2. Specific implementation process

[0065] First, the embodiment of the present invention obtains the required data set with phishing labels through the blockchain authoritative browser public address library EtherScan and the XBlock blockchain authoritative retrieval website. The data set is stored in the form of transaction records, and the transaction records are divided into subsets according to address nodes with known labels, so as to be applied to the model, for example, 80% for training, 10% for verification, and 10% for prediction.

[0066] The graph structure of the embodiment of the present invention uses addresses as nodes and transaction records as directed edges. First, under this definition, the acquired data is embedded, and a static braking strategy is adopted to learn each time slice transaction network around GCN. Then, through this dynamic linkage method, the graph structure data, that is, the address to be trained, is aggregated for neighborhood node information and edge information, so as to learn the topological structure information of the graph around this node, so as to obtain the transaction network structure characteristics of a certain type of node and complete the identification of the similarity of the graph structure around the node. Through this method, the node neighborhood structure and its transaction network similarity value can be generated, which will be used as part of the Embedding matrix of the example model operation. It can also be said that GCN aggregates the captured information to calculate and aggregate the characteristics of the neighborhood nodes and edge information of each node to obtain a more expressive new node vector representation, which is used as the similarity value of the graph structure (here it is based on the second-order and third-order transaction subnetworks. Because the amount of data and graph structure exceeding the third order are particularly large, it has been verified that there are problems, so the embodiment of the present invention uses the second-order and third-order transaction subnetworks), so as to obtain the data expression of the similarity of each address node. The following three types of features, namely the type of digital assets, the type of transaction commands, and the logical features of transactions, will be used as classification conditions for operations. These three types of features form a matrix, thus generating a transaction feature density matrix. For data preprocessing, in addition to the feature embedding matrix (including the node similarity value), the example model also needs to use a two-dimensional sparse matrix to store node and edge information. The content of the sparse matrix is ​​the number of directed edges between the corresponding nodes (and there are no repeated edges in the index), and the degree matrix of each node. The inverse of each item of the degree matrix is ​​used in the operation (that is, the inverse of the degree of each node), so as to achieve normalization to avoid large errors in numerical calculations. The above-mentioned matrix is ​​used as the main part of the model input Xinput in the calculation. The process of the example model is as follows Figure 4 shown.

[0067] For the construction of the model, it is assumed that a GCN network with five convolutional layers is built. It is considered that it is appropriate to conduct analysis when T is equal to one-fifth of the account life cycle. Therefore, the active period of the account is divided into five periods for transaction network analysis, represented by T1 to T5, and ellipsis in the middle. Each time slice can be regarded as a static snapshot of the graph. The dynamic attribute analysis of the transaction sub-network is performed on the fine-grained sub-networks of multiple time slices. The topological information of the evolution of the dynamic transaction network graph is combined with GCN to learn the node representation by transferring and aggregating information between nodes in the graph. It can process large-scale graph data very effectively. For each convolution layer, the first layer of convolution updates the node features after processing the graph data of the first time slice, and then introduces the residual connection. The residual is introduced because it takes into account the flow and change of information in the deep network, that is, the dynamic linkage formed by combining multiple static snapshots (such as Figure 5As shown), the network can more comprehensively learn the behavior changes and patterns within the time span and prevent the gradient from disappearing; the second layer receives the output of the first layer and combines it with the graph data of the second time slice to further update the node features; and so on, until the fifth layer of convolution processes the data of the fifth time slice. The initial state of the example is an adjacency matrix containing a graph, in which the element value is the number of directed edges between a pair of nodes; the second is an Embedding matrix containing a node, each column is an embedding vector of a node, and the embedding vector covers conventional properties, including the node's out-degree and in-degree, the transaction amount of the out-degree and in-degree, and the node structure similarity numerical representation generated by the GCN (the aggregation of node information sets the threshold, such as a second-order transaction subnetwork or a third-order transaction subnetwork); the third is the transaction feature density matrix, each element of which is a feature representation of a certain type of transaction calculated through the micro-attributes, macro-attributes, and logical attributes of the transaction. The classification of the transaction feature density matrix adopts a combination of the following three transaction features: first, the micro-attributes of a certain node (transaction command type, digital asset type), among which the transaction command types include call, create and transfer, and the digital asset feature types include native currency ETH, ERC20 tokens and NFT non-fungible tokens; second, the macro-attributes of a certain node (transaction network density, local clustering coefficient, account address life cycle); third, the logical feature types of transactions (control flow graph, data flow graph, fusion feature graph Mix Graph).Therefore, the model of the embodiment of the present invention needs to perform 3*3*3*3(81) groups of independent matrix multiplications in each layer of operation. Assuming that there are 200 address nodes to be classified, the required matrix design can be as follows (the following matrices will be represented by the letters used above): In the first layer of the network, the dimension of the G(1) matrix is ​​200*200, and each element is the time density representation under the corresponding classification; the dimension of the D matrix and the A matrix is ​​also 200*200. First, take the reciprocal of each item of D, and then perform matrix multiplication with the A matrix (the regularized adjacency matrix is ​​obtained), and the result matrix is ​​multiplied point by point with G; the H(1) matrix of the first layer is the initial feature embedding matrix, which is a 200*5 matrix in the example, and W(1) is the feature conversion weight matrix, which can be set to a dimension of 5*30. After the calculation is completed, a 200*30 matrix will be generated, which is also the dimension (200*30) of the bias matrix B(1) to be set; in the network In the second layer, the output H(1) of the first layer is used as input, G(2) is updated to the transaction feature density under time slice T2, and the same operation is repeated. The W(2) matrix is ​​designed to be 30*30, and then the bias matrix B(2) is also set to 200*30; in the third layer of the network, the output H(2) of the second layer is used as input, G(3) is updated to the transaction feature density under time slice T3, and the same operation is repeated. The W(3) matrix is ​​designed to be 30*30, and then the bias matrix B(3) is also set to 200*30; in the fourth layer of the network, the output H(3) of the third layer is used as input, G(4) is updated to the transaction feature density under time slice T4, and the same operation is repeated. The W(4) matrix is ​​designed to be 30*30, and then the bias matrix B(4) is also set to 200*30; in the fifth layer of the network, the output H(4) of the fourth layer is used as input, G(5) is updated to the transaction feature density under time slice T5, and then the same operation is repeated. It is worth noting that at each layer, the dimension of the W matrix changes as needed, and the output of each layer is based on the transaction characteristics of the current time slice combined with the output of the previous layer. This hierarchical structure and residual connection help information better capture potential transaction network characteristics in a dynamic transaction network. After constructing the equation for operation, the ReLU method is used for nonlinear transformation, and then the matrices set as needed include W and B. Because the problem is a 2-class classification, the dimension of the last layer W(5) is designed to be 30*2, and B(5) is 200*2. This completes one training. Assuming 300 times, the cross entropy method is used to calculate the loss (i.e. the deviation of the model in recognition) in each training, and then the Adam algorithm optimizer is used to update the weights and bias parameters of W and B. After multiple rounds of training, the learning is completed. The operation process of the entire model can be as follows. Figure 6 shown.

[0068] In summary, the fishing node detection method proposed in the embodiment of the present invention has the following features:

[0069] 1. Extract and integrate fine-grained features of transactions and addresses, making the model more refined in learning node feature information, logical information, etc. In addition to the most basic conventional attributes (the out-degree and in-degree of the address (the number of transactions), the out-degree and in-degree transaction amounts), the features used also add address-related macro attributes (network density, clustering coefficient and life cycle) and new features such as address command type (transfer command, create command, call command), and transaction digital asset type (native currency ETH, ERC20 token, NFT non-fungible token). According to these features, more fine-grained convolution operations are classified, and transaction features are integrated into the convolution operations, thereby improving the learning ability of the model and better completing the classification task of Ethereum fishing nodes. In addition, the possibility of these feature expressions changing on the chain is extremely low, so the graph neural network has stronger expressiveness and is more applicable and scalable in the development of Ethereum.

[0070] 2. The logical features are expanded, that is, the types of logical features of transactions (control flow graph, data flow graph, fusion feature graph, Mix Graph). The embodiment of the present invention uses the Ethereum client method to implement the injection command to customize the trace results of the transaction execution process, obtain the operation code generated during the transaction execution process, and then construct the control flow graph and the data flow graph, and aggregate them to obtain the fusion feature graph. In addition to learning micro-attribute features and macro-attribute features, the dynamic graph neural network method also aggregates the embedded expression of the core logical features hidden behind the fraudulent transactions through the learning of the fusion feature graph of the target node, expands the dimension and content of the feature matrix, and improves the recognition ability of the model. The fraud induction means can change, the feature expression can change, but the underlying implementation of the fraud logic is extremely unlikely to be changed on the chain, thus further broadening the scalability of the model.

[0071] 3. The design of the convolutional layer of the multi-time slice dynamic graph neural network, that is, the representation of the operation formula, is as follows:

[0072]

[0073] The above formula constructs a convolutional design of a hierarchical and progressive dynamic graph neural network from the underlying business logic to the time slice transaction network.

[0074] System Example

[0075] According to an embodiment of the present invention, a multi-view feature Ethereum fishing node detection model construction system is provided. Figure 7Schematic diagram of a system for constructing an Ethereum fishing node detection model with multi-view features according to an embodiment of the present invention. Figure 7 As shown, the Ethereum fishing node detection model construction system with multi-view features according to an embodiment of the present invention specifically includes:

[0076] A data module 70 is used to obtain an Ethereum tag address data set and divide the data set into a training set and a validation set;

[0077] The calculation module 72 is used to construct a directed graph structure for the training set, and calculate a multi-view feature matrix based on the directed graph structure; wherein the multi-view feature matrix includes an embedding feature matrix, a transaction feature density matrix, a degree matrix, an adjacency matrix, a weight matrix and an offset matrix; and is specifically used to:

[0078] The Embedding feature matrix of each node is constructed according to the conventional attributes of each node in the directed graph structure, and the transaction feature density matrix of each node is calculated by formula 1 according to the micro-attributes, macro-attributes and logical attributes of each node in the directed graph structure; wherein the conventional attributes include the total degree, out-degree, in-degree, total transaction amount, outgoing transaction amount, incoming transaction amount, total number of neighbors, inverse of transaction frequency, percentage of neighbors with all transactions being zero, and number of transactions of the most frequently traded neighbors; the micro-attributes include the transaction command type and digital asset type of the address; the macro-attributes include the transaction network density shown in formula 2, the transaction clustering coefficient shown in formula 3, and the node life cycle shown in formula 4; the logical attributes include the control flow graph and data flow graph obtained based on the operation code generated during the transaction execution process, and the fusion feature graph obtained by fusion of the control flow graph and the data flow graph;

[0079]

[0080] in, represents the transaction feature density matrix, F static Indicates general attributes, F dynamic represents the macroscopic properties, F logic Represents logical attributes, i' and j' represent the maximum number of nodes and edges in each time slice subnetwork, node i represents the i-th node, edge j represents the jth edge; density(G,T) represents the average network density of phishing accounts at different times calculated by integrating time slices and weighted edges, w ij,T represents the weight of the edge from node i to node j in the time window T, |V T | is the number of active transaction nodes in the time window T, is the sum of the weights of all edges in the time window T, |V T |*(|V T |-1) Calculate the maximum number of possible connections between nodes; N i represents the set of first-order neighboring nodes of node i, t uv Indicates that the transaction between nodes u and v occurs within a specific time window T, w uv represents the weight of the transaction between nodes u and v, δ(t uv ,T) indicates whether the transaction between nodes u and v occurs within the time window T, maxw uv is the maximum transaction weight that may occur in the neighborhood of node i, Represents the local clustering coefficient; LifeCycle phish Represents the life cycle of a node, t last and t first Represents the timestamps of the last transaction and the first transaction of the fishing node respectively;

[0081] The construction module 74 is used to input the obtained feature matrix into the dynamic graph neural network model of the time slice for training, and optimize the dynamic graph neural network model through the loss function to obtain the fishing node detection model, and use the verification set to verify the fishing node detection model to obtain the final Ethereum fishing node detection model, which is specifically used for:

[0082] The obtained feature matrix is ​​input into the dynamic graph neural network model of multiple time slices and convolution operation is performed according to Formula 5. In each layer of convolution operation, residual connection is introduced and ReLU activation function is used for nonlinear transformation. The training is continuously iterated and updated until the training is completed.

[0083]

[0084] Wherein, σ is a nonlinear activation function, T is a time slice transaction network set, t is an element of the time slice transaction network set, E is a transaction command type set, e is an element of the transaction command set, A is a digital asset type set, a is an element of the digital asset type set, N is a transaction logic feature set, n is an element of the transaction logic feature set, is the transaction feature density matrix, is the degree matrix, is the adjacency matrix, H (l) is the output of the l-th layer neural network, H (l+1) is the output of the l+1th layer of the neural network, is the weight matrix of the l-th layer graph neural network, is the bias term of the l-th layer graph neural network, α t is the attention weight of each time slice e t =TAN(H (l) ,t),e t is the attention score of time slice t, It represents the sum of the exponential values ​​of the importance scores of all time slices t', which serves as the normalization term of the softmax function;

[0085] The system further comprises:

[0086] The detection module is used to detect phishing nodes in the Ethereum network through the Ethereum phishing node detection model.

[0087] The embodiment of the present invention is a system embodiment corresponding to the above-mentioned method embodiment. The specific operations of each module can be understood by referring to the description of the method embodiment, which will not be repeated here.

[0088] In summary, the embodiments of the present invention have the following beneficial effects:

[0089] 1. New feature learning has been added for nodes and transactions: (1) Micro perspective: conventional attributes, such as the out-degree and in-degree of the address (number of transactions), the transaction amount of the out-degree and in-degree; more fine-grained attributes: the transaction command types (transfer command, create command, call command) and the digital assets traded (ETH native currency, ERC20 token, NFT non-fungible token, etc.) have been expanded; (2) Macro perspective: the macro attribute representation of the node transaction network has been expanded (by integrating time slices and weighted edges to calculate the average network density of account addresses at different times), the local clustering coefficient representation of the transaction graph (by weighting and normalizing the neighborhood node transactions to obtain the local structural sparsity coefficient between neighborhood nodes in the network), the address life cycle representation (by introducing account activity to calculate the difference in life cycle between phishing nodes and non-phishing nodes), and other new features. Based on the characteristics of Ethereum nodes and transactions and the potential transaction patterns hidden behind them, this paper summarizes the relevant information that can better represent the address, and enhances the learning accuracy based on different types of address features.

[0090] 2. Use the time-slice-based graph neural network to perform multi-perspective cascade aggregation on the graph structure: Using the time-slice network, a dynamic linkage strategy of static braking is proposed, and the GCN algorithm is selected for the fine-grained sub-networks of multiple time slices to learn the neighbors and structure of each time slice transaction network graph to obtain an embedded expression, which can better identify the structural similarity characteristics of nodes with different addresses, making the model more expressive; secondly, GCN learns node representation by transferring and aggregating information between nodes in the graph, effectively revealing the interactive relationship between contracts and contracts, contracts and account addresses, and the calling logic behind them.

[0091] 3. Fusion feature graph design: The logical features are expanded, that is, the types of logical features of transactions (control flow graph ControlGraph, data flow graph Data Graph, fusion feature graph Mix Graph), and the Ethereum client method is used to customize the trace results of the transaction execution process by implementing the injection command to obtain the operation code generated during the transaction execution process; then, the call relationship presented between function calls (using jump-related operation codes such as operation code JUMP as separators to build jumps between code blocks, thereby realizing the construction of the control flow graph) reveals the control flow information, with functions as nodes and edges representing the call relationship between functions, and then the discrete points in the graph that are not related to the fishing logic are deleted, and the calling and called function nodes related to the fishing trunk logic are retained to obtain the control flow graph; in addition, the dependency relationship presented by the variables between functions reveals the data According to the flow information, variables are used as nodes, and edges represent the dependencies between variables. All variables with dependencies are merged and regarded as a whole, so that the original global features are retained. Then the state variables whose edges only act on local variables are deleted (because the globality of the data flow is weak) to obtain the data flow graph. The obtained data flow graph and control flow graph are fused to obtain the fused feature graph (from the perspective of logical attributes). For real-time blockchain systems with rapid updates and iterations, the fraud logic and business implementation hidden behind them are the essence. The fused feature graph explores the business logic hidden behind the fraud in a more fine-grained way, which is essentially difficult to change and is different from the feature extraction method of surface node feature engineering.

[0092] 4. Improved design of the time-slice dynamic graph neural network convolutional layer formula design: The convolutional layer operation formula in the multi-time slice graph neural network is newly designed and improved, and the calculation results of each convolutional layer are transformed nonlinearly to obtain the output of the corresponding convolutional layer, thereby enhancing and improving the classification ability of the model.

[0093] Device Example 1

[0094] An embodiment of the present invention provides an electronic device, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program implements the steps described in the method embodiment when executed by the processor.

[0095] Device Example 2

[0096] An embodiment of the present invention provides a computer-readable storage medium, on which a program for implementing information transmission is stored. When the program is executed by a processor, the steps described in the method embodiment are implemented.

[0097] The computer-readable storage medium in this embodiment includes, but is not limited to, ROM, RAM, magnetic disk or optical disk, etc.

[0098] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein with equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.

Claims

1. A method for constructing a multi-view feature Ethereum phishing node detection model, characterized in that: include: Obtain an Ethereum label address dataset, and divide the dataset into a training set and a validation set; Constructing a directed graph structure for the training set, and calculating a multi-view feature matrix based on the directed graph structure; wherein the multi-view feature matrix includes an embedding feature matrix, a transaction feature density matrix, a degree matrix, an adjacency matrix, a weight matrix, and an offset matrix; The obtained feature matrix is ​​input into a dynamic graph neural network model of up to multiple time slices for training, and the dynamic graph neural network model is optimized by a loss function to obtain a fishing node detection model, and the fishing node detection model is verified using the verification set to obtain a final Ethereum fishing node detection model.

2. The method according to claim 1, characterized in that The method further comprises: The phishing nodes in the Ethereum network are detected by the Ethereum phishing node detection model.

3. The method according to claim 1, characterized in that: Calculating the feature matrix of multiple perspectives based on the directed graph structure specifically includes: The Embedding feature matrix of each node is constructed according to the conventional attributes of each node in the directed graph structure, and the transaction feature density matrix of each node is calculated by formula 1 according to the micro-attributes, macro-attributes and logical attributes of each node in the directed graph structure; wherein the conventional attributes include the total degree, out-degree, in-degree, total transaction amount, outgoing transaction amount, incoming transaction amount, total number of neighbors, inverse of transaction frequency, percentage of neighbors with all transactions being zero, and number of transactions of the most frequently traded neighbors; the micro-attributes include the transaction command type and digital asset type of the address; the macro-attributes include the transaction network density shown in formula 2, the transaction clustering coefficient shown in formula 3, and the node life cycle shown in formula 4; the logical attributes include the control flow graph and data flow graph obtained based on the operation code generated during the transaction execution process, and the fusion feature graph obtained by fusion of the control flow graph and the data flow graph; Among them, G tean represents the transaction feature density matrix, F static Indicates general attributes, F dynamic represents the macroscopic properties, F logic Represents logical attributes, i' and j' represent the maximum number of nodes and edges in each time slice subnetwork, node i represents the i-th node, edge j represents the jth edge; density(G,T) represents the average network density of phishing accounts at different times calculated by integrating time slices and weighted edges, w ij,T represents the weight of the edge from node i to node j in the time window T, |V T | is the number of active transaction nodes in the time window T, is the sum of the weights of all edges in the time window T, |V T |*(|V T |-1) Calculate the maximum number of possible connections between nodes; N i represents the set of first-order neighboring nodes of node i, t uv Indicates that the transaction between nodes u and v occurs within a specific time window T, w uv represents the weight of the transaction between nodes u and v, δ(t uv ,T) indicates whether the transaction between nodes u and v occurs within the time window T, maxw uv is the maximum transaction weight that may occur in the neighborhood of node i, Represents the local clustering coefficient; LifeCycle phish Represents the life cycle of a node, t last and t first Respectively represent the timestamps of the last transaction and the first transaction of the fishing node.

4. The method according to claim 3, characterized in that The obtained feature matrix is ​​input into the dynamic graph neural network model of multiple time slices for training, which specifically includes: The obtained feature matrix is ​​input into the dynamic graph neural network model of multiple time slices and convolution operation is performed according to Formula 5. In each layer of convolution operation, residual connection is introduced and ReLU activation function is used for nonlinear transformation. The training is continuously iterated and updated until the training is completed. Wherein, σ is a nonlinear activation function, T is a time slice transaction network set, t is an element of the time slice transaction network set, E is a transaction command type set, e is an element of the transaction command set, A is a digital asset type set, a is an element of the digital asset type set, N is a transaction logic feature set, n is an element of the transaction logic feature set, is the transaction feature density matrix, is the degree matrix, is the adjacency matrix, H (l) is the output of the l-th layer neural network, H (l+1) is the output of the l+1th layer of the neural network, is the weight matrix of the l-th layer graph neural network, is the bias term of the l-th layer graph neural network, α t is the attention weight of each time slice, e t =TAN(H (l) ,t),e t is the attention score of time slice t, It represents the sum of the exponential values ​​of the importance scores of all time slices t', which serves as the normalization term of the softmax function.

5. A multi-view feature Ethereum phishing node detection model construction system, characterized in that: include: A data module, used to obtain an Ethereum tag address data set and divide the data set into a training set and a validation set; A calculation module, used to construct a directed graph structure for the training set, and calculate a multi-view feature matrix based on the directed graph structure; wherein the multi-view feature matrix includes an embedding feature matrix, a transaction feature density matrix, a degree matrix, an adjacency matrix, a weight matrix, and an offset matrix; A construction module is used to input the obtained feature matrix into a dynamic graph neural network model of up to multiple time slices for training, and optimize the dynamic graph neural network model through a loss function to obtain a fishing node detection model, and use the verification set to verify the fishing node detection model to obtain the final Ethereum fishing node detection model.

6. The system according to claim 5, characterized in that The system further comprises: The detection module is used to detect phishing nodes in the Ethereum network through the Ethereum phishing node detection model.

7. The system according to claim 5, characterized in that The calculation module is specifically used for: The Embedding feature matrix of each node is constructed according to the conventional attributes of each node in the directed graph structure, and the transaction feature density matrix of each node is calculated by formula 1 according to the micro-attributes, macro-attributes and logical attributes of each node in the directed graph structure; wherein the conventional attributes include the total degree, out-degree, in-degree, total transaction amount, outgoing transaction amount, incoming transaction amount, total number of neighbors, inverse of transaction frequency, percentage of neighbors with all transactions being zero, and number of transactions of the most frequently traded neighbors; the micro-attributes include the transaction command type and digital asset type of the address; the macro-attributes include the transaction network density shown in formula 2, the transaction clustering coefficient shown in formula 3, and the node life cycle shown in formula 4; the logical attributes include the control flow graph and data flow graph obtained based on the operation code generated during the transaction execution process, and the fusion feature graph obtained by fusion of the control flow graph and the data flow graph; in, represents the transaction feature density matrix, F static Indicates general attributes, F dynamic represents the macroscopic properties, F logic Represents logical attributes, i' and j' represent the maximum number of nodes and edges in each time slice subnetwork, node i represents the i-th node, edge j represents the jth edge; density(G,T) represents the average network density of phishing accounts at different times calculated by integrating time slices and weighted edges, w ij,T represents the weight of the edge from node i to node j in the time window T, |V T | is the number of active transaction nodes in the time window T, is the sum of the weights of all edges in the time window T, |V T |*(|V T |-1) Calculate the maximum number of possible connections between nodes; N i represents the set of first-order neighboring nodes of node i, t uv Indicates that the transaction between nodes u and v occurs within a specific time window T, w uv represents the weight of the transaction between nodes u and v, δ(t uv ,T) indicates whether the transaction between nodes u and v occurs within the time window T, maxw uv is the maximum transaction weight that may occur in the neighborhood of node i, Represents the local clustering coefficient; LifeCycle phish Represents the life cycle of a node, t last and t first Respectively represent the timestamps of the last transaction and the first transaction of the fishing node.

8. The system according to claim 7, characterized in that The building blocks are specifically used for: The obtained feature matrix is ​​input into the dynamic graph neural network model of multiple time slices and convolution operation is performed according to Formula 5. In each layer of convolution operation, residual connection is introduced and ReLU activation function is used for nonlinear transformation. The training is continuously iterated and updated until the training is completed. Wherein, σ is a nonlinear activation function, T is a time slice transaction network set, t is an element of the time slice transaction network set, E is a transaction command type set, e is an element of the transaction command set, A is a digital asset type set, a is an element of the digital asset type set, N is a transaction logic feature set, n is an element of the transaction logic feature set, is the transaction feature density matrix, is the degree matrix, is the adjacency matrix, H (l) is the output of the l-th layer neural network, H (l+1) is the output of the l+1th layer of the neural network, is the weight matrix of the l-th layer graph neural network, is the bias term of the l-th layer graph neural network, α t is the attention weight of each time slice, e t =TAN(H (l) ,t),e t is the attention score of time slice t, It represents the sum of the exponential values ​​of the importance scores of all time slices t', which serves as the normalization term of the softmax function.

9. An electronic device, characterized in that: include: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the computer program is executed by the processor, the steps of the method for constructing an Ethereum fishing node detection model with multi-view features as described in any one of claims 1 to 4 are implemented.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores an implementation program for information transmission, and when the program is executed by the processor, the steps of the method for constructing an Ethereum fishing node detection model with multi-perspective features as described in any one of claims 1-4 are implemented.

Citation Information

Cited By

  • Intelligent risk control system based on block chain

    CN120070021A

  • Ethereum malicious sample detection method and system for homogeneous enhanced compression modeling

    CN120546989A