An end-to-end Ethereum phishing account detection method and system

By learning from the second-order transaction network and smart contract call characteristics of the Ethereum platform through the graph neural network, end-to-end phishing account detection is achieved, solving the problems of high resource consumption and professional knowledge requirements in the existing technology, and improving detection Precision and efficiency.

CN113111930BActive Publication Date: 2024-08-23ZHEJIANG UNIV OF TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202110359953.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-04-02
Publication Date
2024-08-23
Estimated Expiration
2041-04-02

AI Technical Summary

Technical Problem

It is difficult to effectively detect phishing accounts on the Ethereum platform with existing technology. Traditional methods require a large amount of computing resources and professional knowledge, and cannot achieve end-to-end quick detection.

Method used

The graph neural network is used to sample the second-order transaction network from transaction records, extract smart contract call features, and learn the transaction behavior pattern of the account through the graph neural network to achieve end-to-end phishing account classification.

Benefits of technology

It reduces resource consumption, simplifies the detection process, improves detection accuracy, and realizes end-to-end phishing account detection, with accuracy better than traditional methods.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113111930B
    Figure CN113111930B
Patent Text Reader

Abstract

The present invention provides an end-to-end Ethereum phishing account detection method, including: (S1): sampling the second-order transaction network of the target account from the transaction record, the account includes a phishing account and a non-phishing account; (S2): screening out frequently called contracts from the smart contract call history record, and extracting contract call features for all accounts in the second-order network; (S3): learning the transaction behavior pattern of the account through a graph neural network, and realizing end-to-end account classification, and classifying the phishing account. The present invention also provides an end-to-end Ethereum phishing account detection system, including: a network extraction module, a feature extraction module, a data integration module, a training module, and a phishing account detection module. The present invention can effectively reduce the scale of calculated data, and can effectively distinguish phishing accounts from non-phishing accounts, helping digital currency platforms and users avoid fraud risks.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to an Ethereum blockchain platform, and in particular to an end-to-end Ethereum phishing account detection method and system. Background Art

[0002] Blockchain is a basic technology that realizes decentralization, encryption and tamper-proof functions. Benefiting from its anonymity, cryptocurrencies based on blockchain technology have received widespread attention in recent years. As of the first quarter of 2021, there will be more than 8,700 cryptocurrencies with a total market value of US$1,721 billion. People only need to create a pseudonymous account to perform transactions, and account creation is basically free. Therefore, in the context of such a large number of transactions, the blockchain cryptocurrency system has also become a hotbed for illegal and criminal activities, including various scams (Ponzi schemes, mining scams, scam wallets, fraudulent transactions, etc.), money laundering, abuse of robot accounts, and vulnerability attacks, etc.

[0003] Ethereum, as the second-highest cryptocurrency by market value, cannot avoid these problems. Phishing scams are a common illegal behavior. Scammers design websites to be consistent with some well-known wallets and exchanges to obtain user information. They even use "airdrops" and "giving away digital assets" to trick unsuspecting retail investors who are unaware of the truth into voluntarily providing personal sensitive information, thereby making improper profits. Due to its differences from ordinary phishing scams, the common phishing scam detection methods based on email detection and website detection are not applicable to this context. Therefore, thanks to the fact that blockchain transaction data is completely open and cannot be tampered with, we consider combining methods in the field of network science to learn the differences in the behavior patterns of phishing accounts and normal accounts from the transaction network, thereby realizing the detection of phishing scams.

[0004] Some existing network-based phishing fraud analysis methods are mainly based on manual features and graph embedding algorithms. Manual features usually require sufficient professional knowledge, and the classification performance depends on the feature design; graph embedding algorithms require huge computing and storage resources on such a large-scale data, and require an additional classifier to be trained to cooperate.

[0005] A network representation learning method for Ethernet phishing fraud with publication number CN111447179A extracts the first-order transaction network of the phishing account and generates the account embedding vector using the tran2vec method. The first-order transaction network extracted by this method needs to be combined into a large network. Because the tran2vec method needs to navigate in this large network, it consumes a lot of computing space and time. Secondly, the account embedding vectors generated by this method still need to train a classifier to detect phishing accounts, and end-to-end speed cannot be achieved. Summary of the invention

[0006] The present invention aims to overcome the deficiencies of the above-mentioned prior art and provide an end-to-end Ethereum phishing account detection method, which not only reduces the loss of resources from the perspective of transaction subgraphs, but also realizes an end-to-end problem solution.

[0007] The present invention provides an end-to-end Ethereum phishing account detection method, comprising the following steps:

[0008] S1: Sample the second-order transaction network of the target account from the transaction records, including phishing accounts and non-phishing accounts;

[0009] S2: Filter out frequently called contracts from the smart contract call history and extract contract call features for all accounts in the second-order network;

[0010] S3: Learn the transaction behavior patterns of accounts through graph neural networks, implement end-to-end account classification, and classify phishing accounts.

[0011] Preferably, the step S1 specifically includes:

[0012] S1-1: Starting from the target account, sample its second-order transaction network. If the target account has less than 20 trading counterparts, retain these trading counterparts and calculate their total transaction volume with the target account as the edge weight. If the target account has more than 20 trading counterparts, sample the top 20 trading counterparts with the largest transaction volume in reverse order based on the total transaction volume between them and the target account, and calculate their total transaction volume with the target account as the edge weight. This sampling method is also applicable to sampling second-order trading counterparts through first-order trading counterparts.

[0013] S1-2: The second-order transaction network of a target account can be represented by a triple G = (V, F, y), where V is the node set of the network and the number of nodes is less than 400, and E is the weighted edge set, where the edges are all (v i ,v j ,e ij ) format, where v i ,v j ∈V,e ij The weight of the edge corresponds to the total transaction volume between the two nodes, y is the actual label of the target account corresponding to the network, y = 0 means that this is a second-order transaction network of a non-phishing account, and y = 1 means that this is a second-order transaction network of a phishing account.

[0014] Preferably, the step S2 specifically includes:

[0015] S2-1: Count the number of smart contracts deployed on Ethereum and the number of times they are called by external users, ignore calls between contracts, and keep the top 10,000 smart contracts with the most calls;

[0016] S2-2: Count the calls of the 10,000 smart contracts by the nodes in the second-order transaction network sampled in S1 from the contract call history records. The contract call characteristics of each node can be expressed as The contract call feature matrix of each second-order transaction network can be expressed as Where |V| represents the number of nodes in the node set.

[0017] Preferably, the step S3 specifically includes:

[0018] S3-1: Convert the second-order transaction network of all target accounts into a weighted adjacency matrix Adjs = {A1, A2, ... A n}, where n is the number of known non-phishing accounts and phishing accounts, and the i-th adjacency matrix The value of the jth row and kth column position can be expressed as:

[0019]

[0020] where e jk For node v j ,v k ∈V i The weight of the edge between them;

[0021] S3-2: All adjacency matrices, corresponding feature matrices and labels are mapped one by one to form n data samples. Each data sample can be represented as a triple S i =(A i ,X i ,y i ), and all data samples S={S1,S2,…,S n The training set data is divided into training set and test set. The training set data aggregates account feature information through two graph convolution layers:

[0022]

[0023]

[0024]

[0025]

[0026] in is the normalized adjacency matrix, Adjacency matrix after adding self-loops The diagonal matrix of the vector transformation obtained by summing the columns, D max is also a diagonal matrix, That is, the diagonal position is the maximum value of the corresponding row of the adjacency matrix A. and is a trainable weight matrix, p and q are the intermediate layer dimensions, ReLU is a nonlinear activation function, and finally a maximum pooling layer is used to pool the node features into graph features, and a fully connected layer is further trained to use the features to distinguish phishing accounts from non-phishing accounts:

[0027] Z = Softmax(MaxPooling(X′)W (2) +b) (6) Where MaxPooling(·) is the maximum value of the matrix column by column, and are the trainable weight matrix and bias matrix respectively, and Z is the probability matrix of the final prediction result;

[0028] All the above trainable parameters are updated by minimizing the following objective loss function and optimizing using gradient descent:

[0029]

[0030] where z i is the probability that the i-th sample is detected as a phishing account.

[0031] The present invention also provides an end-to-end Ethereum phishing account detection system, comprising: a network extraction module, a feature extraction module, a data integration module, a training module, and a phishing account detection module;

[0032] The network extraction module is used to extract the second-order transaction network of the input target account;

[0033] The feature extraction module is used to extract the contract call features of all second-order transaction network nodes from the contract call records;

[0034] The integration module is used to integrate network structure data and feature data and put them into the data pool;

[0035] The training module is used to extract training data from the data pool to train a graph neural network for detecting phishing accounts;

[0036] The phishing account detection module is used to extract the target account to be detected from the data pool, and predict whether it is a phishing account through the trained graph neural network;

[0037] The beneficial effects of the present invention are:

[0038] 1. By extracting the second-order transaction network of the account, the huge storage loss and computing loss required to use the complete network data are effectively avoided;

[0039] 2. The deep graph neural network effectively avoids the high requirements for professional knowledge, which is simple and efficient;

[0040] 3. An end-to-end phishing account detection solution is implemented through graph neural networks, which solves the phishing account detection problem as a whole. There is no need to split it for multiple trainings, which improves resource utilization.

[0041] 4. The phishing account detection method proposed in the present invention is more accurate than the existing manual feature and graph embedding detection methods. BRIEF DESCRIPTION OF THE DRAWINGS

[0042] Figure 1 It is a flow chart and system structure diagram of the method of the present invention;

[0043] Figure 2 Schematic diagram of the graph neural network structure of the method of the present invention. DETAILED DESCRIPTION

[0044] The following will be combined with the drawings in this embodiment to clearly and completely describe the technical method in the embodiment of the present invention. For those skilled in the art, it is understandable that some well-known structures and their descriptions in the drawings may be omitted. The described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments in the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0045] Reference Figure 1 As shown, the present invention provides an end-to-end Ethereum phishing account detection method and system, comprising the following steps:

[0046] S1: The second-order transaction network of the target account is sampled from the transaction records. The accounts include 1,660 phishing accounts and 1,700 non-phishing accounts, including:

[0047] S1-1: Starting from the target account, sample its second-order transaction network. If the target account has less than 20 trading counterparts, retain these trading counterparts and calculate their total transaction volume with the target account as the edge weight. If the target account has more than 20 trading counterparts, sample the top 20 trading counterparts with the largest transaction volume in reverse order based on the total transaction volume between them and the target account, and calculate their total transaction volume with the target account as the edge weight. This sampling method is also applicable to sampling second-order trading counterparts through first-order trading counterparts.

[0048] S1-2: The second-order transaction network of a target account can be represented by a triple G = (V, E, y), where V is the node set of the network and the number of nodes is less than 400, and E is the weighted edge set, where the edges are all (v i ,v j ,e ij ) format, where v i ,v j ∈V,e ij The weight of the edge corresponds to the total transaction volume between the two nodes, y is the actual label of the target account in the network, y = 0 means that this is a second-order transaction network of a non-phishing account, and y = 1 means that this is a second-order transaction network of a phishing account;

[0049] S2: Filter out frequently called contracts from the smart contract call history, and extract contract call features for all accounts in the second-order network, including:

[0050] S2-1: Count the number of smart contracts deployed on Ethereum and the number of times they are called by external users, ignore calls between contracts, and keep the top 10,000 smart contracts with the most calls;

[0051] S2-2: Count the calls of the 10,000 smart contracts by the nodes in the second-order transaction network sampled in S1 from the contract call history records. The contract call characteristics of each node can be expressed as The contract call feature matrix of each second-order transaction network can be expressed as Where |V| represents the number of nodes in the node set;

[0052] S3: Learn the transaction behavior patterns of accounts through graph neural networks and implement end-to-end account classification to classify phishing accounts, including:

[0053] S3-1: Convert the second-order transaction network of all target accounts into a weighted adjacency matrix Adjs = {A1, A2, ... A n}, where n is the number of known non-phishing accounts and phishing accounts, and the i-th adjacency matrix The value of the jth row and kth column position can be expressed as:

[0054]

[0055] where e jk For node v j ,v k ∈V i The weight of the edge between them;

[0056] S3-2: All adjacency matrices, corresponding feature matrices and labels are mapped one by one to form 3360 data samples. Each data sample can be represented as a triple S i =(A i ,X i ,y i ), and all data samples S={S1,S2,…,S n The data is divided into training set and test set in a 1:1 ratio. The training set data aggregates account feature information through two graph convolution layers:

[0057]

[0058]

[0059]

[0060]

[0061] in is the normalized adjacency matrix, Adjacency matrix after adding self-loops The diagonal matrix of the vector transformation obtained by summing the columns, D max is also a diagonal matrix, That is, the diagonal position is the maximum value of the corresponding row of the adjacency matrix A. and is a trainable weight matrix, p and q are the intermediate layer dimensions, ReLU is a nonlinear activation function, and finally a maximum pooling layer is used to pool the node features into graph features, and a fully connected layer is further trained to use the features to distinguish phishing accounts from non-phishing accounts:

[0062] Z = Softmax(MaxPooling(X′)W (2) +b) (6) Where MaxPooling(·) is the maximum value of the matrix column by column, and are the trainable weight matrix and bias matrix respectively, and Z is the probability matrix of the final prediction result;

[0063] All the above trainable parameters are updated by minimizing the following objective loss function and optimizing using gradient descent:

[0064]

[0065] where z i is the probability that the i-th sample is detected as a phishing account;

[0066] The trained graph neural network can detect phishing accounts with an accuracy of 85.9% in the test data;

[0067] The present invention also provides an end-to-end Ethereum phishing account detection system, comprising: a network extraction module, a feature extraction module, a data integration module, a training module, and a phishing account detection module;

[0068] The network extraction module is used to extract the second-order transaction network of the input target account;

[0069] The feature extraction module is used to extract the contract call features of all second-order transaction network nodes from the contract call records;

[0070] The integration module is used to integrate network structure data and feature data and put them into the data pool;

[0071] The training module is used to extract training data from the data pool to train a graph neural network for detecting phishing accounts;

[0072] The phishing account detection module is used to extract the target account to be detected from the data pool, and predict whether it is a phishing account through the trained graph neural network;

[0073] The present invention not only reduces resource loss from the perspective of transaction subgraphs, but also realizes an end-to-end solution for phishing account detection.

Claims

1. An end-to-end Ethereum phishing account detection method, characterized by: include: S1: Sample the second-order transaction network of the target account from the transaction records, including phishing accounts and non-phishing accounts; specifically: S1-1: Starting from the target account, sample its second-order transaction network. If the target account has less than 20 trading counterparts, retain these trading counterparts and calculate their total transaction volume with the target account as the edge weight. If the target account has more than 20 trading counterparts, sample the top 20 trading counterparts with the largest transaction volume in reverse order based on the total transaction volume between them and the target account, and calculate their total transaction volume with the target account as the edge weight. This sampling method is also applicable to sampling second-order trading counterparts through first-order trading counterparts. S1-2: The second-order transaction network of a target account can be represented by a triple G = (V, E, y), where V is the node set of the network and the number of nodes is less than 400, and E is the weighted edge set, where the edges are all (v i ,v j ,e ij ) format, where v i ,v j ∈V,e ij The weight of the edge corresponds to the total transaction volume between the two nodes, y is the actual label of the target account in the network, y = 0 means that this is a second-order transaction network of a non-phishing account, and y = 1 means that this is a second-order transaction network of a phishing account; S2: Filter out frequently called contracts from the smart contract call history, and extract contract call features for all accounts in the second-order network; specifically: S2-1: Count the number of smart contracts deployed on Ethereum and the number of times they are called by external users, ignore calls between contracts, and keep the top 10,000 smart contracts with the most calls; S2-2: Count the calls of the 10,000 smart contracts by the nodes in the second-order transaction network sampled in S1 from the contract call history records. The contract call characteristics of each node can be expressed as The contract call feature matrix of each second-order transaction network can be expressed as Where |V| represents the number of nodes in the node set; S3: Learn the transaction behavior patterns of accounts through graph neural networks, implement end-to-end account classification, and classify phishing accounts; specifically, it includes: S3-1: Convert the second-order transaction network of all target accounts into a weighted adjacency matrix Adjs = {A1, A2, ... A n }, where n is the number of known non-phishing accounts and phishing accounts, and the i-th adjacency matrix The value at the jth row and kth column of can be expressed as: where e jk For node v j ,v k ∈V i The weight of the edge between them; S3-2: All adjacency matrices, corresponding feature matrices and labels are mapped one by one to form n data samples. Each data sample can be represented as a triple S i =(A i ,X i ,y i ), and all data samples S={S1,S2,…,S n The training set data is divided into training set and test set. The training set data aggregates account feature information through two graph convolution layers: in is the normalized adjacency matrix, Adjacency matrix after adding self-loops The diagonal matrix of the vector transformation obtained by summing the columns, D max It is also a diagonal matrix, and the diagonal position is the maximum value of the corresponding row of the adjacency matrix A. and is a trainable weight matrix, p and q are the intermediate layer dimensions, ReLU is a nonlinear activation function, and finally a maximum pooling layer is used to pool the node features into graph features, and a fully connected layer is further trained to use the features to distinguish phishing accounts from non-phishing accounts: Z = Softmax(MaxPooling(X ′ )W (2) +b) (6) Among them, MaxPooling(·) is to take the maximum value of the matrix column by column, and are the trainable weight matrix and bias matrix respectively, and Z is the probability matrix of the final prediction result; All the above trainable parameters are updated by minimizing the following objective loss function and optimizing using gradient descent: where z i is the probability that the i-th sample is detected as a phishing account.

2. A detection system for implementing the end-to-end Ethereum phishing account detection method of claim 1, comprising: Network extraction module, feature extraction module, data integration module, training module, phishing account detection module; The network extraction module is used to extract the second-order transaction network of the input target account; specifically includes: S1-1: Starting from the target account, sample its second-order transaction network. If the target account has less than 20 trading counterparts, retain these trading counterparts and calculate their total transaction volume with the target account as the edge weight. If the target account has more than 20 trading counterparts, sample the top 20 trading counterparts with the largest transaction volume in reverse order based on the total transaction volume between them and the target account, and calculate their total transaction volume with the target account as the edge weight. This sampling method is also applicable to sampling second-order trading counterparts through first-order trading counterparts. S1-2: The second-order transaction network of a target account can be represented by a triple G = (V, E, y), where V is the node set of the network and the number of nodes is less than 400, and E is the weighted edge set, where the edges are all (v i ,v j ,e ij ) format, where v i ,v j ∈V,e ij The weight of the edge corresponds to the total transaction volume between the two nodes, y is the actual label of the target account in the network, y = 0 means that this is a second-order transaction network of a non-phishing account, and y = 1 means that this is a second-order transaction network of a phishing account; The feature extraction module is used to extract the contract call features of all second-order transaction network nodes from the contract call records; specifically including: S2-1: Count the number of smart contracts deployed on Ethereum and the number of times they are called by external users, ignore calls between contracts, and keep the top 10,000 smart contracts with the most calls; S2-2: Count the calls of the 10,000 smart contracts by the nodes in the second-order transaction network sampled in S1 from the contract call history records. The contract call characteristics of each node can be expressed as The contract call feature matrix of each second-order transaction network can be expressed as Where |V| represents the number of nodes in the node set; The integration module is used to integrate network structure data and feature data and put them into the data pool; The training module is used to extract training data from the data pool to train a graph neural network for detecting phishing accounts; specifically, it includes: S3-1: Convert the second-order transaction network of all target accounts into a weighted adjacency matrix Adjs = {A1, A2, ... A n }, where n is the number of known non-phishing accounts and phishing accounts, and the i-th adjacency matrix The value at the jth row and kth column of can be expressed as: where e jk For node v j ,v k ∈V i The weight of the edge between them; S3-2: All adjacency matrices, corresponding feature matrices and labels are mapped one by one to form n data samples. Each data sample can be represented as a triple S i =(A i ,X i ,y i ), and all data samples S={S1,S2,…,S n The training set data is divided into training set and test set. The training set data aggregates account feature information through two graph convolution layers: in is the normalized adjacency matrix, Adjacency matrix after adding self-loops The diagonal matrix of the vector transformation obtained by summing the columns, D max It is also a diagonal matrix, and the diagonal position is the maximum value of the corresponding row of the adjacency matrix A. and is a trainable weight matrix, p and q are the intermediate layer dimensions, ReLU is a nonlinear activation function, and finally a maximum pooling layer is used to pool the node features into graph features, and a fully connected layer is further trained to use the features to distinguish phishing accounts from non-phishing accounts: Z = Softmax(MaxPooling(X ′ )W (2) +b) (6) Among them, MaxPooling(·) is to take the maximum value of the matrix column by column, and are the trainable weight matrix and bias matrix respectively, and Z is the probability matrix of the final prediction result; All the above trainable parameters are updated by minimizing the following objective loss function and optimizing using gradient descent: where z i is the probability that the i-th sample is detected as a phishing account; The phishing account detection module is used to extract a target account to be detected from a data pool and predict whether it is a phishing account.