Method, apparatus, device and readable storage medium for tracking cryptocurrency transactions
By finding and constructing a point-edge directed graph of cryptocurrency transaction chain data in the database, the problem of how to effectively study cryptocurrency transaction data is solved, and intuitive representation of transaction flow and mining of hidden information is realized, thereby cracking down on illegal and criminal activities.
Patent Information
- Application Number
- CN202010531513.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-06-11
- Publication Date
- 2025-06-20
- Estimated Expiration
- 2040-06-11
AI Technical Summary
How to provide an effective way to study cryptocurrency transaction data to combat illegal and criminal activities.
By obtaining the transaction chain search conditions, searching for target transaction chain data in the preset database, and building a point-edge directed graph for visual output, intuitively representing the flow direction of transactions in the transaction chain data, which is convenient for user analysis.
It realizes effective tracking and analysis of cryptocurrency transaction chain data, helps to mine hidden information behind transactions, and thus cracks down on illegal and criminal activities.
Smart Images

Figure CN111680194B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of cryptocurrency, and in particular, to a method, device, equipment and readable storage medium for tracking cryptocurrency transactions. Background Art
[0002] A cryptocurrency is a trading medium that uses cryptographic principles to ensure transaction security and control the creation of trading units. For example, Bitcoin, which has become the most important cryptocurrency in recent years. The blockchain technology generated by cryptocurrencies is currently being used for the management of bank transactions, from which we can see the importance of cryptocurrencies, and digital currencies have become the future development direction. Compared with other electronic currencies, cryptocurrencies have anonymity. All detailed records of transactions are stored in a public ledger, with addresses representing the senders and receivers of transactions, and public keys are used to confirm transactions. Although the transaction records are public, it is impossible to confirm the people behind the transactions. The anonymity of cryptocurrencies has found wide applications in the business field, but it has also raised people's concerns. The anonymity of transactions will also bring a sense of insecurity, and some lawbreakers may take advantage of this to carry out financial criminal activities. By researching and analyzing the transaction data of cryptocurrencies, some rules can be summarized to discover unique transaction patterns, thereby hopefully cracking down on illegal and criminal currencies, or solving other practical problems based on the useful hidden information obtained from the analysis. Therefore, due to reasons such as cracking down on illegal and criminal activities using cryptocurrencies, how to provide an effective way to facilitate the research of cryptocurrency transaction data has become an urgent problem to be solved. Summary of the Invention
[0003] The main purpose of the present invention is to provide a method, equipment, system and readable storage medium for tracking cryptocurrency transactions, aiming to solve the problem of how to provide an effective way to facilitate the research of cryptocurrency transaction data.
[0004] To achieve the above object, the present invention provides a method for tracking cryptocurrency transactions, the method comprising the following steps:
[0005] Obtain a transaction chain search condition, and find target transaction chain data in a preset database based on the transaction chain search condition, wherein the preset database records transaction data based on cryptocurrencies;
[0006] Construct a point-edge directed graph according to the target transaction chain data, and visually output the point-edge directed graph.
[0007] Optionally, the transaction chain search condition includes a target level number and a target index number, and the step of finding target transaction chain data in a preset database based on the transaction chain search condition includes:
[0008] Search in the preset database to obtain the first transaction data corresponding to the target index number;
[0009] Based on the first transaction data, perform a loop search in the preset database to obtain the target transaction chain data within the target level number.
[0010] Optionally, the step of performing a loop search in the preset database based on the first transaction data to obtain the target transaction chain data within the target level number includes:
[0011] Detect whether the current loop count reaches the target level number;
[0012] If the loop count reaches the target level number, use each piece of transaction data found currently as the target transaction chain data;
[0013] If the loop count does not reach the target level number, extract the target transaction output address from the first transaction data, search in the preset database to obtain the second transaction data with the target transaction output address as the transaction input address, increment the loop count by one, use the second transaction data as the new first transaction data, and then execute the step: detect whether the loop count reaches the target level number.
[0014] Optionally, the step of constructing a point-edge directed graph according to the target transaction chain data and visually outputting the point-edge directed graph includes:
[0015] Construct transaction nodes corresponding to each piece of transaction data in the target transaction chain data, and construct address nodes corresponding to the transaction output addresses in each piece of transaction data;
[0016] Construct directed edges pointing from transaction nodes to address nodes according to the correspondence between transaction data and transaction output addresses, and construct directed edges pointing from address nodes to transaction nodes according to the correspondence between using the transaction output address as the transaction input address and transaction data, so as to obtain a point-edge directed graph at least including transaction nodes, address nodes, and directed edges.
[0017] Optionally, after the step of constructing a point-edge directed graph according to the target transaction chain data and visually outputting the point-edge directed graph, it further includes:
[0018] Visually output each piece of transaction data in the target transaction chain data in tabular form;
[0019] When a viewing instruction triggered for the target transaction data in the table is detected, highlight the target transaction data and the transaction nodes in the point-edge directed graph corresponding to the target transaction data, or, when a viewing instruction triggered for the target transaction node in the point-edge directed graph is detected, highlight the target transaction node and the transaction data in the table corresponding to the target transaction node.
[0020] Optionally, the nodes in the point-edge directed graph include transaction nodes and address nodes. When visually outputting the point-edge directed graph, the view marking content corresponding to the transaction nodes includes the transaction timestamp, and the view marking content corresponding to the address nodes includes the address abbreviation corresponding to the address nodes.
[0021] After the step of constructing a point-edge directed graph according to the target transaction chain data and visually outputting the point-edge directed graph, it further includes:
[0022] When a viewing instruction for a target address node is detected, obtain the detailed address information of the target address node from the target transaction chain data, and visually output the detailed address information in the form of a tooltip.
[0023] When a viewing instruction for a target transaction node is detected, obtain the detailed transaction information of the target transaction node from the target transaction chain data, and visually output the detailed transaction information in the form of a tooltip.
[0024] Optionally, before the step of obtaining the transaction chain search condition and searching for the target transaction chain data in the preset database based on the transaction chain search condition, it further includes:
[0025] Synchronize the transaction data of each transaction based on the cryptocurrency from the preset cryptocurrency record nodes.
[0026] Construct a database table corresponding to each of the transaction data, where the database table at least includes the index number of the transaction, the transaction input address, and the transaction output address.
[0027] Add each of the database tables to the preset database.
[0028] To achieve the above object, the present invention provides a cryptocurrency transaction tracking device, and the device includes:
[0029] A search module, configured to obtain a transaction chain search condition, and search for target transaction chain data in a preset database based on the transaction chain search condition, where the preset database records transaction data based on the cryptocurrency.
[0030] An output module, configured to construct a point-edge directed graph according to the target transaction chain data, and visually output the point-edge directed graph.
[0031] To achieve the above objectives, the present invention also provides a cryptocurrency transaction tracking device, which includes: a memory, a processor, and a cryptocurrency transaction tracking program stored in the memory and executable on the processor, wherein the cryptocurrency transaction tracking program implements the steps of the cryptocurrency transaction tracking method described above when executed by the processor.
[0032] In addition, to achieve the above-mentioned purpose, the present invention also proposes a computer-readable storage medium, on which a cryptocurrency transaction tracking program is stored. When the cryptocurrency transaction tracking program is executed by a processor, the steps of the cryptocurrency transaction tracking method described above are implemented.
[0033] In the present invention, by tracking and searching in the database based on the transaction chain search condition, the transaction chain data that meets the transaction chain search condition is obtained, so that the user can track the entire transaction chain where the transaction data of interest is located; and by constructing the transaction chain data as a point-edge directed graph and then visually outputting it, the flow of transactions in the transaction chain data is intuitively represented, which is convenient for users to effectively analyze the tracked transaction chain data to explore the hidden information behind the transaction, and then combat illegal and criminal activities. Therefore, the present invention provides an effective way to study cryptocurrency transaction data. BRIEF DESCRIPTION OF THE DRAWINGS
[0034] Figure 1 A schematic diagram of the structure of the hardware operating environment involved in the embodiment of the present invention;
[0035] Figure 2 This is a flow chart of a first embodiment of a cryptocurrency transaction tracking method of the present invention;
[0036] Figure 3 This is a visualization example 1 of a point-edge directed graph involved in various embodiments of the present invention;
[0037] Figure 4 This is a second example of visualization of a point-edge directed graph involved in various embodiments of the present invention;
[0038] Figure 5 This is a functional schematic module diagram of a preferred embodiment of the cryptocurrency transaction tracking device of the present invention.
[0039] The realization of the purpose, functional features and advantages of the present invention will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0040] It should be understood that the specific embodiments described herein are only used to explain the present invention, and are not used to limit the present invention.
[0041] likeFigure 1 As shown Figure 1 It is a schematic diagram of the device structure of the hardware operating environment involved in the embodiment of the present invention.
[0042] It should be noted that the cryptocurrency transaction tracking device in the embodiment of the present invention can be devices such as a smart phone, a personal computer, and a server, and specific limitations are not made here.
[0043] As Figure 1 shown, the cryptocurrency transaction tracking device may include: a processor 1001, such as a CPU, a network interface 1004, a user interface 1003, a memory 1005, and a communication bus 1002. Among them, the communication bus 1002 is used to realize the connection communication between these components. The user interface 1003 may include a display screen (Display) and an input unit such as a keyboard (Keyboard). Optionally, the user interface 1003 may further include a standard wired interface and a wireless interface. The network interface 1004 may optionally include a standard wired interface and a wireless interface (such as a WI-FI interface). The memory 1005 may be a high-speed RAM memory or a stable memory (non-volatile memory), such as a disk memory. Optionally, the memory 1005 may also be a storage device independent of the aforementioned processor 1001.
[0044] Those skilled in the art can understand that Figure 1 the device structure shown in
[0045] does not constitute a limitation on the cryptocurrency transaction tracking device, and may include more or fewer components than shown in the figure, or combine certain components, or have different component arrangements. Figure 1 As shown, the memory 1005 as a computer storage medium may include an operating system, a network communication module, a user interface module, and a cryptocurrency transaction tracking program. Among them, the operating system is a program for managing and controlling the hardware and software resources of the device, and supports the operation of the cryptocurrency transaction tracking program and other software or programs. In Figure 1 the device shown, the user interface 1003 is mainly used for data communication with the client; the network interface 1004 is mainly used to establish a communication connection with the server; the processor 1001 may be used to call the cryptocurrency transaction tracking program stored in the memory 1005 and perform the following operations:
[0046] Obtain a transaction chain search condition, and find target transaction chain data in a preset database based on the transaction chain search condition, where the preset database records transaction data based on cryptocurrencies;
[0047] Construct a point-edge directed graph according to the target transaction chain data and visually output the point-edge directed graph.
[0048] Further, the transaction chain search conditions include a target level number and a target index number, and the step of finding target transaction chain data in a preset database based on the transaction chain search conditions includes:
[0049] Finding first transaction data corresponding to the target index number in the preset database;
[0050] Performing a loop search in the preset database based on the first transaction data to obtain target transaction chain data within the target level number.
[0051] Further, the step of performing a loop search in the preset database based on the first transaction data to obtain target transaction chain data within the target level number includes:
[0052] Detecting whether the current loop count reaches the target level number;
[0053] If the loop count reaches the target level number, using each piece of transaction data currently found as target transaction chain data;
[0054] If the loop count does not reach the target level number, extracting a target transaction output address from the first transaction data, finding second transaction data with the target transaction output address as a transaction input address in the preset database, incrementing the loop count by one, using the second transaction data as the new first transaction data, and then performing the step: detecting whether the loop count reaches the target level number.
[0055] Further, the step of constructing a point-edge directed graph according to the target transaction chain data and visually outputting the point-edge directed graph includes:
[0056] Constructing transaction nodes corresponding to each piece of transaction data in the target transaction chain data, and constructing address nodes corresponding to transaction output addresses in each piece of transaction data;
[0057] Constructing a directed edge pointing from a transaction node to an address node according to the correspondence between transaction data and a transaction output address, and constructing a directed edge pointing from an address node to a transaction node according to the correspondence between using the transaction output address as a transaction input address and transaction data, so as to obtain a point-edge directed graph at least including transaction nodes, address nodes, and directed edges.
[0058] Further, after the step of constructing a point-edge directed graph according to the target transaction chain data and visually outputting the point-edge directed graph, the processor 1001 can be used to call the cryptocurrency transaction tracking program stored in the memory 1005 and further perform the following operations:
[0059] Visualize and output each transaction data in the target transaction chain data in tabular form;
[0060] When a viewing instruction triggered for target transaction data in the table is detected, highlight the target transaction data and the transaction nodes in the point-edge directed graph corresponding to the target transaction data, or, when a viewing instruction triggered for a target transaction node in the point-edge directed graph is detected, highlight the target transaction node and the transaction data in the table corresponding to the target transaction node.
[0061] Further, the nodes in the point-edge directed graph include transaction nodes and address nodes. When visualizing and outputting the point-edge directed graph, the view marking content corresponding to the transaction nodes includes the transaction timestamp, and the view marking content corresponding to the address nodes includes the address abbreviation corresponding to the address nodes.
[0062] After the step of constructing a point-edge directed graph according to the target transaction chain data and visualizing and outputting the point-edge directed graph, the processor 1001 can be used to call the cryptocurrency transaction tracking program stored in the memory 1005 and further perform the following operations:
[0063] When a viewing instruction for a target address node is detected, obtain the detailed address information of the target address node from the target transaction chain data and visualize and output the detailed address information in the form of a tooltip;
[0064] When a viewing instruction for a target transaction node is detected, obtain the detailed transaction information of the target transaction node from the target transaction chain data and visualize and output the detailed transaction information in the form of a tooltip.
[0065] Further, before the step of obtaining a transaction chain search condition and searching for target transaction chain data in a preset database based on the transaction chain search condition, the processor 1001 can be used to call the cryptocurrency transaction tracking program stored in the memory 1005 and further perform the following operations:
[0066] Synchronize the transaction data of each transaction based on the cryptocurrency from preset cryptocurrency record nodes;
[0067] Construct database tables corresponding to each of the transaction data, where the database tables at least include the index number of the transaction, the transaction input address, and the transaction output address;
[0068] Add each of the database tables to the preset database.
[0069] Based on the above structure, various embodiments of a cryptocurrency transaction tracking method are proposed.
[0070] Reference Figure 2 , Figure 2 is a schematic flowchart of the first embodiment of the cryptocurrency transaction tracking method of the present invention. It should be noted that although the logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than here. The execution subject of each embodiment of the cryptocurrency transaction tracking method of the present invention can be devices such as smart phones, personal computers, and servers. For the convenience of description, the execution subject is omitted in the following embodiments. In this embodiment, the cryptocurrency transaction tracking method includes:
[0071] Step S10, obtain the transaction chain search condition, and find the target transaction chain data in the preset database based on the transaction chain search condition, where the preset database records transaction data based on cryptocurrencies;
[0072] In this embodiment, to provide an effective way to facilitate the research of cryptocurrency transaction data, a cryptocurrency transaction tracking method is proposed. Specifically, the characteristic of cryptocurrency is anonymity, and the person behind the transaction is unknown, but the transaction records of cryptocurrency are all public. Cryptocurrency record nodes, such as Bitcoin nodes in the Bitcoin network, record all the transaction data of cryptocurrencies. The transaction data records the transfer data from address to address, specifically including information such as the transaction time, transaction index number, IP address for transaction propagation, transaction input address, transaction output address, and transaction amount. Among them, according to different specific cryptocurrencies, the transaction index numbers are different. For example, it can be the hash value of the transaction, which is used to uniquely mark a transaction; the transaction input address is the address of the party that transfers the currency, and the transaction output address is the address of the party that receives the currency.
[0073] Each transaction data can be stored in a preset database in advance. Among them, the database can use common databases, which are not limited here. By storing the data in the database, the search speed of the transaction data can be improved, thereby improving the tracking efficiency of the transaction data.
[0074] An interactive interface for users to input transaction chain search conditions can be set up. In the interactive interface, an input box or a checkbox for inputting transaction chain search conditions can be set. When users need to perform trace analysis on transaction data, they can input transaction chain search conditions in the interactive interface for the transactions or addresses they are interested in. Among them, the transaction chain search conditions can be a combination of multiple conditions. For example, it can be a combination of a transaction index number and a transaction level number, or a combination of an address and a transaction level number. It can also be, on the basis of the first two combinations, plus a transaction amount limit and / or a transaction time limit, and so on. The transaction level number refers to the number of levels of the transaction chain that the user wants to view. The definition of the level can be that starting from a transaction, this transaction is the first level. When the output address of this transaction is used as the input address, the initiated transaction is the second level. When the output address of the second-level transaction is used as the input address, the initiated transaction is the third level, and so on. It can be understood that the above level definition refers to the levels downstream of the currency flow. Then, the search conditions can also include the number of levels pointing upstream of the currency flow, that is, it can be set in the transaction chain search conditions whether it is the number of transaction levels pointing upstream or downstream.
[0075] Based on the transaction chain search conditions input by the user, target transaction chain data is found in the database. Specifically, according to the transaction chain search conditions, the transaction data can be indexed in the database based on the index number, the downstream transaction data can be found based on the output address of the transaction data, and the upstream transaction data can be found based on the input address of the transaction data. According to these rules, multiple transaction data that meet the transaction chain search conditions are found, and these multiple transaction data are used as the target transaction chain data.
[0076] For example, when the transaction chain search conditions are address 1, 2 levels pointing downstream, the transaction time from 2018 to the present, and the transaction amount is greater than 500 currencies: all transaction data with address 1 as the input address are found in the database. From all the transaction data, the transaction data with a transaction time after 2018 and a transaction amount greater than 500 currencies are selected as the first-level transaction data. For each output address of each first-level transaction data, all transaction data with this output address as the input address are found in the database. From the transaction data, the transaction data with a transaction time after 2018 and a transaction amount greater than 500 currencies are selected as the second-level transaction data. The first-level transaction data and the second-level transaction data are used as the target transaction chain data.
[0077] Step S20: Construct a point-edge directed graph according to the target transaction chain data, and visually output the point-edge directed graph.
[0078] Construct a point-edge directed graph based on the target transaction chain data. Specifically, the transaction chain contains relationships such as address pointing to address, address pointing to transaction, transaction pointing to address, and transaction pointing to transaction. Therefore, in this embodiment, the point-edge directed graph can be a graph that only contains address nodes and directed edges from address node to address node, or a graph that only contains transaction nodes and directed edges from transaction node to transaction node, or a graph that contains address nodes, transaction nodes, directed edges from address node to transaction node, and directed edges from transaction node to address node. Specifically, these three types of point-edge directed graphs can be constructed simultaneously and visually output, or options for the user to select can be set, and the corresponding point-edge directed graph can be output according to the options checked by the user.
[0079] Specifically, when the first type of point-edge directed graph needs to be constructed, address nodes corresponding to the transaction input address and transaction output address of each transaction in the target transaction chain can be constructed, and the same address is constructed as one address node; for the two address nodes corresponding to each transaction data, a directed edge from the address node corresponding to the transaction input address to the address node of the transaction output address is constructed, and finally, a point-edge directed graph composed of address nodes and directed edges is obtained. And the point-edge directed graph is visually output.
[0080] When the point-edge directed graph is visually output, the nodes and directed edges can be marked through view marking content. For example, the view marking content of the address node can include the full name or abbreviation of the address node, and the view marking content of the directed edge between address nodes can include the transaction number, transaction amount, or transaction time of the transaction represented by the directed edge, etc. According to the different research needs of users for transaction data, the view marking content can be different. Further, options for the user to set the view marking content can be set, and then when the point-edge directed graph is visually output, the view marking content checked by the user is displayed. Specifically, in the output view, the nodes can be represented by circular frames. If there are two types of nodes, address nodes and transaction nodes, different circular frames can be used to represent them, and the directed edges can be represented by straight arrows; the view marking content of the nodes can be displayed inside the circular frame of the node. For example, the address node can be represented by a circular frame, and the directed edge can be represented by a straight arrow; the view marking content of the address node can be displayed inside the circular frame representing the address node; the view marking content of the directed edge can be displayed beside the straight arrow representing the directed edge.
[0081] In this embodiment, by performing trace search in a database based on the transaction chain search conditions, transaction chain data that meets the transaction chain search conditions is obtained, enabling the user to trace the entire transaction chain where the transaction data of interest is located. And by constructing the transaction chain data into a directed graph of points and edges and then visualizing and outputting it, the flow direction of transactions in the transaction chain data is intuitively represented, facilitating the user to effectively analyze the traced transaction chain data to uncover hidden information behind the transactions, and further cracking down on illegal and criminal activities. Therefore, this embodiment provides an effective way conducive to researching cryptocurrency transaction data.
[0082] Further, based on the above first embodiment, a second embodiment of the cryptocurrency transaction tracing method of the present invention is proposed. In this embodiment, the step of finding the target transaction chain data in the preset database based on the transaction chain search conditions in step 10 includes:
[0083] Step S101, find the first transaction data corresponding to the target index number in the preset database;
[0084] Further, in this embodiment, when the transaction chain search conditions include the target level number and the target index number, the first transaction data corresponding to the target index number can be found in the preset database. Specifically, each piece of transaction data in the preset database corresponds to a unique index number. The target index number is matched with the index numbers of each piece of transaction data in the database, and the transaction data with a matching result is used as the first transaction data. According to the definition of the level number, this first transaction data can be regarded as the transaction data of the first layer.
[0085] Step S102, perform a loop search in the preset database based on the first transaction data to obtain the target transaction chain data within the target level number.
[0086] Perform a loop search in the preset database based on the first transaction data to obtain the target transaction chain data within the target level number. Specifically, the downstream transaction data can be found according to the output address of the transaction data, and the upstream transaction data can be found based on the input address of the transaction data. According to this rule, a loop search is performed in the preset database to obtain the transaction data within the target level number, and all the obtained transaction data is used as the target transaction chain data.
[0087] Further, the target level number may refer to the level number upstream, that is, the user wants to view the transaction data upstream of the transaction data with the target index number, or the target level number may refer to the level number downstream, that is, the user wants to view the transaction data downstream of the transaction data with the target index number.
[0088] When the target level number refers to the level number upstream, it is possible to detect whether the current loop count reaches the target level number after the first transaction data is found. Herein, the loop count can be initialized to 1 in advance. If the loop count reaches the target level number, that is, is equal to the target level number, then each piece of transaction data currently found is used as the target transaction chain data. Otherwise, the target transaction input address is extracted from the first transaction data, that is, the transaction input address in the first transaction data is used as the target transaction input address. The third transaction data with the target transaction input address as the transaction output address is found in the preset database. This third transaction data can be regarded as the second-layer transaction data upstream. At this time, the loop count is incremented by 1, and the third transaction data is used as the new first transaction data, and then the steps of detecting whether the loop count reaches the target level number and subsequent steps are looped. That is, when the loop count has not reached the target level number, based on the currently found transaction data, the next layer of transaction data is found, and the loop count is incremented by 1. In this way, the loop continues until the loop count reaches the target level number, that is, the target transaction chain data within the target level number upstream is obtained.
[0089] It should be noted that a piece of transaction data may include multiple transaction input addresses. That is, a piece of transaction data may contain records of multiple addresses transferring funds to multiple addresses. Then, when finding the next layer of transaction data, the starting points may include multiple addresses. At this time, it is necessary to find the next layer of transaction data corresponding to each address before the loop count can be incremented by 1.
[0090] Further, the step S102 includes:
[0091] Step S1021, detecting whether the current loop count reaches the target level number;
[0092] When the target level number refers to the level number downstream, it is possible to detect whether the current loop count reaches the target level number after the first transaction data is found. Herein, the loop count can be initialized to 1 in advance.
[0093] Step S1022, if the loop count reaches the target level number, then each piece of transaction data currently found is used as the target transaction chain data;
[0094] If the loop count reaches the target level number, that is, is equal to the target level number, then each piece of transaction data currently found is used as the target transaction chain data.
[0095] Step S1023: If the number of loops has not reached the target level number, extract the target transaction output address from the first transaction data, find the second transaction data with the target transaction output address as the transaction input address in the preset database, increment the number of loops by one, use the second transaction data as the new first transaction data, and then execute the step: Detect whether the number of loops has reached the target level number.
[0096] If the number of loops has not reached the target level number, that is, when it is less than the target level number, the target transaction output address can be extracted from the first transaction data, that is, the transaction output address in the first transaction data is used as the target transaction output address; find the second transaction data with this target transaction output address as the transaction input address in the preset database. This second transaction data can be regarded as the second-layer transaction data downstream; at this time, increment the number of loops by one, use the second transaction data as the new first transaction data, and then loop to execute the steps of detecting whether the number of loops has reached the target level number and subsequent steps. That is, when the number of loops has not reached the target level number, based on the currently found transaction data, find the transaction data of the next layer and increment the number of loops by one. In this way, loop until the number of loops reaches the target level number, that is, the target transaction chain data within the target level number downstream is obtained.
[0097] It should be noted that a transaction data may include multiple transaction output addresses, that is, a transaction data may contain records of multiple addresses transferring money to multiple addresses; then, when looking for the transaction data of the next layer, the starting points may include multiple addresses. At this time, it is necessary to find the transaction data of the next layer corresponding to each address before the number of loops can be incremented by one.
[0098] In this embodiment, by setting a target index number and a target level number as search conditions, the entire transaction chain data within the target level number starting from the transaction data corresponding to the target index number is cyclically queried in the database, realizing the tracking of the entire transaction chain based on a single transaction data, and visualizing and outputting the found target transaction chain data in the form of a point-edge directed graph, enabling the user to intuitively understand the position of the transaction data of interest in the entire transaction chain, thus facilitating the user to analyze the hidden information behind the transaction data, and further solving practical real-world problems based on the hidden information, such as cracking down on illegal money laundering activities based on the discovered money laundering clues.
[0099] Further, based on the above first and / or second embodiments, a third embodiment of the method for tracking cryptocurrency transactions according to the present invention is proposed. In this embodiment, the step of constructing a point-edge directed graph according to the target transaction chain data in step S20 includes:
[0100] Step S201: Construct transaction nodes corresponding to each transaction data in the target transaction chain data, and construct address nodes corresponding to the transaction output addresses in each transaction data;
[0101] Further, in this embodiment, a point-edge directed graph including address nodes, transaction nodes, directed edges from address nodes to transaction nodes, and directed edges from transaction nodes to address nodes can be constructed.
[0102] Specifically, after obtaining the target transaction chain data, transaction nodes corresponding to each transaction data in the target transaction chain data can be constructed, that is, one transaction node is constructed for each transaction data. Then, address nodes corresponding to the transaction output addresses in each transaction data are constructed, that is, for each transaction output address in each transaction data, one address node is constructed. It should be noted that there may be cases where the transaction output addresses in different transaction data are the same. For the same transaction output address, only one address node is constructed to represent the same address.
[0103] Step S202: Construct directed edges from transaction nodes to address nodes according to the correspondence between transaction data and transaction output addresses, and construct directed edges from address nodes to transaction nodes according to the correspondence between the transaction output addresses used as transaction input addresses and transaction data, so as to obtain a point-edge directed graph including at least transaction nodes, address nodes, and directed edges.
[0104] After constructing the transaction nodes and address nodes, directed edges from transaction nodes to address nodes can be constructed according to the correspondence between transaction data and transaction output addresses, that is, for the transaction nodes corresponding to the transaction data, directed edges from each of these transaction nodes to the address nodes corresponding to the respective transaction output addresses in the transaction data are constructed respectively. For example, for the transaction node 11 corresponding to transaction data 1, the transaction data 11 contains three transaction output addresses a, b, and c, and the three transaction output addresses correspond to address nodes A, B, and C respectively. Then three directed edges are constructed, namely: the directed edge from transaction node 11 to address node A, the directed edge from transaction node 11 to address node B, and the directed edge from transaction node 21 to address node C.
[0105] According to the correspondence relationship between the transaction output address in the transaction data and the transaction data when the transaction output address is used as the transaction input address, a directed edge pointing from the address node to the transaction node is constructed. That is, for each transaction output address in each transaction data, find the transaction data in the target transaction chain data with this transaction output address as the transaction input address, and construct a directed edge from the address node corresponding to this transaction output address to the transaction node corresponding to this transaction data. For example, for the transaction output address a, corresponding to the address node A, find three transaction data 1, 2, and 3 in the target transaction chain with the transaction output address a as the transaction input address. The three transaction data respectively correspond to the transaction nodes 11, 22, and 33. Then, three directed edges are constructed, namely: the directed edge from the address node A to the transaction node 11, the directed edge from the address node A to the transaction node 22, and the directed edge from the address node A to the transaction node 33.
[0106] After constructing all the nodes and directed edges, a point-edge directed graph is obtained.
[0107] In this embodiment, by constructing a point-edge directed graph including address nodes, transaction nodes, directed edges pointing from address nodes to transaction nodes, and directed edges pointing from transaction nodes to address nodes according to the target transaction chain data, and visually outputting the point-edge directed graph, users can intuitively know the relationships between addresses and transactions, addresses and addresses, and transactions and transactions on the transaction chain where the transaction data of interest is located, so that they can more clearly and conveniently see the flow of transactions, which is more conducive to users to dig out the hidden information behind the transaction data.
[0108] Further, after step S20, it further includes:
[0109] Step S30, visually output each transaction data in the target transaction chain data in tabular form;
[0110] After outputting the point-edge directed graph, each transaction data in the target transaction chain data can be further visually output in tabular form. Specifically, one transaction data can be used as one row, and each column is a specific data item, such as transaction time, transaction index number, transaction input address, transaction output address, transaction amount, etc. It can also include the level where the transaction data is located. It can be understood that each transaction data in the table corresponds to a transaction node in the point-edge directed graph. The transaction data contains more complete information about each transaction. Outputting in tabular form enables users to, while analyzing the flow of transactions based on the point-edge directed graph, more clearly understand the detailed information in the transaction flow by referring to the transaction data in the table.
[0111] Step S40: When a viewing instruction for the target transaction data in the table is detected, highlight the target transaction data and the transaction nodes in the point-edge directed graph corresponding to the target transaction data; or when a viewing instruction for the target transaction node in the point-edge directed graph is detected, highlight the target transaction node and the transaction data in the table corresponding to the target transaction node.
[0112] After visually outputting the transaction data table, it is possible to detect a viewing instruction for the transaction data in the table or a viewing instruction for the transaction nodes in the point-edge directed graph. Specifically, in the visual user interface, the user can operate on the displayed transaction data table and the point-edge directed graph in the interface to trigger a viewing instruction for the transaction data in the table or a viewing instruction for the transaction nodes in the point-edge directed graph. For example, when the mouse moves to the area where the transaction data is located in the interface or when the area is selected, a viewing instruction for the transaction data is triggered; when the mouse moves to the area where the transaction node is located in the interface or when the area is selected, a viewing instruction for the transaction node is triggered.
[0113] When a viewing instruction for the target transaction data in the table is detected, the target transaction data in the table can be highlighted, and at the same time, the transaction nodes in the point-edge directed graph corresponding to the target transaction data can be highlighted. Or, when a viewing instruction for the target transaction node in the point-edge directed graph is detected, the target transaction node in the point-edge directed graph can be highlighted, and at the same time, the transaction data in the table corresponding to the target transaction node can be highlighted. The highlighting method can be to display the area where the target transaction data and the transaction node are located in a highlighted color, or other highlighting methods, which are not limited here.
[0114] Through the highlighting, the user can intuitively see the corresponding relationship between each transaction node in the point-edge directed graph and each transaction data in the table, thus making it more convenient for the user to analyze the data of the transaction chain by comparing the point-edge directed graph and the table.
[0115] Further, in an embodiment, after the step S20, it further includes:
[0116] Step S50: When a viewing instruction for the target address node is detected, obtain the detailed address information of the target address node from the target transaction chain data and visually output the detailed address information in the form of a prompt box;
[0117] Specifically, the nodes in the point-edge directed graph may include transaction nodes and address nodes. When visualizing and outputting the point-edge directed graph, the view marker content corresponding to the transaction nodes may include the transaction timestamp, and the view marker content corresponding to the address nodes may include the abbreviated address corresponding to the address node. Specifically, the view corresponding to the transaction node may be a circular box, and the transaction timestamp may be displayed within the circular box to mark the transaction node. Among them, the transaction timestamp may include the specific time of the transaction. For example, the transaction timestamp of a transaction node is "07 / 21 17:22:47, 2", indicating that the transaction of this node occurred at 17:22:47 on July 21st, and this node is at level 2. In addition, the size of the circular box of the transaction node can be set according to the amount. The larger the amount, the larger the circular box, so as to facilitate users to intuitively understand the amounts of each transaction and is more conducive to users to lock in large-value transactions. The view corresponding to the address node may also be a circular box, but the circular box of the address node may be different from that of the transaction node for distinction. The abbreviated address corresponding to the address node may be displayed within the circular box of the address node to mark the address node. Similarly, the size of the address node can also be related to the amount of the transaction address corresponding to the address node. The larger the amount, the larger the circular box of the address node, and the smaller the amount, the smaller the circular box of the address node, so as to facilitate users to intuitively understand the amounts owned by each transaction address and is more conducive to users to lock in large-value transaction addresses.
[0118] For example, when the target level number is 3, the target transaction chain data is retrieved from the database according to the target index number, and a point-edge directed graph as shown in Figure 3 is constructed and visually output. In the figure, the black circular nodes are transaction nodes, and the corresponding transaction timestamps are displayed above the transaction nodes. The white circular boxes are address nodes, and the corresponding abbreviated addresses are displayed within the address nodes.
[0119] Based on the visually output point-edge directed graph, viewing instructions for each node in the point-edge directed graph can be detected. Specifically, in the visual user interface, the user can operate on the point-edge directed graph displayed in the interface to trigger viewing instructions for each node in the point-edge directed graph. For example, when the mouse moves to the area where the transaction data is located in the interface, a viewing instruction for the transaction data is triggered. When the mouse moves to the area where the transaction node is located in the interface, a viewing instruction for the transaction node is triggered.
[0120] When a viewing instruction for the target address node is detected, the detailed address information of the target address node can be obtained from the target transaction chain data and visually output in the form of a tooltip. Among them, the detailed address information may include the full address of the address, the quantity of transactions, and the connected transaction levels. The tooltip can be next to the view of the target address node.
[0121] Such asFigure 4 As shown, the detailed information of the address node is displayed in a tooltip above the address node.
[0122] Step S60: When a viewing instruction for a target transaction node is detected, obtain the detailed transaction information of the target transaction node from the target transaction chain data, and visually output the detailed transaction information in the form of a tooltip.
[0123] When a viewing instruction for a target transaction node is detected, the detailed transaction information of the target transaction node can be obtained from the target transaction chain data, and the detailed transaction information can be visually output in the form of a tooltip. Among them, the detailed transaction information may include the transaction occurrence time corresponding to the target transaction node, the index number (hash value), and the propagation IP address of the transaction, and may also include the transaction level where the transaction node is located, etc. The tooltip can be beside the view of the target transaction node.
[0124] As Figure 4 shown, the detailed information of the transaction node is displayed in a tooltip above the transaction node.
[0125] By obtaining the detailed information of the node when a viewing instruction for a node in the point-edge directed graph is detected, and visually outputting the detailed information in the form of a tooltip, the user can conveniently obtain the detailed information of each node in the transaction chain when analyzing the transaction flow based on the point-edge directed graph, which is more conducive to the user to dig out useful hidden information.
[0126] Further, before step S10, it further includes:
[0127] Step S70: Synchronize the transaction data of each transaction based on cryptocurrency from a preset cryptocurrency record node;
[0128] The transaction data of each transaction based on cryptocurrency can be synchronized from a preset cryptocurrency record node. Among them, the preset cryptocurrency record node can be a working node participating in recording cryptocurrency, such as a Bitcoin node. The updated transaction data in the cryptocurrency record node will be synchronized to the database in real time or at regular intervals. The database can use a MySQL database, and MySQL is an open-source relational database.
[0129] Step S80: Construct a database table corresponding to each of the transaction data, where the database table at least includes the index number of the transaction, the transaction input address, and the transaction output address;
[0130] Step S90: Add each of the database tables to the preset database.
[0131] Construct database tables corresponding to each piece of transaction data. Among them, the database tables at least include the index number of the transaction, the transaction input address, and the transaction output address. It is also possible to use the entire transaction data as a database table, so that the final visualized output dot-edge directed graph or transaction data table contains more detailed information, which is more conducive to users to mine information from the transaction data. After constructing the database tables corresponding to each piece of transaction data, add the database tables to a preset database.
[0132] To improve the speed of searching for transaction chain data in the database according to transaction chain search conditions, the database tables can be divided into block tables, transaction tables, and input / output tables. Among them, the block table contains the block number, the time when the block is generated, the transaction fee, the number of transactions, and the hash value of the transaction. The block number is the unique number of the block on the blockchain that records the transaction data. The block generation time is the time when the block is generated. The transaction fee is the fee paid for this transaction. The hash value of the transaction is the hash value of each transaction data contained in the block, that is, the index number of each transaction data. A transaction table includes the transaction occurrence time, index number (hash value), and the propagation IP address of the transaction of a piece of transaction data, and also includes a pointer to the input table and a pointer to the output table. The input table at least contains a transaction address and a transaction amount, indicating the cryptocurrency transferred from this transaction address for this transaction amount. The output table at least contains a transaction address and a transaction amount, indicating that this transaction address receives the cryptocurrency for this transaction amount.
[0133] When searching the database according to transaction chain search conditions, if the conditions include a transaction time limit, the block table can be searched first. According to the block generation time on the block table, select the block tables within the transaction time limit, and search for the transaction data with the target index number from the selected block tables. Compared with searching for the transaction data with the target index number from all transaction data, the search range can be limited to the transaction data corresponding to a small number of block tables, greatly reducing the search range and improving the search speed.
[0134] When searching for transaction data with a target address as the transaction output address based on the target address, the output table can be searched first to find all output tables containing the target address, and the corresponding transaction data can be found according to the corresponding relationship between the output table and the transaction table. Compared with directly searching all transaction data, the data volume of the output table is small and the search speed is faster, thus being able to improve the search speed.
[0135] In addition, an embodiment of the present invention also proposes a cryptocurrency transaction tracking device. Refer to Figure 5 , the device includes:
[0136] Search module 10, configured to obtain a transaction chain search condition, and search for target transaction chain data in a preset database based on the transaction chain search condition, where the preset database records transaction data based on cryptocurrencies;
[0137] Output module 20, configured to construct a point-edge directed graph according to the target transaction chain data and visually output the point-edge directed graph.
[0138] Further, the transaction chain search condition includes a target level number and a target index number, and the search module 10 includes:
[0139] The first search unit is configured to search for first transaction data corresponding to the target index number in the preset database;
[0140] The second search unit is configured to perform a loop search in the preset database based on the first transaction data to obtain the target transaction chain data within the target level number.
[0141] Further, the second search unit includes:
[0142] The detection subunit is configured to detect whether the current loop count reaches the target level number;
[0143] The determination subunit is configured to, if the loop count reaches the target level number, use each piece of transaction data found currently as the target transaction chain data;
[0144] The loop subunit is configured to, if the loop count does not reach the target level number, extract a target transaction output address from the first transaction data, search for second transaction data with the target transaction output address as the transaction input address in the preset database, increment the loop count by one, use the second transaction data as the new first transaction data, and then execute the step: detect whether the loop count reaches the target level number.
[0145] Further, the output module 20 includes:
[0146] The first construction unit is configured to construct transaction nodes corresponding to each piece of transaction data in the target transaction chain data and construct address nodes corresponding to the transaction output addresses in each piece of transaction data;
[0147] The second construction unit is configured to construct directed edges from the transaction nodes to the address nodes according to the correspondence between the transaction data and the transaction output addresses, and construct directed edges from the address nodes to the transaction nodes according to the correspondence between the transaction output addresses as the transaction input addresses and the transaction data, so as to obtain a point-edge directed graph including at least transaction nodes, address nodes, and directed edges.
[0148] Further, the output module 20 is further configured to visually output each transaction data in the target transaction chain data in a tabular manner;
[0149] The apparatus further includes:
[0150] A highlighting marking module, configured to, when detecting a viewing instruction triggered for target transaction data in the table, highlight the target transaction data and the transaction nodes in the point-edge directed graph corresponding to the target transaction data, or, when detecting a viewing instruction triggered for a target transaction node in the point-edge directed graph, highlight the target transaction node and the transaction data in the table corresponding to the target transaction node.
[0151] Further, the nodes in the point-edge directed graph include transaction nodes and address nodes. When visually outputting the point-edge directed graph, the view marking content corresponding to the transaction nodes includes the transaction timestamp, and the view marking content corresponding to the address nodes includes the address abbreviation corresponding to the address nodes.
[0152] The output module 20 is further configured to:
[0153] When detecting a viewing instruction for a target address node, obtain the detailed address information of the target address node from the target transaction chain data, and visually output the detailed address information in a tooltip form;
[0154] When detecting a viewing instruction for a target transaction node, obtain the detailed transaction information of the target transaction node from the target transaction chain data, and visually output the detailed transaction information in a tooltip form.
[0155] Further, the apparatus further includes:
[0156] A data synchronization module, configured to synchronize the transaction data of each transaction based on cryptocurrency from a preset cryptocurrency record node;
[0157] A construction module, configured to construct a database table corresponding to each of the transaction data, where the database table at least includes an index number of the transaction, a transaction input address, and a transaction output address;
[0158] An adding module, configured to add each of the database tables to the preset database.
[0159] The extended content of the specific implementation manner of the cryptocurrency transaction tracking apparatus of the present invention is basically the same as that of each embodiment of the above cryptocurrency transaction tracking method, and will not be elaborated herein.
[0160] In addition, an embodiment of the present invention further provides a computer-readable storage medium, on which a cryptocurrency transaction tracking program is stored. When the cryptocurrency transaction tracking program is executed by a processor, the steps of the cryptocurrency transaction tracking method described below are implemented.
[0161] For each embodiment of the cryptocurrency transaction tracking device and the computer-readable storage medium of the present invention, reference may be made to each embodiment of the cryptocurrency transaction tracking method of the present invention, which will not be elaborated herein.
[0162] It should be noted that in this article, the term "including", "comprising" or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements not only includes those elements, but also includes other elements not expressly listed, or further includes elements inherent to such process, method, article or device. Without further limitation, an element defined by the statement "including a..." does not exclude the existence of additional identical elements in the process, method, article or device including the element.
[0163] The serial numbers of the above embodiments of the present invention are only for description and do not represent the superiority or inferiority of the embodiments.
[0164] Through the description of the above embodiments, those skilled in the art can clearly understand that the above embodiment methods can be implemented by means of software plus a necessary general hardware platform. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. The computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions for causing a terminal device (which may be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to execute the methods described in the embodiments of the present invention.
[0165] The above are only the preferred embodiments of the present invention, and do not limit the patent scope of the present invention accordingly. Any equivalent structure or equivalent process transformation made by using the specification and drawings of the present invention, or directly or indirectly applied in other related technical fields, shall be equally included in the patent protection scope of the present invention.
Claims
1. A method for tracking cryptocurrency transactions, characterized in that, The method includes the following steps: Obtain a transaction chain search condition, and find target transaction chain data in a preset database based on the transaction chain search condition, where the preset database records transaction data based on cryptocurrencies; Construct a point-edge directed graph according to the target transaction chain data, and visually output the point-edge directed graph; The transaction chain search condition includes a target level number and a target index number, and the step of finding target transaction chain data in the preset database based on the transaction chain search condition includes: Find first transaction data corresponding to the target index number in the preset database; Based on the first transaction data, perform a loop search in the preset database to obtain target transaction chain data within the target level number; The step of performing a loop search in the preset database based on the first transaction data to obtain target transaction chain data within the target level number includes: Detect whether the current loop count reaches the target level number; If the loop count reaches the target level number, use each piece of transaction data found currently as the target transaction chain data; If the loop count does not reach the target level number, extract a target transaction output address from the first transaction data, find second transaction data in the preset database with the target transaction output address as the transaction input address, increment the loop count by one, use the second transaction data as the new first transaction data, and then execute the step: detect whether the loop count reaches the target level number; The step of constructing a point-edge directed graph according to the target transaction chain data and visually outputting the point-edge directed graph includes: Construct transaction nodes corresponding to each piece of transaction data in the target transaction chain data, and construct address nodes corresponding to the transaction output addresses in each piece of transaction data; Construct a directed edge pointing from the transaction node to the address node according to the correspondence between the transaction data and the transaction output address, and construct a directed edge pointing from the address node to the transaction node according to the correspondence between the transaction output address used as the transaction input address and the transaction data, so as to obtain a point-edge directed graph including at least transaction nodes, address nodes and directed edges.
2. The method for tracking cryptocurrency transactions according to claim 1, characterized in that, After the step of constructing a point-edge directed graph according to the target transaction chain data and visually outputting the point-edge directed graph, it further includes: Visually output each piece of transaction data in the target transaction chain data in a table; When a viewing instruction triggered by target transaction data in the table is detected, highlight the target transaction data and the transaction nodes in the point-edge directed graph corresponding to the target transaction data, or, When a viewing instruction triggered by a target transaction node in the point-edge directed graph is detected, highlight the target transaction node and the transaction data in the table corresponding to the target transaction node.
3. The method for tracking cryptocurrency transactions according to claim 1, characterized in that, The nodes in the point-edge directed graph include transaction nodes and address nodes. When visualizing and outputting the point-edge directed graph, the view marking content corresponding to the transaction nodes includes the transaction timestamp, and the view marking content corresponding to the address nodes includes the abbreviated address corresponding to the address nodes. After the step of constructing the point-edge directed graph according to the target transaction chain data and visualizing and outputting the point-edge directed graph, the following steps are further included: When a viewing instruction for a target address node is detected, obtain the detailed address information of the target address node from the target transaction chain data, and visually output the detailed address information in the form of a tooltip. When a viewing instruction for a target transaction node is detected, obtain the detailed transaction information of the target transaction node from the target transaction chain data, and visually output the detailed transaction information in the form of a tooltip.
4. The method for tracking cryptocurrency transactions according to any one of claims 1 to 3, characterized in that, Before the step of obtaining the transaction chain search condition and searching for the target transaction chain data in the preset database based on the transaction chain search condition, the following steps are further included: Synchronize the transaction data of each transaction based on the cryptocurrency from the preset cryptocurrency record nodes. Construct database tables corresponding to the respective transaction data, where the database tables at least include the index number of the transaction, the transaction input address, and the transaction output address. Add each of the database tables to the preset database.
5. A device for tracking cryptocurrency transactions, characterized in that, The device includes: A search module for obtaining a transaction chain search condition and searching for target transaction chain data in a preset database based on the transaction chain search condition, where the preset database records transaction data based on cryptocurrency. An output module for constructing a point-edge directed graph according to the target transaction chain data and visually outputting the point-edge directed graph. The transaction chain search condition includes a target level number and a target index number, and the search module includes: A first search unit for searching for first transaction data corresponding to the target index number in the preset database. A second search unit for performing a loop search in the preset database based on the first transaction data to obtain the target transaction chain data within the target level number. The second search unit includes: A detection subunit for detecting whether the current loop count reaches the target level number. A determination subunit for, if the loop count reaches the target level number, taking the respective transaction data found currently as the target transaction chain data. A loop subunit for, if the loop count does not reach the target level number, extracting the target transaction output address from the first transaction data, searching for second transaction data with the target transaction output address as the transaction input address in the preset database, incrementing the loop count by one, taking the second transaction data as the new first transaction data, and then executing the step of detecting whether the loop count reaches the target level number. The output module includes: A first construction unit for constructing transaction nodes corresponding to the respective transaction data in the target transaction chain data and constructing address nodes corresponding to the transaction output addresses in the respective transaction data. A second construction unit is configured to construct a directed edge from a transaction node to an address node according to the correspondence between transaction data and a transaction output address, and construct a directed edge from the address node to the transaction node according to the correspondence between the transaction output address as a transaction input address and the transaction data, so as to obtain a point-edge directed graph including at least the transaction node, the address node, and the directed edge.
6. A cryptocurrency trading tracking device, characterized in that, The cryptocurrency transaction tracking device includes: a memory, a processor, and a cryptocurrency transaction tracking program stored on the memory and executable on the processor. When the cryptocurrency transaction tracking program is executed by the processor, the steps of the cryptocurrency transaction tracking method according to any one of claims 1 to 4 are implemented.
7. A computer-readable storage medium, characterized in that, A cryptocurrency transaction tracking program is stored on the computer-readable storage medium. When the cryptocurrency transaction tracking program is executed by a processor, the steps of the cryptocurrency transaction tracking method according to any one of claims 1 to 4 are implemented.
Citation Information
Patent Citations
Suspicious fund link detection method and device
CN111127024A