[go: up one dir, main page]
More Web Proxy on the site http://driver.im/

CN111768202A - Payment verification method, payment verification node, full-amount node and storage medium - Google Patents

Payment verification method, payment verification node, full-amount node and storage medium Download PDF

Info

Publication number
CN111768202A
CN111768202A CN201910335989.4A CN201910335989A CN111768202A CN 111768202 A CN111768202 A CN 111768202A CN 201910335989 A CN201910335989 A CN 201910335989A CN 111768202 A CN111768202 A CN 111768202A
Authority
CN
China
Prior art keywords
block
target
list
transaction
payment verification
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
CN201910335989.4A
Other languages
Chinese (zh)
Other versions
CN111768202B (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.)
Beijing Jingdong Century Trading Co Ltd
Beijing Jingdong Shangke Information Technology Co Ltd
Original Assignee
Beijing Jingdong Century Trading Co Ltd
Beijing Jingdong Shangke Information 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 Beijing Jingdong Century Trading Co Ltd, Beijing Jingdong Shangke Information Technology Co Ltd filed Critical Beijing Jingdong Century Trading Co Ltd
Priority to CN201910335989.4A priority Critical patent/CN111768202B/en
Publication of CN111768202A publication Critical patent/CN111768202A/en
Application granted granted Critical
Publication of CN111768202B publication Critical patent/CN111768202B/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/40Authorisation, e.g. identification of payer or payee, verification of customer or shop credentials; Review and approval of payers, e.g. check credit lines or negative lists
    • G06Q20/401Transaction verification
    • 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/3827Use of message hashing
    • 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
    • G06Q40/00Finance; Insurance; Tax strategies; Processing of corporate or income taxes
    • G06Q40/04Trading; Exchange, e.g. stocks, commodities, derivatives or currency exchange
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Business, Economics & Management (AREA)
  • Engineering & Computer Science (AREA)
  • Accounting & Taxation (AREA)
  • Finance (AREA)
  • Physics & Mathematics (AREA)
  • Strategic Management (AREA)
  • General Business, Economics & Management (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Development Economics (AREA)
  • Economics (AREA)
  • Marketing (AREA)
  • Technology Law (AREA)
  • Financial Or Insurance-Related Operations Such As Payment And Settlement (AREA)

Abstract

The embodiment of the invention provides a payment verification method, which is applied to a payment verification node, wherein the payment verification node stores block head information of each block in a block chain, and the block head information comprises a transaction hash combination value obtained by performing bitwise OR operation on all hash values in corresponding blocks, and the method comprises the following steps: acquiring a target hash value, traversing a block chain according to the target hash value and a transaction hash combination value, and determining an alternative block list; if the height number of the blocks in the alternative block list is larger than a preset alternative threshold value, constructing a bloom filter according to the target hash value; sending the bloom filter and the alternative block list to a full-volume node, and receiving a transaction alternative list determined by the full-volume node according to the bloom filter and the alternative block list; and acquiring a target Mercker tree corresponding to the target transaction according to the transaction alternative list, and performing payment verification according to the target Mercker tree.

Description

Payment verification method, payment verification node, full-amount node and storage medium
Technical Field
The present invention relates to communications technologies, and in particular, to a payment verification method, a payment verification node, a quantum node, and a storage medium.
Background
Blockchain techniques and their applications are subverting existing traffic patterns. Due to the characteristics of tamper resistance, traceability and the like of the block chain, various industries actively explore the realization of self business in the block chain network, wherein the block chain network comprises financial institutions, government departments, traditional enterprises, Internet companies and the like.
In bitcoin systems, payment verification is the validation process of a transaction. For example, the first party receives a notification from the second party that the second party claims to have remitted an amount of money from his or her own account to the first party, and the first party needs to confirm that the money has been agreed upon on the blockchain, and that a specific number of confirmations, before the first party can perform the corresponding actual transaction.
In the process of implementing the invention, the inventor finds that at least the following problems exist in the prior art:
a Simple Payment Verification (SPV) node only stores block header information and does not store specific block information. In the actual payment verification process, the SPV node constructs a bloom filter, the bloom filter is sent to the full-scale node, the full-scale node traverses all transactions of the blocks in the block chain one by one, and alternative transactions are obtained to be sent to the SPV node for subsequent payment verification. However, as more transactions and more blocks are used, the efficiency of using the payment verification method is low.
Disclosure of Invention
The embodiment of the invention provides a payment verification method, a payment verification node, a full-amount node and a storage medium.
The technical scheme of the embodiment of the invention is realized as follows:
in a first aspect, an embodiment of the present invention provides a payment verification method, which is applied to a payment verification node, where the payment verification node stores block header information of each block in a block chain, where the block header information includes a transaction hash combination value obtained by performing bitwise or operation on all hash values in a corresponding block, and the method includes:
acquiring a target hash value, traversing the block chain according to the target hash value and the transaction hash combination value, and determining an alternative block list;
if the height number of the blocks in the candidate block list is larger than a preset candidate threshold value, constructing a bloom filter according to the target hash value;
sending the bloom filter and the candidate block list to a full-scale node, and receiving a transaction candidate list determined by the full-scale node according to the bloom filter and the candidate block list;
and acquiring a target Mercker tree corresponding to the target transaction according to the transaction alternative list, and performing payment verification according to the target Mercker tree.
In the above method, the performing a block header traversal on the block chain according to the target hash value and the transaction hash combination value to determine a candidate block list includes:
according to the traversal sequence from the highest block to the created block, performing bitwise AND operation on each transaction hash combination value and the target hash value in sequence to obtain an operation result corresponding to each block in the block chain;
determining a target operation result which is larger than zero from the operation results;
acquiring the block height of a block corresponding to the target operation result in the block chain;
adding the block height to the list of candidate blocks.
In the above method, the obtaining a target mercker tree corresponding to a target transaction according to the transaction candidate list includes:
determining the target transaction corresponding to the target hash value from the transaction candidate list;
determining a target block height based on the target transaction;
and sending the target block height to the full-scale node, and receiving the target Merck tree obtained by the full-scale node according to the target block height.
In the above method, after determining the candidate block list, the method further includes:
if the block height number in the candidate block list is smaller than or equal to the preset candidate threshold, sending the block height in the candidate block list to the full-scale node;
and receiving the target Merck tree obtained by the full-amount node according to the block height in the candidate block list, and performing payment verification according to the target Merck tree.
In a second aspect, an embodiment of the present invention provides a payment verification method, which is applied to a full-scale node, where a block chain is stored in the full-scale node, and the method includes:
receiving a bloom filter and an alternative block list sent by a payment verification node;
performing transaction list traversal on the alternative blocks corresponding to the alternative block list according to the bloom filter to obtain a transaction alternative list;
sending the transaction alternative list to the payment verification node, and receiving the height of a target block determined by the payment verification node after screening according to the transaction alternative list;
obtaining a target Merck tree according to the height of the target block;
and sending the target Merck tree to the payment verification node for payment verification by the payment verification node.
In the above method, the traversing the transaction list according to the bloom filter for the candidate blocks corresponding to the candidate block list to obtain the transaction candidate list includes:
determining the alternative blocks from the block chain according to the block heights in the alternative block list;
acquiring a transaction list in the alternative block;
matching each transaction in the transaction list according to the bloom filter to obtain a matching result corresponding to each transaction in the transaction list;
determining a target matching result which is successfully matched from the matching results;
and adding the transaction corresponding to the target matching result into the transaction alternative list.
In the above method, before the sending the target mercker tree to the payment verification node for payment verification by the payment verification node, the method further includes:
receiving the block height in the alternative block list sent by the payment verification node;
and determining a matching block with the block height in the candidate block list from the block chain, and acquiring the target Merckel tree from the matching block.
In a third aspect, an embodiment of the present invention provides a payment verification node, where the payment verification node includes: a first processor, a first memory, and a first communication bus;
the first communication bus is used for realizing connection communication between the first processor and the first memory;
the first memory stores block header information of each block in a block chain, and the block header information comprises transaction hash combination values obtained by bit-wise OR operation of all hash values in corresponding blocks;
the first processor is configured to execute a first payment verification program stored in the first memory to implement the steps of:
acquiring a target hash value, traversing the block chain according to the target hash value and the transaction hash combination value, and determining an alternative block list; if the height number of the blocks in the candidate block list is larger than a preset candidate threshold value, constructing a bloom filter according to the target hash value; sending the bloom filter and the candidate block list to a full-scale node, and receiving a transaction candidate list determined by the full-scale node according to the bloom filter and the candidate block list; and acquiring a target Mercker tree corresponding to the target transaction according to the transaction alternative list, and performing payment verification according to the target Mercker tree.
In the payment verification node, the first processor is specifically configured to execute the first payment verification program, so as to implement the following steps:
according to the traversal sequence from the highest block to the created block, performing bitwise AND operation on each transaction hash combination value and the target hash value in sequence to obtain an operation result corresponding to each block in the block chain; determining a target operation result which is larger than zero from the operation results; acquiring the block height of a block corresponding to the target operation result in the block chain; adding the block height to the list of candidate blocks.
In the payment verification node, the first processor is specifically configured to execute the first payment verification program, so as to implement the following steps:
determining the target transaction corresponding to the target hash value from the transaction candidate list; determining a target block height based on the target transaction; and sending the target block height to the full-scale node, and receiving the target Merck tree obtained by the full-scale node according to the target block height.
In the above payment verification node, the first processor is further configured to execute the first payment verification procedure after determining the candidate block list, so as to implement the following steps:
if the block height number in the candidate block list is smaller than or equal to the preset candidate threshold, sending the block height in the candidate block list to the full-scale node; receiving the target Merck tree obtained by the full-quantity node according to the block height in the candidate block list; and carrying out payment verification according to the target Mercker tree.
In a fourth aspect, an embodiment of the present invention provides a full-scale node, where the full-scale node includes: a second processor, a second memory, and a second communication bus;
the second communication bus is used for realizing connection communication between the second processor and the second memory;
storing a chain of blocks in the second memory;
the second processor is configured to execute a second payment verification program stored in the second memory to perform the steps of:
receiving a bloom filter and an alternative block list sent by a payment verification node; performing transaction list traversal on the alternative blocks corresponding to the alternative block list according to the bloom filter to obtain a transaction alternative list; sending the transaction alternative list to the payment verification node, and receiving the height of a target block determined by the payment verification node after screening according to the transaction alternative list; and acquiring a target Merck tree according to the height of the target block, and sending the target Merck tree to the payment verification node for payment verification by the payment verification node.
In the above-mentioned full-scale node, the second processor is specifically configured to execute the second payment verification program, so as to implement the following steps:
determining the alternative blocks from the block chain according to the block heights in the alternative block list; acquiring a transaction list in the alternative block; matching each transaction in the transaction list according to the bloom filter to obtain a matching result corresponding to each transaction in the transaction list; and if a target matching result which is successfully matched is determined from the matching results, adding the transaction corresponding to the target matching result into the transaction alternative list.
In the above-mentioned full-scale node, the second processor is configured to send the target mercker tree to the payment verification node, so that before the payment verification node performs payment verification, the second processor is further configured to execute the second payment verification program, so as to implement the following steps:
receiving the block height in the alternative block list sent by the payment verification node; and determining a matching block corresponding to the block height in the candidate block list from the block chain, and acquiring the target Merckel tree from the matching block.
In a fifth aspect, an embodiment of the present invention provides a storage medium applied to a payment verification node, where the storage medium stores one or more programs, and the one or more programs are executable by one or more processors to implement the above payment verification method applied to the payment verification node.
In a sixth aspect, an embodiment of the present invention provides a storage medium applied to a full-scale node, where the storage medium stores one or more programs, and the one or more programs are executable by one or more processors to implement the above payment verification method applied to the full-scale node.
Therefore, the payment verification node stores the block head information of each block in the block chain in the payment verification node, the block head information comprises a transaction hash combination value obtained by performing bitwise OR operation on all hash values in the corresponding block, the payment verification node obtains a target hash value, and traverses the block chain according to the target hash value and the transaction hash combination value to determine an alternative block list; if the height number of the blocks in the alternative block list is larger than a preset alternative threshold value, constructing a bloom filter according to the target hash value; sending the bloom filter and the alternative block list to a full-volume node, and receiving a transaction alternative list determined by the full-volume node according to the bloom filter and the alternative block list; and performing payment verification according to the target Mercker tree corresponding to the target transaction according to the transaction alternative list and the target Mercker tree. That is to say, according to the technical scheme provided by the embodiment of the present invention, when performing payment verification, the payment verification node may perform block filtering first according to the transaction hash combination value added in the block header information, thereby reducing blocks that the full number of nodes need to filter, and improving the efficiency of payment verification.
The embodiment of the invention is applied to realize the following beneficial effects:
the block head information of each block in the block chain is stored in the payment verification node, and the block head information comprises the transaction hash combination value obtained by performing bitwise or operation on all hash values in the corresponding block.
Drawings
Fig. 1 is a first schematic flow chart of a payment verification method according to an embodiment of the present invention;
fig. 2 is a block header information composition diagram according to an embodiment of the present invention;
fig. 3 is a schematic flow chart of a payment verification method according to an embodiment of the present invention;
fig. 4 is a third schematic flowchart of a payment verification method according to an embodiment of the present invention;
fig. 5 is a fourth schematic flowchart of a payment verification method according to an embodiment of the present invention;
fig. 6A is a schematic diagram of an interaction between an exemplary payment verification node and a full-scale node according to an embodiment of the present invention;
fig. 6B is a schematic interaction diagram of an exemplary payment verification node and a full-scale node according to an embodiment of the present invention;
fig. 7 is a schematic structural diagram of a payment verification node according to an embodiment of the present invention;
fig. 8 is a schematic structural diagram of a full quantum node according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention clearer, the present invention will be further described in detail with reference to the accompanying drawings, the described embodiments should not be construed as limiting the present invention, and all other embodiments obtained by a person of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.
Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs. The terminology used herein is for the purpose of describing embodiments of the invention only and is not intended to be limiting of the invention.
Before further detailed description of the embodiments of the present invention, terms and expressions mentioned in the embodiments of the present invention are explained, and the terms and expressions mentioned in the embodiments of the present invention are applied to the following explanations.
1) Transaction (Transaction), equivalent to the computer term "Transaction", includes three different Transaction types: deployment (deployment), invocation (Invoke) and Query (Query). The present invention is directed to a method and system for deploying transactions for installing a specified chain code to a node of a blockchain network, invoking and querying a type of transaction for invoking a chain code of a deployment number to implement operations on relevant data of a target account in an ledger, including adding, looking up, modifying data in the form of Key-Value pairs in the account, or adding a new account in the ledger, not simply a transaction in a business context, which is followed by embodiments of the present invention in view of the convention that "transactions" are colloquially used in blockchain technology.
2) A Block (Block) recording a data structure of the ledger data updated by the exchange within a period of time, marked with a timestamp and a unique mark (e.g. a digital fingerprint) of a previous Block, and after the Block is subjected to consensus verification by nodes in the Block chain network, the Block is appended to the end of the Block chain to become a new Block.
3) A chain of blocks (Blockchain), a chain of data structures in which blocks are assembled in a sequentially contiguous manner, in each block referencing a hash value of a previous block or a subset thereof, thereby cryptographically securing the recorded transaction as being non-tamperable and non-forgeable.
4) A blockchain network incorporates new blocks into a set of centerless nodes of the blockchain in a consensus manner.
Example one
The embodiment of the invention provides a payment verification method, which is applied to a payment verification node, wherein the payment verification node stores block head information of each block in a block chain, and the block head information comprises a transaction hash combination value obtained by carrying out bitwise OR operation on all hash values in corresponding blocks. Fig. 1 is a first flowchart illustrating a payment verification method according to an embodiment of the present invention. As shown in fig. 1, the method mainly comprises the following steps:
s101, acquiring a target hash value, traversing a block chain according to the target hash value and a transaction hash combination value, and determining an alternative block list.
In the embodiment of the present invention, the payment verification node may first obtain the target hash value, and perform block head traversal on the block chain according to the target hash value and the transaction hash combination value, to determine the candidate block list.
It should be noted that, in the embodiment of the present invention, the target hash value is a hash value of a target transaction that needs payment verification, and the specific target hash value is not limited in the embodiment of the present invention.
It should be noted that, in the embodiment of the present invention, only the block header information of each block in the block chain is stored in the payment verification node, and in addition, a transaction hash combination value, specifically, a value obtained by performing a bitwise or operation on all hash values in corresponding blocks, is further added to each block header information of the block chain. A plurality of transactions are contained in each block of the blockchain, wherein each transaction corresponds to one hash value, and the hash values form all the hash values in the corresponding block. And performing bitwise OR operation on the hash values to be involved in the operation, wherein the bitwise OR operation is a binary bit OR corresponding to the hash values to be involved in the operation.
Illustratively, in the embodiment of the present invention, the blockchain includes a block a, and the block a includes a transaction 1 and a transaction 2, where the transaction 1 corresponds to a hash value 1 and the transaction 2 corresponds to a hash value 2, and therefore, the hash value 1 and the hash value 2 are bitwise or-operated to obtain a transaction hash combination value corresponding to the block a, and the transaction hash combination value is specifically stored in a block header of the block a.
Fig. 2 is a block header information composition diagram according to an embodiment of the present invention. As shown in fig. 2, in the embodiment of the present invention, the chunk header information of each chunk in the chunk chain stored in the payment verification node includes not only the existing related information, i.e., version, pre-hash value, mercker root, timestamp, difficulty target, and random number, but also the transaction hash combination value.
Specifically, in the embodiment of the present invention, the traversing, by the payment verification node, the block head of the block chain according to the target hash value and the transaction hash combination value to determine the candidate block list includes: according to the traversal sequence from the highest block to the created block, performing bitwise AND operation on each transaction hash combination value and the target hash value in sequence to obtain an operation result corresponding to each block in the block chain; and if the operation result is larger than zero, adding the block height of the corresponding block in the block chain into the alternative block list.
It should be noted that, in the embodiment of the present invention, the highest block is the last block connected in the block chain, that is, the highest block does not have the next block connected thereto, and only has the last block connected thereto. A created block is the first block connected in a chain of blocks, and the earliest constructed block, i.e., the created block, has no previous block connected thereto and only has the next block connected thereto. The payment verification node traverses according to the traversal sequence from the highest block to the created block, namely, firstly, the transaction hash combination value in the block head information of the highest block and the target hash value are subjected to bitwise AND operation to obtain an operation result corresponding to the highest block, then, the transaction hash combination value in the block head information of the last block connected with the highest block and the target hash value are subjected to bitwise AND operation to obtain an operation result corresponding to the last block connected with the highest block, the bitwise AND operation is sequentially performed on the last block, and finally, the transaction hash combination value in the block head information of the created block and the target hash combination value are subjected to bitwise AND operation to obtain an operation result corresponding to the created block.
It is understood that, in the embodiment of the present invention, the payment verification node performs a bitwise and operation on the transaction hash combination value in the chunk header information of each chunk and the target hash value, that is, performs a bitwise and operation on the transaction hash combination value and the target hash value, that is, performs a binary and operation on each transaction hash combination value and each target hash value.
Illustratively, in the embodiment of the present invention, the blockchain includes a block B, the block header information of the block B includes a transaction hash combination value B corresponding to the block B, the target hash value is N, and the payment verification node performs binary and on the transaction hash combination value B and the target hash combination value N, so as to obtain an operation result corresponding to the block B.
It should be noted that, in the embodiment of the present invention, after acquiring the operation result corresponding to each block in the block chain, the payment verification node determines, as the target operation result, a result that is greater than zero in the operation results, that is, as long as the operation result corresponding to a certain block in the block chain is greater than zero, the operation result is determined as the target operation result. Further, since the payment verification node itself stores the block header information of each block in the block chain, and specifically, the payment verification node can store the block header information according to the connection sequence of the block chain, the position of each block in the block chain, that is, the block height of each block, can be known, and therefore, the payment verification node can directly obtain the block height of the corresponding block in the block chain according to the target operation result, and then add the obtained block height to the candidate block list.
For example, in the embodiment of the present invention, the blockchain includes M blocks, which are block 1, block 2, and … … from the created block to the highest block, respectively, block M, i.e., the created block is block 1, and the highest block is block M. The payment verification node obtains an operation result corresponding to each block, wherein the operation result corresponding to the block 2 is greater than zero, that is, the operation result corresponding to the block 2 is a target operation result, and therefore, the payment verification node obtains the block height of the block 2 in the block chain, specifically, the payment verification node can know that the position of the block 2 in the block chain is the second position, which is the block height of the block 2, and further add the block height of the block 2 into the alternative block list.
It can be understood that, in the prior art, the payment verification node cannot screen the blocks in the block chain according to the target hash value, and excludes the blocks irrelevant to the target transaction requiring payment verification, and the full-scale node must specifically screen each block in the block chain in sequence.
S102, if the height number of the blocks in the candidate block list is larger than a preset candidate threshold value, constructing a bloom filter according to the target hash value.
In the embodiment of the present invention, after determining the candidate block list, the payment verification node may count the block height number in the candidate block list, and if the number is large, that is, the block height number is greater than the preset candidate threshold, construct a bloom filter according to the target hash value.
It should be noted that, in the embodiment of the present invention, the payment verification node constructs a bloom filter according to the target hash value, and actually determines the relevant screening condition for the target transaction corresponding to the target hash value.
It should be noted that, in the embodiment of the present invention, the preset alternative threshold may be preset in the payment verification node according to an actual payment verification requirement, and a specific preset alternative threshold is not limited in the embodiment of the present invention.
Illustratively, in the embodiment of the present invention, the candidate block list determined by the payment verification node includes 5 block heights, that is, the number of block heights is 5, and the preset candidate threshold is 3, so that the payment verification node constructs a bloom filter according to the target hash value.
S103, sending the bloom filter and the candidate block list to a full-scale node, and receiving a transaction candidate list determined by the full-scale node according to the bloom filter and the candidate block list.
In an embodiment of the invention, the payment verification node may send the bloom filter and the list of candidate blocks to the full-scale node after constructing the bloom filter, thereby receiving the list of transaction candidates determined by the full-scale node according to the bloom filter and the list of candidate blocks.
It should be noted that, in the embodiment of the present invention, there may be a plurality of total volume nodes around the payment verification node, and therefore, the payment verification node may send the bloom filter and the candidate block list to the plurality of total volume nodes, and correspondingly, the payment verification node may receive the transaction candidate list determined by each of the plurality of total volume nodes.
It should be noted that, in the embodiment of the present invention, only the block header information of each block in the block chain is stored in the payment verification node, and the specific transaction list is stored in the block body of each block, therefore, the payment verification node needs to send the candidate block list and the bloom filter to the surrounding full-scale node, and the full-scale node stores the complete block chain including the complete data of each block, so that the corresponding block may be searched in the block chain according to the height of each block in the candidate block list, the transaction list of the blocks is obtained, each transaction in the transaction list is further matched according to the bloom filter, the successfully matched transaction is placed in the transaction candidate list, and finally, the transaction candidate list is sent to the payment verification node.
S104, obtaining a target Merck tree corresponding to the target transaction according to the transaction alternative list, and performing payment verification according to the target Merck tree.
In the embodiment of the invention, after receiving the transaction candidate list, the payment verification node can acquire the target mercker tree corresponding to the target transaction according to the transaction candidate list, so that payment verification is performed according to the target mercker tree.
Specifically, in the embodiment of the present invention, the acquiring, by the payment verification node, the target mercker tree corresponding to the target transaction according to the transaction candidate list includes: determining a target transaction corresponding to the target hash value from the transaction alternative list; determining a target block height according to the target transaction; and sending the target block height to a full-scale node, and receiving a target Merck tree obtained by the full-scale node according to the target block height.
It should be noted that, in the embodiment of the present invention, the payment verification node receives the transaction candidate list and includes all the transactions matched with the bloom filter, but the bloom filter is only a larger matching condition about the target hash value, and the matched transactions do not completely correspond to the target hash value, so that the payment verification node traverses each transaction in the transaction candidate list and determines the target transaction corresponding to the target hash value from the transaction candidate list, that is, the transaction really matches the target hash value.
It should be noted that, in the embodiment of the present invention, the payment verification node may send the bloom filter and the candidate block list to the multiple full-scale nodes, and correspondingly, the payment verification node may also receive the multiple transaction candidate lists, and since the process of determining the transaction candidate lists by the full-scale nodes according to the bloom filter and the candidate block lists is completely the same, theoretically, the multiple transaction candidate lists received by the payment verification node should be completely the same, but there may still be an unforeseen deviation, that is, there is a case that the received multiple transaction candidate lists are partially different, at this time, the transaction candidate list with the highest repetition rate may be selected, and the target transaction corresponding to the target hash value is determined from the transaction candidate list, so as to ensure the accuracy of the verification.
It should be noted that, in the embodiment of the present invention, after the payment verification node determines the target transaction, a target block height may be further determined according to the target transaction, where the target block height is a block height of a block in a block chain storing the target transaction, and when the full-size node determines the alternative transaction list, the matched transaction is added to the alternative transaction list, and the block height of the block storing the transaction is also indicated, so that the payment verification node may directly determine the target block height according to the target transaction.
It should be noted that, in the embodiment of the present invention, after determining the height of the target block, the payment verification node sends the height of the target block to the full-scale node, and the full-scale node may search a corresponding target block from the block chain according to the height of the target block, and further obtain the target mercker tree in the target block.
It can be understood that, in the embodiment of the present invention, only the block header information of each block in the block chain is stored in the payment verification node, and a specific mercker tree is stored in the block body of each block, therefore, the payment verification node needs to send the target block height to the surrounding full-scale node, and the full-scale node stores the complete block chain including the complete data of each block, so that the corresponding target block can be first searched in the block chain according to the target block height, the target mercker tree stored in the deblock body of the target block is obtained, and finally, the target mercker tree is sent to the payment verification node, and the payment verification node can receive the target mercker tree.
It should be noted that, in the embodiment of the present invention, the target mercker tree includes information related to the target transaction, so that the payment verification node can perform subsequent payment verification, for example, perform logic verification, etc., according to the target mercker tree. Specific subsequent payment verification embodiments of the present invention are not limited.
It should be noted that, in the embodiment of the present invention, in step S101, after the payment verification node determines the candidate block list, if the number of block heights in the candidate block list is less than or equal to the preset candidate threshold, the payment verification node may further perform other steps. Fig. 3 is a schematic flow chart of a payment verification method according to an embodiment of the present invention. As shown in fig. 3, after step S101, the method further includes the following steps:
s301, if the block height number in the candidate block list is smaller than or equal to a preset candidate threshold, sending the block height in the candidate block list to the full-scale node.
In the embodiment of the present invention, after determining the candidate block list, the payment verification node may send the block height in the candidate block list to the full-scale node if the number of block heights in the candidate block list is less than or equal to the preset candidate threshold.
It is understood that, in the embodiment of the present invention, the number of block heights in the candidate block list is less than or equal to the preset candidate threshold, that is, only fewer blocks in the block chain are associated with the target hash value, and therefore, the block heights in the candidate block list may be directly sent to the full-scale node.
Specifically, in the embodiment of the present invention, the payment verification node may send one block height in the candidate block list at a time, and of course, may send all the block heights in the candidate block list to the full-scale node at a time. Specific transmission modes the embodiments of the present invention are not limited.
S302, receiving a target Merck tree obtained by the full-amount node according to the block height in the candidate block list, and performing payment verification according to the target Merck tree.
In the embodiment of the invention, after the payment verification node sends the block height in the candidate block list to the full-scale node, the full-scale node obtains the target mercker tree according to the block height in the received candidate block list, so that the target mercker tree is sent to the payment verification node, and the payment verification node can receive the target mercker tree and further carry out payment verification according to the target mercker tree.
It should be noted that, in the embodiment of the present invention, if the payment verification node sends the block height in the candidate block list one at a time in step S301, and correspondingly, the full-size node also receives the block height in the candidate block list one at a time, at this time, under the condition that the full-scale node receives a block height in the candidate block list, the full-scale node searches a corresponding matching block from the block chain according to the currently received block height and acquires a target Merck tree from the matching block, in the case where the quorum node receives the next block height in the list of candidate blocks, the quorum node will look up the corresponding matching block from the blockchain according to the next block height, and acquiring the target Merck tree from the matching block corresponding to the next block height, namely sequentially and circularly acquiring the target Merck tree. Of course, if the payment verification node sends all the block heights in the candidate block list to the full-scale node in step S301, it may also be understood that the payment verification node directly sends the candidate block list to the full-scale node, at this time, the full-scale node searches for corresponding matching blocks from the block chain according to the block heights in the candidate block list, that is, searches for matching blocks corresponding to each block height in the candidate block list, and obtains the target merck tree from the matching blocks respectively. After receiving the target mercker tree, the payment verification node may perform a subsequent payment verification process, such as logic verification, according to the target mercker tree.
The embodiment of the invention provides a payment verification method, which is applied to a payment verification node, wherein the payment verification node stores block head information of each block in a block chain, the block head information comprises a transaction hash combination value obtained by performing bitwise OR operation on all hash values in corresponding blocks, the payment verification node obtains a target hash value, and traverses the block chain according to the target hash value and the transaction hash combination value to determine an alternative block list; if the height number of the blocks in the alternative block list is larger than a preset alternative threshold value, constructing a bloom filter according to the target hash value; sending the bloom filter and the alternative block list to a full-volume node, and receiving a transaction alternative list determined by the full-volume node according to the bloom filter and the alternative block list; and performing payment verification according to the target Mercker tree corresponding to the target transaction according to the transaction alternative list and the target Mercker tree. That is to say, according to the technical scheme provided by the embodiment of the present invention, when performing payment verification, the payment verification node may perform block filtering first according to the transaction hash combination value added in the block header information, thereby reducing blocks that the full number of nodes need to filter, and improving the efficiency of payment verification.
Example two
Another embodiment of the invention provides a payment verification method, which is applied to a full-scale node and stores a block chain in the full-scale node. Fig. 4 is a third schematic flowchart of a payment verification method according to an embodiment of the present invention. As shown in fig. 4, the method mainly comprises the following steps:
s401, receiving the bloom filter and the alternative block list sent by the payment verification node.
In an embodiment of the present invention, the quorum node may receive the bloom filter and the list of candidate blocks sent by the payment verification node.
It should be noted that, in the embodiment of the present invention, the payment verification node may filter each block in the block chain according to the transaction hash combination value in the corresponding block header information, determine the candidate block list, and send the bloom filter and the candidate block list to the full node if the height number of blocks in the candidate block list is greater than the preset candidate threshold, at this time, the full node may receive the bloom filter and the candidate block list.
It should be noted that, in the embodiment of the present invention, the full-scale node stores a complete block chain, that is, stores complete information of each block in the block chain.
It should be noted that, in the embodiment of the present invention, there may be a plurality of full-scale nodes, that is, each of the plurality of full-scale nodes may receive the bloom filter sent by the payment verification node, but each full-scale node performs the same subsequent steps.
It should be noted that, in the prior art, in the process of performing payment verification, the payment verification node only sends the bloom filter constructed according to the target hash value to the full-scale node, and the full-scale node performs a transaction in a transaction list included in each chunk in the blockchain according to an object matched by the bloom filter.
S402, traversing the transaction list of the candidate blocks corresponding to the candidate block list according to the bloom filter to obtain the transaction candidate list.
In the embodiment of the invention, after receiving the bloom filter and the candidate block list, the full-scale node traverses the transaction list of the candidate blocks corresponding to the candidate block list according to the bloom filter to obtain the transaction candidate list.
Specifically, in the embodiment of the present invention, the traversing the transaction list by the full node according to the bloom filter on the candidate blocks corresponding to the candidate block list to obtain the transaction candidate list includes: determining an alternative block from the block chain according to the block height in the alternative block list; acquiring a transaction list in the alternative block; matching each transaction in the transaction list according to the bloom filter to obtain a matching result corresponding to each transaction in the transaction list; determining a target matching result which is successfully matched from the matching results; and adding the transaction corresponding to the target matching result into a transaction alternative list.
It should be noted that, in the embodiment of the present invention, the candidate block list includes a plurality of block heights determined by the payment verification node, each block height represents a position of one block in the block chain, and the total node may find corresponding blocks from the block chain one by one according to the block heights in the candidate block list, and determine the blocks as candidate blocks.
Illustratively, in the embodiment of the present invention, the candidate block list includes 5 block heights, i.e., a block height 1, a block height 2, a block height 3, a block height 4, and a block height 5. The block corresponding to the block height 1 is found in the block chain by the full node to be the block 1, the block corresponding to the block height 2 is the block 2, the block corresponding to the block height 3 is the block 3, the block corresponding to the block height 4 is the block 4, and the block corresponding to the block height 5 is the block 5, so that the block 1, the block 2, the block 3, the block 4 and the block 5 are all alternative blocks.
It should be noted that, in the embodiment of the present invention, since the complete blockchain is stored in the full-scale node, after determining the candidate block, the full-scale node may directly obtain the transaction list from the candidate blockchain list, and further, match each transaction in the transaction list according to the bloom filter to obtain a matching result corresponding to each transaction.
It should be noted that, in the embodiment of the present invention, the matching result that is successfully matched is the target matching result, and the full-scale node adds the transaction corresponding to the target matching result to the transaction candidate list.
Illustratively, in an embodiment of the present invention, the blockchain includes a block Q, where the block Q is a candidate block determined by the quorum node, and the quorum node obtains a transaction list Q in the block Q, where the transaction list specifically includes: transaction 1, transaction 2, transaction 3, transaction 4, and transaction 5. The full-volume node matches transaction 1, transaction 2, transaction 3, transaction 4 and transaction 5 respectively according to the bloom filter pair, and obtains that the matching result corresponding to transaction 1 is matching failure, the matching result corresponding to transaction 2 is matching success, the matching result corresponding to transaction 3 is matching failure, the matching result corresponding to transaction 4 is matching failure and the matching result corresponding to transaction 5 is matching success, so that transaction 2 and transaction 5 are added into the transaction alternative list.
And S403, sending the transaction alternative list to a payment verification node, and receiving the height of the target block determined by the payment verification node after screening according to the transaction alternative list.
In the embodiment of the invention, after obtaining the transaction candidate list, the full-scale node sends the transaction candidate list to the payment verification node, the payment verification node performs screening according to the transaction candidate list to obtain the height of the target block, and transmits the height of the target block to the full-scale node, and the full-scale node can receive the height of the target block determined by the payment verification node after screening according to the transaction candidate list.
It should be noted that, in the embodiment of the present invention, the payment verification node may determine the target transaction corresponding to the target hash value from the transaction candidate list, and then determine the target block height according to the target transaction, where a process of determining the target block height by the payment verification node is described in detail in the first embodiment, and is not described herein again.
S404, obtaining the target Merck tree according to the height of the target block.
In the embodiment of the invention, after receiving the target block height, the full-amount node can acquire the target mercker tree and send the target mercker tree to the payment verification node so that the payment verification node can perform payment verification.
It should be noted that, in the embodiment of the present invention, the full-scale node stores the complete block chain, so that the full-scale node can find the corresponding target block from the block chain according to the height of the target block, that is, the position information of the representation block in the block chain, and directly obtain the target mercker tree from the target block.
For example, in the embodiment of the present invention, the target block height is S, the full amount of nodes can search for the block with the position S in the block chain, where the block is the target block, and further directly obtain the mercker tree stored in the block, where the mercker tree is the target mercker tree.
S405, the target Mercker tree is sent to a payment verification node so that the payment verification node can conduct payment verification.
In the embodiment of the present invention, after obtaining the target mercker tree, the full-amount node may send the target mercker tree to the payment verification node, and after receiving the target mercker tree, the payment verification node may perform a subsequent payment verification process, such as logic verification, according to the target mercker tree.
It should be noted that, in the embodiment of the present invention, before the step S405, there is another way for the full-quantity node to obtain the target mercker tree. Fig. 5 is a fourth schematic flowchart of a payment verification method according to an embodiment of the present invention. As shown in fig. 5, before step S405, the following steps may be further included:
s501, receiving the block height in the candidate block list sent by the payment verification node.
In an embodiment of the present invention, the full-scale node may further receive a block height in the candidate block list sent by the payment verification node.
It should be noted that, in the embodiment of the present invention, the payment verification node may filter each block in the block chain according to the transaction hash combination value in the corresponding block header information, determine the candidate block list, and then send the block height in the candidate block list to the full node if the number of block heights in the candidate block list is less than or equal to the preset candidate threshold, at this time, the full node may receive the block height in the candidate block list.
Specifically, in the embodiment of the present invention, the payment verification node may send one block height in the candidate block list at a time, and certainly, may also send all block heights in the candidate block list to the full-scale node at a time, so that the full-scale node may sequentially receive different block heights, or may sequentially and directly receive all block heights in the candidate block list. Specific receiving manner the embodiments of the present invention are not limited.
S502, determining a matching block with the block height in the candidate block list from the block chain, and acquiring a target Merckel tree from the matching block.
In an embodiment of the present invention, after receiving the block height in the candidate block list, the full-scale node may determine a matching block of the block height in the candidate block list from the block chain, and obtain the target mercker tree from the matching block.
It should be noted that, in the embodiment of the present invention, a complete block chain is stored in the full node, and the block height represents a position of a block in the block chain, so that the full node may search for a corresponding block from the block chain according to the block height in the received candidate block list, and determine the searched block as a matching block.
It should be noted that, in the embodiment of the present invention, the full-scale node stores a complete block chain, that is, specific information of each block is stored, so that after determining a matching block, the full-scale node may directly obtain the stored merkel tree from the matching block, and determine the obtained merkel tree as the target merkel tree.
The embodiment of the invention provides a payment verification method, which is applied to a full-scale node, wherein a block chain is stored in the full-scale node, and the full-scale node receives a bloom filter and an alternative block list sent by a payment verification node; traversing a transaction list of the alternative blocks corresponding to the alternative block list according to the bloom filter to obtain a transaction alternative list; sending the transaction alternative list to a payment verification node, and receiving the height of a target block determined by the payment verification node after screening according to the transaction alternative list; obtaining a target Merck tree according to the height of a target block; and sending the target Mercker tree to a payment verification node for payment verification by the payment verification node. That is to say, according to the technical scheme provided by the embodiment of the invention, when the payment verification is performed, the transaction list traversal for each block in the block chain is not required by the full-scale node, and the transaction list traversal is performed only for the alternative blocks corresponding to the alternative block list sent by the payment verification node, so that the blocks which need to be filtered by the full-scale node are reduced, and the efficiency of the payment verification is improved.
EXAMPLE III
Fig. 6A is a first schematic diagram of interaction between an exemplary payment verification node and a full-scale node according to an embodiment of the present invention. As shown in fig. 6A, the payment verification node and the full-scale node implement the payment verification specifically as follows:
s601, the payment verification node obtains a target hash value, and traverses the block chain according to the target hash value and the transaction hash combination value to determine an alternative block list.
It should be noted that, in the embodiment of the present invention, only the block header information of each block in the block chain is stored in the payment verification node, and in addition, a transaction hash combination value, specifically, a value obtained by performing a bitwise or operation on all hash values in corresponding blocks, is further added to each block header information of the block chain. A plurality of transactions are contained in each block of the blockchain, wherein each transaction corresponds to one hash value, and the hash values form all the hash values in the corresponding block. And performing bitwise OR operation on the hash values to be involved in the operation, wherein the bitwise OR operation is a binary bit OR corresponding to the hash values to be involved in the operation.
Specifically, in the embodiment of the present invention, the payment verification node performs bitwise and operation on each transaction hash combination value and the target hash value, that is, performs bitwise and operation on each transaction hash combination value and the target hash value, and adds the block height of the block corresponding to the target operation result whose operation result is greater than zero into the candidate block list.
S602, if the height number of the blocks in the candidate block list is larger than a preset candidate threshold, the payment verification node constructs a bloom filter according to the target hash value.
It can be understood that, in the embodiment of the present invention, after determining the candidate block list, the payment verification node may count the number of block heights in the candidate block list, and if the number is large, that is, the number of block heights is greater than the preset candidate threshold, construct a bloom filter according to the target hash value.
S603, the payment verification node sends the bloom filter and the alternative block list to the full-scale node.
And S604, traversing the transaction list by the full-scale node according to the bloom filter to the alternative blocks corresponding to the alternative block list, and obtaining the transaction alternative list.
Specifically, in the embodiment of the present invention, the traversing the transaction list by the full node according to the bloom filter on the candidate blocks corresponding to the candidate block list to obtain the transaction candidate list includes: determining an alternative block from the block chain according to the block height in the alternative block list; acquiring a transaction list in the alternative block; matching each transaction in the transaction list according to the bloom filter to obtain a matching result corresponding to each transaction in the transaction list; determining a target matching result which is successfully matched from the matching results; and adding the transaction corresponding to the target matching result into a transaction alternative list.
And S605, the full-amount node sends the transaction alternative list to the payment verification node.
S606, the payment verification node determines the target transaction corresponding to the target hash value from the transaction alternative list.
It should be noted that, in the embodiment of the present invention, the payment verification node receives the transaction candidate list and includes all the transactions matched with the bloom filter, but the bloom filter is only a larger matching condition about the target hash value, and the matched transactions do not completely correspond to the target hash value, so that the payment verification node traverses each transaction in the transaction candidate list and determines the target transaction corresponding to the target hash value from the transaction candidate list, that is, the transaction really matches the target hash value.
S607, the payment verification node determines the height of the target block according to the target transaction.
It should be noted that, in the embodiment of the present invention, after the payment verification node determines the target transaction, a target block height may be further determined according to the target transaction, where the target block height is a block height of a block in a block chain storing the target transaction, and when the full-size node determines the alternative transaction list, the matched transaction is added to the alternative transaction list, and the block height of the block storing the transaction is also indicated, so that the payment verification node may directly determine the target block height according to the target transaction.
S608, the payment verification node sends the target block height to the full-scale node.
And S609, the full-quantity node acquires a target Mercker tree according to the height of the target block.
It can be understood that, in the embodiment of the present invention, only the block header information of each block in the block chain is stored in the payment verification node, and a specific mercker tree is stored in the block body of each block, therefore, the payment verification node needs to send the target block height to the surrounding full-scale node, and the full-scale node stores the complete block chain including the complete data of each block, so that the corresponding target block can be searched in the block chain according to the target block height to obtain the target mercker tree stored in the deblock body of the target block.
S610, the full-amount node sends the target Mercker tree to the payment verification node.
S611, the payment verification node conducts payment verification according to the target Mercker tree.
It should be noted that, in the embodiment of the present invention, the payment verification node may perform payment verification according to the target mercker tree, for example, logic verification, and the like, and the specific verification process is not limited in the embodiment of the present invention.
Fig. 6B is a schematic diagram of an interaction between an exemplary payment verification node and a full-scale node according to an embodiment of the present invention. As shown in fig. 6B, in the embodiment of the present invention, after step S601, another branch step is further included, and the specific steps are as follows:
and S612, if the block height number in the candidate block list is smaller than or equal to a preset candidate threshold, the payment verification node sends the block height in the candidate block list to the full-scale node.
S613, the full node determines a matching block of the block height in the candidate block list from the block chain, and obtains a target merck tree from the matching block.
It should be noted that, in the embodiment of the present invention, the full-scale node stores a complete block chain, that is, specific information of each block is stored, so that after determining a matching block, the full-scale node may directly obtain the stored merkel tree from the matching block, and determine the obtained merkel tree as the target merkel tree.
It should be noted that, in the embodiment of the present invention, after the step S613, the steps executed are still the above-mentioned S610 and S611.
Example four
An embodiment of the present invention provides a payment verification node, and fig. 7 is a schematic structural diagram of the payment verification node provided in the embodiment of the present invention. As shown in fig. 7, the payment verification node includes: a first processor 701, a first memory 702, and a first communication bus 703;
the first communication bus 703 is used for realizing connection communication between the first processor 701 and the first memory 702;
the first memory 702 stores block header information of each block in a block chain, where the block header information includes a transaction hash combination value obtained by performing bitwise or operation on all hash values in a corresponding block;
the first processor 701 is configured to execute a first payment verification program stored in the first memory 702 to implement the following steps:
acquiring a target hash value, traversing the block chain according to the target hash value and the transaction hash combination value, and determining an alternative block list; if the height number of the blocks in the candidate block list is larger than a preset candidate threshold value, constructing a bloom filter according to the target hash value; sending the bloom filter and the candidate block list to a full-scale node, and receiving a transaction candidate list determined by the full-scale node according to the bloom filter and the candidate block list; and acquiring a target Mercker tree corresponding to the target transaction according to the transaction alternative list, and performing payment verification according to the target Mercker tree.
Optionally, the first processor 701 is specifically configured to execute the first payment verification program, so as to implement the following steps:
according to the traversal sequence from the highest block to the created block, performing bitwise AND operation on each transaction hash combination value and the target hash value in sequence to obtain an operation result corresponding to each block in the block chain; determining a target operation result which is larger than zero from the operation results; acquiring the block height of a block corresponding to the target operation result in the block chain; adding the block height to the list of candidate blocks.
Optionally, the first processor 701 is specifically configured to execute the first payment verification program, so as to implement the following steps:
determining the target transaction corresponding to the target hash value from the transaction candidate list; determining a target block height based on the target transaction; and sending the target block height to the full-scale node, and receiving the target Merck tree obtained by the full-scale node according to the target block height.
Optionally, the first processor 701 is further configured to execute the first payment verification procedure after determining the candidate block list, so as to implement the following steps:
if the block height number in the candidate block list is smaller than or equal to the preset candidate threshold, sending the block height in the candidate block list to the full-scale node; receiving the target Merck tree obtained by the full-quantity node according to the block height in the candidate block list; and carrying out payment verification according to the target Mercker tree.
The embodiment of the invention provides a payment verification node, wherein block head information of each block in a block chain is stored in the payment verification node, the block head information comprises a transaction hash combination value obtained by performing bitwise OR operation on all hash values in the corresponding block, the payment verification node obtains a target hash value, and traverses the block chain according to the target hash value and the transaction hash combination value to determine an alternative block list; if the height number of the blocks in the alternative block list is larger than a preset alternative threshold value, constructing a bloom filter according to the target hash value; sending the bloom filter and the alternative block list to a full-volume node, and receiving a transaction alternative list determined by the full-volume node according to the bloom filter and the alternative block list; and performing payment verification according to the target Mercker tree corresponding to the target transaction according to the transaction alternative list and the target Mercker tree. That is to say, the payment verification node provided in the embodiment of the present invention may perform block filtering first according to the transaction hash combination value added in the block header information when performing payment verification, thereby reducing blocks that the total number of nodes need to filter, and improving the efficiency of payment verification.
EXAMPLE five
An embodiment of the present invention provides a full-scale node, and fig. 8 is a schematic structural diagram of the full-scale node provided in the embodiment of the present invention. As shown in fig. 8, the full-scale node includes: a second processor 801, a second memory 802, and a second communication bus 803;
the second communication bus 803 is used for realizing connection communication between the second processor 801 and the second memory 802;
a chain of memory blocks in the second memory 802;
the second processor 801 is configured to execute a second payment verification program stored in the second memory 802 to implement the following steps:
receiving a bloom filter and an alternative block list sent by a payment verification node; performing transaction list traversal on the alternative blocks corresponding to the alternative block list according to the bloom filter to obtain a transaction alternative list; sending the transaction alternative list to the payment verification node, and receiving the height of a target block determined by the payment verification node after screening according to the transaction alternative list; and acquiring a target Merck tree according to the height of the target block, and sending the target Merck tree to the payment verification node for payment verification by the payment verification node.
Optionally, the second processor 801 is specifically configured to execute the second payment verification program, so as to implement the following steps:
determining the alternative blocks from the block chain according to the block heights in the alternative block list; acquiring a transaction list in the alternative block; matching each transaction in the transaction list according to the bloom filter to obtain a matching result corresponding to each transaction in the transaction list; and if a target matching result which is successfully matched is determined from the matching results, adding the transaction corresponding to the target matching result into the transaction alternative list.
Optionally, the second processor 801 is configured to send the target mercker tree to the payment verification node, so that before the payment verification node performs payment verification, the second processor is further configured to execute the second payment verification procedure, so as to implement the following steps:
receiving the block height in the alternative block list sent by the payment verification node; and determining a matching block corresponding to the block height in the candidate block list from the block chain, and acquiring the target Merckel tree from the matching block.
The embodiment of the invention provides a full-scale node, wherein a block chain is stored in the full-scale node, and the full-scale node receives a bloom filter and an alternative block list sent by a payment verification node; traversing a transaction list of the alternative blocks corresponding to the alternative block list according to the bloom filter to obtain a transaction alternative list; sending the transaction alternative list to a payment verification node, and receiving the height of a target block determined by the payment verification node after screening according to the transaction alternative list; obtaining a target Merck tree according to the height of a target block; and sending the target Mercker tree to a payment verification node for payment verification by the payment verification node. That is to say, the total node provided in the embodiment of the present invention does not need to traverse the transaction list for each block in the block chain during payment verification, and only traverses the transaction list for the candidate block corresponding to the candidate block list sent by the payment verification node, thereby reducing the blocks that the total node needs to filter, and improving the efficiency of payment verification.
In summary, the embodiments of the present invention have the following beneficial effects:
when the payment verification is carried out, the payment verification node can firstly carry out block filtering according to the transaction hash combination value added in the block header information, so that blocks needing to be filtered by the full number of nodes are reduced, and the payment verification efficiency is improved.
The above description is only an example of the present invention, and is not intended to limit the scope of the present invention. Any modification, equivalent replacement, and improvement made within the spirit and scope of the present invention are included in the protection scope of the present invention.

Claims (16)

1. A payment verification method is applied to a payment verification node, block header information of each block in a block chain is stored in the payment verification node, the block header information comprises a transaction hash combination value obtained by bit-wise OR operation of all hash values in corresponding blocks, and the method comprises the following steps:
acquiring a target hash value, traversing the block chain according to the target hash value and the transaction hash combination value, and determining an alternative block list;
if the height number of the blocks in the candidate block list is larger than a preset candidate threshold value, constructing a bloom filter according to the target hash value;
sending the bloom filter and the candidate block list to a full-scale node, and receiving a transaction candidate list determined by the full-scale node according to the bloom filter and the candidate block list;
and acquiring a target Mercker tree corresponding to the target transaction according to the transaction alternative list, and performing payment verification according to the target Mercker tree.
2. The method of claim 1, wherein the performing a block header traversal of the blockchain based on the target hash value and the transaction hash combination value to determine a list of candidate blocks comprises:
according to the traversal sequence from the highest block to the created block, performing bitwise AND operation on each transaction hash combination value and the target hash value in sequence to obtain an operation result corresponding to each block in the block chain;
determining a target operation result which is larger than zero from the operation results;
acquiring the block height of a block corresponding to the target operation result in the block chain;
adding the block height to the list of candidate blocks.
3. The method according to claim 1, wherein the obtaining a target mercker tree corresponding to a target transaction according to the transaction candidate list comprises:
determining the target transaction corresponding to the target hash value from the transaction candidate list;
determining a target block height based on the target transaction;
and sending the target block height to the full-scale node, and receiving the target Merck tree obtained by the full-scale node according to the target block height.
4. The method of claim 1, wherein after determining the candidate block list, the method further comprises:
if the block height number in the candidate block list is smaller than or equal to the preset candidate threshold, sending the block height in the candidate block list to the full-scale node;
and receiving the target Merck tree obtained by the full-amount node according to the block height in the candidate block list, and performing payment verification according to the target Merck tree.
5. A payment verification method applied to a full-scale node, wherein the full-scale node stores a block chain therein, the method comprising:
receiving a bloom filter and an alternative block list sent by a payment verification node;
performing transaction list traversal on the alternative blocks corresponding to the alternative block list according to the bloom filter to obtain a transaction alternative list;
sending the transaction alternative list to the payment verification node, and receiving the height of a target block determined by the payment verification node after screening according to the transaction alternative list;
obtaining a target Merck tree according to the height of the target block;
and sending the target Merck tree to the payment verification node for payment verification by the payment verification node.
6. The method according to claim 5, wherein performing a transaction list traversal on the candidate tiles corresponding to the candidate tile list according to the bloom filter to obtain a transaction candidate list comprises:
determining the alternative blocks from the block chain according to the block heights in the alternative block list;
acquiring a transaction list in the alternative block;
matching each transaction in the transaction list according to the bloom filter to obtain a matching result corresponding to each transaction in the transaction list;
determining a target matching result which is successfully matched from the matching results;
and adding the transaction corresponding to the target matching result into the transaction alternative list.
7. The method of claim 5, wherein before sending the target Mercker tree to the payment verification node for payment verification by the payment verification node, the method further comprises:
receiving the block height in the alternative block list sent by the payment verification node;
and determining a matching block with the block height in the candidate block list from the block chain, and acquiring the target Merckel tree from the matching block.
8. A payment verification node, comprising: a first processor, a first memory, and a first communication bus;
the first communication bus is used for realizing connection communication between the first processor and the first memory;
the first memory stores block header information of each block in a block chain, and the block header information comprises transaction hash combination values obtained by bit-wise OR operation of all hash values in corresponding blocks;
the first processor is configured to execute a first payment verification program stored in the first memory to implement the steps of:
acquiring a target hash value, traversing the block chain according to the target hash value and the transaction hash combination value, and determining an alternative block list; if the height number of the blocks in the candidate block list is larger than a preset candidate threshold value, constructing a bloom filter according to the target hash value; sending the bloom filter and the candidate block list to a full-scale node, and receiving a transaction candidate list determined by the full-scale node according to the bloom filter and the candidate block list; and acquiring a target Mercker tree corresponding to the target transaction according to the transaction alternative list, and performing payment verification according to the target Mercker tree.
9. The payment verification node of claim 8, wherein the first processor is specifically configured to execute the first payment verification procedure to implement the following steps:
according to the traversal sequence from the highest block to the created block, performing bitwise AND operation on each transaction hash combination value and the target hash value in sequence to obtain an operation result corresponding to each block in the block chain; determining a target operation result which is larger than zero from the operation results; acquiring the block height of a block corresponding to the target operation result in the block chain; adding the block height to the list of candidate blocks.
10. The payment verification node of claim 8, wherein the first processor is specifically configured to execute the first payment verification procedure to implement the following steps:
determining the target transaction corresponding to the target hash value from the transaction candidate list; determining a target block height based on the target transaction; and sending the target block height to the full-scale node, and receiving the target Merck tree obtained by the full-scale node according to the target block height.
11. The payment verification node of claim 8, wherein the first processor, after determining the list of candidate blocks, is further configured to execute the first payment verification procedure to perform the steps of:
if the block height number in the candidate block list is smaller than or equal to the preset candidate threshold, sending the block height in the candidate block list to the full-scale node; receiving the target Merck tree obtained by the full-quantity node according to the block height in the candidate block list; and carrying out payment verification according to the target Mercker tree.
12. A full-scale node, comprising: a second processor, a second memory, and a second communication bus;
the second communication bus is used for realizing connection communication between the second processor and the second memory;
storing a chain of blocks in the second memory;
the second processor is configured to execute a second payment verification program stored in the second memory to perform the steps of:
receiving a bloom filter and an alternative block list sent by a payment verification node; performing transaction list traversal on the alternative blocks corresponding to the alternative block list according to the bloom filter to obtain a transaction alternative list; sending the transaction alternative list to the payment verification node, and receiving the height of a target block determined by the payment verification node after screening according to the transaction alternative list; and acquiring a target Merck tree according to the height of the target block, and sending the target Merck tree to the payment verification node for payment verification by the payment verification node.
13. The full-volume node according to claim 12, wherein the second processor is specifically configured to execute the second payment verification procedure to implement the steps of:
determining the alternative blocks from the block chain according to the block heights in the alternative block list; acquiring a transaction list in the alternative block; matching each transaction in the transaction list according to the bloom filter to obtain a matching result corresponding to each transaction in the transaction list; and if a target matching result which is successfully matched is determined from the matching results, adding the transaction corresponding to the target matching result into the transaction alternative list.
14. The full-scale node of claim 12, wherein the second processor is further configured to execute the second payment verification procedure before sending the target merkel tree to the payment verification node for payment verification by the payment verification node, so as to implement the following steps:
receiving the block height in the alternative block list sent by the payment verification node; and determining a matching block corresponding to the block height in the candidate block list from the block chain, and acquiring the target Merckel tree from the matching block.
15. A storage medium for use in a payment verification node, the storage medium storing one or more programs executable by one or more processors to perform the method of any one of claims 1-4.
16. A storage medium applied to a full-scale node, the storage medium storing one or more programs executable by one or more processors to implement the method of any one of claims 5-7.
CN201910335989.4A 2019-04-24 2019-04-24 Payment verification method, payment verification node, full-quantity node and storage medium Active CN111768202B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910335989.4A CN111768202B (en) 2019-04-24 2019-04-24 Payment verification method, payment verification node, full-quantity node and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910335989.4A CN111768202B (en) 2019-04-24 2019-04-24 Payment verification method, payment verification node, full-quantity node and storage medium

Publications (2)

Publication Number Publication Date
CN111768202A true CN111768202A (en) 2020-10-13
CN111768202B CN111768202B (en) 2024-06-18

Family

ID=72718322

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910335989.4A Active CN111768202B (en) 2019-04-24 2019-04-24 Payment verification method, payment verification node, full-quantity node and storage medium

Country Status (1)

Country Link
CN (1) CN111768202B (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112712366A (en) * 2021-01-11 2021-04-27 杭州复杂美科技有限公司 Block execution method, computer device and storage medium
CN112765682A (en) * 2021-04-07 2021-05-07 暗链科技(深圳)有限公司 Block data structure of block distributed block chain, storage medium and electronic equipment
CN113961598A (en) * 2021-10-25 2022-01-21 中国科学院沈阳计算技术研究所有限公司 Novel high-speed retrieval model for data on block chain
CN113988856A (en) * 2021-11-08 2022-01-28 福建博泉哈希科技有限公司 Block header propagation method and storage medium

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104462104A (en) * 2013-09-16 2015-03-25 华为软件技术有限公司 Filter method and server
CN107247773A (en) * 2017-06-07 2017-10-13 北京邮电大学 A kind of method that inquiry is traded in distributed data base based on block chain
WO2018119930A1 (en) * 2016-12-29 2018-07-05 深圳前海达闼云端智能科技有限公司 Transaction verification processing method, apparatus and node device
CN108550039A (en) * 2018-04-24 2018-09-18 北京罗格数据科技有限公司 A kind of method of commerce based on block chain structure data
CN108665272A (en) * 2018-05-02 2018-10-16 百度在线网络技术(北京)有限公司 Block chain data processing method, device, equipment and storage medium
US20190018887A1 (en) * 2017-04-12 2019-01-17 Vijay K. Madisetti Method and System for Tuning Blockchain Scalability, Decentralization, and Security for Fast and Low-Cost Payment and Transaction Processing
WO2019021107A1 (en) * 2017-07-24 2019-01-31 nChain Holdings Limited Computer-implemented system and method for managing a large distributed memory pool in a blockchain network
CN109493061A (en) * 2018-12-28 2019-03-19 合肥达朴汇联科技有限公司 A kind of verification method, device, electronic equipment and the storage medium of the data of block chain
CN109583896A (en) * 2018-11-30 2019-04-05 元灵通智能科技(深圳)有限公司 Transaction verification method, block chain node and storage medium

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104462104A (en) * 2013-09-16 2015-03-25 华为软件技术有限公司 Filter method and server
WO2018119930A1 (en) * 2016-12-29 2018-07-05 深圳前海达闼云端智能科技有限公司 Transaction verification processing method, apparatus and node device
US20190018887A1 (en) * 2017-04-12 2019-01-17 Vijay K. Madisetti Method and System for Tuning Blockchain Scalability, Decentralization, and Security for Fast and Low-Cost Payment and Transaction Processing
CN107247773A (en) * 2017-06-07 2017-10-13 北京邮电大学 A kind of method that inquiry is traded in distributed data base based on block chain
WO2019021107A1 (en) * 2017-07-24 2019-01-31 nChain Holdings Limited Computer-implemented system and method for managing a large distributed memory pool in a blockchain network
CN108550039A (en) * 2018-04-24 2018-09-18 北京罗格数据科技有限公司 A kind of method of commerce based on block chain structure data
CN108665272A (en) * 2018-05-02 2018-10-16 百度在线网络技术(北京)有限公司 Block chain data processing method, device, equipment and storage medium
CN109583896A (en) * 2018-11-30 2019-04-05 元灵通智能科技(深圳)有限公司 Transaction verification method, block chain node and storage medium
CN109493061A (en) * 2018-12-28 2019-03-19 合肥达朴汇联科技有限公司 A kind of verification method, device, electronic equipment and the storage medium of the data of block chain

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112712366A (en) * 2021-01-11 2021-04-27 杭州复杂美科技有限公司 Block execution method, computer device and storage medium
CN112765682A (en) * 2021-04-07 2021-05-07 暗链科技(深圳)有限公司 Block data structure of block distributed block chain, storage medium and electronic equipment
CN113961598A (en) * 2021-10-25 2022-01-21 中国科学院沈阳计算技术研究所有限公司 Novel high-speed retrieval model for data on block chain
CN113988856A (en) * 2021-11-08 2022-01-28 福建博泉哈希科技有限公司 Block header propagation method and storage medium

Also Published As

Publication number Publication date
CN111768202B (en) 2024-06-18

Similar Documents

Publication Publication Date Title
US11461310B2 (en) Distributed ledger technology
TWI728418B (en) Method and system for executing multi-party transaction using smart contract
CN110442652B (en) Cross-chain data processing method and device based on block chain
CN111768202A (en) Payment verification method, payment verification node, full-amount node and storage medium
US7627611B2 (en) Conflict resolution in database replication through autonomous node qualified folding
US10635655B2 (en) Device, method and program for securely reducing an amount of records in a database
KR101986081B1 (en) Method for sharing and verifing a block between specific nodes in a blockchain
CN112651724A (en) Cross-chain interaction method, device and system
JP7003995B2 (en) Blockchain management device, blockchain management method and program
CN111405074B (en) Data center network fault diagnosis and automatic configuration method based on hybrid chain
EP3726774A1 (en) Transparent blockchain sidechains to support blockchain processing heterogeneity
AU2018348327B2 (en) Utilizing nonce table to resolve concurrent blockchain transaction failure
CN111899019A (en) Method and system for cross validation and sharing of blacklist and multiple parties
CN110188103A (en) Data account checking method, device, equipment and storage medium
CN108710681A (en) File acquisition method, device, equipment and storage medium
Verdian et al. Quant overledger whitepaper
CN110597922A (en) Data processing method, device, terminal and storage medium
US20200394162A1 (en) Operation management method for distributed ledger system, operation management system for distributed ledger system, and operation management program for distributed ledger system
US11372847B2 (en) Block verification device, block verification method, and program
US20210152459A1 (en) System and method for sharing data among a plurality of block chain networks
CN109739684A (en) The copy restorative procedure and device of distributed key value database based on vector clock
CN113064764A (en) Method and apparatus for performing blocks in a blockchain system
JP2024539910A (en) Method and system for distributed blockchain functionality
CN110928923A (en) Data storage method and system based on block chain
WO2023160040A1 (en) Data processing method and apparatus based on blockchain, and device and readable storage medium

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