Search

US-12626253-B2 - Method for extracting and parsing bitcoin transaction autonomy information

US12626253B2US 12626253 B2US12626253 B2US 12626253B2US-12626253-B2

Abstract

A method for extracting and parsing Bitcoin transaction autonomy information comprises data extraction, transaction autonomy information extraction, feature extraction, information decoding, information cleaning, information fusion, and data table construction. The method has the following beneficial effects. 1. Universality: This method is applicable to mainstream blockchain systems such as Ethereum, EOS, Polkadot, and Fabric through analysis of the current architecture of blockchain technology. 2. Effectiveness: Taking the relationship between emotional tendency of transaction autonomy information and price changes as an example, a generated dataset shows good performance in monitoring online public opinions. 3. Progressiveness: This method for extracting and parsing Bitcoin transaction autonomy information is helpful for implementing public opinion monitoring in blockchain systems, enhancing cybersecurity, and improving the level of information analysis.

Inventors

  • Jinsong Wang
  • Zening ZHAO
  • KAI SHI

Assignees

  • TIANJIN UNIVERSITY OF TECHNOLOGY

Dates

Publication Date
20260512
Application Date
20230721
Priority Date
20220725

Claims (3)

  1. 1 . A method for extracting and parsing Bitcoin transaction autonomy information, includes the following steps in sequence: (1) building a Bitcoin client and synchronizing original block stream data to a local area, then parsing and structuring the original block stream data to obtain Bitcoin structured data, and then obtaining an output script of each transaction from the Bitcoin structured data; (2) verifying a validity of the transaction output script by using a transaction script verification algorithm Algorithm test , and returning transaction autonomy information Tx information in response to determining failure to verify the validity of the transaction output script; and executing remaining steps, wherein the transaction autonomy information Tx information corresponds to online public opinion information; and wherein obtaining the transaction autonomy information Tx information using the transaction script verification algorithm Algorithm test comprises: ( 201 ) converting the transaction output script Tx script out from a string format to a binary byte stream Scirpt bytearray ; ( 202 ) initializing an empty stack data structure; ( 203 ) reading a byte from the binary byte stream Scirpt bytearray ; and deleting the byte from the binary byte stream Scirpt bytearray ; ( 204 ) converting the byte into a Bitcoin operation code Op code; ( 205 ) putting the Bitcoin operation code OP code into a stack; ( 206 ) acquiring a stack top Bitcoin operation code OP code, and operating the stack according to the stack top Bitcoin operation code Op code; ( 207 ) in response to the stack top Bitcoin operation code Op code has subsequent input parameters, reading a corresponding number of bytes Bytes from the binary byte stream Scirpt bytearray ; ( 208 ) putting the number of bytes Bytes into the stack; ( 209 ) repeating ( 203 ) to ( 208 ) until the binary byte stream Scirpt bytearray is empty; and ( 210 ) verifying a stack top element; in response to the top stack element is a Boolean type True, determining that the transaction output script verification succeeds; in response to the top stack element is a Boolean type False, determining that the transaction output script verification fails; and in response to the top stack element is not a Boolean type, determining that it is the extracted transaction autonomy information Tx information , which will still be preserved on the blockchain, wherein corresponding unspent coins will be transferred to miners; (3) extracting blockchain features from the transaction autonomy information Tx information , and then constructing a transaction autonomy information data table by using the transaction autonomy information and the blockchain features; (4) sequentially reading the transaction autonomy information Tx in formation from the transaction autonomy information data table, and decoding the transaction autonomy information Tx information by using a transaction autonomy information decoding algorithm Algorithm code_recognition to obtain decoded information Information decode , and then inserting the decoded information Information decode into the transaction autonomy information data table as features; (5) cleaning the decoded information Information decode by feature extraction and identification, marking decodable signs Sign decode of the decoded information Information decode which is successfully decoded as 1, and decodable signs Sign decode of other decoded information as 0, and inserting the decodable signs Sign decode into the transaction autonomy information data table as features; (6) determining a fusion possibility of successfully decoded transaction autonomy information Information decode by using an information fusion algorithm Algorithm address_association based on transaction address association analysis, and fusing fusible transaction autonomy information Information decode to form fused information Information related ; and (7) extracting an information ID info id before fusion from the fused information Information related, and constructing a transaction autonomy information fusion information data table, wherein monitoring the online public opinion information on a blockchain is achieved.
  2. 2 . The method for extracting and parsing Bitcoin transaction autonomy information of claim 1 , wherein the step (1) of, building the Bitcoin client and synchronizing the original block stream data to the local area; then parsing and structuring the original block stream data to obtain the Bitcoin structured data; and then obtaining the output script of each transaction from the Bitcoin structured data, specifically comprises: building a Bitcoin client Bitcoin Core, and synchronizing original block stream data Dt to the local area; parsing and structuring the original block stream data Dt to obtain Bitcoin structured data St, wherein the original block stream data Dt represent all block data of the Bitcoin system up to time t, and the Bitcoin structured data St are obtained by processing the block data before time t, including block size BTC_Block size and transaction list Tx_List; then, searching the transaction list Tx_List in the bitcoin structured data St to output a script field in array Outputs; and finally obtaining an output script of each transaction Tx script out .
  3. 3 . The method for extracting and parsing Bitcoin transaction autonomy information of claim 1 , wherein the step (3) of, extracting blockchain features from the transaction autonomy information Tx information , and then constructing a transaction autonomy information data table by using the transaction autonomy information and the blockchain features, specifically comprises: extracting blockchain features from the transaction autonomy information Tx information : ID Block id , block hash Block hash , transaction version Block version , block height Block number , block generation time Block timestamp , transaction hash Block this_txhash , input script transaction hash Block input_txhash , input value Block input_value , input address Block input_address , miner's fee Block fee , output script Block output_script_asm , ASCII script Block output_script_asc and decoded output script Block output_script_decode , and then constructing the transaction autonomy information data table by using the transaction autonomy information and the blockchain features.

Description

CROSS-REFERENCE TO RELATED APPLICATION This application is a 371 of international application of PCT application serial no. PCT/CN2023/108600, filed on Jul. 21, 2023, which claims the priority benefit of China application no. 202210878845.5, filed on Jul. 25, 2022. The entirety of each of the above-mentioned patent application is hereby incorporated by reference herein and made a part of this specification. TECHNICAL FIELD The invention belongs to the technical field of blockchain data mining, and particularly relates to a method for extracting and parsing Bitcoin transaction autonomy information. BACKGROUND ART With the development of blockchain technology, public chains are frequently exploited for illicit financial activities due to their decentralized nature and challenging regulation. Conventional blockchain monitoring techniques primarily center on tracking transactions through methods like address clustering and graphical methods, placing greater emphasis on transaction behavior relationships between users, while overlooking abnormal information in individual transactions. In blockchain systems, users can add autonomous transaction information in addition to conducting transactions, which may contain any type of content, including online public opinion information. However, there is currently no effective method to extract and parse such information. There are several traditional blockchain monitoring techniques. (1) Address clustering-based blockchain monitoring method: Bitcoin adopts the UTXO model, allowing a single tangible user to have multiple transaction addresses in the network. As for address clustering for tangible users, identifying which addresses belong to the same entity from abnormal transaction records is a critical issue.(2) Graph matching-based blockchain monitoring method: Two abnormal transaction behaviors, namely candy airdrop and greedy capital injection, are used as typical representatives, and rules for assessing these two behaviors are designed accordingly.(3) Complex network-based blockchain monitoring method: Complex network analysis techniques are used to study the Bitcoin transaction network, particularly the effective use of community detection to re-identify multiple addresses belonging to the same user. Traditional blockchain monitoring techniques focus on transaction relationships between blockchain users and do not analyze information unrelated to transactions between users. Recent blockchain messaging incidents highlight the importance of detecting and analyzing blockchain transaction data for public opinion monitoring on the blockchain, which is a significant research area in blockchain data mining. SUMMARY OF THE INVENTION In order to solve the above problems, the invention aims to provide a method for extracting and parsing Bitcoin transaction autonomy information. In order to achieve the above objectives, the method for extracting and parsing Bitcoin transaction autonomy information provided by the invention comprises the following steps in sequence: (1) building a Bitcoin client and synchronizing original block stream data to a local area; then parsing and structuring the original block stream data to obtain Bitcoin structured data; and then obtaining an output script of each transaction from the Bitcoin structured data;(2) verifying the validity of the transaction output script by using a transaction script verification algorithm Algorithmtest; determining that the transaction is true and valid and does not contain any transaction autonomy information if the verification succeeds; and returning transaction autonomy information Txinformation if the verification fails;(3) extracting blockchain features from the transaction autonomy information Txinformation, and then constructing a transaction autonomy information data table by using the transaction autonomy information and the blockchain features;(4) sequentially reading the transaction autonomy information Txinformation from the transaction autonomy information data table, and decoding the transaction autonomy information Txinformation by using a transaction autonomy information decoding algorithm Algorithmcode_recognition to obtain decoded information Informationdecode; and then inserting the decoded information Informationdecode into the transaction autonomy information data table as features;(5) cleaning the decoded information Informationdecode by feature extraction and identification, marking decodable signs Signdecode of decoded information Informationdecode which is successfully decoded as 1, and decodable signs Signdecode of other decoded information as 0, and inserting the decodable signs Signdecode into the transaction autonomy information data table as features;(6) determining the fusion possibility of successfully decoded transaction autonomy information Informationdecode by using an information fusion algorithm Algorithmaddress_association based on transaction address association analysis, and fus