A system and method for identifying related contracts based on smart contract interaction relationships
By constructing a co-occurring smart contract relationship matrix and frequent item set mining, the problem of being unable to determine the boundaries of smart contract projects in existing technologies is solved, and the deanonymization and accurate identification of smart contract addresses are achieved.
Patent Information
- Application Number
- CN202210617608.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-01
- Publication Date
- 2025-09-12
- Estimated Expiration
- 2042-06-01
AI Technical Summary
Existing technologies cannot effectively determine the boundaries of the smart contract pool of the project to which the target smart contract belongs, and cannot determine whether different smart contracts belong to the same project.
By obtaining the on-chain transaction data of the target smart contract, a co-occurring smart contract relationship matrix is constructed. By using frequent item set mining and associated address screening, other smart contract addresses that are strongly associated with the target smart contract are determined, and then the boundaries of the smart contract pool are determined.
It achieves deanonymization of smart contract addresses, determines the boundaries of smart contract pools, and improves the accuracy of identifying smart contract projects.
Smart Images

Figure CN114911585B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of regional blockchain smart contract application technology, and more specifically, to a system and method for identifying associated contracts based on smart contract interaction relationships. Background Art
[0002] Smart contracts are programs deployed within blockchain networks that can automatically execute scripted tasks. Ethereum was the first blockchain platform to support smart contracts. Due to their decentralized, tamper-proof, low-cost, and transparent nature, smart contracts have emerged in diverse application scenarios, including decentralized lending, crowdfunding, and decentralized finance. In recent years, an increasing number of traditional projects have been migrated to blockchain platforms using regional blockchain technology, resulting in numerous decentralized projects with significant funding. The decentralization and anonymity of blockchains have also led to the rapid proliferation of illegal and criminal activities such as fraud and pyramid schemes, which are increasingly concealed by decentralized smart contracts. Therefore, it is necessary to correlate smart contracts belonging to the same decentralized project on the blockchain, identifying the boundaries of the smart contract pool, particularly for unknown decentralized projects, to facilitate further analysis of their transactional data.
[0003] Currently, machine learning techniques are used to identify certain categories of smart contracts. By extracting the first- and second-order neighbors of a specific category of smart contracts, a second-order transaction behavior subgraph network of the target smart contract is constructed. Graph neural networks and graph embedding methods are then used for model training, enabling the identification of unknown smart contracts. However, these methods cannot determine whether different smart contracts belong to the same project and ignore the relationships between different smart contracts.
[0004] In summary, existing recognition systems are all based on the transaction behavior subgraph of smart contracts and modeled using relevant machine learning algorithms. While machine learning algorithms can learn information such as the target smart contract's neighbors and network structure, they cannot determine the boundaries of the project set to which the target smart contract belongs.
[0005] In view of this, this application is hereby filed. Summary of the Invention
[0006] The technical problem to be solved by this invention is that existing technologies are unable to determine the boundaries of the smart contract pool for the project to which a target smart contract belongs. The purpose is to provide a system and method for identifying related contracts based on smart contract interactions. By finding smart contracts with strong relationships with the target smart contract, the smart contract pool for the project to which the target smart contract belongs is determined, and the boundaries of the smart contract pool are then determined, thereby deanonymizing the smart contract address.
[0007] The present invention is achieved through the following technical solutions:
[0008] on the one hand,
[0009] The present invention provides a system for identifying associated contracts based on smart contract interaction relationships, comprising:
[0010] The transaction data acquisition module is used to obtain multiple on-chain transaction data corresponding to the target smart contract and obtain an on-chain transaction data set;
[0011] An address set construction module, configured to perform hash grouping on the on-chain transaction data set and construct a smart contract address set corresponding to each hash group;
[0012] A frequent itemset mining module, configured to perform frequent itemset mining on the target smart contract based on the smart contract address set and preset algorithms and rules, to obtain the frequent itemsets of the target smart contract;
[0013] A co-occurrence matrix construction module, used to construct a co-occurrence smart contract relationship matrix based on the smart contract address set;
[0014] The contract tag acquisition module is used to obtain multiple smart contract tags and obtain the smart contract tag library;
[0015] The associated address screening module is used to jointly filter the frequent itemsets according to the co-occurring smart contract relationship matrix, the smart contract tag library and a preset threshold to obtain the addresses of other smart contracts that are strongly associated with the address of the target smart contract.
[0016] Further,
[0017] The associated contract identification system further includes:
[0018] A transaction data processing module is used to parse the on-chain transaction data to obtain the parsed results of the on-chain transaction data, including: transaction hash, transaction creation time, transaction block number, transaction input address, and transaction output address;
[0019] The contract collection storage module is used to store the final project-based smart contract collection.
[0020] Further,
[0021] The transaction data acquisition module includes: a blockchain full node construction unit, which is used to build a blockchain full node.
[0022] Further,
[0023] The address set construction module includes:
[0024] A data aggregation unit, configured to aggregate on-chain transaction data according to the parsing result;
[0025] a data grouping unit, configured to group the on-chain transaction data set according to the transaction hash in the parsing result;
[0026] The address deduplication unit is used to deduplicate multiple smart contract addresses corresponding to multiple on-chain transaction data in each group;
[0027] The address removal unit is used to remove ordinary blockchain addresses to obtain the smart contract address set.
[0028] Further,
[0029] The associated address screening module includes:
[0030] A directly strongly associated address screening unit is used to screen out other smart contract addresses that are directly strongly associated with the target smart contract address;
[0031] The indirect strong association address screening unit is used to screen out other smart contract addresses that are indirectly strongly associated with the target smart contract address.
[0032] on the other hand,
[0033] The present invention also provides a method for identifying associated contracts based on smart contract interaction relationships, comprising the following steps:
[0034] Obtain multiple on-chain transaction data corresponding to the target smart contract and obtain an on-chain transaction data set;
[0035] Hash grouping the on-chain transaction data set and constructing a smart contract address set corresponding to each hash group;
[0036] Perform frequent item set mining on the target smart contract according to the smart contract address set and preset algorithms and rules to obtain the frequent item sets of the target smart contract;
[0037] Construct a co-occurring smart contract relationship matrix based on the smart contract address set;
[0038] Get multiple smart contract tags and obtain the smart contract tag library;
[0039] According to the co-occurring smart contract relationship matrix, the smart contract tag library and the preset threshold, the frequent itemsets are jointly filtered to obtain the addresses of other smart contracts that are strongly associated with the address of the target smart contract.
[0040] Further,
[0041] The associated contract identification method further includes the following steps: parsing the on-chain transaction data to obtain the parsing results of the on-chain transaction data, including: transaction hash, transaction creation time, transaction block number, transaction input address and transaction output address.
[0042] Further,
[0043] The associated contract identification method further comprises the following steps:
[0044] Build a full blockchain node;
[0045] Build a method to store preset algorithms and rules for frequent itemset mining;
[0046] The final project-based smart contract collection is stored in the database.
[0047] Further,
[0048] The method for constructing the smart contract address set includes the following steps:
[0049] Aggregating on-chain transaction data according to the analysis results;
[0050] Grouping the on-chain transaction data set according to the transaction hash in the parsing result;
[0051] De-duplicate multiple smart contract addresses corresponding to multiple on-chain transaction data in each group;
[0052] Eliminate ordinary blockchain addresses to obtain the smart contract address set.
[0053] Further,
[0054] The joint filtering includes: filtering other smart contract addresses that are directly and strongly associated with the target smart contract address, and filtering other smart contract addresses that are indirectly and strongly associated with the target smart contract address.
[0055] Compared with the prior art, the present invention has the following advantages and beneficial effects:
[0056] 1. The present invention provides a system and method for identifying associated contracts based on smart contract interactions. Starting from a target smart contract, the system obtains all on-chain transactions associated with the target smart contract, further obtains the smart contracts associated with each on-chain transaction, and obtains a co-occurring smart contract relationship matrix. Furthermore, the system obtains frequent itemsets of the target smart contract, uses the co-occurring smart contract relationship matrix, and filters out smart contract matrices that are strongly associated with the target smart contract from the frequent itemsets according to preset rules, thereby obtaining a smart contract pool for the project described by the target smart contract, and further determining the boundaries of the smart contract pool.
[0057] 2. The present invention provides a system and method for identifying associated contracts based on smart contract interactions. By determining the boundaries of a project's smart contract pool, the smart contract addresses can be deanonymized. BRIEF DESCRIPTION OF THE DRAWINGS
[0058] In order to more clearly illustrate the technical solutions of the exemplary embodiments of the present invention, the following briefly introduces the drawings required for use in the embodiments. It should be understood that the following drawings only illustrate certain embodiments of the present invention and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other relevant drawings can be obtained based on these drawings without making any creative efforts.
[0059] Figure 1 A schematic diagram of the structure of the associated contract identification system provided by an embodiment of the present invention;
[0060] Figure 2 A schematic diagram of the operation logic of the associated contract identification system provided by an embodiment of the present invention;
[0061] Figure 3 A flowchart of a method for identifying associated contracts provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0062] In order to make the objectives, technical solutions and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with examples and drawings. The exemplary embodiments of the present invention and their descriptions are only used to explain the present invention and are not intended to limit the present invention.
[0063] Example 1
[0064] Existing identification systems are all based on the transaction behavior subgraph of smart contracts and are modeled using relevant machine learning algorithms. While machine learning algorithms can learn information such as the target smart contract's neighbors and network structure, they cannot determine the boundaries of the project set to which the target smart contract belongs.
[0065] To address the shortcomings of the prior art, this embodiment provides a contract-related identification system based on smart contract interaction relationships, the system structure of which is as follows: Figure 1 As shown, the system operation logic is as follows Figure 2 As shown. The following combination Figure 1 and Figure 2 , a detailed explanation of the associated contract identification system based on the interactive relationship of smart contracts is given.
[0066] The associated contract identification system includes:
[0067] The transaction data acquisition module is used to obtain multiple on-chain transaction data corresponding to the target smart contract and obtain an on-chain transaction data set.
[0068] Due to the decentralized and anonymous nature of blockchains, it's impossible to determine the specific information and number of transactions and smart contracts associated with a decentralized project within the blockchain—in other words, it's impossible to determine the decentralized project's smart contract pool. Therefore, this embodiment first identifies a subset of smart contracts within the decentralized project as target smart contracts. Starting from these target smart contracts, all transactions associated with them are searched across the entire blockchain, establishing a first-level topological network. The transaction data acquisition module retrieves all transactions corresponding to the target smart contracts across the entire blockchain, creating an on-chain transaction data set.
[0069] After obtaining the on-chain transaction data set, the data needs to be pre-processed. The on-chain transaction data is parsed through the transaction data processing module to obtain the parsed results of the on-chain transaction data, including: transaction hash, transaction creation time, transaction block number, transaction input address and transaction output address.
[0070] It should be noted that the transaction data acquisition module searches for all transactions associated with it on the blockchain. Therefore, the transaction data acquisition module includes a blockchain full node building unit for building a blockchain full node.
[0071] Further,
[0072] The address set construction module is used to hash the on-chain transaction data set and construct a smart contract address set corresponding to each hash group.
[0073] After establishing the first-level topological network, only the on-chain transaction data set associated with the target smart contract is obtained. The target smart contract is only a part of the smart contracts associated with the decentralized project. Therefore, it is necessary to continue to find the remaining smart contracts associated with the decentralized project in the entire blockchain and establish a second-level topological network.
[0074] Because transactions in a blockchain have different attributes, some transactions in a transaction data set may share some of the same attributes. Therefore, the address set construction module first groups multiple transactions in the transaction data set according to transaction hashes, with each group containing multiple transaction data. Furthermore, since a transaction in a blockchain corresponds to one or more smart contracts, each group corresponds to a smart contract address set, further expanding the number of smart contracts associated with decentralized projects. The address set construction module then generates the smart contract address set corresponding to each group.
[0075] The specific implementation method is: according to the results of transaction data preprocessing, the transaction data is aggregated, the obtained transaction data set is grouped according to the transaction hash, and the smart contract addresses in each transaction group are deduplicated, while the ordinary blockchain addresses are removed to form a smart contract address set based on the transaction hash.
[0076] The address set construction module includes:
[0077] A data aggregation unit, configured to aggregate on-chain transaction data according to the parsing result;
[0078] a data grouping unit, configured to group the on-chain transaction data set according to the transaction hash in the parsing result;
[0079] The address deduplication unit is used to deduplicate multiple smart contract addresses corresponding to multiple on-chain transaction data in each group;
[0080] The address removal unit is used to remove ordinary blockchain addresses to obtain the smart contract address set.
[0081] Further,
[0082] The frequent itemset mining module is used to perform frequent itemset mining on the target smart contract according to the smart contract address set and preset algorithms and rules to obtain the frequent itemsets of the target smart contract.
[0083] Frequent itemsets are sets whose support is greater than or equal to the minimum support. Support refers to the frequency with which a set appears across all transactions. Mining frequent itemsets for a target smart contract is a way to identify other smart contracts associated with the target smart contract. This is a hypothesis about possible smart contracts associated with the target smart contract and can also serve as a supplement to the smart contract address set. The frequent itemsets for the target smart contract can be obtained using the frequent itemset mining module.
[0084] Specifically, based on the smart contract address set data based on transaction hash, with the smart contract address as the smallest unit item set, a preset algorithm is used to mine frequent item sets in the entire transaction data to obtain the frequent co-occurrence relationship between the target smart contract and other smart contract addresses.
[0085] It should be noted that the preset algorithms and rules are all existing frequent itemset mining technologies.
[0086] Further,
[0087] The co-occurrence matrix construction module is used to construct a co-occurrence smart contract relationship matrix based on the smart contract address set.
[0088] By building the second-layer topological network, we obtain a set of smart contract addresses corresponding to each set of on-chain transaction data. The second-layer topological network is built based on the first-layer topological network of the target smart contract. Therefore, by building the co-occurrence smart contract relationship matrix through the co-occurrence matrix construction module, we can reflect the co-occurrence relationship between the target smart contract and other smart contracts.
[0089] Further,
[0090] The contract tag acquisition module is used to obtain multiple smart contract tags through a third-party open source website (Etherscan.io) to obtain a smart contract tag library.
[0091] Further,
[0092] The associated address screening module is used to jointly filter the frequent itemsets according to the co-occurring smart contract relationship matrix, the smart contract tag library and a preset threshold to obtain the addresses of other smart contracts that are strongly associated with the address of the target smart contract.
[0093] Combining the frequent itemsets, smart contract relationship matrix and smart contract tag library output by the association rule-based mining module, filtering according to specific business rules can improve the correlation between the target smart contract and other smart contracts, ensure the correctness of the business logic of the results, and then obtain other smart contract addresses that are strongly associated with the target contract address, and finally obtain a project-based smart contract set and merge it into the library.
[0094] The above-mentioned associated contract identification system based on smart contract interaction relationships provided in this embodiment starts from the target smart contract. On the one hand, by obtaining all on-chain transactions associated with the target smart contract, further obtaining the smart contracts associated with each on-chain transaction, and obtaining a co-occurring smart contract relationship matrix; on the other hand, obtaining the frequent item sets of the target smart contract, using the co-occurring smart contract relationship matrix, according to preset rules, filter out the smart contract matrices that are strongly associated with the target smart contract from the frequent item sets, thereby obtaining the smart contract pool of the project described by the target smart contract, and then being able to determine the boundary of the smart contract pool, and realize the deanonymization of the smart contract address.
[0095] Example 2
[0096] This embodiment provides a method for identifying associated contracts based on smart contract interaction relationships, including the following steps:
[0097] Obtain multiple on-chain transaction data corresponding to the target smart contract and obtain an on-chain transaction data set;
[0098] Parsing the on-chain transaction data to obtain parsed results of the on-chain transaction data, including: transaction hash, transaction creation time, transaction block number, transaction input address, and transaction output address;
[0099] Hash grouping the on-chain transaction data set and constructing a smart contract address set corresponding to each hash group;
[0100] Perform frequent item set mining on the target smart contract according to the smart contract address set and preset algorithms and rules to obtain the frequent item sets of the target smart contract;
[0101] Construct a co-occurring smart contract relationship matrix based on the smart contract address set;
[0102] Get multiple smart contract tags and obtain the smart contract tag library;
[0103] According to the co-occurring smart contract relationship matrix, the smart contract tag library and the preset threshold, the frequent itemsets are jointly filtered to obtain the addresses of other smart contracts that are strongly associated with the address of the target smart contract.
[0104] in,
[0105] The associated contract identification method further includes the following steps:
[0106] Build a full blockchain node;
[0107] Build a method to store preset algorithms and rules for frequent itemset mining;
[0108] The final project-based smart contract collection is stored in the database.
[0109] The method for constructing a smart contract address set includes the following steps:
[0110] Aggregating on-chain transaction data according to the analysis results;
[0111] Grouping the on-chain transaction data set according to the transaction hash in the parsing result;
[0112] De-duplicate multiple smart contract addresses corresponding to multiple on-chain transaction data in each group;
[0113] Eliminate ordinary blockchain addresses to obtain the smart contract address set.
[0114] Joint filtering includes: filtering other smart contract addresses that are directly and strongly associated with the target smart contract address, and filtering other smart contract addresses that are indirectly and strongly associated with the target smart contract address.
[0115] The specific implementation methods described above further illustrate the objectives, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above description is only a specific implementation method of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.
Claims
1. A system for identifying related contracts based on smart contract interaction relationships, characterized in that: include: The transaction data acquisition module is used to obtain multiple on-chain transaction data corresponding to the target smart contract and obtain an on-chain transaction data set; An address set construction module, configured to perform hash grouping on the on-chain transaction data set and construct a smart contract address set corresponding to each hash group; A frequent itemset mining module, configured to perform frequent itemset mining on the target smart contract based on the smart contract address set and preset algorithms and rules, to obtain the frequent itemsets of the target smart contract; A co-occurrence matrix construction module, used to construct a co-occurrence smart contract relationship matrix based on the smart contract address set; The contract tag acquisition module is used to obtain multiple smart contract tags and obtain the smart contract tag library; An associated address screening module, configured to perform joint filtering on the frequent itemsets based on the co-occurring smart contract relationship matrix, the smart contract tag library, and a preset threshold, to obtain the addresses of other smart contracts that are strongly associated with the address of the target smart contract; A transaction data processing module is used to parse the on-chain transaction data to obtain the parsed results of the on-chain transaction data, including: transaction hash, transaction creation time, transaction block number, transaction input address, and transaction output address; The contract collection storage module is used to store the final project-based smart contract collection; The address set construction module includes: a data aggregation unit for aggregating on-chain transaction data according to the parsing result; a data grouping unit for grouping the on-chain transaction data set according to the transaction hash in the parsing result; an address deduplication unit for deduplicating multiple smart contract addresses corresponding to multiple on-chain transaction data in each group; and an address removal unit for removing ordinary blockchain addresses to obtain the smart contract address set. The associated address screening module includes: a direct strong associated address screening unit, used to screen out other smart contract addresses that are directly and strongly associated with the target smart contract address; and an indirect strong associated address screening unit, used to screen out other smart contract addresses that are indirectly and strongly associated with the target smart contract address.
2. A system for identifying associated contracts based on smart contract interaction relationships according to claim 1, characterized in that: The transaction data acquisition module includes: a blockchain full node construction unit, which is used to build a blockchain full node.
3. A method for identifying related contracts based on smart contract interaction relationships, characterized in that: The following steps are involved: Obtain multiple on-chain transaction data corresponding to the target smart contract and obtain an on-chain transaction data set; Hash grouping the on-chain transaction data set and constructing a smart contract address set corresponding to each hash group; Perform frequent item set mining on the target smart contract according to the smart contract address set and preset algorithms and rules to obtain the frequent item sets of the target smart contract; Construct a co-occurring smart contract relationship matrix based on the smart contract address set; Get multiple smart contract tags and obtain the smart contract tag library; Performing joint filtering on the frequent itemsets based on the co-occurring smart contract relationship matrix, the smart contract tag library, and a preset threshold to obtain addresses of other smart contracts that are strongly associated with the address of the target smart contract; Parsing the on-chain transaction data to obtain parsed results of the on-chain transaction data, including: transaction hash, transaction creation time, transaction block number, transaction input address, and transaction output address; The final project-based smart contract collection is stored in the database; The method for constructing the smart contract address set includes the following steps: aggregating on-chain transaction data according to the parsing result; grouping the on-chain transaction data set according to the transaction hash in the parsing result; deduplicating multiple smart contract addresses corresponding to multiple on-chain transaction data in each group; and removing ordinary blockchain addresses to obtain the smart contract address set; The joint filtering includes: filtering other smart contract addresses that are directly and strongly associated with the target smart contract address, and filtering other smart contract addresses that are indirectly and strongly associated with the target smart contract address.
4. A method for identifying associated contracts based on smart contract interaction relationships according to claim 3, characterized in that: The following steps are also included: Build a full blockchain node; Build a method to store preset algorithms and rules for frequent itemset mining; The final project-based smart contract collection is stored in the database.
Citation Information
Patent Citations
Blockchain consensus method and system based on association rule model training
CN111680076A