CN111523897A - Anti-attack method, device and storage medium - Google Patents

Anti-attack method, device and storage medium Download PDF

Info

Publication number
CN111523897A
CN111523897A CN202010373917.1A CN202010373917A CN111523897A CN 111523897 A CN111523897 A CN 111523897A CN 202010373917 A CN202010373917 A CN 202010373917A CN 111523897 A CN111523897 A CN 111523897A
Authority
CN
China
Prior art keywords
transaction
block
pool
hash
full
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202010373917.1A
Other languages
Chinese (zh)
Other versions
CN111523897B (en
Inventor
何玉斌
王志文
吴思进
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hangzhou Fuzamei Technology Co Ltd
Original Assignee
Hangzhou Fuzamei Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hangzhou Fuzamei Technology Co Ltd filed Critical Hangzhou Fuzamei Technology Co Ltd
Priority to CN202010373917.1A priority Critical patent/CN111523897B/en
Publication of CN111523897A publication Critical patent/CN111523897A/en
Application granted granted Critical
Publication of CN111523897B publication Critical patent/CN111523897B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/38Payment protocols; Details thereof
    • G06Q20/382Payment protocols; Details thereof insuring higher security of transaction
    • G06Q20/3825Use of electronic signatures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/22Indexing; Data structures therefor; Storage structures
    • G06F16/2228Indexing structures
    • G06F16/2255Hash tables
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2455Query execution
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/38Payment protocols; Details thereof
    • G06Q20/382Payment protocols; Details thereof insuring higher security of transaction
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/38Payment protocols; Details thereof
    • G06Q20/382Payment protocols; Details thereof insuring higher security of transaction
    • G06Q20/3823Payment protocols; Details thereof insuring higher security of transaction combining multiple encryption tools for a transaction

Abstract

The invention provides an anti-attack method, equipment and a storage medium, wherein the method comprises the following steps: in the transaction broadcasting stage, the transaction is checked for duplication according to the transaction full hash; when the packaging right of a first block with the first block height is obtained, packaging a plurality of transactions from a local transaction pool to generate a first block, and generating a first data set according to the first block; broadcasting the first set of data to other blockchain nodes for the other blockchain nodes: searching each transaction of the first block in a local transaction pool according to a first transaction full hash list of the first data set; and after the verification of the Merkel root, assembling and restoring the first block according to the first data set and the searched transactions. The method improves the stability of the block chain.

Description

Anti-attack method, device and storage medium
Technical Field
The present application relates to the field of blockchain technologies, and in particular, to an anti-attack method, device, and storage medium.
Background
In the transaction broadcast mechanism previously proposed by the applicant (specifically, refer to patent texts such as transaction broadcasts or block broadcasts applied by the applicant), the transaction hash is generated from the transaction content of the transaction, the merkel root in the block header information of the block is generated by the transaction hash calculation of each transaction of the block, when the blockchain node receives a transaction, assuming that the transaction content is content (x), the blockchain node first determines whether another transaction identical to content (x) exists locally: if yes, discarding the newly received transaction; and if not, storing the newly received transaction into a local transaction pool. In the block verification mechanism previously proposed by the applicant (refer to patent texts such as each item of block generation, block broadcast or block verification, etc. applied by the applicant), the block chaining node of the generated block sends the data set of the generated block (including the block header information and the transaction hash list of the generated block) to other block chaining nodes; when other block chain nodes receive the block, all transactions of the received block are searched in a local transaction pool according to the transaction hash list, the Merkel root is calculated according to the transaction hash of the searched transactions, when the calculated Merkel root is judged to be the same as the Merkel root in the block header information, the first block is assembled and restored according to the received data set and the searched transactions, the restored first block is executed to obtain an execution result, when the execution result is not consistent with the execution result in the block header information, the block chain node points consider that the problem (the Merkel root is the same and the execution result is different) is caused by inconsistent versions, and the block chain node points stop running and wait for version updating.
Assuming that there are four ABCD blockchain nodes in the blockchain, user a is a malicious user, and user a signs the same transaction content with the private keys of two accounts to generate two different transactions tx1(sig _ a1(content (M)) and tx2(sig _ a2(content (M)); assume A, B receives tx1 first and C, D receives tx2 first; A. after receiving tx1, when receiving tx2, A, B will not store tx2 in the local transaction pool because the transaction contents of tx1 and tx2 are the same; similarly, C, D will not deposit tx1 into the local transaction pool; assume a generates block (n) comprising tx1 and broadcasts a transaction hash list of block header (n) and block (n) to B, C, D; since the transaction hash is generated from the transaction content of the transaction, the merkel roots of A, B, C, D are all the same; in the case of the same mekerr root, B, C, D assembles a reduction block (n) from the found transactions; b finds tx1 locally according to hash (content (m), and C, D finds tx2 locally according to hash (content (m); therefore, A, B execution block (n) generates the same first execution result, C, D execution block (n) generates the same second execution result, and the first execution result is different from the second execution result. C. D considers the problem to be due to version inconsistency and C, D stops running and waits for a version update. Therefore, in the transaction broadcasting mechanism, one transaction can ensure that a plurality of block chain link points can not work normally, and the stability of block chain operation is reduced.
Disclosure of Invention
In view of the above-mentioned drawbacks and deficiencies in the prior art, it is desirable to provide an anti-attack method, apparatus, and storage medium that improve blockchain stability.
In a first aspect, the present invention provides an anti-attack method for blockchain nodes, where a blockchain system does not support generation and execution of a transaction group, the method including:
receiving a first transaction sent by a client or broadcast by other blockchain nodes, and generating a first transaction full hash according to first transaction content and first signature information of the first transaction;
when a second transaction which is identical to the first transaction in full hash does not exist in the local transaction pool, storing the first transaction and broadcasting the first transaction to other block link nodes;
when the packaging right of a first block with the first block height is obtained, packaging a plurality of transactions from a local transaction pool to generate a first block, and generating a first data set according to the first block; the first data set comprises first block header information of a first block and a first transaction full-hash list, wherein the first block header information comprises a first Merkel root, and the first Merkel root is generated by transaction full-hash of packaged transactions; and the number of the first and second groups,
broadcasting the first set of data to other blockchain nodes for the other blockchain nodes:
searching each transaction of the first block in a local transaction pool according to the first transaction full hash list;
calculating a second Merkel root according to the found transaction full hash of each transaction, and judging whether the second Merkel root is the same as the first Merkel root:
if yes, the first block is assembled and restored according to the first data set and the searched transactions;
otherwise, the first block is requested from the current node.
In a second aspect, the present invention provides an anti-attack method applicable to blockchain nodes, where the blockchain network is configured with a corresponding transaction pool network, the transaction pool network includes a plurality of transaction pool nodes that communicate with each other, each blockchain node is respectively registered with a push address for pushing a new transaction at any transaction pool node, and the blockchain system does not support generation and execution of a transaction group, where the method includes:
receiving and storing a first transaction sent by a client, generating a first transaction full hash according to first transaction content and first signature information of the first transaction, broadcasting the first transaction full hash to other block chain nodes, sending the first transaction to a first transaction pool node for broadcasting the first transaction to other transaction pool nodes, and pushing the first transaction to a plurality of block chain nodes according to registered push addresses;
receiving second transaction full hashes broadcast by other blockchain nodes, and monitoring whether a second transaction is received or not when the second transaction which is the same as the first transaction full hashes does not exist in the local transaction pool;
receiving and storing a third transaction pushed by the first transaction pool node;
when the packaging right of a first block with the first block height is obtained, packaging a plurality of transactions from a local transaction pool to generate a first block, and generating a first data set according to the first block; the first data set comprises first block header information of a first block and a first transaction full-hash list, wherein the first block header information comprises a first Merkel root, and the first Merkel root is generated by transaction full-hash of packaged transactions; and the number of the first and second groups,
broadcasting the first set of data to other blockchain nodes for the other blockchain nodes:
searching each transaction of the first block in a local transaction pool according to the first transaction full hash list;
calculating a second Merkel root according to the found transaction full hash of each transaction, and judging whether the second Merkel root is the same as the first Merkel root:
if yes, the first block is assembled and restored according to the first data set and the searched transactions;
otherwise, the first block is requested from the current node.
In a third aspect, the present invention also provides an apparatus comprising one or more processors and a memory, wherein the memory contains instructions executable by the one or more processors to cause the one or more processors to perform the attack-prevention method provided according to the embodiments of the present invention.
In a fourth aspect, the present invention also provides a storage medium storing a computer program that causes a computer to execute the attack prevention method provided according to the embodiments of the present invention.
According to the anti-attack method, the anti-attack equipment and the anti-attack storage medium provided by the embodiments of the invention, a first transaction full hash is generated according to a first transaction content and first signature information of the first transaction by receiving the first transaction sent by a client or broadcasted by other blockchain nodes; when a second transaction which is identical to the first transaction in full hash does not exist in the local transaction pool, storing the first transaction and broadcasting the first transaction to other block link nodes; when the packaging right of a first block with the first block height is obtained, packaging a plurality of transactions from a local transaction pool to generate a first block, and generating a first data set according to the first block; the first data set comprises first block header information of a first block and a first transaction full-hash list, wherein the first block header information comprises a first Merkel root, and the first Merkel root is generated by transaction full-hash of packaged transactions; and broadcasting the first set of data to other blockchain nodes for the other blockchain nodes to: searching each transaction of the first block in a local transaction pool according to the first transaction full hash list; calculating a second Merkel root according to the found transaction full hash of each transaction, and judging whether the second Merkel root is the same as the first Merkel root: if yes, the first block is assembled and restored according to the first data set and the searched transactions; and if not, requesting the first block method from the current node, and improving the stability of the block chain.
Drawings
Other features, objects and advantages of the present application will become more apparent upon reading of the following detailed description of non-limiting embodiments thereof, made with reference to the accompanying drawings in which:
fig. 1 is a flowchart of an attack prevention method according to an embodiment of the present invention.
Fig. 2 is a flowchart of another anti-attack method according to an embodiment of the present invention.
Fig. 3 is a schematic structural diagram of an apparatus according to an embodiment of the present invention.
Detailed Description
The present application will be described in further detail with reference to the following drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the relevant invention and not restrictive of the invention. It should be noted that, for convenience of description, only the portions related to the present invention are shown in the drawings.
It should be noted that the embodiments and features of the embodiments in the present application may be combined with each other without conflict. The present application will be described in detail below with reference to the embodiments with reference to the attached drawings.
Fig. 1 is a flowchart of an attack prevention method according to an embodiment of the present invention. As shown in fig. 1, in this embodiment, the present invention provides an anti-attack method applied to a blockchain node, where a blockchain system does not support generation and execution of a transaction group, and the method includes:
s12: receiving a first transaction sent by a client or broadcast by other blockchain nodes, and generating a first transaction full hash according to first transaction content and first signature information of the first transaction;
s14: when a second transaction which is identical to the first transaction in full hash does not exist in the local transaction pool, storing the first transaction and broadcasting the first transaction to other block link nodes;
s161: when the packaging right of a first block with the first block height is obtained, packaging a plurality of transactions from a local transaction pool to generate a first block, and generating a first data set according to the first block; the first data set comprises first block header information of a first block and a first transaction full-hash list, wherein the first block header information comprises a first Merkel root, and the first Merkel root is generated by transaction full-hash of packaged transactions; and the number of the first and second groups,
s162: broadcasting the first set of data to other blockchain nodes for the other blockchain nodes:
searching each transaction of the first block in a local transaction pool according to the first transaction full hash list;
calculating a second Merkel root according to the found transaction full hash of each transaction, and judging whether the second Merkel root is the same as the first Merkel root:
if yes, the first block is assembled and restored according to the first data set and the searched transactions;
otherwise, the first block is requested from the current node.
Specifically, assuming that there are four ABCD blockchain nodes in the blockchain, user a is a malicious user, and user a signs the same transaction content with the private keys of two accounts to generate two different transactions tx1(sig _ a1(content (m)) and tx2(sig _ a2(content (m))); A. b receives tx1 first, C, D receives tx2 first; assume that a generates block (n) comprising tx1(sig _ a1(content (m)), tx3(sig _ b (content (r)), tx4(sig _ c (content (s))), a broadcasts B, C, D a transaction hash list of block header (n) and block (n);
in the transaction broadcast mechanism previously proposed by the applicant (specifically, refer to each transaction broadcast or block broadcast patent document applied by the applicant), the transaction hash is generated from the transaction content of the transaction, the merkel root in the block header information of the block is generated by the transaction hash calculation of each transaction of the block, the block link node receives one transaction, and if the transaction content is content (x), the block link node first determines whether another transaction identical to content (x) exists locally: if yes, discarding the newly received transaction; and if not, storing the newly received transaction into a local transaction pool. In the block verification mechanism previously proposed by the applicant (refer to patent texts such as each item of block generation, block broadcast or block verification, etc. applied by the applicant), the block chaining node of the generated block sends the data set of the generated block (including the block header information and the transaction hash list of the generated block) to other block chaining nodes; when other block chain nodes receive the block, all transactions of the received block are searched in a local transaction pool according to the transaction hash list, the Merkel root is calculated according to the transaction hash of the searched transactions, when the calculated Merkel root is judged to be the same as the Merkel root in the block header information, the first block is assembled and restored according to the received data set and the searched transactions, the restored first block is executed to obtain an execution result, when the execution result is not consistent with the execution result in the block header information, the block chain node points consider that the problem (the Merkel root is the same and the execution result is different) is caused by inconsistent versions, and the block chain node points stop running and wait for version updating.
A. After receiving tx1, when receiving tx2, A, B will not store tx2 in the local transaction pool because the transaction contents of tx1 and tx2 are the same; similarly, C, D will not deposit tx1 into the local transaction pool; a broadcasts the blockheader (n) (including merkel root (generated from hash (content (m)), hash (content (r), hash (content (s)), transaction hash list (hash (m)), hash (content (r), hash (s)) to B, C, D;
b finds tx1 locally according to hash (content (m), and C, D finds tx2 locally according to hash (content (m); since the transaction hash is generated from the transaction content of the transaction, the merkel roots of A, B, C, D are all the same; in the case of the same mekerr root, B, C, D assembles a reduction block (n) according to the found transaction, but A, B executes the block (n) to generate the same first execution result (actually executed tx1, tx3 and tx4), C, D executes the block (n) to generate the same second execution result (actually executed tx2, tx3 and tx4), and the first execution result is different from the second execution result. C. D considers the problem to be due to version inconsistency and C, D stops running and waits for a version update. Therefore, in the transaction broadcasting mechanism, one transaction can ensure that a plurality of block chain link points can not work normally, and the stability of block chain operation is reduced.
The problem generated in the above scenario can be solved through steps S12 to S162;
a, signing the same transaction content by using private keys of two accounts to generate two different transactions tx1(sig _ a1(content (m)) and tx2(sig _ a2(content (m)), A, B receives tx1 first (namely, the local transaction pool of A, B already stores tx1), and C, D receives tx2 first (namely, the local transaction pool of C, D already stores tx1 at this time); assuming that there are tx1, tx3 and tx4 in the local transaction pool of a, and at this time, a receives tx2 again, a packages all transactions in the local transaction pool to generate a block (N ') (i.e., if tx2 is different from tx1, tx3 and tx4, the block (N ') includes tx1, tx2, tx3 and tx 4; if tx2 is the same as tx1 or tx3 or tx4, the block (N ') includes tx1, tx3 and tx 4);
a performs step S12, receiving tx2, generating a full transaction hash _ tx2 according to content (m) and sig _ a2, the full hash _ tx2 being hash ((content (m) + sig _ a 2));
a performs step S14, since the trades of the trades in the local trading pool are fully hashed to fullhash _ tx1(fullhash _ tx1 ═ hash ((content (m) + sig _ a1))), fullhash _ tx3 (fullhash _ tx3 ═ hash ((content (r) + sig _ b))), fullhash _ tx4(fullhash _ tx4 ═ hash ((content (S) + sig _ c))), fullhash _ tx1, fullhash _ tx3, and fullhash _ tx4 are all different from fullhash _ tx2, tx2 is stored and broadcast to B, C, D;
B. c, D go through steps S12 and S14:
B. c, D execution of step S12 is identical to the execution of step S12 by A;
the execution of step S14 by B is identical to the execution of step S14 by a;
C. d, when step S14 is executed, if it is determined that there is a fullhash _ tx2 in the local transaction pool, C, D discards tx 2;
step S161 is performed by a, packaging tx1, tx2, tx3, tx4 from the local transaction pool to generate block (N '), generating a data set of block (N ') from block (N ');
the data set of block (N ') comprises a block header (N ') and a block (N ') full hash list; the blockheader (N ') comprises a merklehashroot (N') generated according to fullhash _ tx1, fullhash _ tx2, fullhash _ tx3, and fullhash _ tx 4; the full hash list is hash (content (m) + sig _ a1), hash (content (m) + sig _ a2), hash (content (r) + sig _ b), hash (content(s) + sig _ c);
a executes step S162, and broadcasts block (N') data set to B, C, D;
B. c, D finding each transaction of block (N') from the full hash list;
let B, C find the transactions tx1, tx2, tx3, tx4, D because the local transaction pool database is faulty, the found transactions tx1, tx2, tx3, tx 4';
B. c, calculating a Merkel root according to the transaction full hash of tx1, tx2, tx3 and tx4, and assembling a reduction block (N ') according to the data set of the block (N ') and tx1, tx2, tx3 and tx4 if the calculated Merkel root is the same as the merkleashroot (N ');
d, calculating a Merkel root according to the transaction full hash of tx1, tx2, tx3 and tx4', and requesting block (N ') from A if the calculated Merkel root is different from merklehashroot (N ').
In the above embodiment, the block chain link point does not stop running, increasing the stability of the running of the block chain.
Preferably, the transaction further comprises a round, storing the first transaction and broadcasting the first transaction to other tile linked points comprises:
judging whether the first round of the first transaction reaches a first value:
if yes, storing the first transaction and broadcasting the first transaction full hash to other blockchain nodes;
and if not, storing the first transaction and broadcasting the first transaction to other block link points.
Assuming that the preconfigured first value is 5 and the transaction is received by one node each time the transaction is taken, the round is +1 and the initial value of the round is 0;
when the round of tx2 received is [0,4], a stores tx2 and broadcasts tx2 to B, C, D;
when the round of tx2 received is [5, ∞ ], A stores tx2 and broadcasts fullhash _ tx2 to B, C, D.
The above embodiments reduce the size of the transmitted data in the blockchain network.
Fig. 2 is a flowchart of another anti-attack method according to an embodiment of the present invention. As shown in fig. 2, in this embodiment, the present invention provides an anti-attack method applied to a blockchain node, where the blockchain network is configured with a corresponding transaction pool network, the transaction pool network includes a plurality of transaction pool nodes that communicate with each other, each blockchain node is respectively registered with a push address for pushing a new transaction at any transaction pool node, and the blockchain system does not support generation and execution of a transaction group, where the method includes:
s22: receiving and storing a first transaction sent by a client, generating a first transaction full hash according to first transaction content and first signature information of the first transaction, broadcasting the first transaction full hash to other block chain nodes, sending the first transaction to a first transaction pool node for broadcasting the first transaction to other transaction pool nodes, and pushing the first transaction to a plurality of block chain nodes according to registered push addresses;
s24: receiving second transaction full hashes broadcast by other blockchain nodes, and monitoring whether a second transaction is received or not when the second transaction which is the same as the first transaction full hashes does not exist in the local transaction pool;
s26: receiving and storing a third transaction pushed by the first transaction pool node;
s281: when the packaging right of a first block with the first block height is obtained, packaging a plurality of transactions from a local transaction pool to generate a first block, and generating a first data set according to the first block; the first data set comprises first block header information of a first block and a first transaction full-hash list, wherein the first block header information comprises a first Merkel root, and the first Merkel root is generated by transaction full-hash of packaged transactions; and the number of the first and second groups,
s282: broadcasting the first set of data to other blockchain nodes for the other blockchain nodes:
searching each transaction of the first block in a local transaction pool according to the first transaction full hash list;
calculating a second Merkel root according to the found transaction full hash of each transaction, and judging whether the second Merkel root is the same as the first Merkel root:
if yes, the first block is assembled and restored according to the first data set and the searched transactions;
otherwise, the first block is requested from the current node.
In the above embodiments, the steps S281 and S282 refer to the methods S161 and S162 shown in fig. 1, and are not described herein again.
Steps S22 to S26 of the above embodiment are different from steps S12 to S14 shown in fig. 1 in that in the method shown in fig. 1, A, B, C, D are connected with each other, then B will receive tx2 at least 3 times, whereas in this application, B will receive tx2 only once, and has shapful _ tx2 at least 3 times, and the data volume of shapful _ tx2 is much smaller than tx2, so that S22 to S26 reduce transaction redundancy and improve transmission efficiency.
In the above embodiment, the block link point also does not stop running, increasing the stability of the block chain running.
Preferably, monitoring whether the second transaction is received comprises:
when a second transaction corresponding to the second transaction hash is not received within a preconfigured first time length, requesting the second transaction from the block chain node which sends the second transaction full hash;
a second transaction is received and stored.
Fig. 3 is a schematic structural diagram of an apparatus according to an embodiment of the present invention.
As shown in fig. 3, as another aspect, the present application also provides an apparatus 300 including one or more Central Processing Units (CPUs) 301 that can perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM)302 or a program loaded from a storage section 308 into a Random Access Memory (RAM) 303. In the RAM303, various programs and data necessary for the operation of the apparatus 300 are also stored. The CPU301, ROM302, and RAM303 are connected to each other via a bus 304. An input/output (I/O) interface 305 is also connected to bus 304.
The following components are connected to the I/O interface 305: an input portion 306 including a keyboard, a mouse, and the like; an output section 307 including a display such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, and a speaker; a storage section 308 including a hard disk and the like; and a communication section 309 including a network interface card such as a LAN card, a modem, or the like. The communication section 309 performs communication processing via a network such as the internet. A drive 310 is also connected to the I/O interface 305 as needed. A removable medium 311 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 310 as necessary, so that a computer program read out therefrom is mounted into the storage section 308 as necessary.
In particular, according to an embodiment of the present disclosure, the method described in any of the above embodiments may be implemented as a computer software program. For example, embodiments of the present disclosure include a computer program product comprising a computer program tangibly embodied on a machine-readable medium, the computer program comprising program code for performing any of the methods described above. In such an embodiment, the computer program may be downloaded and installed from a network through the communication section 309, and/or installed from the removable medium 311.
As yet another aspect, the present application also provides a computer-readable storage medium, which may be the computer-readable storage medium included in the apparatus of the above-described embodiment; or it may be a separate computer readable storage medium not incorporated into the device. The computer readable storage medium stores one or more programs for use by one or more processors in performing the methods described in the present application.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units or modules described in the embodiments of the present application may be implemented by software or hardware. The described units or modules may also be provided in a processor, for example, each of the described units may be a software program provided in a computer or a mobile intelligent device, or may be a separately configured hardware device. Wherein the designation of a unit or module does not in some way constitute a limitation of the unit or module itself.
The above description is only a preferred embodiment of the application and is illustrative of the principles of the technology employed. It will be appreciated by those skilled in the art that the scope of the invention herein disclosed is not limited to the particular combination of features described above, but also encompasses other arrangements formed by any combination of the above features or their equivalents without departing from the spirit of the present application. For example, the above features may be replaced with (but not limited to) features having similar functions disclosed in the present application.

Claims (6)

1. An anti-attack method, wherein a blockchain system does not support generation and execution of transaction groups, the method being applicable to blockchain nodes, the method comprising:
receiving a first transaction sent by a client or broadcast by other blockchain nodes, and generating a first transaction full hash according to first transaction content and first signature information of the first transaction;
when a second transaction which is identical to the first transaction in full hash does not exist in a local transaction pool, storing the first transaction and broadcasting the first transaction to other block link nodes;
when the packaging right of a first block with the first block height is obtained, packaging a plurality of transactions from a local transaction pool to generate a first block, and generating a first data set according to the first block; wherein the first data set comprises first chunk header information and a first transaction full hash list of the first chunk, the first chunk header information comprising a first Merkel root, the first Merkel root generated from transaction full hashes of the packaged transactions; and the number of the first and second groups,
broadcasting the first set of data to other blockchain nodes for other blockchain nodes:
searching each transaction of the first block in a local transaction pool according to the first transaction full hash list;
calculating a second Merkel root according to the found transaction full hash of each transaction, and judging whether the second Merkel root is the same as the first Merkel root:
if yes, the first block is assembled and restored according to the first data set and the searched transactions;
and if not, requesting the first block from the current node.
2. The method of claim 1, wherein a transaction further comprises a turn, and wherein storing the first transaction and broadcasting the first transaction to other tile link points comprises:
judging whether the first round of the first transaction reaches a first value:
if yes, storing the first transaction and broadcasting the first transaction full hash to other block link points;
and if not, storing the first transaction and broadcasting the first transaction to other block link points.
3. An anti-attack method is characterized in that a blockchain network is configured with a corresponding transaction pool network, the transaction pool network comprises a plurality of transaction pool nodes which are communicated with each other, each blockchain node is respectively registered with a push address for pushing a new transaction at any transaction pool node, a blockchain system does not support generation and execution of a transaction group, and the method is suitable for the blockchain nodes and comprises the following steps:
receiving and storing a first transaction sent by a client, generating a first transaction full hash according to first transaction content and first signature information of the first transaction, broadcasting the first transaction full hash to other block chain nodes, sending the first transaction to a first transaction pool node for broadcasting the first transaction to other transaction pool nodes, and pushing the first transaction to a plurality of block chain nodes according to registered push addresses;
receiving second transaction full hashes broadcast by other blockchain nodes, and monitoring whether a second transaction is received or not when the second transaction which is the same as the first transaction full hash does not exist in a local transaction pool;
receiving and storing a third transaction pushed by the first transaction pool node;
when the packaging right of a first block with the first block height is obtained, packaging a plurality of transactions from a local transaction pool to generate a first block, and generating a first data set according to the first block; wherein the first data set comprises first chunk header information and a first transaction full hash list of the first chunk, the first chunk header information comprising a first Merkel root, the first Merkel root generated from transaction full hashes of the packaged transactions; and the number of the first and second groups,
broadcasting the first set of data to other blockchain nodes for other blockchain nodes:
searching each transaction of the first block in a local transaction pool according to the first transaction full hash list;
calculating a second Merkel root according to the found transaction full hash of each transaction, and judging whether the second Merkel root is the same as the first Merkel root:
if yes, the first block is assembled and restored according to the first data set and the searched transactions;
and if not, requesting the first block from the current node.
4. The method of claim 3, wherein the monitoring whether the second transaction is received comprises:
when a second transaction corresponding to the second transaction hash is not received within a preconfigured first time length, requesting the second transaction from a block chain node point which sends the second transaction full hash;
receiving and storing the second transaction.
5. An apparatus, characterized in that the apparatus comprises:
one or more processors;
a memory for storing one or more programs,
the one or more programs, when executed by the one or more processors, cause the one or more processors to perform the method recited in any of claims 1-4.
6. A storage medium storing a computer program, characterized in that the program, when executed by a processor, implements the method according to any one of claims 1-4.
CN202010373917.1A 2020-05-06 2020-05-06 Anti-attack method, device and storage medium Active CN111523897B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010373917.1A CN111523897B (en) 2020-05-06 2020-05-06 Anti-attack method, device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010373917.1A CN111523897B (en) 2020-05-06 2020-05-06 Anti-attack method, device and storage medium

Publications (2)

Publication Number Publication Date
CN111523897A true CN111523897A (en) 2020-08-11
CN111523897B CN111523897B (en) 2023-04-07

Family

ID=71908629

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010373917.1A Active CN111523897B (en) 2020-05-06 2020-05-06 Anti-attack method, device and storage medium

Country Status (1)

Country Link
CN (1) CN111523897B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112732720A (en) * 2021-01-11 2021-04-30 杭州复杂美科技有限公司 Data storage method, data query method, computer device and storage medium

Citations (16)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106650495A (en) * 2016-12-16 2017-05-10 杭州嘉楠耘智信息科技有限公司 File verification method and device
US20170344435A1 (en) * 2016-05-24 2017-11-30 Mastercard International Incorporated Method and system for desynchronization recovery for permissioned blockchains using bloom filters
CN108108487A (en) * 2018-01-10 2018-06-01 杭州复杂美科技有限公司 A kind of common recognition method of block chain
CN108984662A (en) * 2018-06-28 2018-12-11 杭州复杂美科技有限公司 A kind of block chain method of data synchronization
CN109034807A (en) * 2018-08-15 2018-12-18 杭州复杂美科技有限公司 A kind of block chain method of data synchronization
CN109146484A (en) * 2018-08-31 2019-01-04 深圳付贝科技有限公司 Common recognition verification method, digging mine machine and block catenary system based on block chain
CN109409889A (en) * 2018-11-13 2019-03-01 杭州秘猿科技有限公司 A kind of block in block chain determines method, apparatus and electronic equipment
CN109447641A (en) * 2018-10-26 2019-03-08 众安信息技术服务有限公司 To the method and apparatus of block chain browser transport block chain data
CN109586934A (en) * 2018-12-27 2019-04-05 链极智能科技(上海)有限公司 A kind of block chain bottom-layer network transaction Synchronous fluorimetry method
WO2019093574A1 (en) * 2017-11-10 2019-05-16 부산대학교 산학협력단 Block chain system and method employing hash-based signature scheme
CN109784928A (en) * 2019-01-23 2019-05-21 众安信息技术服务有限公司 Information processing method and information processing unit based on block chain
CN110336676A (en) * 2019-07-15 2019-10-15 杭州复杂美科技有限公司 A kind of block chain transaction broadcasting method and system, equipment and storage medium
CN110443610A (en) * 2019-07-15 2019-11-12 杭州复杂美科技有限公司 For reducing method and system, equipment and the storage medium of trading group repeated broadcast
CN110503558A (en) * 2019-08-29 2019-11-26 深圳前海微众银行股份有限公司 A kind of processing method and processing device based on block catenary system
CN110647582A (en) * 2019-09-17 2020-01-03 腾讯科技(深圳)有限公司 Method and device for block chain network consensus checking, storage medium and computer equipment
US20200076571A1 (en) * 2018-08-29 2020-03-05 International Business Machines Corporation Checkpointing for increasing efficiency of a blockchain

Patent Citations (16)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20170344435A1 (en) * 2016-05-24 2017-11-30 Mastercard International Incorporated Method and system for desynchronization recovery for permissioned blockchains using bloom filters
CN106650495A (en) * 2016-12-16 2017-05-10 杭州嘉楠耘智信息科技有限公司 File verification method and device
WO2019093574A1 (en) * 2017-11-10 2019-05-16 부산대학교 산학협력단 Block chain system and method employing hash-based signature scheme
CN108108487A (en) * 2018-01-10 2018-06-01 杭州复杂美科技有限公司 A kind of common recognition method of block chain
CN108984662A (en) * 2018-06-28 2018-12-11 杭州复杂美科技有限公司 A kind of block chain method of data synchronization
CN109034807A (en) * 2018-08-15 2018-12-18 杭州复杂美科技有限公司 A kind of block chain method of data synchronization
US20200076571A1 (en) * 2018-08-29 2020-03-05 International Business Machines Corporation Checkpointing for increasing efficiency of a blockchain
CN109146484A (en) * 2018-08-31 2019-01-04 深圳付贝科技有限公司 Common recognition verification method, digging mine machine and block catenary system based on block chain
CN109447641A (en) * 2018-10-26 2019-03-08 众安信息技术服务有限公司 To the method and apparatus of block chain browser transport block chain data
CN109409889A (en) * 2018-11-13 2019-03-01 杭州秘猿科技有限公司 A kind of block in block chain determines method, apparatus and electronic equipment
CN109586934A (en) * 2018-12-27 2019-04-05 链极智能科技(上海)有限公司 A kind of block chain bottom-layer network transaction Synchronous fluorimetry method
CN109784928A (en) * 2019-01-23 2019-05-21 众安信息技术服务有限公司 Information processing method and information processing unit based on block chain
CN110336676A (en) * 2019-07-15 2019-10-15 杭州复杂美科技有限公司 A kind of block chain transaction broadcasting method and system, equipment and storage medium
CN110443610A (en) * 2019-07-15 2019-11-12 杭州复杂美科技有限公司 For reducing method and system, equipment and the storage medium of trading group repeated broadcast
CN110503558A (en) * 2019-08-29 2019-11-26 深圳前海微众银行股份有限公司 A kind of processing method and processing device based on block catenary system
CN110647582A (en) * 2019-09-17 2020-01-03 腾讯科技(深圳)有限公司 Method and device for block chain network consensus checking, storage medium and computer equipment

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112732720A (en) * 2021-01-11 2021-04-30 杭州复杂美科技有限公司 Data storage method, data query method, computer device and storage medium
CN112732720B (en) * 2021-01-11 2022-05-24 杭州复杂美科技有限公司 Data storage method, data query method, computer device and storage medium

Also Published As

Publication number Publication date
CN111523897B (en) 2023-04-07

Similar Documents

Publication Publication Date Title
US20210243032A1 (en) Sending cross-chain authenticatable messages
KR102548540B1 (en) Method and apparatus for cross-ledger transfer between distributed ledgers and systems using cross-ledger transfer
US20210216522A1 (en) Distributed blockchain data storage under account model
WO2020143852A2 (en) Distributed blockchain data storage under account model
US20200012631A1 (en) Comparing data stores using hash sums on disparate parallel systems
CN102970284B (en) User profile processing method and server
CN112583811B (en) Wallet finding method, equipment and storage medium
CN112600664B (en) Delayed transaction generation method, delayed transaction execution device and storage medium
WO2023016426A1 (en) Asynchronous binary agreement method and apparatus, and electronic device and storage medium
EP3769230B1 (en) Taking snapshots of blockchain data
CN102984277B (en) Prevent the system and method that malice connects
CN111523896B (en) Attack prevention method, apparatus and storage medium
CN111523897B (en) Anti-attack method, device and storage medium
EP3769219A2 (en) Taking snapshots of blockchain data
CN104580428A (en) Data routing method, data management device and distributed storage system
CN111405037A (en) Block synchronization method, device and storage medium
CN113590020A (en) Method, apparatus and computer program product for data management
CN117642744A (en) Method and device for verifying database query results
CN111524011B (en) Parallel link consensus validation method, apparatus, and storage medium
CN116542668A (en) Block chain-based data processing method, equipment and readable storage medium
CN103701844A (en) User information management method and system
CN114202425A (en) Method, device and storage medium for predicting multi-main-chain interlinkage of language machine
CN111639939A (en) Block restoring method, equipment and storage medium
CN111290733A (en) Settlement method, apparatus and storage medium
CN115021945B (en) Block chain transaction processing method and system

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant