Nothing Special   »   [go: up one dir, main page]

CN111768202B - Payment verification method, payment verification node, full-quantity node and storage medium - Google Patents

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

Info

Publication number
CN111768202B
CN111768202B CN201910335989.4A CN201910335989A CN111768202B CN 111768202 B CN111768202 B CN 111768202B CN 201910335989 A CN201910335989 A CN 201910335989A CN 111768202 B CN111768202 B CN 111768202B
Authority
CN
China
Prior art keywords
block
target
transaction
list
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.)
Active
Application number
CN201910335989.4A
Other languages
Chinese (zh)
Other versions
CN111768202A (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

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)
  • Accounting & Taxation (AREA)
  • Engineering & Computer Science (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)
  • Economics (AREA)
  • Marketing (AREA)
  • Technology Law (AREA)
  • Development Economics (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 header information of each block in a block chain, the block header information comprises transaction hash combined values 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 block height number in the alternative block list is larger than a preset alternative threshold value, constructing a bloom filter according to the target hash value; transmitting 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 merck tree corresponding to the target transaction according to the transaction alternative list, and performing payment verification according to the target merck tree.

Description

Payment verification method, payment verification node, full-quantity node and storage medium
Technical Field
The present invention relates to communication technologies, and in particular, to a payment verification method, a payment verification node, a full-scale node, and a storage medium.
Background
Blockchain technology and its applications are subverting existing traffic patterns. Due to the tamper resistance and traceability of blockchains, industries are actively exploring to implement their business in blockchain networks, including financial institutions, government departments, traditional enterprises, internet companies, and the like.
In the process of implementing the present invention, the inventor finds that at least the following problems exist in the prior art:
The Simple Pay Verification (SPV) node stores only block header information and does not store specific block information. In the actual payment verification process, the SPV node builds a bloom filter, sends the bloom filter to the full-quantity node, traverses all transactions of the blocks in the blockchain one by the full-quantity node, acquires alternative transactions to send to the SPV node, and performs subsequent payment verification. However, as transactions increase, so too does the number of blocks, the efficiency of employing this payment verification method is lower.
Disclosure of Invention
The embodiment of the invention provides a payment verification method, a payment verification node, a full-quantity 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, applied to a payment verification node, where block header information of each block in a block chain is stored in the payment verification node, where the block header information includes a transaction hash combined value obtained by performing bitwise or operation on all hash values in the 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 block height number in the alternative block list is larger than a preset alternative threshold value, a bloom filter is constructed according to the target hash value;
Transmitting 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 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 above method, the traversing the block head of the blockchain according to the target hash value and the transaction hash combination value, determining an alternative block list includes:
According to the traversing sequence from the highest block to the created block, performing bit-wise AND operation on each transaction hash combined 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 greater than zero from the operation results;
Acquiring the block height of a block corresponding to the target operation result in the block chain;
and adding the block height to the alternative block list.
In the above method, the obtaining, according to the transaction candidate list, a target merck tree corresponding to a target transaction includes:
Determining the 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 the full-quantity node, and receiving the target merck tree acquired by the full-quantity node according to the target block height.
In the above method, after the 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 value, transmitting the block height in the candidate block list to the full-scale node;
and receiving the target merck tree acquired by the full-quantity 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 applied to a full-scale node, where a blockchain is stored in the full-scale node, the method including:
receiving a bloom filter and an alternative block list sent by a payment verification node;
Performing transaction list traversal on the candidate block corresponding to the candidate block list according to the bloom filter to obtain a transaction candidate list;
Transmitting the transaction alternative list to the payment verification node, and receiving the target block height determined by the payment verification node after screening according to the transaction alternative list;
acquiring a target merck tree according to the target block height;
And sending the target merck tree to the payment verification node for the payment verification node to carry out payment verification.
In the above method, the performing, according to the bloom filter, transaction list traversal on the candidate block corresponding to the candidate block list to obtain a transaction candidate list includes:
Determining the candidate block from the blockchain according to the block height in the candidate block list;
acquiring a transaction list in the candidate block;
Respectively 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 of successful matching 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 merck tree to the payment verification node for the payment verification node to perform payment verification, the method further includes:
Receiving the block height in the alternative block list sent by the payment verification node;
Determining a matching block of block height in the candidate block list from the blockchain, and acquiring the target merck tree from the matching block.
In a third aspect, an embodiment of the present invention provides a payment verification node, the 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 the block chain, wherein the block header information comprises transaction hash combined values obtained by performing bit OR operation on all hash values in the corresponding block;
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 block height number in the alternative block list is larger than a preset alternative threshold value, a bloom filter is constructed according to the target hash value; transmitting 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 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 above 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 traversing sequence from the highest block to the created block, performing bit-wise AND operation on each transaction hash combined 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 greater than zero from the operation results; acquiring the block height of a block corresponding to the target operation result in the block chain; and adding the block height to the alternative block list.
In the above 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 alternative list; determining a target block height according to the target transaction; and sending the target block height to the full-quantity node, and receiving the target merck tree acquired by the full-quantity 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 the determination of the candidate block list, 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 value, transmitting the block height in the candidate block list to the full-scale node; receiving the target merck tree acquired by the full-scale node according to the block heights in the candidate block list; and carrying out payment verification according to the target merck tree.
In a fourth aspect, an embodiment of the present invention provides a full-scale node, including: 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 blockchain in the second memory;
The second processor is configured to execute a second payment verification program stored in the second memory to implement the steps of:
Receiving a bloom filter and an alternative block list sent by a payment verification node; performing transaction list traversal on the candidate block corresponding to the candidate block list according to the bloom filter to obtain a transaction candidate list; transmitting the transaction alternative list to the payment verification node, and receiving the target block height determined by the payment verification node after screening according to the transaction alternative list; acquiring a target merck tree according to the target block height, and sending the target merck tree to the payment verification node for the payment verification node to carry out payment verification.
In the full-scale node, the second processor is specifically configured to execute the second payment verification procedure, so as to implement the following steps:
Determining the candidate block from the blockchain according to the block height in the candidate block list; acquiring a transaction list in the candidate block; respectively 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 full-scale node, the second processor sends the target merck 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 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 merck 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 may be executed by one or more processors, so as to implement the 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 may be executed by one or more processors to implement the payment verification method applied to the full-scale node.
It can be seen that, in the payment verification node according to the embodiment of the present invention, the block header information of each block in the blockchain is stored, where the block header information includes a transaction hash combination value obtained by performing bitwise or operation on all hash values in the corresponding block, and the payment verification node obtains a target hash value, and traverses the blockchain according to the target hash value and the transaction hash combination value to determine an alternative block list; if the block height number in the alternative block list is larger than a preset alternative threshold value, constructing a bloom filter according to the target hash value; transmitting 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 according to the target merck tree corresponding to the target transaction of the transaction alternative list, and according to the target merck tree, carrying out payment verification. That is, according to the technical scheme provided by the embodiment of the invention, when the payment verification is performed, the payment verification node can first filter the blocks according to the transaction hash combination value added in the block header information, so that the blocks required to be filtered by the full-quantity node are reduced, and the payment verification efficiency is improved.
The embodiment of the invention has the following beneficial effects:
Because the block header information of each block in the block chain is stored in the payment verification node, the block header information comprises transaction hash combined values obtained by performing bit OR operation on all hash values in the corresponding blocks, and when the payment verification is performed, the payment verification node can perform block filtering according to the transaction hash combined values added in the block header information, so that the blocks required to be filtered by the full nodes are reduced, and the payment verification efficiency is improved.
Drawings
Fig. 1 is a schematic flow chart of a payment verification method according to an embodiment of the present invention;
Fig. 2 is a schematic diagram of a block header according to an embodiment of the present invention;
Fig. 3 is a second flowchart of a payment verification method according to an embodiment of the present invention;
fig. 4 is a flowchart of a payment verification method according to an embodiment of the present invention;
fig. 5 is a flow chart diagram of a payment verification method according to an embodiment of the present invention;
FIG. 6A is a schematic diagram illustrating an exemplary interaction between a payment verification node and a full-scale node according to an embodiment of the present invention;
FIG. 6B is a second schematic diagram illustrating interactions between 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-scale node according to an embodiment of the present invention.
Detailed Description
The present invention will be further described in detail with reference to the accompanying drawings, for the purpose of making the objects, technical solutions and advantages of the present invention more apparent, and the described embodiments should not be construed as limiting the present invention, and all other embodiments obtained by those skilled in the art without making any inventive effort are within the 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 describing embodiments of the present invention in further detail, the terms and terminology involved in the embodiments of the present invention will be described, and the terms and terminology involved in the embodiments of the present invention will be used in the following explanation.
1) Transaction (Transaction), which is equivalent to the computer term "Transaction," includes three different Transaction types: deployment (Deploy), invocation (Invoke) and Query (Query). The present invention, embodiments follow this convention in view of the terms "transaction" that are colloquially used in blockchain technology, by deploying transactions for installing designated chain codes to nodes of a blockchain network, invoking and querying types of transactions for invoking chain codes of deployment numbers to effect operations on data related to a target account in a ledger, including adding, querying, modifying data in the form of Key-Value pairs in an account, or adding new accounts in a ledger.
2) A Block (Block) records the data structure of the ledger data updated by transactions over a period of time, is time stamped and a unique tag (e.g., a digital fingerprint) of the previous Block, and after the Block is authenticated by the common identity of nodes in the blockchain network, is appended to the end of the blockchain as a new Block.
3) A blockchain (Blockchain) in which blocks are combined in a sequential manner to form a chained data structure, the hash value of a previous block or a subset thereof being referenced in each block, thereby cryptographically ensuring that the transaction recorded is not tamperable and counterfeit.
4) A blockchain network incorporates new blocks into a set of series of centerless nodes of the blockchain by way of consensus.
Examples
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 header information of each block in a block chain, and the block header information comprises transaction hash combined values obtained by performing bit OR operation on all hash values in corresponding blocks. Fig. 1 is a schematic flow chart of 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 the block chain according to the target hash value and the transaction hash combination value, and determining an alternative block list.
In the embodiment of the invention, the payment verification node can firstly acquire 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 alternative block list.
In the embodiment of the present invention, the target hash value is a hash value of a target transaction that needs to be verified for payment, and the embodiment of the present invention is not limited to the specific target hash value.
It should be noted that, in the embodiment of the present invention, only the block header information of each block in the blockchain is stored in the payment verification node, and in addition, a transaction hash combination value, specifically, a value obtained by performing bitwise or operation on all hash values in the corresponding block is added to each block header information of the blockchain. A plurality of transactions are contained in each block of the blockchain, wherein each transaction corresponds to a hash value that forms all of the hash values in the corresponding block. The hash values to be involved in the operation are respectively corresponding to binary OR.
For example, 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 the hash value 1 and the transaction 2 corresponds to the hash value 2, and therefore, the hash value 1 and the hash value 2 are bitwise or operated, so as to obtain a transaction hash combined value corresponding to the block a, and the transaction hash combined value is specifically stored in a block header of the block a.
Fig. 2 is a schematic diagram of a block header according to an embodiment of the present invention. As shown in fig. 2, in the embodiment of the present invention, the block header information of each block in the blockchain stored in the payment verification node includes not only the existing related information, that is, the version, the pre-hash value, the merck root, the timestamp, the difficulty target and the random number, but also the transaction hash combination value.
Specifically, in an embodiment of the present invention, a payment verification node performs block head traversal on a blockchain according to a target hash value and a transaction hash combination value, and determines an alternative block list, including: according to the traversing sequence from the highest block to the created block, performing bitwise and operation on each transaction hash combined value and the target hash value in sequence to obtain an operation result corresponding to each block in the block chain; if the operation result is greater than zero, adding the block height of the corresponding block in the block chain into the candidate block list.
It should be noted that, in the embodiment of the present invention, the highest block is the last block connected in the blockchain, that is, the highest block has no next block connected thereto, and only the last block connected thereto. The created block is the first block connected in the block chain, and the earliest block is the block which is created without the last block connected with the created block and only the next block connected with the created block. The payment verification node traverses according to the traversing sequence from the highest block to the generated block, namely, firstly, the transaction hash combination value in the block header 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 header 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 last block is sequentially subjected to bitwise AND operation, and finally, the transaction hash combination value in the block header information of the generated block and the target hash combination value are subjected to bitwise AND operation to obtain an operation result corresponding to the generated block.
It may be appreciated that in the embodiment of the present invention, the payment verification node performs bitwise and operation on the transaction hash combination value in the block header information of each block and the target hash value, that is, binary phase and binary phase corresponding to each transaction hash combination value and the target hash value respectively.
In an exemplary embodiment of the present invention, a block B is included in the blockchain, a transaction hash combination value B corresponding to the block B is included in the block header information of the block B, the target hash value is N, and the payment verification node performs binary phase operation on the transaction hash combination value B and the target hash combination value N, thereby obtaining an operation result corresponding to the block B.
It should be noted that, in the embodiment of the present invention, after obtaining the operation result corresponding to each block in the blockchain, the payment verification node determines the result greater than zero in the operation result as the target operation result, that is, determines the operation result as the target operation result as long as the operation result corresponding to a certain block in the blockchain is greater than zero. Further, since the payment verification node stores the block header information of each block in the blockchain, the payment verification node can specifically store the block header information according to the connection sequence of the blockchain, so that the position of each block in the blockchain can be known, 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 blockchain according to the target operation result, and then the obtained block height is added into the candidate block list.
In an exemplary embodiment of the present invention, the blockchain includes M blocks, namely, block 1, block 2, … …, and block M in order from the generated block to the highest block, namely, block 1, and 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 the target operation result, so that the payment verification node obtains the block height of the block 2 in the blockchain, specifically, the payment verification node can obtain that the position of the block 2 in the blockchain is the second, the position is the block height of the block 2, and further adds the block height of the block 2 into the candidate block list.
It can be understood that in the prior art, the payment verification node cannot screen the blocks in the blockchain according to the target hash value, and the blocks irrelevant to the target transaction requiring payment verification are excluded, and each block in the blockchain must be specifically screened by the full-scale node in turn.
S102, if the block height number in the alternative block list is larger than a preset alternative threshold value, a bloom filter is constructed according to the target hash value.
In the embodiment of the 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 the bloom filter according to the target hash value, which is actually to determine the relevant screening condition about the target transaction corresponding to the target hash value.
It should be noted that, in the embodiment of the present invention, the preset device selection threshold may be preset in the payment verification node according to the actual payment verification requirement, and the embodiment of the present invention is not limited by the specific preset device selection threshold.
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, the bloom filter and the candidate block list are sent to the full-quantity node, and the transaction candidate list determined by the full-quantity node according to the bloom filter and the candidate block list is received.
In an embodiment of the present invention, the payment verification node may send the bloom filter and the candidate block list to the full node after constructing the bloom filter, thereby receiving a transaction candidate list determined by the full node according to the bloom filter and the candidate block list.
It should be noted that, in the embodiment of the present invention, the number of the full-scale nodes around the payment verification node may be plural, so the payment verification node may send the bloom filter and the candidate block list to the plurality of full-scale nodes, and correspondingly, the payment verification node may receive the transaction candidate list determined by each of the plurality of full-scale nodes, respectively.
It should be noted that, in the embodiment of the present invention, only the block header information of each block in the blockchain is stored in the payment verification node, and the specific transaction list is stored in the block of each block, so the payment verification node needs to send the candidate block list and the bloom filter to all surrounding nodes, and the complete blockchain including the complete data of each block is stored in all nodes, so that the corresponding block can be searched in the blockchain according to the height of each block in the candidate block list, the transaction list of the block is obtained, and further, each transaction in the transaction list is matched according to the bloom filter, and the successfully matched transaction is put into the transaction candidate list, and finally, the transaction candidate list is sent to the payment verification node.
S104, acquiring 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 alternative list, the payment verification node can acquire the target merck tree corresponding to the target transaction according to the transaction alternative list, so that payment verification is performed according to the target merck tree.
Specifically, in an embodiment of the present invention, a payment verification node obtains a target merck tree corresponding to a target transaction according to a transaction candidate list, including: 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 the full-quantity node, and receiving a target merck tree acquired by the full-quantity node according to the target block height.
It should be noted that, in the embodiment of the present invention, all transactions matching with the bloom filter are included in the transaction candidate list received by the payment verification node, 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 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 truly conforming to 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 multiple full-quantity nodes, and correspondingly, the payment verification node may also receive multiple transaction candidate lists, where the full-quantity nodes determine that the transaction candidate lists are identical according to the bloom filter and the candidate block list, and theoretically, the multiple transaction candidate lists received by the payment verification node should be identical, but there may still be unpredictable deviations, that is, there are some different cases in the received multiple transaction candidate lists, and 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 verification accuracy.
It should be noted that, in the embodiment of the present invention, after determining the target transaction, the payment verification node may further determine the target block height according to the target transaction, where the target block height is the block height of the block storing the target transaction in the blockchain, and when determining the candidate transaction list, the full-scale node adds the matched transaction to the candidate transaction list, and also indicates the block height of the block storing the transaction, 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 target block height, the payment verification node sends the target block height to the full-quantity node, and the full-quantity node may search the corresponding target block from the blockchain according to the target block height, and further obtain the target merck tree in the target block.
It may be appreciated that in the embodiment of the present invention, only the block header information of each block in the blockchain is stored in the payment verification node, and the specific merck tree is stored in the block of each block, so that the payment verification node needs to send the target block height to all surrounding nodes, and the complete blockchain including the complete data of each block is stored in the all nodes, so that the corresponding target block can be searched in the blockchain according to the target block height first, the target merck tree stored in the deblocking body of the target block is obtained, and finally, the target merck tree is sent to the payment verification node, and the payment verification node can receive the target merck tree.
It should be noted that, in the embodiment of the present invention, the target merck tree includes information about the target transaction, so that the payment verification node may perform subsequent payment verification, for example, logic verification, according to the target merck 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, after the payment verification node determines the candidate block list in the above step S101, the payment verification node may further perform other steps if the number of the block heights in the candidate block list is less than or equal to the pre-device selection threshold. Fig. 3 is a second flowchart 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:
And S301, if the number of the block heights in the candidate block list is smaller than or equal to the preset equipment selection threshold value, transmitting the block heights in the candidate block list to the full-quantity nodes.
In the embodiment of the present invention, after determining the candidate block list, the payment verification node may send the block heights 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 device selection threshold.
It will be appreciated that in embodiments of the present invention, the number of block heights in the candidate block list is less than or equal to the pre-equipment selection threshold, i.e., only fewer blocks in the blockchain are associated with the target hash value, and thus, 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 the block heights in the candidate block list at a time, and of course, may also send all the block heights in the candidate block list to the full-scale node at a time. Specific transmission mode the embodiment of the present invention is not limited.
S302, receiving a target merck tree obtained by the full-quantity 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-quantity node, the full-quantity node acquires the target merck tree according to the block height in the received candidate block list, so that the target merck tree is sent to the payment verification node, the payment verification node can receive the target merck tree, and further performs payment verification according to the target merck tree.
It should be noted that, in the embodiment of the present invention, if the payment verification node sends the block heights in the candidate block list one at a time in step S301, and correspondingly, the full node also receives the block heights in the candidate block list one at a time, at this time, when the full node receives the block heights in the candidate block list, the full node searches for the corresponding matching block from the blockchain according to the currently received block height, and obtains the target merck tree from the matching block, and then, when the full node receives the next block height in the candidate block list, the full node searches for the corresponding matching block from the blockchain according to the next block height, and obtains the target merck tree from the matching block corresponding to the next block height, i.e. sequentially and circularly obtains the target merck tree. Of course, if in step S301, the payment verification node sends all the block heights in the candidate block list to the full-scale node at a time, it may also be understood that the payment verification node directly sends the candidate block list to the full-scale node, and 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. After receiving the target merck tree, the payment verification node can perform subsequent payment verification processes, such as logic verification, according to the target merck 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 header information of each block in a block chain, the block header information comprises transaction hash combined values obtained by performing bit OR operation on all hash values in corresponding blocks, the payment verification node obtains target hash values, and traverses the block chain according to the target hash values and the transaction hash combined values to determine an alternative block list; if the block height number in the alternative block list is larger than a preset alternative threshold value, constructing a bloom filter according to the target hash value; transmitting 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 according to the target merck tree corresponding to the target transaction of the transaction alternative list, and according to the target merck tree, carrying out payment verification. That is, according to the technical scheme provided by the embodiment of the invention, when the payment verification is performed, the payment verification node can first filter the blocks according to the transaction hash combination value added in the block header information, so that the blocks required to be filtered by the full-quantity node are reduced, and the payment verification efficiency is improved.
Examples
The invention further provides a payment verification method which is applied to the full-quantity node, and the block chain is stored in the full-quantity node. Fig. 4 is a flowchart illustrating 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 a bloom filter and an alternative block list sent by a payment verification node.
In an embodiment of the invention, the full-scale 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 first filter each block in the blockchain according to the transaction hash combination value in the corresponding block header information, determine the candidate block list, and then, if the number of block heights in the candidate block list is greater than the preset candidate threshold, send the bloom filter and the candidate block list to the full-scale node, where the full-scale 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 amount node stores therein a complete blockchain, that is, stores therein complete information of each block in the blockchain.
It should be noted that, in the embodiment of the present invention, the number of full-scale nodes may be plural, 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 a bloom filter constructed according to the target hash value to the full-quantity node, and the full-quantity node receives the bloom filter and the candidate block list according to the bloom filter matched object as the transaction in the transaction list included in each block in the blockchain, and the block to be filtered by the full-quantity node is reduced according to the bloom filter matched object as the block corresponding to the block height in the candidate block list.
S402, performing transaction list traversal on the candidate block corresponding to the candidate block list according to the bloom filter to obtain a transaction candidate list.
In the embodiment of the invention, after receiving the bloom filter and the candidate block list, the full-quantity node traverses the transaction list according to the bloom filter on the candidate block corresponding to the candidate block list to obtain a transaction candidate list.
Specifically, in an embodiment of the present invention, a full-quantity node performs transaction list traversal on an alternative block corresponding to an alternative block list according to a bloom filter, to obtain a transaction alternative list, including: determining an alternative block from the blockchain according to the block height in the alternative block list; acquiring a transaction list in the alternative block; respectively 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 of successful matching 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 a block in the blockchain, and the full-scale node can find corresponding blocks from the blockchain one by one according to the block heights in the candidate block list, and determine the blocks as candidate blocks.
Illustratively, in an embodiment of the present invention, the candidate block list includes 5 block heights, namely block height 1, block height 2, block height 3, block height 4, and block height 5. The full-quantity node searches the block corresponding to the block height 1 in the block chain as a block 1, the block corresponding to the block height 2 as a block 2, the block corresponding to the block height 3 as a block 3, the block corresponding to the block height 4 as a block 4, and the block corresponding to the block height 5 as a block 5, so that the block 1, the block 2, the block 3, the block 4 and the block 5 are all candidate blocks.
It should be noted that, in the embodiment of the present invention, since the full-scale node stores the complete blockchain, after determining the candidate block, the full-scale node may directly obtain the transaction list from the candidate block list, and further, match each transaction in the transaction list according to the bloom filter, so as to obtain a matching result corresponding to each transaction.
It should be noted that, in the embodiment of the present invention, the matching result of successful matching is the target matching result, and the full-amount node adds the transaction corresponding to the target matching result to the transaction candidate list.
Illustratively, in the embodiment of the present invention, the blockchain includes a block Q, where the block Q is an alternative block determined by a full-scale node, and the full-scale 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. And respectively matching the transaction 1, the transaction 2, the transaction 3, the transaction 4 and the transaction 5 by the full-quantity node according to the bloom filter to obtain a matching result corresponding to the transaction 1 as a matching failure, a matching result corresponding to the transaction 2 as a matching success, a matching result corresponding to the transaction 3 as a matching failure, a matching result corresponding to the transaction 4 as a matching failure and a matching result corresponding to the transaction 5 as a matching success, so that the transaction 2 and the transaction 5 are added into a transaction alternative list.
S403, the transaction alternative list is sent to the payment verification node, and the target block height determined by the payment verification node after screening according to the transaction alternative list is received.
In the embodiment of the invention, after the transaction alternative list is obtained, the full-quantity node sends the transaction alternative list to the payment verification node, the payment verification node screens according to the transaction alternative list to obtain the target block height, and transmits the target block height to the full-quantity node, and the full-quantity node can receive the target block height determined by the payment verification node after screening according to the transaction alternative 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, and the process of determining the target block height by the payment verification node is described in detail in the first embodiment, which is not repeated herein.
S404, acquiring a target merck tree according to the target block height.
In the embodiment of the invention, after receiving the target block height, the full-volume node can acquire the target merck tree and send the target merck tree to the payment verification node for the payment verification node to carry out payment verification.
It should be noted that, in the embodiment of the present invention, the full-volume node stores the complete blockchain, so that the full-volume node can find the corresponding target block from the blockchain according to the target block height, that is, the position information of the characterization block in the blockchain, and directly obtain the target merck tree from the target block.
For example, in the embodiment of the present invention, the target block height is S, the full-quantity node may find a block with a position S in the blockchain, where the block is the target block, and further directly obtain the merck tree stored therein from the block, where the merck tree is the target merck tree.
S405, the target merck tree is sent to a payment verification node for payment verification by the payment verification node.
In the embodiment of the invention, after the full-volume node acquires the target merck tree, the target merck tree can be sent to the payment verification node, and after the payment verification node receives the target merck tree, the payment verification node can perform subsequent payment verification processes, such as logic verification and the like, according to the target merck tree.
It should be noted that, in the embodiment of the present invention, before the step S405, another way exists for the full-scale node to acquire the target merck tree. Fig. 5 is a flowchart illustrating 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 alternative block list sent by the payment verification node.
In an embodiment of the present invention, the full-scale node may also receive the block heights 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 first filter each block in the blockchain according to the transaction hash combination value in the corresponding block header information, determine the candidate block list, and then, if the number of the block heights in the candidate block list is less than or equal to the preset device selection threshold, send the block heights in the candidate block list to the full-scale node, where the full-scale node may receive the block heights 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, or of course, may send all the 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 directly receive all the block heights in the candidate block list. Specific manner of reception 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 merck tree from the matching block.
In an embodiment of the present invention, after receiving the block heights in the candidate block list, the full-volume node may determine a matching block of the block heights in the candidate block list from the blockchain, and obtain the target merck tree from the matching block.
It should be noted that, in the embodiment of the present invention, the full-volume node stores a complete blockchain, and the block height represents the position of a block in the blockchain, so that the full-volume node can search a corresponding block from the blockchain according to the received block height in the 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-volume node stores the complete blockchain, that is, stores specific information of each block, so after determining the matching block, the full-volume node may directly obtain the stored merck tree from the matching block, and determine the obtained merck tree as the target merck tree.
The embodiment of the invention provides a payment verification method which is applied to a full-quantity node, wherein a block chain is stored in the full-quantity node, and the full-quantity node receives a bloom filter and an alternative block list which are sent by the payment verification node; performing transaction list traversal on the corresponding candidate block of the candidate block list according to the bloom filter to obtain a transaction candidate list; transmitting the transaction alternative list to a payment verification node, and receiving the target block height determined by the payment verification node after screening according to the transaction alternative list; acquiring a target merck tree according to the target block height; and sending the target merck tree to the payment verification node for the payment verification node to perform payment verification. That is, according to the technical scheme provided by the embodiment of the invention, when payment verification is performed, the full-quantity node does not need to perform transaction list traversal on each block in the blockchain, and only performs transaction list traversal on the candidate block corresponding to the candidate block list sent by the payment verification node, so that the blocks required to be filtered by the full-quantity node are reduced, and the payment verification efficiency is improved.
Examples
Fig. 6A is a schematic diagram illustrating 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 specific steps for implementing payment verification by the payment verification node and the full-scale node are as follows:
S601, the payment verification node acquires a target hash value, traverses the block chain according to the target hash value and the transaction hash combination value, and determines 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 blockchain is stored in the payment verification node, and in addition, a transaction hash combination value, specifically, a value obtained by performing bitwise or operation on all hash values in the corresponding block is added to each block header information of the blockchain. A plurality of transactions are contained in each block of the blockchain, wherein each transaction corresponds to a hash value that forms all of the hash values in the corresponding block. The hash values to be involved in the operation are respectively corresponding to binary OR.
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, binary phase corresponding to each transaction hash combination value and the target hash value respectively, and adds the block height of the block corresponding to the target operation result with the operation result greater than zero to the candidate block list.
S602, if the block height number in the alternative block list is larger than a preset alternative threshold value, the payment verification node builds a bloom filter according to the target hash value.
It may be appreciated 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 greater, that is, the number of blocks is greater than the preset candidate threshold, construct the bloom filter according to the target hash value.
S603, the payment verification node sends the bloom filter and the candidate block list to the full-size node.
S604, the full-quantity node traverses the transaction list of the candidate block corresponding to the candidate block list according to the bloom filter, and a transaction candidate list is obtained.
Specifically, in an embodiment of the present invention, a full-quantity node performs transaction list traversal on an alternative block corresponding to an alternative block list according to a bloom filter, to obtain a transaction alternative list, including: determining an alternative block from the blockchain according to the block height in the alternative block list; acquiring a transaction list in the alternative block; respectively 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 of successful matching from the matching results; and adding the transaction corresponding to the target matching result into a transaction alternative list.
And S605, the full-quantity node sends the transaction alternative list to the payment verification node.
S606, the payment verification node determines a 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, all transactions matching with the bloom filter are included in the transaction candidate list received by the payment verification node, 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 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 truly conforming to the target hash value.
S607, the payment verification node determines the target block height according to the target transaction.
It should be noted that, in the embodiment of the present invention, after determining the target transaction, the payment verification node may further determine the target block height according to the target transaction, where the target block height is the block height of the block storing the target transaction in the blockchain, and when determining the candidate transaction list, the full-scale node adds the matched transaction to the candidate transaction list, and also indicates the block height of the block storing the transaction, so that the payment verification node may directly determine the target block height according to the target transaction.
And S608, the payment verification node sends the target block height to the full-quantity node.
S609, the full-quantity node acquires a target merck tree according to the target block height.
It may be appreciated that in the embodiment of the present invention, only the block header information of each block in the blockchain is stored in the payment verification node, and the specific merck tree is stored in the block body of each block, so that the payment verification node needs to send the target block height to surrounding full nodes, and the full nodes store the complete blockchain including the complete data of each block, so that the corresponding target block can be searched in the blockchain according to the target block height to obtain the target merck tree stored in the deblocking body of the target block.
And S610, the full-quantity node sends the target merck tree to the payment verification node.
S611, the payment verification node performs payment verification according to the target merck 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 merck tree, for example, logic verification, etc., and the embodiment of the present invention is not limited to the specific verification process.
Fig. 6B is a second schematic interaction diagram of 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 branching step is further included, and the specific steps are as follows:
and S612, if the number of the block heights in the candidate block list is smaller than or equal to the pre-equipment selection threshold value, the payment verification node sends the block heights in the candidate block list to the full-quantity node.
S613, the full-quantity node determines a matching block with the block height in the candidate block list from the block chain, and acquires a target merck tree from the matching block.
It should be noted that, in the embodiment of the present invention, the full-volume node stores the complete blockchain, that is, stores specific information of each block, so after determining the matching block, the full-volume node may directly obtain the stored merck tree from the matching block, and determine the obtained merck tree as the target merck tree.
It should be noted that, in the embodiment of the present invention, after step S613, the steps performed are still S610 and S611 described above.
Examples
The embodiment of the invention provides a payment verification node, and fig. 7 is a schematic structural diagram of the payment verification node. 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 to implement a connection communication between the first processor 701 and the first memory 702;
The first memory 702 stores block header information of each block in the block chain, where the block header information includes transaction hash combined values obtained by performing bitwise or operation on all hash values in the corresponding block;
the first processor 701 is configured to execute a first payment verification program stored in the first memory 702, so as 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 block height number in the alternative block list is larger than a preset alternative threshold value, a bloom filter is constructed according to the target hash value; transmitting 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 merck tree corresponding to the target transaction according to the transaction alternative list, and performing payment verification according to the target merck tree.
Optionally, the first processor 701 is specifically configured to execute the first payment verification procedure, so as to implement the following steps:
According to the traversing sequence from the highest block to the created block, performing bit-wise AND operation on each transaction hash combined 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 greater than zero from the operation results; acquiring the block height of a block corresponding to the target operation result in the block chain; and adding the block height to the alternative block list.
Optionally, the first processor 701 is specifically configured to execute the first payment verification procedure, so as to implement the following steps:
Determining the 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 the full-quantity node, and receiving the target merck tree acquired by the full-quantity node according to the target block height.
Optionally, after the determining the candidate block list, the first processor 701 is further configured to execute the first payment verification procedure 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 value, transmitting the block height in the candidate block list to the full-scale node; receiving the target merck tree acquired by the full-scale node according to the block heights in the candidate block list; and carrying out payment verification according to the target merck tree.
The embodiment of the invention provides a payment verification node, wherein the payment verification node stores block header information of each block in a block chain, the block header information comprises transaction hash combined values obtained by bit-wise OR operation of 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 combined values to determine an alternative block list; if the block height number in the alternative block list is larger than a preset alternative threshold value, constructing a bloom filter according to the target hash value; transmitting 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 according to the target merck tree corresponding to the target transaction of the transaction alternative list, and according to the target merck tree, carrying out payment verification. That is, when the payment verification node provided by the embodiment of the invention performs payment verification, the filtering of the blocks can be performed according to the transaction hash combination value added in the block header information, so that the blocks required to be filtered by the full-quantity node are reduced, and the payment verification efficiency is improved.
Examples
The embodiment of the invention provides a full-scale node, and fig. 8 is a schematic structural diagram of the full-scale node. As shown in fig. 8, the full-volume node includes: a second processor 801, a second memory 802, and a second communication bus 803;
the second communication bus 803 is used to implement a connection communication between the second processor 801 and the second memory 802;
storing a blockchain in the second memory 802;
The second processor 801 is configured to execute a second payment verification program stored in the second memory 802, so as 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 candidate block corresponding to the candidate block list according to the bloom filter to obtain a transaction candidate list; transmitting the transaction alternative list to the payment verification node, and receiving the target block height determined by the payment verification node after screening according to the transaction alternative list; acquiring a target merck tree according to the target block height, and sending the target merck tree to the payment verification node for the payment verification node to carry out payment verification.
Optionally, the second processor 801 is specifically configured to execute the second payment verification procedure, so as to implement the following steps:
Determining the candidate block from the blockchain according to the block height in the candidate block list; acquiring a transaction list in the candidate block; respectively 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 further configured to execute the second payment verification procedure to implement the following steps before sending the target merck tree to the payment verification node for the payment verification by the payment verification node:
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 merck tree from the matching block.
The embodiment of the invention provides a full-quantity node, wherein a block chain is stored in the full-quantity node, and the full-quantity node receives a bloom filter and an alternative block list which are sent by a payment verification node; performing transaction list traversal on the corresponding candidate block of the candidate block list according to the bloom filter to obtain a transaction candidate list; transmitting the transaction alternative list to a payment verification node, and receiving the target block height determined by the payment verification node after screening according to the transaction alternative list; acquiring a target merck tree according to the target block height; and sending the target merck tree to the payment verification node for the payment verification node to perform payment verification. That is, when the full-scale node provided by the embodiment of the invention performs payment verification, transaction list traversal is not required to be performed on each block in the blockchain, and only the transaction list traversal is performed on the candidate block corresponding to the candidate block list sent by the payment verification node, so that the blocks required to be filtered by the full-scale node are reduced, and the payment verification efficiency is improved.
In summary, the embodiment of the invention has the following beneficial effects:
When the payment verification is carried out, the payment verification node can filter the blocks according to the transaction hash combination value added in the block header information, so that the blocks required to be filtered by the full-quantity node are reduced, and the payment verification efficiency is improved.
The foregoing is merely exemplary embodiments of the present invention and is not intended to limit the scope of the present invention. Any modification, equivalent replacement, improvement, etc. made within the spirit and scope of the present invention are included in the protection scope of the present invention.

Claims (16)

1. The payment verification method is characterized by being applied to a payment verification node, wherein the payment verification node stores block header information of each block in a block chain, the block header information comprises transaction hash combined values obtained by performing bitwise OR operation on all hash values in the corresponding block, 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 block height number in the alternative block list is larger than a preset alternative threshold value, a bloom filter is constructed according to the target hash value;
Transmitting 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 merck tree corresponding to the target transaction according to the transaction alternative list, and performing payment verification according to the target merck tree.
2. The method of claim 1, wherein the traversing the blockchain for a block head based on the target hash value and the transaction hash combination value, determining a list of candidate blocks, comprises:
According to the traversing sequence from the highest block to the created block, performing bit-wise AND operation on each transaction hash combined 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 greater than zero from the operation results;
Acquiring the block height of a block corresponding to the target operation result in the block chain;
and adding the block height to the alternative block list.
3. The method according to claim 1, wherein the obtaining, according to the transaction candidate list, a target merck tree corresponding to a target transaction includes:
Determining the 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 the full-quantity node, and receiving the target merck tree acquired by the full-quantity node according to the target block height.
4. The method of claim 1, wherein after the determining the list of candidate blocks, the method further comprises:
If the block height number in the candidate block list is smaller than or equal to the preset candidate threshold value, transmitting the block height in the candidate block list to the full-scale node;
and receiving the target merck tree acquired by the full-quantity 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 in which a blockchain is stored, the method comprising:
Receiving a bloom filter and an alternative block list sent by a payment verification node; the block header information of each block in the block chain stored in the payment verification node comprises a transaction hash combination value of the corresponding block, wherein the transaction hash combination value is a 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 blockchain to determine the alternative block list according to the target hash value and the transaction hash combination value;
Performing transaction list traversal on the candidate block corresponding to the candidate block list according to the bloom filter to obtain a transaction candidate list;
Transmitting the transaction alternative list to the payment verification node, and receiving the target block height determined by the payment verification node after screening according to the transaction alternative list;
acquiring a target merck tree according to the target block height;
And sending the target merck tree to the payment verification node for the payment verification node to carry out payment verification.
6. The method of claim 5, wherein the traversing the transaction list for the candidate block corresponding to the candidate block list according to the bloom filter to obtain the transaction candidate list comprises:
Determining the candidate block from the blockchain according to the block height in the candidate block list;
acquiring a transaction list in the candidate block;
Respectively 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 of successful matching 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 the sending the target merck tree to the payment verification node for use by the payment verification node prior to payment verification, the method further comprising:
Receiving the block height in the alternative block list sent by the payment verification node;
Determining a matching block of block height in the candidate block list from the blockchain, and acquiring the target merck tree from the matching block.
8. A payment verification node, the 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 the block chain, wherein the block header information comprises transaction hash combined values obtained by performing bit OR operation on all hash values in the corresponding block;
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 block height number in the alternative block list is larger than a preset alternative threshold value, a bloom filter is constructed according to the target hash value; transmitting 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 merck tree corresponding to the target transaction according to the transaction alternative list, and performing payment verification according to the target merck tree.
9. The payment verification node of claim 8, wherein the first processor is configured to execute the first payment verification procedure to perform the steps of:
According to the traversing sequence from the highest block to the created block, performing bit-wise AND operation on each transaction hash combined 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 greater than zero from the operation results; acquiring the block height of a block corresponding to the target operation result in the block chain; and adding the block height to the alternative block list.
10. The payment verification node of claim 8, wherein the first processor is configured to execute the first payment verification procedure to perform the steps of:
Determining the 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 the full-quantity node, and receiving the target merck tree acquired by the full-quantity node according to the target block height.
11. The payment verification node of claim 8, wherein the first processor, after the determination of the list of candidate blocks, is further configured to execute the first payment verification program to implement the steps of:
If the block height number in the candidate block list is smaller than or equal to the preset candidate threshold value, transmitting the block height in the candidate block list to the full-scale node; receiving the target merck tree acquired by the full-scale node according to the block heights in the candidate block list; and carrying out payment verification according to the target merck tree.
12. A full-scale node, the 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 blockchain in the second memory;
The second processor is configured to execute a second payment verification program stored in the second memory to implement the steps of:
Receiving a bloom filter and an alternative block list sent by a payment verification node; the block header information of each block in the block chain stored in the payment verification node comprises a transaction hash combination value of the corresponding block, wherein the transaction hash combination value is a 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 blockchain to determine the alternative block list according to the target hash value and the transaction hash combination value; performing transaction list traversal on the candidate block corresponding to the candidate block list according to the bloom filter to obtain a transaction candidate list; transmitting the transaction alternative list to the payment verification node, and receiving the target block height determined by the payment verification node after screening according to the transaction alternative list; acquiring a target merck tree according to the target block height, and sending the target merck tree to the payment verification node for the payment verification node to carry out payment verification.
13. The full-scale 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 candidate block from the blockchain according to the block height in the candidate block list; acquiring a transaction list in the candidate block; respectively 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 program to implement the following steps before sending the target merck tree to the payment verification node for payment verification by the payment verification node:
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 merck tree from the matching block.
15. A storage medium for application to a payment verification node, the storage medium storing one or more programs executable by one or more processors to implement the method of any of claims 1-4.
16. A storage medium, for application 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 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 CN111768202A (en) 2020-10-13
CN111768202B true 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)

Families Citing this family (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
CN112765682B (en) * 2021-04-07 2022-08-05 暗链科技(深圳)有限公司 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 (2)

* 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

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2018119930A1 (en) * 2016-12-29 2018-07-05 深圳前海达闼云端智能科技有限公司 Transaction verification processing method, apparatus and node device
US10255342B2 (en) * 2017-04-12 2019-04-09 Vijay K. Madisetti Method and system for tuning blockchain scalability, decentralization, and security for fast and low-cost payment and transaction processing
GB201711879D0 (en) * 2017-07-24 2017-09-06 Nchain Holdings Ltd Computer-implemented system and method
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
CN109493061B (en) * 2018-12-28 2021-03-23 合肥达朴汇联科技有限公司 Verification method and device for data of block chain, electronic equipment and storage medium

Patent Citations (2)

* 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

Also Published As

Publication number Publication date
CN111768202A (en) 2020-10-13

Similar Documents

Publication Publication Date Title
CN111768202B (en) Payment verification method, payment verification node, full-quantity node and storage medium
CN110597925B (en) Cross-chain data processing method and device based on block chain
US10635655B2 (en) Device, method and program for securely reducing an amount of records in a database
US8117609B2 (en) System and method for optimizing changes of data sets
CN111971931B (en) Method for verifying transactions in a blockchain network and nodes constituting the network
US11314727B2 (en) Blockchain management apparatus, blockchain management method, and program
CN104346365A (en) Device and method for determining specific service associated logs
CN110188103A (en) Data account checking method, device, equipment and storage medium
CN111899019A (en) Method and system for cross validation and sharing of blacklist and multiple parties
CN107004088A (en) Determining device, determine method and determination program
CN110597922A (en) Data processing method, device, terminal and storage medium
US20190372825A1 (en) Communication apparatus, communication method, and recording medium
CN104333614B (en) The method, apparatus and system of terminal recognition
CN106874289B (en) Associated node determination method and equipment
CN105703941B (en) The processing method and processing device of configuration transaction
CN113672776B (en) Fault analysis method and device
CN105893445A (en) Data processing method, server and terminal device
CN110852744A (en) Method, device, terminal equipment and medium for switching transaction channels
CN111339089A (en) Data storage and acquisition method and device applied to block chain
CN109753485A (en) A kind of disk lock management method and device
CN111222159B (en) Cloud platform data leakage path identification method based on graph computing technology
CN113301002B (en) Information processing method, device, electronic equipment and storage medium
CN113206825B (en) Scanning result comparison analysis method of missing scanning device
CN112000731B (en) Data processing method and device, electronic equipment and storage medium
US9104566B2 (en) System and method for determining whether a failed communication between signal transfer points was in error

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