A hybrid Bitcoin deanonymization method based on Transformer-convolutional neural network
Through the Transformer-convolutional neural network hybrid network structure, the problem of insufficient timing feature capture in Bitcoin deanonymization is solved, and efficient and accurate identification of Bitcoin transaction entity is achieved, suitable for large-scale data processing and dynamic analysis.
Patent Information
- Application Number
- CN202411440985.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-16
- Publication Date
- 2025-08-22
- Estimated Expiration
- 2044-10-16
AI Technical Summary
The existing technology fails to effectively capture the timing characteristics of transactions during the Bitcoin deanonymization process, resulting in low recognition accuracy, difficulty in processing large-scale Bitcoin transaction data, and inability to accurately identify dynamic changes and stable long-term characteristics.
Using a hybrid network structure based on Transformer-convolutional neural network, we use bitcoin transaction data, build training sets and verification sets to extract timing characteristics of transactions and entities, and use position coding and convolutional neural network to capture long-term dependencies to achieve end-to-end entity recognition.
It improves the accuracy and efficiency of Bitcoin transaction recognition, can effectively process large-scale data, has good generalization ability and computing efficiency, and directly from the original data to the entity recognition results, without manual feature extraction.
Smart Images

Figure CN118965003B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of deep learning classification and recognition, and specifically to a hybrid Bitcoin deanonymization method based on the combination of Transformer-convolutional neural network. Background Art
[0002] The Bitcoin deanonymization method based on a combination of Transformer and convolutional neural networks utilizes a hybrid deep learning network architecture as a classification and recognition technology for Bitcoin deanonymization. This technology utilizes two different deep learning networks (Transformer and convolutional neural networks) to process up to 5 terabytes of Bitcoin transaction data. Through this hybrid network classification and recognition technology, users can identify the user type of each Bitcoin transaction, understanding how entities in the Bitcoin system (entities refer to users who use Bitcoin for transactions) conduct transactions and the legality of these transactions. This will help bring Bitcoin to a wider public perspective and facilitate the regulation of Bitcoin transactions.
[0003] The advantage of this technology is that it not only incorporates the raw characteristics of the transactions themselves, but also captures the long-term temporal characteristics between different transactions, thus hindering illegal users from attempting to evade regulation by changing short-term choices. Furthermore, improvements based on the Transformer-convolutional neural network model can capture the long-term dependence and adaptive learning process, making entity recognition results more accurate and convincing.
[0004] The existing technology has the following deficiencies:
[0005] Among existing Bitcoin deanonymization technologies, most rely on traditional heuristic algorithms to cluster addresses and then use machine learning to identify the entities within these clusters. However, this approach fails to consider the temporal characteristics of transactions, resulting in only a rough, short-term identification and prediction of transaction types, potentially leading to inflated algorithmic accuracy. Furthermore, current entity-based approaches based on transaction network graphs rely solely on descriptive transaction statistics and research on transaction network graphs, enabling only static and short-term analysis and failing to accurately capture the dynamic changes and long-term stability of the Bitcoin system. Furthermore, with the Bitcoin network boasting over 100 million total addresses and a significant number of addresses having participated in over 10 million transactions, constructing a transaction graph becomes increasingly difficult and unrealistic. Existing technologies are unable to effectively address these issues.
[0006] The above information disclosed in this Background section is only for enhancement of understanding of the background of the present disclosure and therefore it may contain information that does not form the prior art that is already known to a person of ordinary skill in the art. Summary of the Invention
[0007] The purpose of the present invention is to provide a hybrid Bitcoin deanonymization method based on a combination of Transformer and convolutional neural networks to solve the problems in the above-mentioned background technology.
[0008] To achieve the above objectives, the present invention provides the following technical solution: a hybrid Bitcoin deanonymization method based on a combination of Transformer and convolutional neural networks, comprising the following steps:
[0009] The analysis based on the original Bitcoin transaction data includes the following steps:
[0010] In the initial preparation phase, we crawled the original Bitcoin transaction data from relevant websites (blockchain.com and blockchair.com) and saved the data in JSON file format. The data volume was about 4TB.
[0011] Install the Bitcoin Core client (app, Bitcoin Core) and access data through the Remote Procedure Call (RPC) interface. This is done to double-verify the original transaction data to ensure the data source is secure and reliable. The data content includes Bitcoin block data and Bitcoin transaction data.
[0012] Use the Python-bitcoinrpc library to access data in Python. Then import Bitcoin block data and Bitcoin transaction data into the MongoDB database;
[0013] Extract the raw transaction data into a column-oriented (column-oriented means each transaction is a row, and different transactions are in different rows) table in a MongoDB database to facilitate further data processing;
[0014] Through the UnionFind algorithm, according to the heuristic (the heuristic condition is that all the input addresses of a Bitcoin transaction belong to the same user who uses Bitcoin to trade (hereinafter referred to as the entity), if the input addresses of two transactions overlap, it means that the input addresses of the two transactions belong to the same user, and the two transactions are made by the same person, such as Figure 3 ) Generate all addresses linked to the user, and the final result is the address list of each user's ID and all addresses owned by each user, as well as a list of transactions corresponding to these addresses.
[0015] A relatively rich training dataset and test dataset were manually constructed. The specific steps are as follows:
[0016] We crawled the entire web (walletexplore.com, blockchain.com, blockchair.com) to obtain the raw user data of the entities that have disclosed Bitcoin transactions, and saved the data in CSV file format;
[0017] Import block data of known entity types and original transaction data into the MongoDB database as a training dataset;
[0018] Visualize the training data to understand the structural distribution of the data;
[0019] Transaction data were classified according to entity type and descriptive statistics were also performed;
[0020] Feature extraction based on raw transaction data and raw user data mainly includes the temporal features of transactions and entities. The specific steps are as follows:
[0021] Use 10-fold cross validation, randomly sample and distinguish between training and validation sets;
[0022] Finally, the ratio of training set, validation set and test set determined by this method is 6:2:2;
[0023] The original transaction data and original user data are sampled according to the transaction time to form time series data;
[0024] Get basic variables representing transaction characteristics in the JSON file, such as transaction size, transaction fee, etc.
[0025] Based on the basic variables of transaction characteristics, the external variables of the transaction system and the transaction variables with time series characteristics are constructed;
[0026] Get the basic variables representing entity characteristics in the CSV file, such as the number of addresses of the entity;
[0027] Based on the basic variables of entity characteristics, the external variables of the system where the entity is located and the entity variables with time series characteristics are constructed;
[0028] Extract the features of each transaction variable and entity variable to form a feature sequence tx={f1,…,fn} with n features;
[0029] Combine tx into data TX(m*n) with time series, where m and n are the number of transactions and features respectively;
[0030] The encoding generates the corresponding category label, i represents the category, j represents the number of each category, and the format is as follows:
[0031]
[0032] Aggregate the above features to obtain the training data format;
[0033] Obtain multiple transactions and their corresponding category labels at a certain time interval, and divide the sequence length into 5, that is, all the features of 5 transactions are a set of inputs;
[0034] For missing values, we fill them with invalid cells, such as transactions 1-5, transactions 2-6, and so on. When stacking transactions, ensure that all five transactions belong to the same category; otherwise, pay attention to the number of missing cells.
[0035] The extracted transaction and entity features can be mainly divided into the following three types. The specific steps are as follows:
[0036] First, there are the statistical items of the transaction itself, which reflect the basic characteristics of the transaction;
[0037] The second is the time interval of the transaction itself, which reflects the temporal characteristics of different transactions;
[0038] Finally, the transaction time and frequency reflect the behavioral characteristics of the entity;
[0039] The improved Transformer is used to capture long-term dependencies in training data with time series features. The specific steps are as follows:
[0040] Based on the feature sequence after the above preprocessing, in the Transformer branch, dropout is first used to randomly discard some values. Then, based on the feature sequence containing time series information, each feature is encoded using positional encoding information.
[0041] In the Transformer branch, positional encoding information is used to encode each feature, thereby leveraging the advantages of the Transformer structure while preserving temporal feature information.
[0042] When encoding positions, dropout is used to randomly discard some values to reduce dependence on certain features and enhance robustness;
[0043] Based on the experimental results, multiple layers of linear decoding are added continuously to ensure that the relationship between more features can be learned while adjusting the size;
[0044] Determine the optimal parameters in the Transformer branch experiment, such as the number of iterations, learning rate, optimizer, learning rate and other indicators, and input sequence length m each time; the optimal parameters are selected based on the accuracy rate.
[0045] Convolutional neural networks are used to capture long-term dependencies in training data with time series features. The specific steps are as follows:
[0046] Bitcoin transactions are treated as special images. The algorithm initially inputs transaction features of m*n dimensions. A convolutional neural network with different convolution kernel sizes and appropriate padding is used. The ReLU activation function is also introduced to introduce nonlinear information. The algorithm focuses on learning information between Bitcoin transactions, including timing information. The channel is adjusted while ensuring that the output size is m*n.
[0047] Before the convolution operation, the data is unsqueezed to increase the dimension, and after the convolution operation, squeeze is used to reduce the dimension, and finally a feature of size m*n is obtained;
[0048] Determine optimal parameters for convolutional neural network branching experiments, such as the maximum number of channels and kernel size.
[0049] A hybrid network of Transformer-Convolutional Neural Network is used to capture long-term dependencies in training data with time series characteristics. The specific steps are as follows:
[0050] The feature fusion stage is completed by using the intermediate features of the two-layer transformer and convolutional neural network operations and the original input to perform feature addition operations;
[0051] The fused features are resized using a fully connected layer for training and prediction;
[0052] Determine the optimal parameters in the fusion experiment, such as the number of fusion layers and fusion method.
[0053] Based on the training set, the optimal parameters of the hybrid network of Transformer-Convolutional Neural Network are obtained, and then the validation set is classified and recognized. The specific steps are as follows:
[0054] Obtain the accuracy of entity recognition under the fusion model;
[0055] In the above technical solution, the technical effects and advantages provided by the present invention are:
[0056] By using a hybrid network structure of Transformer-convolutional neural network, the present invention can capture the characteristics of the transaction itself while incorporating the timing characteristics of the transaction into the model to achieve the deanonymization process of Bitcoin addresses. This deep learning-based recognition strategy can identify each new transaction, effectively improving the efficiency and accuracy of deanonymization.
[0057] This invention analyzes the original data of Bitcoin transactions, and the training data reaches the T level. The experimental results of this training based on rich data are extremely convincing. In addition, the introduction of position information in the Transformer through position encoding alleviates the problem that the Transformer itself is insensitive to the position of the transaction sequence. This improvement is naturally suitable for processing Bitcoin transaction data with time sequence.
[0058] The hybrid network structure of the present invention allows the model to process multiple sequences simultaneously, significantly improving computational efficiency. At the same time, the Transformer's self-attention mechanism and the CNN's local receptive field work together to reduce the model's overfitting to specific training data, improving the technology's predictive capabilities on unknown data. Furthermore, the hybrid network of the present invention is designed as an end-to-end model, directly outputting the final entity recognition results from raw data without the need for manual feature extraction. It also exhibits excellent generalization capabilities, enabling better generalization to the latest transaction data, significantly reducing the complexity of actual use. BRIEF DESCRIPTION OF THE DRAWINGS
[0059] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, a brief introduction to the drawings required for use in the embodiments will be given below. Obviously, the drawings described below are only some embodiments recorded in the present invention. For ordinary technicians in this field, other drawings can also be obtained based on these drawings.
[0060] Figure 1 This is the overall flow chart of the hybrid Bitcoin deanonymization method based on the combination of Transformer and convolutional neural network.
[0061] Figure 2 This is a technical details roadmap for the hybrid Bitcoin deanonymization method based on the combination of Transformer and convolutional neural networks.
[0062] Figure 3 This is pseudocode for the union-find algorithm in the hybrid Bitcoin deanonymization method based on the combination of Transformer and convolutional neural networks. DETAILED DESCRIPTION
[0063] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in many forms and should not be construed as limited to the examples set forth herein; rather, these example embodiments are provided so that the description of this disclosure will be thorough and complete and will fully convey the concepts of the example embodiments to those skilled in the art.
[0064] The present invention provides Figure 1 、 Figure 2and Figure 3 The hybrid Bitcoin deanonymization method based on the combination of Transformer and convolutional neural network includes the following steps:
[0065] The analysis of Bitcoin transaction data in the original JSON file format is based on the crawling, including the following steps:
[0066] In the initial preparation phase, we crawled the raw data of all Bitcoin transactions from 2009 to 2023 from relevant websites (blockchain.com, blochchair.com) and saved the data in JSON file format. The data volume reached about 4TB.
[0067] Further install the Bitcoin Core client (an official software specifically used for Bitcoin transactions, called Bitcoin Core), and use the programming interface of the Bitcoin Core API. Most programming languages have libraries "wrapped" in the Bitcoin Core API, which makes it easier to use. Using the python-bitcoinlib library can simplify API access. However, a running Bitcoin Core node is required for JSON-RPC calls, which means that a computer is required as a node to synchronously download all transaction data in real time. The purpose of downloading data from Bitcoin Core is to double-verify to ensure that the source of the original transaction data is safe and reliable. We access the data of the Bitcoin Core client through the remote procedure call (RPC) interface and parse the downloaded original binary file;
[0068] Import the downloaded raw transaction data into the MongoDB database and use the Python-bitcoinrpc library to access the data in the MongoDB database.
[0069] The transaction data is further extracted into a column-oriented MongoDB database table to facilitate further data processing;
[0070] Through the UnionFind algorithm, according to the heuristic condition (the heuristic condition means that all input addresses of a Bitcoin transaction belong to the same user who uses Bitcoin to trade (hereinafter referred to as the entity), if the input addresses of two transactions overlap, it means that the input addresses of the two transactions belong to the same user, and the two transactions are made by the same person, such as Figure 3) Cluster the output addresses of transactions. The specific heuristic conditions include: (1) All input addresses of a transaction are from the same user by default; (2) If the input addresses of two transactions overlap, it is assumed that all input addresses of the two addresses belong to the same user; (3) For coinbase transactions, all output addresses belong to the mining pool; (4) For the change address, if the address is no longer used as an input in transactions, it is considered to be the change address of the user;
[0071] Generate a set of all addresses linked to the user. The final result is the entity ID behind each transaction address (an entity is a user who uses Bitcoin to trade in the Bitcoin system, such as ordinary traders or exchanges) and a list of all transactions that occurred in the entity, in preparation for building a test set.
[0072] Continue to manually construct the training dataset and validation dataset. The specific steps are as follows:
[0073] We crawled raw user data from the entire web (primarily from walletexplore.com, blockchain.com, blockchair.com, and also from social networking sites like bitcointalk and twitter) for entities that have disclosed known bitcoin transactions, such as exchanges, and saved the data in CSV file format.
[0074] Import block data of known entity types and raw transaction data into the MongoDB database to prepare for building a training dataset;
[0075] Visualize the training data set as a whole to understand the basic distribution of the original data;
[0076] Transaction data were classified according to entity type and descriptive statistics were also performed;
[0077] Based on the above two sets of raw data, we extract the time series features of transactions and entities. The specific steps are as follows:
[0078] Use 10-fold cross-validation to randomly sample the dataset of labeled entities and distinguish between training set, validation set and test set;
[0079] Finally, the ratio of the training set, validation set, and test set determined by the present invention is 6:2:2;
[0080] The original user data of known entities and the original transaction data of unknown entities are sampled sequentially before and after the transaction time to form time series data;
[0081] First, obtain the basic variables representing transaction characteristics from the JSON file of the original transaction data, such as transaction size, transaction amount, transaction fee, etc. These variables can be directly obtained from the JSON file;
[0082] Based on the basic variables of transaction characteristics, the external variables of the exchange in the system and transaction variables with time series characteristics are constructed, such as the block time of the exchange, the transaction time interval, etc.
[0083] Get the basic variables representing entity characteristics in the CSV file, such as the total number of addresses of the entity, the total transaction amount of the entity, etc.
[0084] Based on the basic variables of entity characteristics, the external variables of the system where the entity is located and the entity variables with time series characteristics, such as the transaction frequency of the entity, are constructed;
[0085] Extract relevant variables of known entities to form a feature sequence tx={f1,…,fn} with n features;
[0086] Combine tx into data TX(m*n) with time series, where m and n are the number of transactions and features respectively;
[0087] The encoding generates the corresponding category label, i represents the category, j represents the number of each category, and the format is as follows:
[0088]
[0089] Aggregate the above features to obtain the training data format;
[0090] Obtain multiple transactions and their corresponding category labels at a certain time interval, and divide the sequence length into 5, that is, all the features of 5 transactions are a set of inputs;
[0091] For missing values, we fill them with invalid cells, such as transactions 1-5, transactions 2-6, and so on. When stacking transactions, ensure that all five transactions belong to the same category; otherwise, pay attention to the number of missing cells.
[0092] The extracted transaction and entity features can be mainly divided into the following three types. The specific steps are as follows:
[0093] First, there are the statistical items of the transaction itself, which reflect the basic characteristics of the transaction;
[0094] The second is the time interval of the transaction itself, which reflects the temporal characteristics of different transactions;
[0095] Finally, the transaction time and frequency reflect the behavioral characteristics of the entity;
[0096] Improve Transformer to capture long-term dependencies in training data with time series features. The specific steps are as follows:
[0097] In the improved Transformer branch, positional encoding information is used to encode each feature of the input data, leveraging the advantages of the Transformer structure while maintaining temporal feature information;
[0098] During position encoding, dropout is first used to randomly discard some transactions. Multiple dropouts can be performed to reduce reliance on certain features. During each training session, certain neurons are randomly stopped from participating in the calculation, thus forming multiple groups of network models to enhance robustness.
[0099] Continuously add multiple linear layers for decoding, and feed the output of the top decoder into a linear layer (generating a logit vector) and a log softmax layer. The logit vector is converted into a probability through the log softmax function. This operation ensures that more relationships between features can be learned while adjusting the size.
[0100] Based on the experimental results, the optimal parameters in the Transformer branch experiment were determined. After multiple analyses, the optimal parameters of the hi experiment were selected as follows: the number of iterations was 40, the learning rate Lr was 0.001, the optimizer used the Adam algorithm, the learning rate was updated using the LambdaLR method, and the input sequence length was 5 each time.
[0101] Convolutional neural networks are used to capture long-term dependencies in training data with time series features. The specific steps are as follows:
[0102] Bitcoin transactions are treated as special images. The algorithm initially inputs 5*15 dimensional transaction features. Initial learning is performed using a convolutional neural network with a 2*1 convolution kernel, a hidden node number of c=nhid / 2, and appropriate padding. Subsequently, the convolution kernel is adjusted to (2, 1) and c=nhid, (1, 1) and c=nhid, (2, 1) and c=nhid / 2, and (2, 1) and c=1. The ReLU activation function is used after the first and third layers to increase nonlinear information, focusing on learning Bitcoin transaction information itself and the timing information between transactions. The channel is adjusted while ensuring the output size is 5*15.
[0103] Before the convolution operation, the original input data is unsqueezed to increase the dimension. After the dimension expansion, it becomes 50*5*15. After the convolution operation, the dimension is squeezed to reduce the dimension. Finally, the feature size of 5*15 is obtained.
[0104] Finally, based on the experimental results, the optimal parameters in the convolutional neural network branch experiment were determined. The maximum number of channels was 100, and the convolution kernel sizes were (2, 1), (2, 1), (1, 1), (2, 1), and (2, 1).
[0105] A hybrid network of Transformer-Convolutional Neural Network is used to capture long-term dependencies in training data with time series characteristics. The specific steps are as follows:
[0106] Because features at different levels contain different information, deep features carry more abstract information, while shallow features contain more original structural information. Fusion of features from different levels enriches learned feature information and reduces errors. Furthermore, similar to residual structures, fusing shallow features can also prevent gradient loss. This invention uniquely uses two layers of transformers, intermediate features from convolutional neural network operations, and the original input to perform feature addition operations, completing the feature fusion stage.
[0107] The fused features are resized using a fully connected layer for training and prediction;
[0108] Determine the parameters in the fusion experiment, the number of fusion layers is 2, and the fusion method is concat, mainly to ensure that while fusing features from different stages, the learned features can be richer and more accurate;
[0109] Based on the training set, the optimal parameters of the hybrid network of Transformer-Convolutional Neural Network are obtained, and then the validation set is classified and identified. The specific steps are as follows:
[0110] Obtain the accuracy of entity recognition under the fusion model;
[0111] By using a hybrid network structure of Transformer-convolutional neural network, the present invention can capture the characteristics of the transaction itself while incorporating the timing characteristics of the transaction into the model to achieve the deanonymization process of Bitcoin addresses. This deep learning-based recognition strategy can identify each new transaction, effectively improving the efficiency and accuracy of deanonymization.
[0112] This invention analyzes the original data of Bitcoin transactions, and the training data reaches the T level. The experimental results of this training based on rich data are extremely convincing. In addition, the introduction of position information in the Transformer through position encoding alleviates the problem that the Transformer itself is insensitive to the position of the transaction sequence. This improvement is naturally suitable for processing Bitcoin transaction data with time sequence.
[0113] The hybrid network structure of the present invention allows the model to process multiple sequences simultaneously, significantly improving computational efficiency. At the same time, the Transformer's self-attention mechanism and the CNN's local receptive field work together to reduce the model's overfitting to specific training data, improving the technology's predictive capabilities on unknown data. Furthermore, the hybrid network of the present invention is designed as an end-to-end model, directly outputting the final entity recognition results from raw data without the need for manual feature extraction. It also exhibits excellent generalization capabilities, enabling better generalization to the latest transaction data, significantly reducing the complexity of actual use.
[0114] The above description is merely a specific embodiment of the present application, but the scope of protection of the present application is not limited thereto. Any changes or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in this application should be included in the scope of protection of this application. Therefore, the scope of protection of this application should be based on the scope of protection of the claims.
[0115] The above description is merely illustrative of certain exemplary embodiments of the present invention. It goes without saying that those skilled in the art will be able to modify the described embodiments in various ways without departing from the spirit and scope of the present invention. Therefore, the above drawings and description are illustrative in nature and should not be construed as limiting the scope of protection of the claims.
Claims
1. A hybrid Bitcoin deanonymization method based on a combination of Transformer and convolutional neural networks, characterized by: The steps include: Perform data analysis based on publicly accessible Bitcoin transactions that have occurred and are disclosed on public websites, including collecting and extracting features from raw Bitcoin transaction data and raw Bitcoin user data; And construct training data sets and test data sets to improve the existing Transformer network and convolutional neural network and obtain the optimal parameters, thereby fusing a hybrid network combining Transformer and convolutional neural network; Bitcoin raw transaction data collection and feature extraction involves obtaining Bitcoin raw transaction data and using the Union-Find algorithm to obtain a list of all addresses of each user who transacts with Bitcoin. This is then randomly sampled in the order of transaction time to form a time series data with a sequential order. The collection and feature extraction of Bitcoin original user data includes obtaining original user data that has been marked with categories of users who use Bitcoin for transactions, constructing system variables that reflect the characteristics of the Bitcoin system in which users who use Bitcoin for transactions are located, and variables between user transactions with time series characteristics; Constructing a training dataset and a test dataset includes constructing a training dataset, a test dataset, and a validation dataset in proportion based on the features of Bitcoin original transaction data and Bitcoin original user data; Improving existing Transformer networks and convolutional neural networks and obtaining optimal parameters includes using data preprocessing to obtain optimal parameters; The hybrid network obtained by fusion of Transformer-convolutional neural network includes determining the optimal parameters of fusion based on the optimal parameters obtained by improving the existing Transformer network and convolutional neural network.
2. The hybrid Bitcoin deanonymization method based on the combination of Transformer and convolutional neural network according to claim 1 is characterized in that: The analysis based on the original Bitcoin transaction data includes the following steps: In the initial preparation stage, crawl the original Bitcoin transaction data and save the data in JSON file format; Access the original Bitcoin transaction data through the remote call interface. The command instruction is bitcoin-cli. The file is saved in the out format. The original Bitcoin transaction data is double-verified and supplemented. Import the original Bitcoin transaction data into the MongoDB database, extract the original Bitcoin transaction data into a column-oriented table in the MongoDB database, and use the Python-bitcoinrpc library to access the data; Based on the original Bitcoin transaction data, the Union-Find algorithm is used to generate a list of all input addresses linked to users who use Bitcoin for transactions according to heuristic conditions, and finally a list of all addresses containing every user who uses Bitcoin for transactions is obtained.
3. The hybrid Bitcoin deanonymization method based on the combination of Transformer and convolutional neural network according to claim 2 is characterized in that: Manually construct the training dataset and test dataset. The specific steps are as follows: Crawl raw user data marked with Bitcoin transaction categories and save it in CSV file format; Import the original user data of users who have been labeled as using Bitcoin for transactions into the MongoDB database and extract it into a column-oriented table as a training dataset. Visualize the training dataset using a fan-shaped diagram, introduce the numpy library, and call the matplotlib function; The original user data was classified according to the types of users who used Bitcoin for transactions, and descriptive statistics were performed to count the number of users in each category who used Bitcoin for transactions; According to the hash value in the Bitcoin transaction, the original user data and original transaction data with the same hash value are supplemented and improved; Based on the improved original user data, K-fold cross validation is used to randomly sample the improved original user data and distinguish between training sets, validation sets and test sets.
4. The hybrid Bitcoin deanonymization method based on the combination of Transformer and convolutional neural network according to claim 3 is characterized in that: Based on the original transaction data and original user data, the time series features of all Bitcoin transactions and users who use Bitcoin for transactions are extracted. The specific steps are as follows: The original transaction data and original user data are randomly sampled in the order of transaction time to form a time series data with a chronological order; Obtain the variables representing transaction characteristics in the original Bitcoin transaction data by using the variable names in the JSON file; Based on the variables in the obtained Bitcoin raw transaction data, we construct system variables between different transactions and those that reflect the characteristics of the entire Bitcoin system, as well as variables between transactions with time series characteristics. Obtain variables representing the characteristics of users who use Bitcoin for transactions in the original user data; Based on the variables obtained from the original user data, we continue to construct system variables that can reflect the characteristics of the Bitcoin system in which users who use Bitcoin for transactions are located, and variables between user transactions with time series characteristics; Extract the features of the original transaction data and original user data of each user who uses Bitcoin to trade, forming a feature sequence tx={f1,…,fn} with n features; Combine tx into a data matrix with time series: TX(m*n), where m and n are the number of transactions and features respectively; Use sklearn's LabelEncoder function to encode the above features, generate corresponding category labels, aggregate the above features, and obtain the feature format of the training dataset as the input of the classification network; Multiple transactions and their corresponding category labels are obtained at regular intervals. The input sequence length of the classification network is divided into arbitrary fixed lengths n. All features of Bitcoin transactions of any fixed length n are used as a set of valid inputs. The format of the valid inputs is to stack transactions one by one. The stacked transactions are in the following format: 1---m, 2---m+1, 3---m+2. In the case of missing features, invalid units are used to fill them; To address the problem of unbalanced classification of original user data, when superimposing transactions, ensure that m transactions belong to the same category. Otherwise, pay attention to the number of invalid units to be filled.
5. The hybrid Bitcoin deanonymization method based on the combination of Transformer and convolutional neural network according to claim 4 is characterized in that: The features of the extracted raw transaction data and raw user data are mainly divided into the following three types. The specific steps are as follows: First, for each Bitcoin transaction itself, the variables of Bitcoin transaction characteristics in the original transaction data; Secondly, for each Bitcoin transaction, the time interval between different transactions of users who use Bitcoin to trade in the original transaction data reflects the temporal characteristics of different Bitcoin transactions; Finally, regarding the time and frequency of Bitcoin transactions, the original user data reflects the behavioral characteristics of users who use Bitcoin for transactions.
6. The hybrid Bitcoin deanonymization method based on the combination of Transformer and convolutional neural network according to claim 5, characterized in that: Improve the existing Transformer network. The specific steps are as follows: Based on the feature sequence after the above preprocessing, in the Transformer branch, dropout is first used to randomly discard some values. Then, based on the feature sequence containing time series information, each feature is encoded using positional encoding information. Based on the encoded information, multiple layers of initial transformers are stacked for training according to the experimental results; According to the experimental results, multiple consecutive linear layers are added for decoding; Based on the experimental results, the optimal parameters in the Transformer branch experiment are determined. The evaluation criteria are that the parameters corresponding to the highest accuracy are the optimal.
7. The hybrid Bitcoin deanonymization method based on the combination of Transformer and convolutional neural network according to claim 6, characterized in that: Improve the existing convolutional neural network. The specific steps are as follows: Treating each Bitcoin transaction input as a special image, the convolutional neural network first inputs an m*n dimensional Bitcoin transaction feature matrix. Using convolutional neural networks with different convolution kernel sizes and appropriate padding, the data is unsqueezed before the convolution operation to increase the dimensionality, and squeezed after the convolution operation to reduce the dimensionality, ultimately obtaining m*n sized features. At the same time, the improved convolutional neural network needs to cross-superimpose multiple activation functions to introduce nonlinear information, and finally apply the logsoftmax activation function to obtain the label classification with the maximum probability; Based on the experimental results, the optimal parameters in the convolutional neural network branch experiment are determined. The evaluation criterion is that the corresponding parameters with the highest accuracy are the optimal.
8. The hybrid Bitcoin deanonymization method based on the combination of Transformer and convolutional neural network according to claim 7, characterized in that: Under the premise of knowing their respective optimal parameters, the Transformer-convolutional neural network is fused to form a new hybrid network. The specific steps are as follows: In the Transformer network, multiple layers of traditional Transformer network structures are used for stacked learning and continuous linear layers are used for stacked information transmission. In the convolutional neural network, the convolution kernel and hidden layer nodes are modified multiple times, and the ReLU activation function is applied at intervals during the process of dimensionality increase and decrease. The intermediate features obtained from the branch experiment and the original input are added, and a specific fusion method is selected to complete the feature fusion stage. The fused features are resized using a fully connected layer for training and prediction; Based on the experimental results, determine the optimal number of fusion layers and fusion methods in the fusion experiment; Based on the optimal parameters in the fusion experiment, classification training is performed on the training dataset and applied to the validation set and test set.
Citation Information
Patent Citations
Tracing method and device for bitcoin transaction
CN114841685A
Tor illegal user deanonymization method based on Bitcoin transaction analysis
CN115170130A