Method for tracing path of attack on smart contract on blockchain
Abstract
The present disclosure provides a method for tracing a path of an attack on a smart contract on a blockchain, belonging to the technical field of blockchains. The method specifically includes: determining a hacker's attack address, and determining an attack's start time and an attack's stop time according to a data record of the hacker's attack address; and determining hash values of all transactions from a hacker's attack destination address between the attack's start time and the attack's stop time automatically, and obtaining a fungible token and a non-fungible token by parsing the hash values automatically. The problems of large error and low efficiency during original manual extraction are solved, accuracy and efficiency are higher, and the overall security is improved.
Claims
exact text as granted — not AI-modified1 . A method for tracing a path of an attack on a smart contract on a blockchain, specifically comprising:
S 1 : determining a hacker's attack address, and determining an attack's start time and an attack's stop time according to a data record of the hacker's attack address; and S 2 : determining hash values of all transactions from a hacker's attack destination address between the attack's start time and the attack's stop time automatically, and obtaining a fungible token and a non-fungible token by parsing the hash values automatically.
2 . The method for tracing a path of an attack on a smart contract on a blockchain according to claim 1 , wherein the hash values of all the transactions from the hacker's attack destination address are queried according to the following steps:
S 21 , querying hash values of all transactions from the hacker's attack address between the attack's start time and the attack's stop time; S 22 , obtaining the hacker's attack destination address by parsing the hash values of the transactions from the hacker's attack address, and recording all transaction records of the hacker's attack destination address; and S 23 , reading all the transaction records of the hacker's attack destination address and the hacker's attack destination address value corresponding to the hacker's attack destination address, and querying and storing the hash values of all the transactions initiated by the hacker's attack address and taking the hacker's attack destination address as an attack target between the attack's start time and the attack's stop time.
3 . The method for tracing a path of an attack on a smart contract on a blockchain according to claim 1 , wherein the hash values of all the transactions from the hacker's attack address between the attack's start time and the attack's stop time are queried through a Web3 Application Programming Interface (API).
4 . The method for tracing a path of an attack on a smart contract on a blockchain according to claim 1 , wherein the hacker's attack address is determined by reading a character string beginning with a symbol “0x” on the blockchain.
5 . The method for tracing a path of an attack on a smart contract on a blockchain according to claim 1 , wherein the hacker's attack destination address is determined according to a transaction address label value of the hacker's attack destination address.
6 . The method for tracing a path of an attack on a smart contract on a blockchain according to claim 1 , wherein the hash values are parsed automatically to obtain an event “Internal Transactions” and an event “Tokens Transferred”.
7 . The method for tracing a path of an attack on a smart contract on a blockchain according to claim 6 , wherein the event “Internal Transactions” is parsed by querying at least one of a keyword “Transfer”, a keyword “send” and a keyword “call”, to obtain a transferred-out token.
8 . The method for tracing a path of an attack on a smart contract on a blockchain according to claim 6 , wherein the event “Tokens Transferred” is parsed by querying at least one of a keyword “Transfer”, a keyword “send” and a keyword “call”, to obtain a transferred-out fungible token and a transferred-out non-fungible token.
9 . A computer-readable storage medium, storing a computer program, wherein when the computer program is executed in a computer, the computer executes the method for tracing a path of an attack on a smart contract on a blockchain according to claim 1 .
10 . The computer-readable storage medium according to claim 9 , wherein the hash values of all the transactions from the hacker's attack destination address are queried according to the following steps:
S 21 , querying hash values of all transactions from the hacker's attack address between the attack's start time and the attack's stop time; S 22 , obtaining the hacker's attack destination address by parsing the hash values of the transactions from the hacker's attack address, and recording all transaction records of the hacker's attack destination address; and S 23 , reading all the transaction records of the hacker's attack destination address and the hacker's attack destination address value corresponding to the hacker's attack destination address, and querying and storing the hash values of all the transactions initiated by the hacker's attack address and taking the hacker's attack destination address as an attack target between the attack's start time and the attack's stop time.
11 . The computer-readable storage medium according to claim 9 , wherein the hash values of all the transactions from the hacker's attack address between the attack's start time and the attack's stop time are queried through a Web3 Application Programming Interface (API).
12 . The computer-readable storage medium according to claim 9 , wherein the hacker's attack address is determined by reading a character string beginning with a symbol “0x” on the blockchain.
13 . The computer-readable storage medium according to claim 9 , wherein the hacker's attack destination address is determined according to a transaction address label value of the hacker's attack destination address.
14 . The computer-readable storage medium according to claim 9 , wherein the hash values are parsed automatically to obtain an event “Internal Transactions” and an event “Tokens Transferred”.
15 . The computer-readable storage medium according to claim 14 , wherein the event “Internal Transactions” is parsed by querying at least one of a keyword “Transfer”, a keyword “send” and a keyword “call”, to obtain a transferred-out token.
16 . The computer-readable storage medium according to claim 14 , wherein the event “Tokens Transferred” is parsed by querying at least one of a keyword “Transfer”, a keyword “send” and a keyword “call”, to obtain a transferred-out fungible token and a transferred-out non-fungible token.
17 . A computer program product, storing an instruction, wherein when the instruction is executed by a computer, the computer implements the method for tracing a path of an attack on a smart contract on a blockchain according to claim 1 .
18 . The computer program product according to claim 17 , wherein the hash values of all the transactions from the hacker's attack destination address are queried according to the following steps:
S 21 , querying hash values of all transactions from the hacker's attack address between the attack's start time and the attack's stop time; S 22 , obtaining the hacker's attack destination address by parsing the hash values of the transactions from the hacker's attack address, and recording all transaction records of the hacker's attack destination address; and S 23 , reading all the transaction records of the hacker's attack destination address and the hacker's attack destination address value corresponding to the hacker's attack destination address, and querying and storing the hash values of all the transactions initiated by the hacker's attack address and taking the hacker's attack destination address as an attack target between the attack's start time and the attack's stop time.
19 . The computer program product according to claim 17 , wherein the hash values of all the transactions from the hacker's attack address between the attack's start time and the attack's stop time are queried through a Web3 Application Programming Interface (API).
20 . The computer program product according to claim 17 , wherein the hacker's attack address is determined by reading a character string beginning with a symbol “0x” on the blockchain.Join the waitlist — get patent alerts
Track US2025080550A1 — get alerts on status changes and closely related new filings.
We store only your email — no account needed. See our privacy policy.