WO2023070831A1 - Block confirmation method and device - Google Patents

Block confirmation method and device Download PDF

Info

Publication number
WO2023070831A1
WO2023070831A1 PCT/CN2021/135349 CN2021135349W WO2023070831A1 WO 2023070831 A1 WO2023070831 A1 WO 2023070831A1 CN 2021135349 W CN2021135349 W CN 2021135349W WO 2023070831 A1 WO2023070831 A1 WO 2023070831A1
Authority
WO
WIPO (PCT)
Prior art keywords
priority
transaction
nodes
blockchain
decrypted
Prior art date
Application number
PCT/CN2021/135349
Other languages
French (fr)
Chinese (zh)
Inventor
李昊轩
严强
王朝阳
廖飞强
贺双洪
李辉忠
张开翔
范瑞彬
Original Assignee
深圳前海微众银行股份有限公司
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 深圳前海微众银行股份有限公司 filed Critical 深圳前海微众银行股份有限公司
Publication of WO2023070831A1 publication Critical patent/WO2023070831A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/38Payment protocols; Details thereof
    • G06Q20/382Payment protocols; Details thereof insuring higher security of transaction
    • 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/3829Payment protocols; Details thereof insuring higher security of transaction involving key management

Definitions

  • Embodiments of the present invention relate to the field of financial technology (Fintech), and in particular to a block confirmation method and device.
  • Fetech financial technology
  • each blockchain node in the blockchain network competes to complete the block confirmation process through computing power. Specifically, by setting up a proof-of-work mechanism to determine which node in the blockchain network will complete the block confirmation process, that is, to determine which node will perform the block operation and send the block As a block on the chain. Among them, the relationship between each blockchain node in the blockchain network is equal, and they all participate in the process of competing block confirmation with an equal identity, and the computing power of each blockchain node is the same.
  • the proof-of-work mechanism is to hash a certain transaction in the respective transaction pool with a random number generated by itself, requiring the first number of digits of the calculated hash value to be 0, such as the first 6 digits is 0, that is, 000000. Then, each blockchain node in the blockchain network performs relevant hash operations according to the proof-of-work mechanism, and keeps looking for random numbers that meet the requirements. If a certain blockchain node finds out a random number that meets the requirements, The transaction, random number and hash value can be uploaded to the chain so that other blockchain nodes in the blockchain network can perform consensus verification. Other blockchain nodes only need to add the random number to the transaction for hashing.
  • Embodiments of the present invention provide a block confirmation method and device, which are used to complete the process of block confirmation through priority nodes first, so as to effectively improve the efficiency of block chaining.
  • the embodiment of the present invention provides a block confirmation method, which is applicable to a block chain network with m block chain nodes, and the method includes:
  • the client determines k blockchain nodes from the m blockchain nodes as priority nodes;
  • the client generates a first confusion factor based on the public keys of the k priority nodes
  • the client generates a first priority commitment based on the first confusion factor and the transaction
  • the client generates a first priority transaction based on the first priority commitment and a hash value of the transaction, and sends the first priority transaction to the blockchain network.
  • the technical solution in the present invention designates some blockchain nodes as priority nodes, so that when the computing capabilities of each blockchain node in the blockchain network are the same or close to each other, the priority nodes designated by the client have a great Probability can be the first to complete the block confirmation process, so it can save the time spent in the block confirmation process, thereby effectively improving the efficiency of block chaining.
  • the client can determine k blockchain nodes as priority nodes from the m blockchain nodes, and generate the first confusion factor based on the public keys of the k priority nodes.
  • the first priority transaction is sent to the block chain network, and a block chain node (such as a priority node) in the block chain network can take the lead in recovering the transaction through the first priority commitment in the first priority transaction.
  • a block chain node such as a priority node
  • the priority node Even if the computing power of each blockchain node is different, the priority node has a great probability to be the first to pass the first priority in the first priority transaction. Promise to restore the transaction, so as to quickly complete the block confirmation process, which can effectively improve the efficiency of block chaining.
  • the client since the client does not directly send the transaction to the blockchain network, but uses the first obfuscation factor to obfuscate the transaction, and sends the hash value of the transaction and the first priority commitment obtained after the obfuscation to Blockchain network, so the risk of transaction data leakage can be avoided, which can help ensure the privacy and security of transaction data.
  • the client generates a first confusion factor based on the public keys of the k priority nodes, including:
  • the public keys of the k priority nodes are generated through a bilinear mapping algorithm to generate the first confusion factor
  • the client generates a first priority transaction based on the first priority commitment and the hash value of the transaction, including:
  • the client performs a hash operation on the transaction to generate a hash value of the transaction
  • the client generates the first priority transaction according to the first priority commitment and the hash value of the transaction.
  • this solution adopts Set different numbers of priority nodes to specify the process of completing block confirmation with a high probability through the priority nodes.
  • the number k of priority nodes specified by the client is 2
  • the public keys of the two priority nodes are used to generate the first confusion factor through the bilinear mapping algorithm, and the first confusion factor is used to confuse the The transaction to be processed, that is, the first priority commitment generated by the first confusion factor and the transaction.
  • the first priority transaction corresponding to when the number k of designated priority nodes is 2 is generated through the first priority commitment and the hash value of the transaction.
  • the first priority commitment is used as a voucher for each blockchain node consensus to confirm the transaction, and a certain blockchain node (such as a priority node) in the blockchain network can first decrypt the transaction through the first priority commitment, In this way, under the premise of ensuring that a certain transaction that the client needs to process is not disclosed, only a certain blockchain node in the blockchain network can first decrypt the transaction through the first priority commitment, thereby preventing the transaction from being tampered with or be stolen.
  • the client generates a first confusion factor based on the public keys of the k priority nodes, including:
  • the client determines a first priority placeholder based on an elliptic curve, and passes the first priority placeholder and the public keys of the k priority nodes through a double line A property mapping algorithm that generates the first confusion factor;
  • the client generates a first priority transaction based on the first priority commitment and the hash value of the transaction, including:
  • the client performs a hash operation on the transaction to generate a hash value of the transaction
  • the client generates the first priority transaction according to the first priority commitment, the first priority placeholder, and the hash value of the transaction.
  • the first priority placeholder is determined through the elliptic curve, and the first priority placeholder is used as A priority node is the dot field element of the cooperative operation in the bilinear mapping algorithm. Then the public key of one priority node and the first priority placeholder are used to generate the first confusion factor through the bilinear mapping algorithm, and the first confusion factor is used to confuse the transaction that the client needs to process, that is, through the first A confounding factor and the transaction generate the first priority commitment. Then, the first priority transaction corresponding to when the number k of designated priority nodes is 1 is generated through the first priority commitment and the hash value of the transaction.
  • the first priority commitment is used as a voucher for each blockchain node consensus to confirm the transaction, and a certain blockchain node (such as a priority node) in the blockchain network can first decrypt the transaction through the first priority commitment, In this way, under the premise of ensuring that a certain transaction that the client needs to process is not disclosed, only a certain blockchain node in the blockchain network can first decrypt the transaction through the first priority commitment, thereby preventing the transaction from being tampered with or be stolen.
  • the client determines two unequal second priority placeholders and third priority placeholders based on elliptic curves, and uses the second priority placeholder and the third priority placeholder
  • the third priority placeholder generates a second confusion factor through a bilinear mapping algorithm
  • the client generates a second priority commitment based on the second confusion factor and the transaction
  • the client generates the second priority transaction according to the second priority commitment, the second priority placeholder, the third priority placeholder, and the hash value of the transaction, and sends the A second priority transaction is sent to the blockchain network.
  • the client when the number k of priority nodes designated by the client is 0, that is, the client does not designate a priority node. At this time, in order not to let others easily know whether the client has designated priority nodes or not The number of priority nodes specified by the client is used to better conceal the identity of the priority nodes, and in order to cooperate with the dot field operation in the bilinear mapping algorithm, it will be realized by generating two unequal priority placeholders. Specifically, two unequal second priority placeholders and third priority placeholders are determined through elliptic curves, and the second priority placeholder and the third priority placeholder are used as double The dot-field element of the fit operation in the linear mapping algorithm.
  • the second priority commitment is used as a voucher for each blockchain node consensus to confirm the transaction, and a certain blockchain node (such as a priority node) in the blockchain network can first decrypt the transaction through the second priority commitment, In this way, under the premise of ensuring that a certain transaction that the client needs to process is not disclosed, only a certain blockchain node in the blockchain network can first decrypt the transaction through the second priority commitment, thereby preventing the transaction from being tampered with or be stolen.
  • the client generates a first priority commitment based on the first confusion factor and the transaction, including:
  • the client uses the first confusion factor and the transaction to generate a first priority commitment through an elliptic curve dot domain multiplication algorithm.
  • the client uses the elliptic curve point field multiplication algorithm to process the first obfuscation factor and the transaction, so that the transaction can be obfuscated, and the first priority commitment that meets the requirements of not disclosing transaction information is generated, and This can avoid the risk of leakage of a certain transaction information that the client needs to process, and help ensure the privacy and security of the transaction.
  • the embodiment of the present invention provides a block confirmation method, which is suitable for a blockchain network with m blockchain nodes, and the method includes:
  • the blockchain node For any one of the m blockchain nodes, when the blockchain node detects the first priority transaction, it generates a first decrypted segment based on the private key of the blockchain node;
  • the first priority transaction is generated by the client based on the first priority commitment and the hash value of the transaction;
  • the first priority commitment is generated by the client based on the first confusion factor and the transaction;
  • the first The confusion factor is generated by the client based on the public keys of the k priority nodes determined by the client from the m blockchain nodes;
  • the blockchain node generates a first decrypted transaction according to the first decrypted fragment and the first priority commitment in the first priority transaction through a bilinear mapping algorithm
  • the block chain node When the block chain node determines that the hash value of the first decrypted transaction is equal to the hash value of the transaction in the first priority transaction, it packs the first decrypted transaction into a block and uploads it to the chain.
  • the block chain node when the block chain node detects the first priority transaction, the block chain node can try to decrypt the client through the elements contained in the first priority transaction.
  • the blockchain node generates the first decryption segment based on its own private key, and uses the first decryption segment and the first priority commitment in the first priority transaction through the bilinear mapping algorithm to generate the first decryption transaction , and then determine whether the blockchain node has successfully decrypted the transaction by judging whether the hash value of the first decrypted transaction is equal to the hash value of the transaction, so as to determine whether it is executed by the blockchain node
  • the block generation operation for the transaction that is, after other blockchain nodes successfully reach a consensus on the first decrypted transaction, the blockchain node packages the first decrypted transaction into a block and uploads it to the chain.
  • the priority node can have a great probability to be the first to pass the first priority transaction when the computing power of each blockchain node in the blockchain network is the same or close.
  • the client since the client sends to the blockchain network the hash value of the transaction and the first-priority transaction formed by the obfuscated first-priority commitment, it does not directly send the transaction to the blockchain network, so the transaction can be avoided. There is a risk of data leakage, which can help ensure the privacy and security of transaction data.
  • the blockchain node when the blockchain node detects the first priority transaction, it generates a first decrypted segment based on the private key of the blockchain node, including:
  • the private key of the block chain node is generated through a number field inversion algorithm to generate the first decryption private key
  • the block chain node obtains the public keys of the m block chain nodes from the block chain, and for the public key of any block chain node, according to the first decryption private key and the block chain
  • the public key of the node is used to generate the first decrypted fragment.
  • any blockchain node decrypts the The method used in the transaction is also different.
  • the blockchain node when k is determined to be 2 by the number of elements contained in the first priority transaction, the blockchain node adopts the transaction decryption processing method corresponding to k being 2, that is, by The public key of any blockchain node and the first decryption private key generated by its own private key to generate the first decryption segment.
  • the first decrypted fragment is used to assist the blockchain node to decrypt a first decrypted transaction, and the blockchain node will judge whether the hash value of the decrypted first decrypted transaction is equal to the hash value of the transaction To determine whether the blockchain node has successfully decrypted the transaction, and after the equality is determined, the decrypted first decrypted transaction will be packaged into a block and synchronized to other blockchain nodes for consensus verification.
  • the blockchain node when the blockchain node detects the first priority transaction, it generates a first decrypted segment based on the private key of the blockchain node, including:
  • the private key of the block chain node is generated through a number field inversion algorithm to generate a first decryption private key
  • the blockchain node obtains a first priority placeholder from the first priority transaction, and generates the first decryption segment according to the first decryption private key and the first priority placeholder.
  • the blockchain node when k is determined to be 1 by the number of elements contained in the first priority transaction, the blockchain node adopts the transaction decryption processing method corresponding to k being 1, that is, The first decryption fragment is generated by using the first decryption private key generated according to the first priority placeholder in the first priority transaction and its own private key.
  • the first decrypted fragment is used to assist the blockchain node to decrypt a first decrypted transaction, and the blockchain node will judge whether the hash value of the decrypted first decrypted transaction is equal to the hash value of the transaction To determine whether the blockchain node has successfully decrypted the transaction, and after the equality is determined, the decrypted first decrypted transaction will be packaged into a block and synchronized to other blockchain nodes for consensus verification.
  • the blockchain node When the blockchain node detects the second priority transaction, it obtains two unequal second priority placeholders and third priority placeholders from the second priority transaction; The number of elements included indicates that k is 0;
  • the block chain node generates a second decryption fragment according to the second priority placeholder and the third priority placeholder;
  • the blockchain node generates a second decrypted transaction according to the second decrypted fragment and the second priority commitment in the second priority transaction through a bilinear mapping algorithm
  • the block chain node When the block chain node determines that the hash value of the second decrypted transaction is equal to the hash value of the transaction in the second priority transaction, it packs the second decrypted transaction into a block and uploads it to the chain.
  • the blockchain node when k is determined to be 0 by the number of elements contained in the second priority transaction, the blockchain node adopts the transaction decryption processing method corresponding to k being 0, that is, Generate the second decryption fragment through the second priority placeholder and the third priority placeholder in the second priority transaction, and pass the second decryption fragment and the second priority commitment in the second priority transaction through the double line property mapping algorithm to generate a second decrypted transaction. Then, judge whether the hash value of the second decrypted transaction is equal to the hash value of the transaction to judge whether the block chain node has successfully decrypted the transaction, so as to determine whether the block chain node performs the The block production operation for this transaction.
  • the blockchain node packs the second decrypted transaction and the hash value of the second decrypted transaction into a block, and synchronizes the block to other blockchain nodes for consensus Verification, if it is determined that the consensus is successful, the block will be uploaded to the chain.
  • the block chain node determines that the hash values of the first decrypted transactions corresponding to the m block chain nodes are not equal to the hash values of the transactions in the first priority transaction, from the block chain Obtain the public keys of m block chain nodes, and for the public key of any block chain node, use the public key of the block chain node through the number field inversion algorithm to generate the first decryption public key;
  • the block chain node generates a third decrypted segment based on the first decrypted public key
  • the blockchain node generates a third decrypted transaction according to the third decrypted fragment and the first priority commitment in the first priority transaction through a bilinear mapping algorithm
  • the block chain node When the block chain node determines that the hash value of the third decrypted transaction is equal to the hash value of the transaction in the first priority transaction, it packs the third decrypted transaction into a block and uploads it to the chain.
  • any block chain node when the block chain node determines that the hash value of each first decrypted transaction corresponding to the m block chain nodes is not equal to the hash value of the transaction, it can pass another A decryption method to decrypt the transaction. That is, the blockchain node processes the public key of any blockchain node through a number field inversion algorithm, generates a first decryption public key, and generates a third decryption segment based on the first decryption public key. Then, the third decrypted transaction is generated through the third decrypted fragment and the first priority commitment in the first priority transaction.
  • the blockchain node packs the third decrypted transaction and the hash value of the third decrypted transaction into a block, and synchronizes the block to other blockchain nodes for consensus Verification, if it is determined that the consensus is successful, the block will be uploaded to the chain.
  • an embodiment of the present invention provides a block confirmation device, which is suitable for a blockchain network with m blockchain nodes, and the device includes:
  • a determination unit configured to determine k blockchain nodes from the m blockchain nodes as priority nodes for any transaction
  • the first processing unit is configured to generate a first confusion factor based on the public keys of k priority nodes; generate a first priority commitment based on the first confusion factor and the transaction; and generate a first priority commitment based on the first priority commitment and the The hash value of the transaction generates a first priority transaction, and sends the first priority transaction to the blockchain network.
  • the embodiment of the present invention provides a block confirmation device, which is suitable for a blockchain network with m blockchain nodes, and the device includes:
  • a generating unit configured to generate a first decrypted segment based on the private key of the blockchain node when a first priority transaction is detected for any one of the m blockchain nodes;
  • the first priority transaction is generated by the client based on the first priority commitment and the hash value of the transaction;
  • the first priority commitment is generated by the client based on the first confusion factor and the transaction;
  • the first confusion The factor is generated by the client based on the public keys of k priority nodes determined by the client from the m blockchain nodes;
  • the second processing unit is configured to generate a first decrypted transaction according to the first decrypted fragment and the first priority commitment in the first priority transaction through a bilinear mapping algorithm; when determining the first decrypted transaction When the hash value of is equal to the hash value of the transaction in the first priority transaction, the first decrypted transaction is packaged as a block and uploaded to the chain.
  • an embodiment of the present invention provides a computing device, including at least one processor and at least one memory, wherein the memory stores a computer program, and when the program is executed by the processor, the processing The device implements the block confirmation method described in any of the above first aspect or the above second aspect.
  • an embodiment of the present invention provides a computer-readable storage medium, which stores a computer program executable by a computing device, and when the program runs on the computing device, the computing device executes the above-mentioned first aspect or the block confirmation method described in any of the above-mentioned second aspects.
  • FIG. 1 is a schematic flow diagram of a block confirmation method provided by an embodiment of the present invention
  • FIG. 2 is a schematic structural diagram of a block confirmation device provided by an embodiment of the present invention.
  • FIG. 3 is a schematic structural diagram of another block confirmation device provided by an embodiment of the present invention.
  • FIG. 4 is a schematic structural diagram of a computing device provided by an embodiment of the present invention.
  • Block It is the basic unit of the process blockchain, consisting of a block header containing metadata and a block body containing transaction data. Among them, the block header mainly includes the hash of the parent block.
  • a block in the blockchain consists of a block header and a block body.
  • the block header mainly includes the block height h, the hash of the previous block, etc.
  • the block body mainly stores transaction data.
  • G1 is an additive cyclic group with generator P and order p
  • G2 is a multiplicative cyclic group with the same order as G1
  • a and b are elements in Z p * (prime cyclic group of order p).
  • Elliptic curve group A group is a set of a series of elements satisfying certain algebraic operations in cryptography, and an elliptic curve group is a set of elements constructed based on elliptic curve cryptography.
  • uppercase letters such as G1 and G2 represent points on the elliptic curve, that is, point field elements, and point field elements have additive properties, such as G1+G2.
  • a lowercase letter, such as a represents a scalar, that is, an element of a number field, and an element of a number field has the properties of operations such as addition, multiplication, and power, such as a*b, a ⁇ b, a+b, etc.
  • Fig. 1 exemplarily shows the flow of a block confirmation method provided by an embodiment of the present invention, and the flow can be executed by a block confirmation device.
  • the block confirmation method is applicable to a blockchain network with m blockchain nodes.
  • the process specifically includes:
  • Step 101 for any transaction, the client determines k blockchain nodes from the m blockchain nodes as priority nodes.
  • the priority node when the client uploads a certain transaction to the blockchain network for processing, in order to realize that the computing power of each blockchain node is the same or close, the priority node can be the first to complete the block confirmation.
  • the process can be realized by the client specifying a part of blockchain nodes as priority nodes.
  • k blockchain nodes can be selected from m blockchain nodes in the blockchain network as priority nodes.
  • the client specifies priority The number of nodes is 0, 1 or 2, etc. For example, if the number of designated priority nodes is 2, the client can randomly select 2 blockchain nodes from m blockchain nodes as priority node.
  • the m blockchain nodes can be sorted according to their respective computing capabilities from large to small, and the top 2 blocks can be selected from the sorted m blockchain nodes Chain nodes act as priority nodes.
  • m and k are integers, and k ⁇ m.
  • the client when the client uploads a certain transaction to the blockchain network for processing, it can designate 2 blockchain nodes as priority nodes, then it can start from Among the 10 blockchain nodes in the blockchain network, 2 blockchain nodes are selected as priority nodes and added to the priority queue.
  • the client can designate a blockchain node as a priority node, and then select a blockchain node from the 10 blockchain nodes in the blockchain network as a priority node and add it to the priority queue.
  • the client can designate 0 blockchain nodes as priority nodes, then select 0 blockchain nodes from the 10 blockchain nodes in the blockchain network as priority nodes and add them to the priority queue.
  • Step 102 the client generates a first confusion factor based on the public keys of the k priority nodes.
  • Step 103 the client generates a first priority commitment based on the first confusion factor and the transaction.
  • Step 104 the client generates a first priority transaction based on the first priority commitment and the hash value of the transaction.
  • Step 105 the client sends the first priority transaction to the blockchain network.
  • the client determines that the number k of priority nodes is 2
  • the public keys of the k priority nodes are passed through a bilinear mapping algorithm to generate a first confusion factor, which is used to confuse the client
  • the client will not directly upload the transaction to the blockchain network, which can avoid the risk of transaction data leakage, which can help ensure the privacy and security of transaction data.
  • the first confusion factor and the transaction are passed through the elliptic curve point field multiplication algorithm to generate the first priority commitment.
  • the transaction to be processed by the client is hashed to generate the hash value of the transaction , and according to the first priority commitment and the hash value of the transaction, generate the first priority transaction, and send the first priority transaction to the blockchain network.
  • set hash algorithm such as Message-Digest Algorithm 5 (Message-Digest Algorithm 5, MD5) or SHA256 algorithm, etc.
  • the first priority commitment is used as a voucher for each blockchain node consensus to confirm the transaction, and a certain blockchain node in the blockchain network can first decrypt the transaction through the first priority commitment, so as to ensure that no leakage Under the premise of a certain transaction that the client needs to process, only a certain blockchain node in the blockchain network can first decrypt the transaction through the first priority commitment, so as to prevent the transaction from being tampered with or stolen.
  • a certain blockchain node in the blockchain network such as blockchain node 1
  • a client initiates a certain transaction (such as transaction tx), it will first select 2 blockchain nodes from the 5 blockchain nodes as priority nodes, such as selecting blockchain node 1 and blockchain node 1.
  • Node 3 is the priority node.
  • the public key of the two blockchain nodes can be obtained from the blockchain through any blockchain node in the blockchain network.
  • Node 2 sends a request to obtain the public key of blockchain node 1 and the public key of blockchain node 3.
  • blockchain node 2 After receiving the request, blockchain node 2 obtains the public key of blockchain node 1 from the blockchain pk1 and the public key pk3 of the blockchain node 3, and send the public key pk1 of the blockchain node 1 and the public key pk3 of the blockchain node 3 to the client.
  • the first priority commitment P is used as a voucher for node transaction confirmation.
  • the hash value h is used as a factor to verify the correctness of the node transaction confirmation process.
  • a first priority transaction (P, h) is generated, and the first priority transaction (P, h) is sent to the blockchain network.
  • the client determines that the number k of priority nodes is 1, it determines the first priority placeholder based on the elliptic curve, and uses the first priority placeholder and the public keys of the k priority nodes through bilinear mapping Algorithm to generate the first confusion factor, which is used to confuse the transactions that the client needs to process, so that the client will not directly upload the transaction to the blockchain network, which can avoid the risk of transaction data leakage. This can help ensure the privacy and security of transaction data. Then the first confusion factor and the transaction are passed through the elliptic curve point field multiplication algorithm to generate the first priority commitment.
  • the transaction to be processed by the client is hashed to generate the hash value of the transaction , and generate a first priority transaction according to the first priority commitment, the first priority placeholder and the hash value of the transaction, and send the first priority transaction to the blockchain network.
  • the set hash algorithm such as Message-Digest Algorithm 5 (Message-Digest Algorithm 5, MD5) or SHA256 algorithm, etc.
  • the first priority commitment is used as a voucher for each blockchain node consensus to confirm the transaction, and a certain blockchain node in the blockchain network can first decrypt the transaction through the first priority commitment, so as to ensure that no leakage Under the premise of a certain transaction that the client needs to process, only a certain blockchain node in the blockchain network can first decrypt the transaction through the first priority commitment, so as to prevent the transaction from being tampered with or stolen.
  • a client initiates a certain transaction (such as transaction tx), it will first obtain Select one blockchain node as the priority node among the nodes, for example, select blockchain node 1 as the priority node.
  • the public key of the 1 blockchain node can be obtained from the blockchain through any blockchain node in the blockchain network.
  • Node 3 sends a request to obtain the public key of blockchain node 1.
  • blockchain node 3 obtains the public key of blockchain node 1 from the blockchain and sends the blockchain node 1's public key is sent to the client.
  • the first priority commitment P is used as a voucher for node transaction confirmation.
  • the hash value h is used as a factor to verify the correctness of the node transaction confirmation process. Then, according to the first priority placeholder R, the hash value h of the transaction tx and the first priority commitment P, the first priority transaction (P, h, R) is generated, and the first priority transaction (P, h, R) sent to the blockchain network.
  • the client determines that the number k of priority nodes is 0, it determines two unequal second priority placeholders and third priority placeholders based on the elliptic curve, and uses the second priority placeholder and the third priority placeholder
  • the priority placeholder uses a bilinear mapping algorithm to generate a second confusion factor, which is used to confuse the transaction that the client needs to process, so that the client will not directly upload the transaction to the blockchain network, The risk of leakage of transaction data can be avoided, thereby helping to ensure the privacy and security of transaction data.
  • a second priority commitment is generated.
  • the transaction to be processed by the client is hashed to generate the hash value of the transaction , and generate a second priority transaction according to the second priority commitment, the second priority placeholder, the third priority placeholder and the hash value of the transaction, and send the second priority transaction to the blockchain network.
  • the set hash algorithm such as Message-Digest Algorithm 5 (Message-Digest Algorithm 5, MD5) or SHA256 algorithm, etc.
  • the second priority commitment is used as a certificate for each blockchain node to confirm the transaction by consensus, and a certain blockchain node in the blockchain network can first decrypt the transaction through the second priority commitment, so as to ensure that it is not leaked Under the premise of a certain transaction that the client needs to process, only a certain blockchain node in the blockchain network can first decrypt the transaction through the second priority commitment, so as to prevent the transaction from being tampered with or stolen.
  • a client initiates a certain transaction (such as transaction tx), it will first obtain Among the nodes, 0 blockchain nodes are selected as priority nodes, that is, the client does not specify a priority node. At this time, in order not to let others easily know whether the client has a designated priority node or not to let others easily know the number of priority nodes designated by the client, so as to better hide the identity of the priority node, and in order to cooperate with the bilinear mapping algorithm Dotfield operations in will be implemented by generating two unequal precedence placeholders.
  • the second priority placeholder Ra and the third priority placeholder Rb are used as dot field elements for cooperative operation in the bilinear mapping algorithm when there are 0 priority nodes.
  • the second priority commitment P is used as a voucher for node transaction confirmation.
  • the hash value h is used as a factor to verify the correctness of the node transaction confirmation process. Then, generate a second priority transaction (P, h, Ra, Rb) according to the second priority placeholder Ra, the third priority placeholder Rb, the hash value h of the transaction tx and the second priority commitment P, And send the second priority transaction (P, h, Ra, Rb) to the blockchain network.
  • Step 106 for any one of the m blockchain nodes, when the blockchain node detects the first priority transaction, generate a first decryption based on the private key of the blockchain node Fragmentation.
  • Step 107 the blockchain node generates a first decrypted transaction according to the first decrypted segment and the first priority commitment in the first priority transaction through a bilinear mapping algorithm.
  • Step 108 when the block chain node determines that the hash value of the first decrypted transaction is equal to the hash value of the transaction in the first priority transaction, pack the first decrypted transaction into a block for execution winding.
  • the blockchain node when the blockchain node detects the first priority transaction, the blockchain node can try to decrypt the customer A certain transaction that the terminal needs to process. Since the client can specify a different number of priority nodes, the elements contained in the generated priority transactions are also different, so any blockchain node uses the elements contained in the priority transaction to decrypt the transaction. The approach is also different.
  • any blockchain node when the blockchain node determines that k is 2 through the number of elements contained in the first priority transaction, it adopts the transaction decryption processing method corresponding to k being 2, that is, the The private key of the blockchain node generates the first decryption private key through the number field inversion algorithm, and obtains the public keys of m blockchain nodes from the blockchain, and for the public key of any blockchain node, According to the first decrypted private key and the public key of the block chain node, a first decrypted segment is generated, and the first decrypted segment is used to assist the block chain node to decrypt the first decrypted transaction.
  • the first decryption fragment and the first priority commitment in the first priority transaction through the bilinear mapping algorithm to generate the first decryption transaction, and judge whether the hash value of the first decryption transaction is consistent with the hash value of the transaction Values are equal to determine whether the blockchain node has successfully decrypted the transaction, so as to determine whether the blockchain node performs the block generation operation for the transaction. That is, after it is determined that the hash value of the first decrypted transaction is equal to the hash value of the transaction, the first decrypted transaction and the hash value of the first decrypted transaction are packaged into a block, and the block is The block is synchronized to other blockchain nodes for consensus verification. If it is determined that the consensus of other blockchain nodes is successful, the block will be uploaded to the chain.
  • a set hash algorithm such as MD5 or SHA256 algorithm
  • Step f the blockchain node 1 determines whether the hash value h' of the first decrypted transaction tx_try is equal to the hash value h of the transaction in the first priority transaction. If it is determined that they are equal, the first decrypted transaction tx_try and the hash value h' of the first decrypted transaction tx_try can be packaged into a block, and the block is synchronized to other blockchain nodes for consensus verification. If the consensus of each blockchain node is successful, the block will be uploaded to the chain.
  • the blockchain node that executes the specific process of the above transaction decryption processing method is in the priority queue, that is, the blockchain node is the priority node, then the specific process of executing the above transaction decryption processing method must be successful
  • the decrypted transaction that is, the first decrypted transaction obtained through decryption is the transaction that the client needs to process. Assuming that there are m blockchain nodes in the blockchain network, the transaction can be successfully decrypted after an average of m/2 attempts.
  • the blockchain node that executes the specific process of the above-mentioned transaction decryption processing method is not in the priority queue, that is, the blockchain node is not a priority node, then the blockchain node continues to traverse the public key list pk_list.
  • the other public key pkj is any public key taken out in sequence in the public key list pk_list.
  • tx_try P*T
  • the blockchain node when the blockchain node determines that k is 1 through the number of elements contained in the first priority transaction, it adopts the transaction decryption processing method corresponding to k being 1, that is, the block
  • the private key of the block chain node generates the first decryption private key through the number field inversion algorithm, and obtains the first priority placeholder from the first priority transaction, and according to the first decryption private key and the first priority placeholder symbol to generate a first decrypted segment, and the first decrypted segment is used to assist the block chain node to decrypt the first decrypted transaction.
  • the first decryption fragment and the first priority commitment in the first priority transaction through the bilinear mapping algorithm to generate the first decryption transaction, and judge whether the hash value of the first decryption transaction is consistent with the hash value of the transaction Values are equal to determine whether the blockchain node has successfully decrypted the transaction, so as to determine whether the blockchain node performs the block generation operation for the transaction. That is, after it is determined that the hash value of the first decrypted transaction is equal to the hash value of the transaction, the first decrypted transaction and the hash value of the first decrypted transaction are packaged into a block, and the block is The block is synchronized to other blockchain nodes for consensus verification.
  • the block will be uploaded to the chain.
  • the number k of priority nodes is 1, if the block chain node determines that it has not successfully decrypted the transaction through the above method, and determines the first decrypted transaction corresponding to the other m-1 block chain nodes If the hash value and the hash value of the transaction are not equal, another transaction decryption processing method can be used for processing.
  • the public keys of m blockchain nodes are obtained from the blockchain, and for the public key of any blockchain node, the public key of the blockchain node is generated through the number field inversion algorithm to generate the first
  • the public key is decrypted, and a third decrypted segment is generated based on the first decrypted public key and the first priority placeholder in the first priority transaction.
  • a third decryption transaction is generated, and then it is judged whether the hash value of the third decryption transaction is consistent with the hash value of the transaction Values are equal to determine whether the blockchain node has successfully decrypted the transaction, so as to determine whether the blockchain node performs the block generation operation for the transaction. That is, after the equality is determined, the blockchain node packs the third decrypted transaction and the hash value of the third decrypted transaction into a block, and synchronizes the block to other blockchain nodes for consensus Verification, if it is determined that the consensus is successful, the block will be uploaded to the chain.
  • a set hash algorithm such as MD5 or SHA256 algorithm
  • Step e the blockchain node 1 determines whether the hash value h' of the first decrypted transaction tx_try is equal to the hash value h of the transaction in the first priority transaction. If it is determined that they are equal, the first decrypted transaction tx_try and the hash value h' of the first decrypted transaction tx_try can be packaged into a block, and the block is synchronized to other blockchain nodes for consensus verification. If the consensus of each block chain node is successful, the block will be uploaded to the chain, and at the same time, it will be determined as the priority node and the operation will be terminated. If it is determined that they are not equal, step f is performed.
  • Step f the blockchain node 1 determines whether there are other blockchain nodes synchronizing the block for the transaction, and if so, performs a hash operation on the decrypted transaction in the block through the set hash operation to determine the Decrypt the hash value of the transaction, and verify whether the hash value of the decrypted transaction is equal to the hash value of the transaction in the block. If it is determined that they are equal, the operation is terminated. If it is determined that they are not equal, step g is performed.
  • the number field inversion algorithm ie, the elliptic curve point field inverse element algorithm
  • a set hash algorithm such as MD5 or SHA256 algorithm
  • Step 1 the blockchain node 1 determines whether the hash value h' of the first decrypted transaction tx_try is equal to the hash value h of the transaction in the first priority transaction. If it is determined that they are equal, the third decrypted transaction tx_try and the hash value h' of the third decrypted transaction tx_try can be packaged into a block, and the block is synchronized to other blockchain nodes for consensus verification. If the consensus of each blockchain node is successful, the block will be uploaded to the chain.
  • step h re-execute step h to step l until the correct tx_try is synchronized by other blockchain nodes, or until the hash value h' of the third decrypted transaction tx_try and the hash value h' of the first priority transaction are successfully obtained
  • the hash values h of the transactions are equal.
  • the blockchain node that executes the specific process of the above transaction decryption processing method is in the priority queue, that is, the blockchain node is the priority node, then only one time is required to execute the specific process of the above transaction decryption processing method.
  • the transaction can be successfully decrypted during the process, that is, the first decrypted transaction obtained by decryption is the transaction that the client needs to process. If the blockchain node that performs the specific process of the above transaction decryption processing method is not in the priority queue, assuming that there are m blockchain nodes in the blockchain network, it will take m/2 attempts on average to successfully decrypt the transaction.
  • the blockchain node when the blockchain node determines that k is 0 through the number of elements contained in the second priority transaction, it adopts the transaction decryption processing method corresponding to k being 0, that is, from the second Two unequal second priority placeholders and third priority placeholders are obtained in the priority transaction, and a second decryption fragment is generated according to the second priority placeholder and the third priority placeholder.
  • the blockchain node packs the second decrypted transaction and the hash value of the second decrypted transaction into a block, and synchronizes the block to other blockchain nodes for consensus Verification, if it is determined that the consensus is successful, the block will be uploaded to the chain.
  • a set hash algorithm such as MD5 or SHA256 algorithm
  • Step d the block chain node 1 determines whether the hash value h" of the second decrypted transaction tx_try is equal to the hash value h" of the transaction in the second priority transaction. If it is determined to be equal, the second decrypted transaction can be tx_try and the hash value h” of the second decrypted transaction tx_try are packaged into a block, and the block is synchronized to other blockchain nodes for consensus verification. If it is determined that the consensus of other blockchain nodes is successful, the block Go to the chain. If it is determined that they are not equal, it will prompt that the transaction is abnormal and terminate the transaction.
  • the above-mentioned embodiment shows that, since the relationship of each blockchain node in the blockchain network of the prior art solution is equal, and the computing power of each blockchain node is the same, the block confirmation algorithm involved in this prior art solution It is also aimed at each blockchain node in a peer-to-peer relationship, so it cannot support the block confirmation process with priority node requirements (that is, specifying some blockchain nodes to process transactions first). With the same computing power, no node can complete the block confirmation process first, so it takes a long time for each blockchain node to confirm the block through the workload proof mechanism, resulting in low efficiency of block chaining.
  • the technical solution in the present invention designates some blockchain nodes as priority nodes, so that when the computing capabilities of each blockchain node in the blockchain network are the same or close to each other, the priority nodes designated by the client have a great Probability can be the first to complete the block confirmation process, so it can save the time spent in the block confirmation process, thereby effectively improving the efficiency of block chaining.
  • the client can determine k blockchain nodes as priority nodes from the m blockchain nodes, and generate the first confusion factor based on the public keys of the k priority nodes.
  • the first priority transaction is sent to the block chain network, and a block chain node (such as a priority node) in the block chain network can take the lead in recovering the transaction through the first priority commitment in the first priority transaction.
  • a block chain node such as a priority node
  • the priority node Even if the computing power of each blockchain node is different, the priority node has a great probability to be the first to pass the first priority in the first priority transaction. Promise to restore the transaction, so as to quickly complete the block confirmation process, which can effectively improve the efficiency of block chaining.
  • the client since the client does not directly send the transaction to the blockchain network, but uses the first obfuscation factor to obfuscate the transaction, and sends the hash value of the transaction and the first priority commitment obtained after the obfuscation to Blockchain network, so the risk of transaction data leakage can be avoided, which can help ensure the privacy and security of transaction data.
  • FIG. 2 exemplarily shows a block confirmation device provided by an embodiment of the present invention, and the device can execute the flow of the block confirmation method.
  • the block confirmation method is applicable to a blockchain network with m blockchain nodes.
  • the device includes:
  • the determination unit 201 is configured to determine k blockchain nodes from the m blockchain nodes as priority nodes for any transaction;
  • the first processing unit 202 is configured to generate a first confusion factor based on the public keys of the k priority nodes; generate a first priority commitment based on the first confusion factor and the transaction; and generate a first priority commitment based on the first priority commitment and the The hash value of the transaction is used to generate a first priority transaction, and the first priority transaction is sent to the block chain network.
  • the first processing unit 202 is specifically configured to:
  • the public keys of the k priority nodes are passed through a bilinear mapping algorithm to generate the first confusion factor
  • the first processing unit 202 is specifically used for:
  • the first priority transaction is generated according to the first priority commitment and the hash value of the transaction.
  • the first processing unit 202 is specifically configured to:
  • the first processing unit 202 is specifically used for:
  • the first priority transaction is generated according to the first priority commitment, the first priority placeholder, and the hash value of the transaction.
  • the first processing unit 202 is further configured to:
  • the first processing unit 202 is specifically configured to:
  • FIG. 3 exemplarily shows another block confirmation device provided by an embodiment of the present invention, and the device can execute the flow of the block confirmation method.
  • the block confirmation method is applicable to a blockchain network with m blockchain nodes.
  • the device includes:
  • the generating unit 301 is configured to generate a first decrypted segment based on the private key of the blockchain node for any one of the m blockchain nodes when the first priority transaction is detected;
  • the first priority transaction is generated by the client based on the first priority commitment and the hash value of the transaction;
  • the first priority commitment is generated by the client based on the first confusion factor and the transaction;
  • the first The confusion factor is generated by the client based on the public keys of the k priority nodes determined by the client from the m blockchain nodes;
  • the second processing unit 302 is configured to use a bilinear mapping algorithm to generate a first decrypted transaction according to the first decrypted fragment and the first priority commitment in the first priority transaction; When the hash value of the transaction is equal to the hash value of the transaction in the first priority transaction, the first decrypted transaction is packed into a block and uploaded to the chain.
  • the generating unit 301 is specifically configured to:
  • the private key of the blockchain node is passed through a number field inversion algorithm to generate a first decryption private key
  • the generating unit 301 is specifically configured to:
  • the private key of the blockchain node is passed through a number field inversion algorithm to generate a first decryption private key
  • the second processing unit 302 is further configured to:
  • the second decrypted transaction is packaged into a block and uploaded to the chain.
  • the second processing unit 302 is further configured to:
  • m blocks are obtained from the blockchain
  • the public key of the chain node, and for the public key of any blockchain node, the public key of the blockchain node is passed through the number field inversion algorithm to generate the first decryption public key;
  • the third decrypted transaction is packaged into a block and uploaded to the chain.
  • the embodiment of the present invention also provides a computing device, as shown in FIG. 4 , including at least one processor 401 and a memory 402 connected to the at least one processor.
  • the specific connection medium between the processor 401 and the memory 402, the bus connection between the processor 401 and the memory 402 in FIG. 4 is taken as an example.
  • the bus can be divided into address bus, data bus, control bus and so on.
  • the memory 402 stores instructions that can be executed by at least one processor 401, and at least one processor 401 can execute the steps included in the aforementioned block confirmation method by executing the instructions stored in the memory 402.
  • the processor 401 is the control center of the computing device, which can use various interfaces and lines to connect various parts of the computing device, by running or executing instructions stored in the memory 402 and calling data stored in the memory 402, thereby realizing data deal with.
  • the processor 401 may include one or more processing units, and the processor 401 may integrate an application processor and a modem processor.
  • the call processor mainly handles issuing instructions. It can be understood that the foregoing modem processor may not be integrated into the processor 401 .
  • the processor 401 and the memory 402 can be implemented on the same chip, and in some embodiments, they can also be implemented on independent chips.
  • the processor 401 can be a general processor, such as a central processing unit (CPU), a digital signal processor, an application specific integrated circuit (Application Specific Integrated Circuit, ASIC), a field programmable gate array or other programmable logic devices, discrete gates or transistors Logic devices and discrete hardware components can implement or execute the methods, steps and logic block diagrams disclosed in the embodiments of the present invention.
  • a general purpose processor may be a microprocessor or any conventional processor or the like.
  • the steps of the method disclosed in the embodiment of the block confirmation method can be directly implemented by a hardware processor, or implemented by a combination of hardware and software modules in the processor.
  • the memory 402 can be used to store non-volatile software programs, non-volatile computer-executable programs and modules.
  • Memory 402 can include at least one type of storage medium, for example, can include flash memory, hard disk, multimedia card, card memory, random access memory (Random Access Memory, RAM), static random access memory (Static Random Access Memory, SRAM), Programmable Read Only Memory (PROM), Read Only Memory (ROM), Electrically Erasable Programmable Read-Only Memory (EEPROM), Magnetic Memory, Disk , CD, etc.
  • Memory 402 is, but is not limited to, any other medium that can be used to carry or store desired program code in the form of instructions or data structures and that can be accessed by a computer.
  • the memory 402 in the embodiment of the present invention may also be a circuit or any other device capable of implementing a storage function, and is used for storing program instructions and/or data.
  • an embodiment of the present invention also provides a computer-readable storage medium, which stores a computer program executable by a computing device, and when the program is run on the computing device, the computing device Execute the steps of the block confirmation method described above.
  • the embodiments of the present invention may be provided as methods, systems, or computer program products. Accordingly, the present invention can take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) having computer-usable program code embodied therein.
  • computer-usable storage media including but not limited to disk storage, CD-ROM, optical storage, etc.
  • These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing apparatus to operate in a specific manner, such that the instructions stored in the computer-readable memory produce an article of manufacture comprising instruction means, the instructions
  • the device realizes the function specified in one or more procedures of the flowchart and/or one or more blocks of the block diagram.

Abstract

A block confirmation method and device. The method comprises for any transaction, a client determining k block chain nodes from m block chain nodes as priority nodes (101); generating a first confounding factor on the basis of public keys of the k priority nodes (102); generating a first priority commitment on the basis of the first confounding factor and the transaction (103); generating a first priority transaction on the basis of the first priority commitment and a hash value of the transaction (104); and sending the first priority transaction to a block chain network (105). In this case, under the condition that the computing capabilities of the block chain nodes are the same or approximate, the priority nodes specified by the client have a great probability of first recovering the transaction by means of the first priority commitment in the first priority transaction, so as to rapidly complete the block confirmation process, thereby effectively improving the block on-chain efficiency. Moreover, the client confounds the transaction by means of the first confounding factor and then sends the confounded transaction to the block chain network, such that the privacy security of transaction data can be ensured.

Description

一种区块确认方法及装置Method and device for block confirmation
相关申请的交叉引用Cross References to Related Applications
本申请要求在2021年10月27日提交中国专利局、申请号为202111254334.8、申请名称为“一种区块确认方法及装置”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of the Chinese patent application with the application number 202111254334.8 and the application title "A Block Confirmation Method and Device" submitted to the China Patent Office on October 27, 2021, the entire contents of which are incorporated by reference in this application middle.
技术领域technical field
本发明实施例涉及金融科技(Fintech)领域,尤其涉及一种区块确认方法及装置。Embodiments of the present invention relate to the field of financial technology (Fintech), and in particular to a block confirmation method and device.
背景技术Background technique
随着计算机技术的发展,越来越多的技术应用在金融领域,传统金融业正在逐步向金融科技转变,但由于金融行业的安全性、实时性要求,也对技术提出的更高的要求。With the development of computer technology, more and more technologies are applied in the financial field, and the traditional financial industry is gradually transforming into financial technology. However, due to the security and real-time requirements of the financial industry, higher requirements are also placed on technology.
现阶段,基于现有工作量证明共识协议,区块链网络中的各区块链节点是通过计算能力来竞争完成区块确认的过程。具体来说,通过设置一个工作量证明机制来确定由区块链网络中的哪一个节点来完成区块确认的过程,也即是确定由哪一个节点来执行出块操作,并将该区块作为上链的区块。其中,区块链网络中各区块链节点的关系是对等的,都是以平等的身份参与到竞争区块确认的过程,且各区块链节点的计算能力相同。此外,该工作量证明机制是将各自交易池中的某一笔交易加上一个自己生成的随机数进行哈希运算,要求所计算出的哈希值的前多少位为0,比如前6位为0,即000000。然后,区块链网络中的各区块链节点按照该工作量证明机制进行相关的哈希运算,不停地寻找符合要求的随机数,如果某一区块链节点寻找出符合要求的随机数,可以将该笔交易、随机数以及哈希值进行上链,以便区块链网络中的其它区块链节点进行共识验证,其它区块链节点只需将该笔交易加上该随机数进行哈希运算,验证所计算出的哈希值前多少位是否为0,且验证所计算出的哈希值是否等于链上的哈希值,并在验证通过后,即可确认由该区块链节点来打包该笔交易生成一个上链的区块。然而,这种处理方式由于区块链网络中各区块链节点的关系都是对等的,适用的业务场景较为单一,无法适用不同的业务场景(比如联盟链中的业务场景要求在计算能力相同的各区块链节点中有区块链节点可以率先完成区块的确认过程)的需求,且现有技术方案的区块链网络中各区块链节点的计算能力相同,则通过工作量证明机制完成区块确认的过程所耗费的时间就会比较长,导致区块上链的效率低。At this stage, based on the existing proof-of-work consensus protocol, each blockchain node in the blockchain network competes to complete the block confirmation process through computing power. Specifically, by setting up a proof-of-work mechanism to determine which node in the blockchain network will complete the block confirmation process, that is, to determine which node will perform the block operation and send the block As a block on the chain. Among them, the relationship between each blockchain node in the blockchain network is equal, and they all participate in the process of competing block confirmation with an equal identity, and the computing power of each blockchain node is the same. In addition, the proof-of-work mechanism is to hash a certain transaction in the respective transaction pool with a random number generated by itself, requiring the first number of digits of the calculated hash value to be 0, such as the first 6 digits is 0, that is, 000000. Then, each blockchain node in the blockchain network performs relevant hash operations according to the proof-of-work mechanism, and keeps looking for random numbers that meet the requirements. If a certain blockchain node finds out a random number that meets the requirements, The transaction, random number and hash value can be uploaded to the chain so that other blockchain nodes in the blockchain network can perform consensus verification. Other blockchain nodes only need to add the random number to the transaction for hashing. Greek operation, verify whether the number of digits before the calculated hash value is 0, and verify whether the calculated hash value is equal to the hash value on the chain, and after the verification is passed, it can be confirmed that the block chain Nodes package the transaction to generate an on-chain block. However, due to the fact that the relationship between each blockchain node in the blockchain network is equal, this processing method is applicable to a single business scenario and cannot be applied to different business scenarios (for example, the business scenarios in the alliance chain require There are blockchain nodes in each blockchain node that can take the lead in completing the block confirmation process), and the computing power of each blockchain node in the blockchain network of the existing technical solution is the same, then it is completed through the proof-of-work mechanism The block confirmation process will take a long time, resulting in low efficiency of block chaining.
综上,目前亟需一种区块确认方法,用以通过优先节点率先完成区块确认的过程,以此有效地提高区块上链的效率。To sum up, there is an urgent need for a block confirmation method, which is used to complete the process of block confirmation through priority nodes, so as to effectively improve the efficiency of block chaining.
发明内容Contents of the invention
本发明实施例提供了一种区块确认方法及装置,用以通过优先节点率先完成区块确认的过程,以此有效地提高区块上链的效率。Embodiments of the present invention provide a block confirmation method and device, which are used to complete the process of block confirmation through priority nodes first, so as to effectively improve the efficiency of block chaining.
第一方面,本发明实施例提供了一种区块确认方法,适用于具有m个区块链节点的区 块链网络,所述方法包括:In the first aspect, the embodiment of the present invention provides a block confirmation method, which is applicable to a block chain network with m block chain nodes, and the method includes:
针对任一交易,客户端从所述m个区块链节点中确定出k个区块链节点作为优先节点;For any transaction, the client determines k blockchain nodes from the m blockchain nodes as priority nodes;
所述客户端基于k个优先节点的公钥,生成第一混淆因子;The client generates a first confusion factor based on the public keys of the k priority nodes;
所述客户端基于所述第一混淆因子和所述交易,生成第一优先承诺;The client generates a first priority commitment based on the first confusion factor and the transaction;
所述客户端基于所述第一优先承诺和所述交易的哈希值生成第一优先交易,并将所述第一优先交易发送给所述区块链网络。The client generates a first priority transaction based on the first priority commitment and a hash value of the transaction, and sends the first priority transaction to the blockchain network.
上述技术方案中,由于现有技术方案的区块链网络中各区块链节点的关系是对等的,且各区块链节点的计算能力相同,如此该现有技术方案所涉及的区块确认算法也是针对处于对等关系的各区块链节点,那么也就无法支持具有优先节点要求(即指定一些区块链节点优先处理交易)的区块确认过程,同时由于现有技术方案的各区块链节点计算能力相同,没有节点能够率先完成区块确认的过程,如此就需要各区块链节点耗费较长的时间通过工作量证明机制进行区块的确认,从而导致区块上链的效率低。基于此,本发明中的技术方案通过指定部分区块链节点作为优先节点,如此在区块链网络中各区块链节点的计算能力相同或接近时,客户端所指定的优先节点有极大的概率能够率先完成区块确认的过程,因此可以节省区块确认的过程所耗费的时间,从而可以有效地提高区块上链的效率。具体来说,针对任一交易,客户端从m个区块链节点中可确定出k个区块链节点作为优先节点,并基于该k个优先节点的公钥,生成第一混淆因子。再基于第一混淆因子和该交易,生成第一优先承诺,该第一优先承诺作为节点交易确认的凭证,并在基于第一优先承诺和该交易的哈希值生成第一优先交易后,将该第一优先交易发送给区块链网络,区块链网络中的某一区块链节点(比如优先节点)可率先通过该第一优先交易中的第一优先承诺恢复出该交易。如此,该方案可以在区块链网络中各区块链节点的计算能力相同或接近的情况下,客户端所指定的优先节点有极大的概率能够率先通过该第一优先交易中的第一优先承诺恢复出该交易,从而快速完成区块确认的过程,即使在各区块链节点的计算能力不相同的情况下,优先节点也有极大的概率能够率先通过该第一优先交易中的第一优先承诺恢复出该交易,以此快速完成区块确认的过程,以此可以有效地提高区块上链的效率。同时,由于客户端并没有直接向区块链网络发送该交易,而是通过第一混淆因子对该交易进行混淆处理,并将交易的哈希值以及混淆处理后所得到的第一优先承诺发送区块链网络,因此可以避免交易数据存在泄露的风险,从而可以有助于确保交易数据的隐私安全性。In the above technical solution, since the relationship of each blockchain node in the blockchain network of the prior art solution is equal, and the computing power of each blockchain node is the same, the block confirmation algorithm involved in this prior art solution It is also aimed at each blockchain node in a peer-to-peer relationship, so it cannot support the block confirmation process with priority node requirements (that is, specifying some blockchain nodes to process transactions first). With the same computing power, no node can complete the block confirmation process first, so it takes a long time for each blockchain node to confirm the block through the workload proof mechanism, resulting in low efficiency of block chaining. Based on this, the technical solution in the present invention designates some blockchain nodes as priority nodes, so that when the computing capabilities of each blockchain node in the blockchain network are the same or close to each other, the priority nodes designated by the client have a great Probability can be the first to complete the block confirmation process, so it can save the time spent in the block confirmation process, thereby effectively improving the efficiency of block chaining. Specifically, for any transaction, the client can determine k blockchain nodes as priority nodes from the m blockchain nodes, and generate the first confusion factor based on the public keys of the k priority nodes. Based on the first confusion factor and the transaction, generate the first priority commitment, which is used as the node transaction confirmation certificate, and after generating the first priority transaction based on the first priority commitment and the hash value of the transaction, the The first priority transaction is sent to the block chain network, and a block chain node (such as a priority node) in the block chain network can take the lead in recovering the transaction through the first priority commitment in the first priority transaction. In this way, under the condition that the computing capabilities of each blockchain node in the blockchain network are the same or close to each other, the priority node designated by the client has a great probability of being the first to pass the first priority transaction in the first priority transaction. Promise to restore the transaction, so as to quickly complete the block confirmation process. Even if the computing power of each blockchain node is different, the priority node has a great probability to be the first to pass the first priority in the first priority transaction. Promise to restore the transaction, so as to quickly complete the block confirmation process, which can effectively improve the efficiency of block chaining. At the same time, since the client does not directly send the transaction to the blockchain network, but uses the first obfuscation factor to obfuscate the transaction, and sends the hash value of the transaction and the first priority commitment obtained after the obfuscation to Blockchain network, so the risk of transaction data leakage can be avoided, which can help ensure the privacy and security of transaction data.
可选地,所述客户端基于k个优先节点的公钥,生成第一混淆因子,包括:Optionally, the client generates a first confusion factor based on the public keys of the k priority nodes, including:
所述客户端在确定优先节点的个数k为2时,将所述k个优先节点的公钥通过双线性映射算法,生成所述第一混淆因子;When the client determines that the number k of priority nodes is 2, the public keys of the k priority nodes are generated through a bilinear mapping algorithm to generate the first confusion factor;
所述客户端基于所述第一优先承诺和所述交易的哈希值生成第一优先交易,包括:The client generates a first priority transaction based on the first priority commitment and the hash value of the transaction, including:
所述客户端对所述交易进行哈希运算,生成所述交易的哈希值;The client performs a hash operation on the transaction to generate a hash value of the transaction;
所述客户端根据所述第一优先承诺和所述交易的哈希值,生成所述第一优先交易。The client generates the first priority transaction according to the first priority commitment and the hash value of the transaction.
上述技术方案中,由于客户端可以指定优先节点的数量,而不同数量的优先节点所对应的优先交易有所不同,即,生成的优先交易中包含的元素数量是不相同的,因此本方案通过设置不同数量的优先节点来具体说明通过优先节点可极大概率的率先完成区块确认的过程。具体地,在客户端指定优先节点的个数k为2时,将该2个优先节点的公钥通过双线性映射算法来生成第一混淆因子,该第一混淆因子用于混淆客户端所需处理的交易,也即是通过第一混淆因子和该交易生成第一优先承诺。然后,通过第一优先承诺和该交易 的哈希值生成指定优先节点的个数k为2时所对应的第一优先交易。其中,该第一优先承诺用于作为各区块链节点共识确认交易的凭证,区块链网络中的某一区块链节点(比如优先节点)可通过该第一优先承诺率先解密出该交易,如此在确保不泄露客户端所需处理的某一交易的前提下,只有区块链网络中的某一区块链节点能够率先通过第一优先承诺解密出该交易,从而可以避免该交易被篡改或被盗取。In the above technical solution, since the client can specify the number of priority nodes, and the priority transactions corresponding to different numbers of priority nodes are different, that is, the number of elements contained in the generated priority transactions is different, so this solution adopts Set different numbers of priority nodes to specify the process of completing block confirmation with a high probability through the priority nodes. Specifically, when the number k of priority nodes specified by the client is 2, the public keys of the two priority nodes are used to generate the first confusion factor through the bilinear mapping algorithm, and the first confusion factor is used to confuse the The transaction to be processed, that is, the first priority commitment generated by the first confusion factor and the transaction. Then, the first priority transaction corresponding to when the number k of designated priority nodes is 2 is generated through the first priority commitment and the hash value of the transaction. Among them, the first priority commitment is used as a voucher for each blockchain node consensus to confirm the transaction, and a certain blockchain node (such as a priority node) in the blockchain network can first decrypt the transaction through the first priority commitment, In this way, under the premise of ensuring that a certain transaction that the client needs to process is not disclosed, only a certain blockchain node in the blockchain network can first decrypt the transaction through the first priority commitment, thereby preventing the transaction from being tampered with or be stolen.
可选地,所述客户端基于k个优先节点的公钥,生成第一混淆因子,包括:Optionally, the client generates a first confusion factor based on the public keys of the k priority nodes, including:
所述客户端在确定优先节点的个数k为1时,基于椭圆曲线确定第一优先占位符,并将所述第一优先占位符以及所述k个优先节点的公钥通过双线性映射算法,生成所述第一混淆因子;When determining that the number k of priority nodes is 1, the client determines a first priority placeholder based on an elliptic curve, and passes the first priority placeholder and the public keys of the k priority nodes through a double line A property mapping algorithm that generates the first confusion factor;
所述客户端基于所述第一优先承诺和所述交易的哈希值生成第一优先交易,包括:The client generates a first priority transaction based on the first priority commitment and the hash value of the transaction, including:
所述客户端对所述交易进行哈希运算,生成所述交易的哈希值;The client performs a hash operation on the transaction to generate a hash value of the transaction;
所述客户端根据所述第一优先承诺、所述第一优先占位符和所述交易的哈希值,生成所述第一优先交易。The client generates the first priority transaction according to the first priority commitment, the first priority placeholder, and the hash value of the transaction.
上述技术方案中,在客户端指定优先节点的个数k为1时,为了更好地隐匿优先节点的身份,通过椭圆曲线确定第一优先占位符,该第一优先占位符用于作为1个优先节点时双线性映射算法中配合运算的点域元素。再将该1个优先节点的公钥以及第一优先占位符通过双线性映射算法生成第一混淆因子,该第一混淆因子用于混淆客户端所需处理的交易,也即是通过第一混淆因子和该交易生成第一优先承诺。然后,通过第一优先承诺和该交易的哈希值生成指定优先节点的个数k为1时所对应的第一优先交易。其中,该第一优先承诺用于作为各区块链节点共识确认交易的凭证,区块链网络中的某一区块链节点(比如优先节点)可通过该第一优先承诺率先解密出该交易,如此在确保不泄露客户端所需处理的某一交易的前提下,只有区块链网络中的某一区块链节点能够率先通过第一优先承诺解密出该交易,从而可以避免该交易被篡改或被盗取。In the above technical solution, when the number k of priority nodes designated by the client is 1, in order to better conceal the identity of the priority nodes, the first priority placeholder is determined through the elliptic curve, and the first priority placeholder is used as A priority node is the dot field element of the cooperative operation in the bilinear mapping algorithm. Then the public key of one priority node and the first priority placeholder are used to generate the first confusion factor through the bilinear mapping algorithm, and the first confusion factor is used to confuse the transaction that the client needs to process, that is, through the first A confounding factor and the transaction generate the first priority commitment. Then, the first priority transaction corresponding to when the number k of designated priority nodes is 1 is generated through the first priority commitment and the hash value of the transaction. Among them, the first priority commitment is used as a voucher for each blockchain node consensus to confirm the transaction, and a certain blockchain node (such as a priority node) in the blockchain network can first decrypt the transaction through the first priority commitment, In this way, under the premise of ensuring that a certain transaction that the client needs to process is not disclosed, only a certain blockchain node in the blockchain network can first decrypt the transaction through the first priority commitment, thereby preventing the transaction from being tampered with or be stolen.
可选地,还包括:Optionally, also include:
所述客户端在确定优先节点的个数k为0时,基于椭圆曲线确定两个不相等的第二优先占位符和第三优先占位符,并将所述第二优先占位符和所述第三优先占位符通过双线性映射算法,生成第二混淆因子;When the client determines that the number k of priority nodes is 0, it determines two unequal second priority placeholders and third priority placeholders based on elliptic curves, and uses the second priority placeholder and the third priority placeholder The third priority placeholder generates a second confusion factor through a bilinear mapping algorithm;
所述客户端基于所述第二混淆因子和所述交易,生成第二优先承诺;The client generates a second priority commitment based on the second confusion factor and the transaction;
所述客户端根据所述第二优先承诺、所述第二优先占位符、所述第三优先占位符和所述交易的哈希值,生成所述第二优先交易,并将所述第二优先交易发送给所述区块链网络。The client generates the second priority transaction according to the second priority commitment, the second priority placeholder, the third priority placeholder, and the hash value of the transaction, and sends the A second priority transaction is sent to the blockchain network.
上述技术方案中,在客户端指定优先节点的个数k为0时,也即是客户端没有指定优先节点,此时为了不让他人轻易知道客户端是否有指定优先节点或不让他人轻易知道客户端所指定的优先节点的数量,以此更好地隐匿优先节点的身份,并为了配合双线性映射算法中的点域运算,会通过生成两个不相等的优先占位符来实现。具体地,通过椭圆曲线确定两个不相等的第二优先占位符和第三优先占位符,该第二优先占位符和该第三优先占位符用于作为0个优先节点时双线性映射算法中配合运算的点域元素。再将第二优先占位符和第三优先占位符通过双线性映射算法,生成第二混淆因子,该第二混淆因子用于混淆客户端所需处理的交易,也即是通过第二混淆因子和该交易生成第二优先承诺。然后,通过第二优先承诺和该交易的哈希值生成指定优先节点的个数k为0时所对应的第二优先交易。其中,该第二优先承诺用于作为各区块链节点共识确认交易的凭证,区块链网络中的某一 区块链节点(比如优先节点)可通过该第二优先承诺率先解密出该交易,如此在确保不泄露客户端所需处理的某一交易的前提下,只有区块链网络中的某一区块链节点能够率先通过第二优先承诺解密出该交易,从而可以避免该交易被篡改或被盗取。In the above technical solution, when the number k of priority nodes designated by the client is 0, that is, the client does not designate a priority node. At this time, in order not to let others easily know whether the client has designated priority nodes or not The number of priority nodes specified by the client is used to better conceal the identity of the priority nodes, and in order to cooperate with the dot field operation in the bilinear mapping algorithm, it will be realized by generating two unequal priority placeholders. Specifically, two unequal second priority placeholders and third priority placeholders are determined through elliptic curves, and the second priority placeholder and the third priority placeholder are used as double The dot-field element of the fit operation in the linear mapping algorithm. Then pass the second priority placeholder and the third priority placeholder through the bilinear mapping algorithm to generate the second confusion factor, which is used to confuse the transaction that the client needs to process, that is, through the second The confusion factor and the transaction generate a second-priority commitment. Then, a second priority transaction corresponding to when the number k of designated priority nodes is 0 is generated through the second priority commitment and the hash value of the transaction. Wherein, the second priority commitment is used as a voucher for each blockchain node consensus to confirm the transaction, and a certain blockchain node (such as a priority node) in the blockchain network can first decrypt the transaction through the second priority commitment, In this way, under the premise of ensuring that a certain transaction that the client needs to process is not disclosed, only a certain blockchain node in the blockchain network can first decrypt the transaction through the second priority commitment, thereby preventing the transaction from being tampered with or be stolen.
可选地,所述客户端基于所述第一混淆因子和所述交易,生成第一优先承诺,包括:Optionally, the client generates a first priority commitment based on the first confusion factor and the transaction, including:
所述客户端将所述第一混淆因子和所述交易,通过椭圆曲线点域乘法算法,生成第一优先承诺。The client uses the first confusion factor and the transaction to generate a first priority commitment through an elliptic curve dot domain multiplication algorithm.
上述技术方案中,客户端通过椭圆曲线点域乘法算法,将第一混淆因子和该交易进行处理,如此即可将该交易进行混淆处理,生成符合不泄露交易信息要求的第一优先承诺,以此可以避免客户端所需处理的某一交易信息存在泄漏的风险,有助于确保交易的隐私安全性。In the above technical solution, the client uses the elliptic curve point field multiplication algorithm to process the first obfuscation factor and the transaction, so that the transaction can be obfuscated, and the first priority commitment that meets the requirements of not disclosing transaction information is generated, and This can avoid the risk of leakage of a certain transaction information that the client needs to process, and help ensure the privacy and security of the transaction.
第二方面,本发明实施例提供了一种区块确认方法,适用于具有m个区块链节点的区块链网络,所述方法包括:In the second aspect, the embodiment of the present invention provides a block confirmation method, which is suitable for a blockchain network with m blockchain nodes, and the method includes:
针对所述m个区块链节点中的任一区块链节点,所述区块链节点在检测到第一优先交易时,基于所述区块链节点的私钥生成第一解密分片;所述第一优先交易是客户端基于第一优先承诺和交易的哈希值生成的;所述第一优先承诺是所述客户端基于第一混淆因子和所述交易生成的;所述第一混淆因子是所述客户端基于所述客户端从所述m个区块链节点中确定出的k个优先节点的公钥生成的;For any one of the m blockchain nodes, when the blockchain node detects the first priority transaction, it generates a first decrypted segment based on the private key of the blockchain node; The first priority transaction is generated by the client based on the first priority commitment and the hash value of the transaction; the first priority commitment is generated by the client based on the first confusion factor and the transaction; the first The confusion factor is generated by the client based on the public keys of the k priority nodes determined by the client from the m blockchain nodes;
所述区块链节点通过双线性映射算法,根据所述第一解密分片以及所述第一优先交易中的第一优先承诺,生成第一解密交易;The blockchain node generates a first decrypted transaction according to the first decrypted fragment and the first priority commitment in the first priority transaction through a bilinear mapping algorithm;
所述区块链节点在确定所述第一解密交易的哈希值与所述第一优先交易中的交易的哈希值相等时,将所述第一解密交易打包为区块进行上链。When the block chain node determines that the hash value of the first decrypted transaction is equal to the hash value of the transaction in the first priority transaction, it packs the first decrypted transaction into a block and uploads it to the chain.
上述技术方案中,针对任一区块链节点,该区块链节点在检测到第一优先交易时,该区块链节点可尝试通过该第一优先交易中所包含的元素来解密出客户端所需处理的某一交易。具体地,该区块链节点基于自己的私钥生成第一解密分片,并将第一解密分片以及第一优先交易中的第一优先承诺通过双线性映射算法,生成第一解密交易,然后通过判断该第一解密交易的哈希值是否与该交易的哈希值相等来判断该区块链节点是否真的成功解密出该交易,从而才能确定是否由该区块链节点来执行针对该交易的出块操作,也即是在其它区块链节点针对该第一解密交易共识成功后,由该区块链节点将该第一解密交易打包为区块进行上链。其中,如果该区块链节点为优先节点,则该优先节点可以在区块链网络中各区块链节点的计算能力相同或接近的情况下,有极大的概率能够率先通过第一优先交易中的第一优先承诺来解密出交易,或者在各区块链节点的计算能力不相同的情况下,也有极大的概率能够率先通过第一优先交易中的第一优先承诺来解密出交易,如此即可在将该解密出的交易打包为区块,并将该区块同步给其它区块链节点进行共识成功后进行上链,以此可以有效地提高区块上链的效率。同时,由于客户端发送给区块链网络的是交易的哈希值以及经过混淆处理形成的第一优先承诺组成的第一优先交易,并未直接发送交易给区块链网络,因此可以避免交易数据存在泄露的风险,从而可以有助于确保交易数据的隐私安全性。In the above technical solution, for any block chain node, when the block chain node detects the first priority transaction, the block chain node can try to decrypt the client through the elements contained in the first priority transaction. A transaction that needs to be processed. Specifically, the blockchain node generates the first decryption segment based on its own private key, and uses the first decryption segment and the first priority commitment in the first priority transaction through the bilinear mapping algorithm to generate the first decryption transaction , and then determine whether the blockchain node has successfully decrypted the transaction by judging whether the hash value of the first decrypted transaction is equal to the hash value of the transaction, so as to determine whether it is executed by the blockchain node The block generation operation for the transaction, that is, after other blockchain nodes successfully reach a consensus on the first decrypted transaction, the blockchain node packages the first decrypted transaction into a block and uploads it to the chain. Among them, if the blockchain node is a priority node, the priority node can have a great probability to be the first to pass the first priority transaction when the computing power of each blockchain node in the blockchain network is the same or close. The first priority commitment in the first priority transaction to decrypt the transaction, or in the case that the computing power of each blockchain node is different, there is also a great probability that the transaction can be decrypted first through the first priority commitment in the first priority transaction, so that The decrypted transaction can be packaged into a block, and the block is synchronized to other blockchain nodes for consensus, and then uploaded to the chain, which can effectively improve the efficiency of block chaining. At the same time, since the client sends to the blockchain network the hash value of the transaction and the first-priority transaction formed by the obfuscated first-priority commitment, it does not directly send the transaction to the blockchain network, so the transaction can be avoided. There is a risk of data leakage, which can help ensure the privacy and security of transaction data.
可选地,所述区块链节点在检测到第一优先交易时,基于所述区块链节点的私钥生成第一解密分片,包括:Optionally, when the blockchain node detects the first priority transaction, it generates a first decrypted segment based on the private key of the blockchain node, including:
所述区块链节点在通过所述第一优先交易中所包含的元素数量指示k为2时,将所述 区块链节点的私钥通过数域求逆算法,生成第一解密私钥;When the block chain node indicates that k is 2 through the number of elements contained in the first priority transaction, the private key of the block chain node is generated through a number field inversion algorithm to generate the first decryption private key;
所述区块链节点从区块链上获取所述m个区块链节点的公钥,并针对任一区块链节点的公钥,根据所述第一解密私钥和所述区块链节点的公钥,生成所述第一解密分片。The block chain node obtains the public keys of the m block chain nodes from the block chain, and for the public key of any block chain node, according to the first decryption private key and the block chain The public key of the node is used to generate the first decrypted fragment.
上述技术方案中,由于客户端可以指定不同数量的优先节点,则所生成的优先交易中所包含的元素也不相同,因此任一区块链节点在通过优先交易中所包含的元素进行解密出交易时所采用的方式也有所不同。具体地,针对任一区块链节点,该区块链节点在通过第一优先交易中所包含的元素数量确定k为2时,采用k为2所对应的交易解密处理方式,即,通过根据任一区块链节点的公钥以及自己的私钥所生成的第一解密私钥,来生成第一解密分片。其中,该第一解密分片用于辅助该区块链节点解密出一个第一解密交易,同时区块链节点会判断解密出的第一解密交易的哈希值是否与交易的哈希值相等来确定该区块链节点是否真的成功解密出交易,并在确定相等后会将该解密出的第一解密交易打包为区块同步给其它区块链节点进行共识验证。In the above technical solution, since the client can specify different numbers of priority nodes, the elements contained in the generated priority transactions are also different, so any blockchain node decrypts the The method used in the transaction is also different. Specifically, for any blockchain node, when k is determined to be 2 by the number of elements contained in the first priority transaction, the blockchain node adopts the transaction decryption processing method corresponding to k being 2, that is, by The public key of any blockchain node and the first decryption private key generated by its own private key to generate the first decryption segment. Wherein, the first decrypted fragment is used to assist the blockchain node to decrypt a first decrypted transaction, and the blockchain node will judge whether the hash value of the decrypted first decrypted transaction is equal to the hash value of the transaction To determine whether the blockchain node has successfully decrypted the transaction, and after the equality is determined, the decrypted first decrypted transaction will be packaged into a block and synchronized to other blockchain nodes for consensus verification.
可选地,所述区块链节点在检测到第一优先交易时,基于所述区块链节点的私钥生成第一解密分片,包括:Optionally, when the blockchain node detects the first priority transaction, it generates a first decrypted segment based on the private key of the blockchain node, including:
所述区块链节点在通过所述第一优先交易中所包含的元素数量指示k为1时,将所述区块链节点的私钥通过数域求逆算法,生成第一解密私钥;When the block chain node indicates that k is 1 through the number of elements contained in the first priority transaction, the private key of the block chain node is generated through a number field inversion algorithm to generate a first decryption private key;
所述区块链节点从所述第一优先交易中获取第一优先占位符,并根据所述第一解密私钥和所述第一优先占位符,生成所述第一解密分片。The blockchain node obtains a first priority placeholder from the first priority transaction, and generates the first decryption segment according to the first decryption private key and the first priority placeholder.
上述技术方案中,针对任一区块链节点,该区块链节点在通过第一优先交易中所包含的元素数量确定k为1时,采用k为1所对应的交易解密处理方式,即,通过根据第一优先交易中的第一优先占位符以及自己的私钥所生成的第一解密私钥,来生成第一解密分片。其中,该第一解密分片用于辅助该区块链节点解密出一个第一解密交易,同时区块链节点会判断解密出的第一解密交易的哈希值是否与交易的哈希值相等来确定该区块链节点是否真的成功解密出交易,并在确定相等后会将该解密出的第一解密交易打包为区块同步给其它区块链节点进行共识验证。In the above technical solution, for any blockchain node, when k is determined to be 1 by the number of elements contained in the first priority transaction, the blockchain node adopts the transaction decryption processing method corresponding to k being 1, that is, The first decryption fragment is generated by using the first decryption private key generated according to the first priority placeholder in the first priority transaction and its own private key. Wherein, the first decrypted fragment is used to assist the blockchain node to decrypt a first decrypted transaction, and the blockchain node will judge whether the hash value of the decrypted first decrypted transaction is equal to the hash value of the transaction To determine whether the blockchain node has successfully decrypted the transaction, and after the equality is determined, the decrypted first decrypted transaction will be packaged into a block and synchronized to other blockchain nodes for consensus verification.
可选地,还包括:Optionally, also include:
所述区块链节点在检测到第二优先交易时,从所述第二优先交易中获取两个不相等的第二优先占位符和第三优先占位符;所述第二优先交易中所包含的元素数量指示k为0;When the blockchain node detects the second priority transaction, it obtains two unequal second priority placeholders and third priority placeholders from the second priority transaction; The number of elements included indicates that k is 0;
所述区块链节点根据所述第二优先占位符和所述第三优先占位符,生成第二解密分片;The block chain node generates a second decryption fragment according to the second priority placeholder and the third priority placeholder;
所述区块链节点通过双线性映射算法,根据所述第二解密分片以及所述第二优先交易中的第二优先承诺,生成第二解密交易;The blockchain node generates a second decrypted transaction according to the second decrypted fragment and the second priority commitment in the second priority transaction through a bilinear mapping algorithm;
所述区块链节点在确定所述第二解密交易的哈希值与所述第二优先交易中的交易的哈希值相等时,将所述第二解密交易打包为区块进行上链。When the block chain node determines that the hash value of the second decrypted transaction is equal to the hash value of the transaction in the second priority transaction, it packs the second decrypted transaction into a block and uploads it to the chain.
上述技术方案中,针对任一区块链节点,该区块链节点在通过第二优先交易中所包含的元素数量确定k为0时,采用k为0所对应的交易解密处理方式,即,通过第二优先交易中的第二优先占位符和第三优先占位符,来生成第二解密分片,并将第二解密分片以及第二优先交易中的第二优先承诺通过双线性映射算法,生成第二解密交易。然后,判断该第二解密交易的哈希值是否与该交易的哈希值相等来判断该区块链节点是否真的成功解密出该交易,从而才能确定是否由该区块链节点来执行针对该交易的出块操作。也即是,在确定相等后,由该区块链节点将该第二解密交易以及该第二解密交易的哈希值打包为区 块,并将该区块同步给其它区块链节点进行共识验证,如果确定共识成功,则将该区块进行上链。In the above technical solution, for any blockchain node, when k is determined to be 0 by the number of elements contained in the second priority transaction, the blockchain node adopts the transaction decryption processing method corresponding to k being 0, that is, Generate the second decryption fragment through the second priority placeholder and the third priority placeholder in the second priority transaction, and pass the second decryption fragment and the second priority commitment in the second priority transaction through the double line property mapping algorithm to generate a second decrypted transaction. Then, judge whether the hash value of the second decrypted transaction is equal to the hash value of the transaction to judge whether the block chain node has successfully decrypted the transaction, so as to determine whether the block chain node performs the The block production operation for this transaction. That is, after the equality is determined, the blockchain node packs the second decrypted transaction and the hash value of the second decrypted transaction into a block, and synchronizes the block to other blockchain nodes for consensus Verification, if it is determined that the consensus is successful, the block will be uploaded to the chain.
可选地,还包括:Optionally, also include:
所述区块链节点在确定所述m个区块链节点对应的各第一解密交易的哈希值与所述第一优先交易中的交易的哈希值均不相等时,从区块链上获取m个区块链节点的公钥,并针对任一区块链节点的公钥,将所述区块链节点的公钥通过数域求逆算法,生成第一解密公钥;When the block chain node determines that the hash values of the first decrypted transactions corresponding to the m block chain nodes are not equal to the hash values of the transactions in the first priority transaction, from the block chain Obtain the public keys of m block chain nodes, and for the public key of any block chain node, use the public key of the block chain node through the number field inversion algorithm to generate the first decryption public key;
所述区块链节点基于所述第一解密公钥,生成第三解密分片;The block chain node generates a third decrypted segment based on the first decrypted public key;
所述区块链节点通过双线性映射算法,根据所述第三解密分片以及所述第一优先交易中的第一优先承诺,生成第三解密交易;The blockchain node generates a third decrypted transaction according to the third decrypted fragment and the first priority commitment in the first priority transaction through a bilinear mapping algorithm;
所述区块链节点在确定所述第三解密交易的哈希值与所述第一优先交易中的交易的哈希值相等时,将所述第三解密交易打包为区块进行上链。When the block chain node determines that the hash value of the third decrypted transaction is equal to the hash value of the transaction in the first priority transaction, it packs the third decrypted transaction into a block and uploads it to the chain.
上述技术方案中,针对任一区块链节点,该区块链节点在确定m个区块链节点对应的各第一解密交易的哈希值与交易的哈希值不相等时,可通过另一种解密方式来解密出交易。即,该区块链节点通过数域求逆算法处理任一区块链节点的公钥,生成第一解密公钥,并基于该第一解密公钥生成第三解密分片。再通过第三解密分片以及第一优先交易中的第一优先承诺,生成第三解密交易。然后,判断该第三解密交易的哈希值是否与该交易的哈希值相等来判断该区块链节点是否真的成功解密出该交易,从而才能确定是否由该区块链节点来执行针对该交易的出块操作。也即是,在确定相等后,由该区块链节点将该第三解密交易以及该第三解密交易的哈希值打包为区块,并将该区块同步给其它区块链节点进行共识验证,如果确定共识成功,则将该区块进行上链。In the above technical solution, for any block chain node, when the block chain node determines that the hash value of each first decrypted transaction corresponding to the m block chain nodes is not equal to the hash value of the transaction, it can pass another A decryption method to decrypt the transaction. That is, the blockchain node processes the public key of any blockchain node through a number field inversion algorithm, generates a first decryption public key, and generates a third decryption segment based on the first decryption public key. Then, the third decrypted transaction is generated through the third decrypted fragment and the first priority commitment in the first priority transaction. Then, judge whether the hash value of the third decrypted transaction is equal to the hash value of the transaction to judge whether the block chain node has successfully decrypted the transaction, so as to determine whether the block chain node executes the The block production operation for this transaction. That is, after the equality is determined, the blockchain node packs the third decrypted transaction and the hash value of the third decrypted transaction into a block, and synchronizes the block to other blockchain nodes for consensus Verification, if it is determined that the consensus is successful, the block will be uploaded to the chain.
第三方面,本发明实施例提供了一种区块确认装置,适用于具有m个区块链节点的区块链网络,所述装置包括:In a third aspect, an embodiment of the present invention provides a block confirmation device, which is suitable for a blockchain network with m blockchain nodes, and the device includes:
确定单元,用于针对任一交易,从所述m个区块链节点中确定出k个区块链节点作为优先节点;A determination unit, configured to determine k blockchain nodes from the m blockchain nodes as priority nodes for any transaction;
第一处理单元,用于基于k个优先节点的公钥,生成第一混淆因子;基于所述第一混淆因子和所述交易,生成第一优先承诺;基于所述第一优先承诺和所述交易的哈希值生成第一优先交易,并将所述第一优先交易发送给所述区块链网络。The first processing unit is configured to generate a first confusion factor based on the public keys of k priority nodes; generate a first priority commitment based on the first confusion factor and the transaction; and generate a first priority commitment based on the first priority commitment and the The hash value of the transaction generates a first priority transaction, and sends the first priority transaction to the blockchain network.
第四方面,本发明实施例提供了一种区块确认装置,适用于具有m个区块链节点的区块链网络,所述装置包括:In the fourth aspect, the embodiment of the present invention provides a block confirmation device, which is suitable for a blockchain network with m blockchain nodes, and the device includes:
生成单元,用于针对所述m个区块链节点中的任一区块链节点,在检测到第一优先交易时,基于所述区块链节点的私钥生成第一解密分片;所述第一优先交易是客户端基于第一优先承诺和交易的哈希值生成的;所述第一优先承诺是所述客户端基于第一混淆因子和所述交易生成的;所述第一混淆因子是所述客户端基于所述客户端从所述m个区块链节点中确定出的k个优先节点的公钥生成的;A generating unit, configured to generate a first decrypted segment based on the private key of the blockchain node when a first priority transaction is detected for any one of the m blockchain nodes; The first priority transaction is generated by the client based on the first priority commitment and the hash value of the transaction; the first priority commitment is generated by the client based on the first confusion factor and the transaction; the first confusion The factor is generated by the client based on the public keys of k priority nodes determined by the client from the m blockchain nodes;
第二处理单元,用于通过双线性映射算法,根据所述第一解密分片以及所述第一优先交易中的第一优先承诺,生成第一解密交易;在确定所述第一解密交易的哈希值与所述第一优先交易中的交易的哈希值相等时,将所述第一解密交易打包为区块进行上链。The second processing unit is configured to generate a first decrypted transaction according to the first decrypted fragment and the first priority commitment in the first priority transaction through a bilinear mapping algorithm; when determining the first decrypted transaction When the hash value of is equal to the hash value of the transaction in the first priority transaction, the first decrypted transaction is packaged as a block and uploaded to the chain.
第五方面,本发明实施例提供一种计算设备,包括至少一个处理器以及至少一个存储器,其中,所述存储器存储有计算机程序,当所述程序被所述处理器执行时,使得所述处 理器执行上述第一方面或上述第二方面任意所述的区块确认方法。In a fifth aspect, an embodiment of the present invention provides a computing device, including at least one processor and at least one memory, wherein the memory stores a computer program, and when the program is executed by the processor, the processing The device implements the block confirmation method described in any of the above first aspect or the above second aspect.
第六方面,本发明实施例提供一种计算机可读存储介质,其存储有可由计算设备执行的计算机程序,当所述程序在所述计算设备上运行时,使得所述计算设备执行上述第一方面或上述第二方面任意所述的区块确认方法。In a sixth aspect, an embodiment of the present invention provides a computer-readable storage medium, which stores a computer program executable by a computing device, and when the program runs on the computing device, the computing device executes the above-mentioned first aspect or the block confirmation method described in any of the above-mentioned second aspects.
附图说明Description of drawings
为了更清楚地说明本发明实施例中的技术方案,下面将对实施例描述中所需要使用的附图作简要介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域的普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings that need to be used in the description of the embodiments will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present invention. For Those of ordinary skill in the art can also obtain other drawings based on these drawings without making creative efforts.
图1为本发明实施例提供的一种区块确认方法的流程示意图;FIG. 1 is a schematic flow diagram of a block confirmation method provided by an embodiment of the present invention;
图2为本发明实施例提供的一种区块确认装置的结构示意图;FIG. 2 is a schematic structural diagram of a block confirmation device provided by an embodiment of the present invention;
图3为本发明实施例提供的另一种区块确认装置的结构示意图;FIG. 3 is a schematic structural diagram of another block confirmation device provided by an embodiment of the present invention;
图4为本发明实施例提供的一种计算设备的结构示意图。FIG. 4 is a schematic structural diagram of a computing device provided by an embodiment of the present invention.
具体实施方式Detailed ways
为了使本发明的目的、技术方案和优点更加清楚,下面将结合附图对本发明作进一步地详细描述,显然,所描述的实施例仅仅是本发明的一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其它实施例,都属于本发明保护的范围。In order to make the purpose, technical solutions and advantages of the present invention clearer, the present invention will be further described in detail below in conjunction with the accompanying drawings. Obviously, the described embodiments are only some of the embodiments of the present invention, rather than all of them. Based on the embodiments of the present invention, all other embodiments obtained by persons of ordinary skill in the art without making creative efforts belong to the protection scope of the present invention.
下面首先对本发明实施例中涉及的部分用语进行解释说明,以便于本领域技术人员进行理解。Part of the terms involved in the embodiments of the present invention will firstly be explained below, so as to facilitate the understanding of those skilled in the art.
(1)区块:是过程区块链的基本单元,由包含元数据的区块头和包含交易数据的区块体构成。其中,区块头主要包括父区块的哈希。(1) Block: It is the basic unit of the process blockchain, consisting of a block header containing metadata and a block body containing transaction data. Among them, the block header mainly includes the hash of the parent block.
(2)区块链:是由一系列区块组成的一条链,每个块上除了记录本块的数据还会记录上一块的Hash值,通过这种方式组成一条链。此外,区块链的核心理念有两个:一个是密码学技术,另一个是去中心化思想。基于这两个理念做到区块链上的历史信息无法被篡改。区块链中的一个区块由块头和块体组成。其中,块头主要包括该区块高度h、上一个区块的hash等,而块体主要存储交易数据。(2) Blockchain: It is a chain composed of a series of blocks. In addition to recording the data of this block, each block also records the Hash value of the previous block. In this way, a chain is formed. In addition, there are two core concepts of the blockchain: one is cryptography technology, and the other is the idea of decentralization. Based on these two concepts, the historical information on the blockchain cannot be tampered with. A block in the blockchain consists of a block header and a block body. Among them, the block header mainly includes the block height h, the hash of the previous block, etc., and the block body mainly stores transaction data.
(3)双线性映射:是一类满足对于任意的a,b∈Z p *,R,S∈G,有e(aR,bS)=e(R,S)^ab的密码学协议,R,S是G1的任意点。假设G1是生成元为P的加法循环群,阶为p,G2是与G1具有相同阶的乘法循环群,a,b是Z p *(p阶素数循环群)中的元素。 (3) Bilinear mapping: it is a kind of cryptographic protocol that satisfies e(aR,bS)=e(R,S)^ab for any a, b∈Z p * , R, S∈G, R, S are any points of G1. Assume that G1 is an additive cyclic group with generator P and order p, G2 is a multiplicative cyclic group with the same order as G1, and a and b are elements in Z p * (prime cyclic group of order p).
(4)椭圆曲线群:群是密码学中满足一定代数运算的一系列元素的集合,椭圆曲线群是基于椭圆曲线密码学构造的元素集合。在椭圆曲线群中,G1、G2等大写字母表示椭圆曲线上的点,即点域元素,点域元素具备加法性质,如G1+G2。小写字母,比如a,表示标量,即数域元素,数域元素具备加法、乘法、幂次等运算的性质,如a*b、a^b、a+b等。(4) Elliptic curve group: A group is a set of a series of elements satisfying certain algebraic operations in cryptography, and an elliptic curve group is a set of elements constructed based on elliptic curve cryptography. In the elliptic curve group, uppercase letters such as G1 and G2 represent points on the elliptic curve, that is, point field elements, and point field elements have additive properties, such as G1+G2. A lowercase letter, such as a, represents a scalar, that is, an element of a number field, and an element of a number field has the properties of operations such as addition, multiplication, and power, such as a*b, a^b, a+b, etc.
如上介绍了本发明实施例中涉及的部分用语,下面对本发明实施例涉及的技术特征进 行介绍。Some of the terms involved in the embodiments of the present invention have been introduced above, and the technical features involved in the embodiments of the present invention will be introduced below.
图1示例性的示出了本发明实施例提供的一种区块确认方法的流程,该流程可以由区块确认装置执行。其中,该区块确认方法适用于具有m个区块链节点的区块链网络。Fig. 1 exemplarily shows the flow of a block confirmation method provided by an embodiment of the present invention, and the flow can be executed by a block confirmation device. Wherein, the block confirmation method is applicable to a blockchain network with m blockchain nodes.
如图1所示,该流程具体包括:As shown in Figure 1, the process specifically includes:
步骤101,针对任一交易,客户端从所述m个区块链节点中确定出k个区块链节点作为优先节点。 Step 101, for any transaction, the client determines k blockchain nodes from the m blockchain nodes as priority nodes.
本发明实施例中,客户端在上传某一交易至区块链网络进行处理时,为了能够实现在各区块链节点的计算能力相同或接近的前提下,可以通过优先节点率先完成区块确认的过程,可由客户端指定一部分区块链节点作为优先节点来实现,比如可以从区块链网络中的m个区块链节点中选取出k个区块链节点作为优先节点,比如客户端指定优先节点的数量为0,1或2等,例如以指定的优先节点的数量为2为例,则该客户端可采用随机的方式从m个区块链节点中选取出2个区块链节点作为优先节点。或者,可以采用将m个区块链节点按照m个区块链节点各自的计算能力从大到小进行排序,并从排序后的m个区块链节点选择出排序位于前2个的区块链节点作为优先节点。其中,m、k为整数,且k≤m。In the embodiment of the present invention, when the client uploads a certain transaction to the blockchain network for processing, in order to realize that the computing power of each blockchain node is the same or close, the priority node can be the first to complete the block confirmation. The process can be realized by the client specifying a part of blockchain nodes as priority nodes. For example, k blockchain nodes can be selected from m blockchain nodes in the blockchain network as priority nodes. For example, the client specifies priority The number of nodes is 0, 1 or 2, etc. For example, if the number of designated priority nodes is 2, the client can randomly select 2 blockchain nodes from m blockchain nodes as priority node. Alternatively, the m blockchain nodes can be sorted according to their respective computing capabilities from large to small, and the top 2 blocks can be selected from the sorted m blockchain nodes Chain nodes act as priority nodes. Wherein, m and k are integers, and k≤m.
示例性地,假设区块链网络中有10个区块链节点,客户端在上传某一交易至该区块链网络进行处理时,可以指定2个区块链节点作为优先节点,则可以从该区块链网络的10个区块链节点中选择出2个区块链节点作为优先节点加入到优先队列中。或者,客户端可以指定1个区块链节点作为优先节点,则可以从该区块链网络的10个区块链节点中选择出1个区块链节点作为优先节点加入到优先队列中。或者,客户端可以指定0个区块链节点作为优先节点,则可以从该区块链网络的10个区块链节点中选择出0个区块链节点作为优先节点加入到优先队列中。For example, assuming that there are 10 blockchain nodes in the blockchain network, when the client uploads a certain transaction to the blockchain network for processing, it can designate 2 blockchain nodes as priority nodes, then it can start from Among the 10 blockchain nodes in the blockchain network, 2 blockchain nodes are selected as priority nodes and added to the priority queue. Alternatively, the client can designate a blockchain node as a priority node, and then select a blockchain node from the 10 blockchain nodes in the blockchain network as a priority node and add it to the priority queue. Alternatively, the client can designate 0 blockchain nodes as priority nodes, then select 0 blockchain nodes from the 10 blockchain nodes in the blockchain network as priority nodes and add them to the priority queue.
步骤102,所述客户端基于k个优先节点的公钥,生成第一混淆因子。 Step 102, the client generates a first confusion factor based on the public keys of the k priority nodes.
步骤103,所述客户端基于所述第一混淆因子和所述交易,生成第一优先承诺。 Step 103, the client generates a first priority commitment based on the first confusion factor and the transaction.
步骤104,所述客户端基于所述第一优先承诺和所述交易的哈希值生成第一优先交易。 Step 104, the client generates a first priority transaction based on the first priority commitment and the hash value of the transaction.
步骤105,所述客户端发送所述第一优先交易给所述区块链网络。Step 105, the client sends the first priority transaction to the blockchain network.
本发明实施例中,客户端在确定优先节点的个数k为2时,将k个优先节点的公钥通过双线性映射算法,生成第一混淆因子,该第一混淆因子用于混淆客户端所需处理的交易,如此可以使得客户端不会直接将交易上传给区块链网络,能够避免交易数据存在泄露的风险,从而可以有助于确保交易数据的隐私安全性。再将该第一混淆因子以及交易通过椭圆曲线点域乘法算法,生成第一优先承诺。然后,通过设定的哈希算法,比如信息-摘要算法5(Message-Digest Algorithm 5,MD5)或SHA256算法等,对客户端所需处理的交易进行哈希运算,生成该交易的哈希值,并根据该第一优先承诺以及该交易的哈希值,生成第一优先交易,将该第一优先交易发送给区块链网络。其中,该第一优先承诺用于作为各区块链节点共识确认交易的凭证,区块链网络中的某一区块链节点可通过该第一优先承诺率先解密出该交易,如此在确保不泄露客户端所需处理的某一交易的前提下,只有区块链网络中的某一区块链节点能够率先通过第一优先承诺解密出该交易,从而可以避免该交易被篡改或被盗取。In the embodiment of the present invention, when the client determines that the number k of priority nodes is 2, the public keys of the k priority nodes are passed through a bilinear mapping algorithm to generate a first confusion factor, which is used to confuse the client In this way, the client will not directly upload the transaction to the blockchain network, which can avoid the risk of transaction data leakage, which can help ensure the privacy and security of transaction data. Then the first confusion factor and the transaction are passed through the elliptic curve point field multiplication algorithm to generate the first priority commitment. Then, through the set hash algorithm, such as Message-Digest Algorithm 5 (Message-Digest Algorithm 5, MD5) or SHA256 algorithm, etc., the transaction to be processed by the client is hashed to generate the hash value of the transaction , and according to the first priority commitment and the hash value of the transaction, generate the first priority transaction, and send the first priority transaction to the blockchain network. Among them, the first priority commitment is used as a voucher for each blockchain node consensus to confirm the transaction, and a certain blockchain node in the blockchain network can first decrypt the transaction through the first priority commitment, so as to ensure that no leakage Under the premise of a certain transaction that the client needs to process, only a certain blockchain node in the blockchain network can first decrypt the transaction through the first priority commitment, so as to prevent the transaction from being tampered with or stolen.
其中,客户端在选择优先节点前,区块链网络中的各区块链节点会先生成自己的公钥、私钥,并将自己的公钥上传至区块链。例如,针对区块链网络中的每个区块链节点,该区块链节点在椭圆曲线数域上使用随机数生成算法,生成256位随机数ri,该256位随机数 ri作为节点区块确认私钥,私密保存。再根据256位随机数ri,使用椭圆曲线点域乘法算法,计算出节点区块确认公钥pki,即pki=ri*G。然后,将自己的节点区块确认公钥pki上传至区块链,在区块链上形成一个公钥列表pk_list,即pk_list={pk1,pk2,…,pkm}。示例性地,以区块链网络中的某一区块链节点,比如区块链节点1为例进行描述,该区块链节点1在椭圆曲线数域上使用随机数生成算法,生成256位随机数r1,该256位随机数r1作为节点区块确认私钥,再根据256位随机数r1,使用椭圆曲线点域乘法算法,计算出节点区块确认公钥pk1,即pk1=r1*G。然后,将自己的节点区块确认公钥pk1上传至区块链。Among them, before the client selects the priority node, each blockchain node in the blockchain network will first generate its own public key and private key, and upload its own public key to the blockchain. For example, for each blockchain node in the blockchain network, the blockchain node uses a random number generation algorithm on the elliptic curve number field to generate a 256-bit random number ri, and the 256-bit random number ri is used as the node block Confirm the private key and keep it private. Then according to the 256-bit random number ri, use the elliptic curve point field multiplication algorithm to calculate the node block confirmation public key pki, that is, pki=ri*G. Then, upload your own node block confirmation public key pki to the blockchain, and form a public key list pk_list on the blockchain, that is, pk_list={pk1,pk2,...,pkm}. Exemplarily, a certain blockchain node in the blockchain network, such as blockchain node 1, is described as an example. The blockchain node 1 uses a random number generation algorithm on the elliptic curve number field to generate a 256-bit Random number r1, the 256-bit random number r1 is used as the private key for node block confirmation, and then according to the 256-bit random number r1, use the elliptic curve point field multiplication algorithm to calculate the node block confirmation public key pk1, that is, pk1=r1*G . Then, upload your own node block confirmation public key pk1 to the blockchain.
示例性地,假设区块链网络中有5个区块链节点,即区块链节点1、区块链节点2、区块链节点3、区块链节点4和区块链节点5,某一客户端在发起某一笔交易(比如交易tx)时,首先会从该5个区块链节点中选择出2个区块链节点作为优先节点,比如选择区块链节点1和区块链节点3作为优先节点。在选择出该2个优先节点后,即可通过区块链网络中的任一区块链节点从区块链上获取该2个区块链节点的公钥,比如该客户端向区块链节点2发送获取区块链节点1的公钥和区块链节点3的公钥的请求,区块链节点2在接收到该请求后,从区块链上获取区块链节点1的公钥pk1和区块链节点3的公钥pk3,并将该区块链节点1的公钥pk1和该区块链节点3的公钥pk3发送给客户端。该客户端根据该区块链节点1的公钥pk1和该区块链节点3的公钥pk3,通过双线性映射算法,生成第一混淆因子Y,即Y=e(pk1,pk3)。再根据该第一混淆因子Y和交易tx,通过使用椭圆曲线点域乘法算法,得到第一优先承诺P,即P=Y*tx。该第一优先承诺P用于作为节点交易确认的凭证。同时,该客户端通过MD5或SHA256算法等对交易tx进行哈希运算,生成该交易tx的哈希值h,即h=hash(tx)。该哈希值h用于作为节点交易确认过程验证正确的因子。然后,根据交易tx的哈希值h以及第一优先承诺P,生成第一优先交易(P,h),并将该第一优先交易(P,h)发送给区块链网络。Exemplarily, assuming that there are 5 blockchain nodes in the blockchain network, that is, blockchain node 1, blockchain node 2, blockchain node 3, blockchain node 4 and blockchain node 5, a certain When a client initiates a certain transaction (such as transaction tx), it will first select 2 blockchain nodes from the 5 blockchain nodes as priority nodes, such as selecting blockchain node 1 and blockchain node 1. Node 3 is the priority node. After the two priority nodes are selected, the public key of the two blockchain nodes can be obtained from the blockchain through any blockchain node in the blockchain network. Node 2 sends a request to obtain the public key of blockchain node 1 and the public key of blockchain node 3. After receiving the request, blockchain node 2 obtains the public key of blockchain node 1 from the blockchain pk1 and the public key pk3 of the blockchain node 3, and send the public key pk1 of the blockchain node 1 and the public key pk3 of the blockchain node 3 to the client. According to the public key pk1 of the blockchain node 1 and the public key pk3 of the blockchain node 3, the client generates a first confusion factor Y through a bilinear mapping algorithm, that is, Y=e(pk1, pk3). Then, according to the first confusion factor Y and the transaction tx, the first priority commitment P is obtained by using the elliptic curve point field multiplication algorithm, that is, P=Y*tx. The first priority commitment P is used as a voucher for node transaction confirmation. At the same time, the client performs a hash operation on the transaction tx through the MD5 or SHA256 algorithm to generate a hash value h of the transaction tx, that is, h=hash(tx). The hash value h is used as a factor to verify the correctness of the node transaction confirmation process. Then, according to the hash value h of the transaction tx and the first priority commitment P, a first priority transaction (P, h) is generated, and the first priority transaction (P, h) is sent to the blockchain network.
或者,客户端在确定优先节点的个数k为1时,基于椭圆曲线确定第一优先占位符,并将该第一优先占位符以及该k个优先节点的公钥通过双线性映射算法,生成第一混淆因子,该第一混淆因子用于混淆客户端所需处理的交易,如此可以使得客户端不会直接将交易上传给区块链网络,能够避免交易数据存在泄露的风险,从而可以有助于确保交易数据的隐私安全性。再将该第一混淆因子以及交易通过椭圆曲线点域乘法算法,生成第一优先承诺。然后,通过设定的哈希算法,比如信息-摘要算法5(Message-Digest Algorithm 5,MD5)或SHA256算法等,对客户端所需处理的交易进行哈希运算,生成该交易的哈希值,并根据该第一优先承诺、该第一优先占位符以及该交易的哈希值,生成第一优先交易,将该第一优先交易发送给区块链网络。其中,该第一优先承诺用于作为各区块链节点共识确认交易的凭证,区块链网络中的某一区块链节点可通过该第一优先承诺率先解密出该交易,如此在确保不泄露客户端所需处理的某一交易的前提下,只有区块链网络中的某一区块链节点能够率先通过第一优先承诺解密出该交易,从而可以避免该交易被篡改或被盗取。Or, when the client determines that the number k of priority nodes is 1, it determines the first priority placeholder based on the elliptic curve, and uses the first priority placeholder and the public keys of the k priority nodes through bilinear mapping Algorithm to generate the first confusion factor, which is used to confuse the transactions that the client needs to process, so that the client will not directly upload the transaction to the blockchain network, which can avoid the risk of transaction data leakage. This can help ensure the privacy and security of transaction data. Then the first confusion factor and the transaction are passed through the elliptic curve point field multiplication algorithm to generate the first priority commitment. Then, through the set hash algorithm, such as Message-Digest Algorithm 5 (Message-Digest Algorithm 5, MD5) or SHA256 algorithm, etc., the transaction to be processed by the client is hashed to generate the hash value of the transaction , and generate a first priority transaction according to the first priority commitment, the first priority placeholder and the hash value of the transaction, and send the first priority transaction to the blockchain network. Among them, the first priority commitment is used as a voucher for each blockchain node consensus to confirm the transaction, and a certain blockchain node in the blockchain network can first decrypt the transaction through the first priority commitment, so as to ensure that no leakage Under the premise of a certain transaction that the client needs to process, only a certain blockchain node in the blockchain network can first decrypt the transaction through the first priority commitment, so as to prevent the transaction from being tampered with or stolen.
示例性地,继续以上述区块链网络中有5个区块链节点为例进行描述,某一客户端在发起某一笔交易(比如交易tx)时,首先会从该5个区块链节点中选择出1个区块链节点作为优先节点,比如选择区块链节点1作为优先节点。在选择出该1个优先节点后,即可通过区块链网络中的任一区块链节点从区块链上获取该1个区块链节点的公钥,比如该客户端向区块链节点3发送获取区块链节点1的公钥的请求,区块链节点3在接收到该请求后,从区块链上获取该区块链节点1的公钥,并将该区块链节点1的公钥发送给客户端。 同时,为了更好地隐匿优先节点的身份,会通过椭圆曲线确定第一优先占位符,该第一优先占位符用于作为1个优先节点时双线性映射算法中配合运算的点域元素,即,客户端本地生成256位随机数r,该256位随机数r作为填充于双线性映射的占位符临时因子,并将椭圆曲线上的公开点G和占位符临时因子r,通过椭圆曲线点域乘法算法,生成第一优先占位符R,即R=r*G。再根据该区块链节点1的公钥pk1和该第一优先占位符R,通过双线性映射算法,生成第一混淆因子Y,即Y=e(pk1,R),并根据该第一混淆因子Y和交易tx,通过使用椭圆曲线点域乘法算法,得到第一优先承诺P,即P=Y*tx。该第一优先承诺P用于作为节点交易确认的凭证。同时,该客户端通过MD5或SHA256算法等对交易tx进行哈希运算,生成该交易tx的哈希值h,即h=hash(tx)。该哈希值h用于作为节点交易确认过程验证正确的因子。然后,根据第一优先占位符R、交易tx的哈希值h以及第一优先承诺P,生成第一优先交易(P,h,R),并将该第一优先交易(P,h,R)发送给区块链网络。Exemplarily, continue to take the example of five blockchain nodes in the above blockchain network for description. When a client initiates a certain transaction (such as transaction tx), it will first obtain Select one blockchain node as the priority node among the nodes, for example, select blockchain node 1 as the priority node. After the 1 priority node is selected, the public key of the 1 blockchain node can be obtained from the blockchain through any blockchain node in the blockchain network. Node 3 sends a request to obtain the public key of blockchain node 1. After receiving the request, blockchain node 3 obtains the public key of blockchain node 1 from the blockchain and sends the blockchain node 1's public key is sent to the client. At the same time, in order to better conceal the identity of the priority node, the first priority placeholder will be determined through the elliptic curve, and the first priority placeholder is used as a dot field in the bilinear mapping algorithm for a priority node Elements, that is, the client generates a 256-bit random number r locally, and the 256-bit random number r is used as a placeholder temporary factor filled in the bilinear map, and the public point G on the elliptic curve and the placeholder temporary factor r , generate the first priority placeholder R through the elliptic curve point field multiplication algorithm, that is, R=r*G. Then, according to the public key pk1 of the block chain node 1 and the first priority placeholder R, the first confusion factor Y is generated through the bilinear mapping algorithm, that is, Y=e(pk1, R), and according to the first A confusion factor Y and the transaction tx, by using the elliptic curve dot field multiplication algorithm, obtain the first priority commitment P, that is, P=Y*tx. The first priority commitment P is used as a voucher for node transaction confirmation. At the same time, the client performs a hash operation on the transaction tx through the MD5 or SHA256 algorithm to generate a hash value h of the transaction tx, that is, h=hash(tx). The hash value h is used as a factor to verify the correctness of the node transaction confirmation process. Then, according to the first priority placeholder R, the hash value h of the transaction tx and the first priority commitment P, the first priority transaction (P, h, R) is generated, and the first priority transaction (P, h, R) sent to the blockchain network.
或者,客户端在确定优先节点的个数k为0时,基于椭圆曲线确定两个不相等的第二优先占位符和第三优先占位符,并将第二优先占位符和第三优先占位符通过双线性映射算法,生成第二混淆因子,该第二混淆因子用于混淆客户端所需处理的交易,如此可以使得客户端不会直接将交易上传给区块链网络,能够避免交易数据存在泄露的风险,从而可以有助于确保交易数据的隐私安全性。再基于第二混淆因子和交易,生成第二优先承诺。然后,通过设定的哈希算法,比如信息-摘要算法5(Message-Digest Algorithm 5,MD5)或SHA256算法等,对客户端所需处理的交易进行哈希运算,生成该交易的哈希值,并根据该第二优先承诺、该第二优先占位符、第三优先占位符以及该交易的哈希值,生成第二优先交易,将该第二优先交易发送给区块链网络。其中,该第二优先承诺用于作为各区块链节点共识确认交易的凭证,区块链网络中的某一区块链节点可通过该第二优先承诺率先解密出该交易,如此在确保不泄露客户端所需处理的某一交易的前提下,只有区块链网络中的某一区块链节点能够率先通过第二优先承诺解密出该交易,从而可以避免该交易被篡改或被盗取。Or, when the client determines that the number k of priority nodes is 0, it determines two unequal second priority placeholders and third priority placeholders based on the elliptic curve, and uses the second priority placeholder and the third priority placeholder The priority placeholder uses a bilinear mapping algorithm to generate a second confusion factor, which is used to confuse the transaction that the client needs to process, so that the client will not directly upload the transaction to the blockchain network, The risk of leakage of transaction data can be avoided, thereby helping to ensure the privacy and security of transaction data. Then based on the second confusion factor and the transaction, a second priority commitment is generated. Then, through the set hash algorithm, such as Message-Digest Algorithm 5 (Message-Digest Algorithm 5, MD5) or SHA256 algorithm, etc., the transaction to be processed by the client is hashed to generate the hash value of the transaction , and generate a second priority transaction according to the second priority commitment, the second priority placeholder, the third priority placeholder and the hash value of the transaction, and send the second priority transaction to the blockchain network. Among them, the second priority commitment is used as a certificate for each blockchain node to confirm the transaction by consensus, and a certain blockchain node in the blockchain network can first decrypt the transaction through the second priority commitment, so as to ensure that it is not leaked Under the premise of a certain transaction that the client needs to process, only a certain blockchain node in the blockchain network can first decrypt the transaction through the second priority commitment, so as to prevent the transaction from being tampered with or stolen.
示例性地,继续以上述区块链网络中有5个区块链节点为例进行描述,某一客户端在发起某一笔交易(比如交易tx)时,首先会从该5个区块链节点中选择出0个区块链节点作为优先节点,也即是客户端不指定优先节点。此时为了不让他人轻易知道客户端是否有指定优先节点或不让他人轻易知道客户端所指定的优先节点的数量,以此更好地隐匿优先节点的身份,并为了配合双线性映射算法中的点域运算,会通过生成两个不相等的优先占位符来实现。即,客户端本地生成一个256位随机数ra,该256位随机数ra作为填充于双线性映射的占位符临时因子a,同时本地生成另一个256位随机数rb,该256位随机数rb作为填充于双线性映射的占位符临时因子b,并将椭圆曲线上的公开点G和占位符临时因子ra,通过椭圆曲线点域乘法算法,生成第二优先占位符Ra,即Ra=ra*G。同时将椭圆曲线上的公开点G和占位符临时因子rb,通过椭圆曲线点域乘法算法,生成第三优先占位符Rb,即Rb=rb*G。其中,该第二优先占位符Ra和该第三优先占位符Rb用于作为0个优先节点时双线性映射算法中配合运算的点域元素。再根据该第二优先占位符Ra和该第三优先占位符Rb,通过双线性映射算法,生成第二混淆因子Y,即Y=e(Ra,Rb),并根据该第二混淆因子Y和交易tx,通过使用椭圆曲线点域乘法算法,得到第二优先承诺P,即P=Y*tx。该第二优先承诺P用于作为节点交易确认的凭证。同时,该客户端通过MD5或 SHA256算法等对交易tx进行哈希运算,生成该交易tx的哈希值h,即h=hash(tx)。该哈希值h用于作为节点交易确认过程验证正确的因子。然后,根据该第二优先占位符Ra、该第三优先占位符Rb、交易tx的哈希值h以及第二优先承诺P,生成第二优先交易(P,h,Ra,Rb),并将该第二优先交易(P,h,Ra,Rb)发送给区块链网络。Exemplarily, continue to take the example of five blockchain nodes in the above blockchain network for description. When a client initiates a certain transaction (such as transaction tx), it will first obtain Among the nodes, 0 blockchain nodes are selected as priority nodes, that is, the client does not specify a priority node. At this time, in order not to let others easily know whether the client has a designated priority node or not to let others easily know the number of priority nodes designated by the client, so as to better hide the identity of the priority node, and in order to cooperate with the bilinear mapping algorithm Dotfield operations in will be implemented by generating two unequal precedence placeholders. That is, the client locally generates a 256-bit random number ra, which is used as a placeholder temporary factor a filled in the bilinear map, and at the same time locally generates another 256-bit random number rb, the 256-bit random number rb is used as the placeholder temporary factor b filled in the bilinear map, and the public point G on the elliptic curve and the placeholder temporary factor ra are used to generate the second priority placeholder Ra through the elliptic curve point field multiplication algorithm. That is, Ra=ra*G. At the same time, the public point G on the elliptic curve and the placeholder temporary factor rb are used to generate the third priority placeholder Rb through the elliptic curve point field multiplication algorithm, that is, Rb=rb*G. Wherein, the second priority placeholder Ra and the third priority placeholder Rb are used as dot field elements for cooperative operation in the bilinear mapping algorithm when there are 0 priority nodes. Then, according to the second priority placeholder Ra and the third priority placeholder Rb, through the bilinear mapping algorithm, generate the second confusion factor Y, that is, Y=e(Ra, Rb), and according to the second confusion factor Y The factor Y and the transaction tx, by using the elliptic curve point field multiplication algorithm, obtain the second priority commitment P, that is, P=Y*tx. The second priority commitment P is used as a voucher for node transaction confirmation. At the same time, the client performs a hash operation on the transaction tx through the MD5 or SHA256 algorithm to generate a hash value h of the transaction tx, that is, h=hash(tx). The hash value h is used as a factor to verify the correctness of the node transaction confirmation process. Then, generate a second priority transaction (P, h, Ra, Rb) according to the second priority placeholder Ra, the third priority placeholder Rb, the hash value h of the transaction tx and the second priority commitment P, And send the second priority transaction (P, h, Ra, Rb) to the blockchain network.
步骤106,针对所述m个区块链节点中的任一区块链节点,所述区块链节点在检测到第一优先交易时,基于所述区块链节点的私钥生成第一解密分片。 Step 106, for any one of the m blockchain nodes, when the blockchain node detects the first priority transaction, generate a first decryption based on the private key of the blockchain node Fragmentation.
步骤107,所述区块链节点通过双线性映射算法,根据所述第一解密分片以及所述第一优先交易中的第一优先承诺,生成第一解密交易。 Step 107, the blockchain node generates a first decrypted transaction according to the first decrypted segment and the first priority commitment in the first priority transaction through a bilinear mapping algorithm.
步骤108,所述区块链节点在确定所述第一解密交易的哈希值与所述第一优先交易中的交易的哈希值相等时,将所述第一解密交易打包为区块进行上链。 Step 108, when the block chain node determines that the hash value of the first decrypted transaction is equal to the hash value of the transaction in the first priority transaction, pack the first decrypted transaction into a block for execution winding.
本发明实施例中,针对任一区块链节点,该区块链节点在检测到第一优先交易时,该区块链节点可尝试通过该第一优先交易中所包含的元素来解密出客户端所需处理的某一交易。由于客户端可以指定不同数量的优先节点,则所生成的优先交易中所包含的元素也不相同,因此任一区块链节点在通过优先交易中所包含的元素进行解密出交易时所采用的方式也有所不同。具体地,针对任一区块链节点,该区块链节点在通过第一优先交易中所包含的元素数量确定k为2时,采用k为2所对应的交易解密处理方式,即,将该区块链节点的私钥通过数域求逆算法,生成第一解密私钥,以及从区块链上获取m个区块链节点的公钥,并针对任一区块链节点的公钥,根据该第一解密私钥和区块链节点的公钥,生成第一解密分片,该第一解密分片用于辅助该区块链节点解密出第一解密交易。再将第一解密分片以及第一优先交易中的第一优先承诺通过双线性映射算法,生成第一解密交易,并通过判断该第一解密交易的哈希值是否与该交易的哈希值相等来判断该区块链节点是否真的成功解密出该交易,从而确定是否由该区块链节点来执行针对该交易的出块操作。也即是,在确定该第一解密交易的哈希值与该交易的哈希值相等后,将该第一解密交易以及该第一解密交易的哈希值打包为区块,并将该区块同步给其它区块链节点进行共识验证,如果确定其它各区块链节点共识成功,则将该区块进行上链。In the embodiment of the present invention, for any blockchain node, when the blockchain node detects the first priority transaction, the blockchain node can try to decrypt the customer A certain transaction that the terminal needs to process. Since the client can specify a different number of priority nodes, the elements contained in the generated priority transactions are also different, so any blockchain node uses the elements contained in the priority transaction to decrypt the transaction. The approach is also different. Specifically, for any blockchain node, when the blockchain node determines that k is 2 through the number of elements contained in the first priority transaction, it adopts the transaction decryption processing method corresponding to k being 2, that is, the The private key of the blockchain node generates the first decryption private key through the number field inversion algorithm, and obtains the public keys of m blockchain nodes from the blockchain, and for the public key of any blockchain node, According to the first decrypted private key and the public key of the block chain node, a first decrypted segment is generated, and the first decrypted segment is used to assist the block chain node to decrypt the first decrypted transaction. Then pass the first decryption fragment and the first priority commitment in the first priority transaction through the bilinear mapping algorithm to generate the first decryption transaction, and judge whether the hash value of the first decryption transaction is consistent with the hash value of the transaction Values are equal to determine whether the blockchain node has successfully decrypted the transaction, so as to determine whether the blockchain node performs the block generation operation for the transaction. That is, after it is determined that the hash value of the first decrypted transaction is equal to the hash value of the transaction, the first decrypted transaction and the hash value of the first decrypted transaction are packaged into a block, and the block is The block is synchronized to other blockchain nodes for consensus verification. If it is determined that the consensus of other blockchain nodes is successful, the block will be uploaded to the chain.
示例性地,继续以上述区块链网络中有5个区块链节点为例进行描述,比如,以区块链节点1检测到第一优先交易为例,该区块链节点1通过读取第一优先交易,确定该第一优先交易中所包含的元素数量为2个,即(P,h),此时通过区块链网络与客户端之间所共知的一种对应关系,即优先交易中所包含的数量与优先节点的数量之间的对应关系,可判断出k为2,也即是优先队列中有2个优先节点,如此即可采用k为2所对应的交易解密处理方式。该交易解密处理方式的具体过程为:Exemplarily, continue to take five blockchain nodes in the above blockchain network as an example for description, for example, take blockchain node 1 detecting the first priority transaction as an example, the blockchain node 1 reads For the first priority transaction, it is determined that the number of elements contained in the first priority transaction is 2, that is, (P, h), at this time through a well-known correspondence between the blockchain network and the client, namely The corresponding relationship between the number contained in the priority transaction and the number of priority nodes can be judged that k is 2, that is, there are 2 priority nodes in the priority queue, so that the transaction decryption processing corresponding to k is 2 can be used Way. The specific process of the transaction decryption processing method is as follows:
步骤a、区块链节点1将自己的私钥r1通过数域求逆算法,生成第一解密私钥rv,即rv=-r1。Step a, blockchain node 1 generates the first decryption private key rv through its own private key r1 through the number field inversion algorithm, that is, rv=-r1.
步骤b、该区块链节点1从区块链上读取区块链节点公钥列表pk_list={pk1,pk2,…,pkm},该公钥列表pk_list可以作为区块确认解密参数。Step b. The blockchain node 1 reads the blockchain node public key list pk_list={pk1,pk2,...,pkm} from the blockchain, and the public key list pk_list can be used as a block confirmation decryption parameter.
步骤c、该区块链节点1依次遍历该公钥列表pk_list中的每个元素,比如遍历到公钥pki,通过根据第一解密私钥rv和公钥pki,生成第一解密分片T,即T=(rv*G,pki)。Step c, the blockchain node 1 traverses each element in the public key list pk_list in turn, such as traversing to the public key pki, and generates the first decrypted segment T according to the first decrypted private key rv and the public key pki, That is, T=(rv*G,pki).
步骤d、该区块链节点1将该第一解密分片T和第一优先交易中的第一优先承诺P通过双线性映射算法,生成第一解密交易tx_try,即tx_try=P*T。具体地,在计算第一解密交易tx_try时,可通过下述方式进行计算,即, tx_try=e(pk1,pk3)*tx*e(rv*G,pki)=e(r1*G,r3*G)*tx*e(-r1*G,ri*G)=tx*e(G,G)^r1r3*e(G,G)^-r1ri=tx*e(G,G)^(r1r3-r1ri)。如此可知,当ri=r3时,则r1r3-r1ri=r1r3-r1r3=0,即可得到tx_try=tx*e(G,G)^0=tx。Step d, the blockchain node 1 generates the first decrypted transaction tx_try through the first decrypted segment T and the first priority commitment P in the first priority transaction through a bilinear mapping algorithm, that is, tx_try=P*T. Specifically, when calculating the first decrypted transaction tx_try, the calculation can be performed in the following manner, that is, tx_try=e(pk1,pk3)*tx*e(rv*G,pki)=e(r1*G,r3* G)*tx*e(-r1*G,ri*G)=tx*e(G,G)^r1r3*e(G,G)^-r1ri=tx*e(G,G)^(r1r3- r1ri). It can be seen that, when ri=r3, then r1r3-r1ri=r1r3-r1r3=0, and tx_try=tx*e(G,G)^0=tx can be obtained.
步骤e、该区块链节点1通过设定的哈希算法,比如MD5或SHA256算法等,对该第一解密交易tx_try进行哈希运算,生成该第一解密交易tx_try的哈希值h’,即h’=hash(tx_try)。Step e, the blockchain node 1 performs a hash operation on the first decrypted transaction tx_try through a set hash algorithm, such as MD5 or SHA256 algorithm, to generate a hash value h' of the first decrypted transaction tx_try, That is h'=hash(tx_try).
步骤f、该区块链节点1确定该第一解密交易tx_try的哈希值h’是否与第一优先交易中的交易的哈希值h相等。如果确定相等,则可以将该第一解密交易tx_try以及该第一解密交易tx_try的哈希值h’打包为区块,并将该区块同步给其它区块链节点进行共识验证,如果确定其它各区块链节点共识成功,则将该区块进行上链。如果确定不相等,则重新执行步骤a至步骤f,直至有其它区块链节点同步出正确的tx_try,或者直至成功得到该第一解密交易tx_try的哈希值h′与第一优先交易中的交易的哈希值h相等。Step f, the blockchain node 1 determines whether the hash value h' of the first decrypted transaction tx_try is equal to the hash value h of the transaction in the first priority transaction. If it is determined that they are equal, the first decrypted transaction tx_try and the hash value h' of the first decrypted transaction tx_try can be packaged into a block, and the block is synchronized to other blockchain nodes for consensus verification. If the consensus of each blockchain node is successful, the block will be uploaded to the chain. If it is determined that they are not equal, re-execute steps a to f until other blockchain nodes synchronize the correct tx_try, or until the hash value h' of the first decrypted transaction tx_try and the hash value h' in the first priority transaction are successfully obtained. The hash values h of the transactions are equal.
需要说明的是,如果执行上述交易解密处理方式的具体过程的区块链节点处于优先队列中,也即是该区块链节点为优先节点,则执行上述交易解密处理方式的具体过程一定可以成功解密出交易,也即是解密得到的第一解密交易是客户端所需处理的交易。假设区块链网络中有m个区块链节点,则平均尝试m/2次即可成功解密出交易。如果执行上述交易解密处理方式的具体过程的区块链节点不处于优先队列中,也即是该区块链节点不是优先节点,则该区块链节点继续遍历公钥列表pk_list,在遍历到公钥pki时,将该公钥pki通过数域求逆算法(即椭圆曲线点域逆元算法),生成解密公钥pk’,即pk’=-pki,同时依次取出公钥列表pk_list中的另一个公钥pkj,该另一个公钥pkj是公钥列表pk_list中的顺序所取出的任一个公钥。根据解密公钥pk’和另一个公钥pkj,生成解密分片T,即T=(-pki,pkj)。再将解密分片T和第一优先交易中的第一优先承诺P通过双线性映射算法,生成解密交易tx_try,即tx_try=P*T,直至遍历出正确的结果hash(tx_try)。假设区块链网络中有m个区块链节点,则平均尝试m*(m-1)/2次才成功解密出交易。It should be noted that if the blockchain node that executes the specific process of the above transaction decryption processing method is in the priority queue, that is, the blockchain node is the priority node, then the specific process of executing the above transaction decryption processing method must be successful The decrypted transaction, that is, the first decrypted transaction obtained through decryption is the transaction that the client needs to process. Assuming that there are m blockchain nodes in the blockchain network, the transaction can be successfully decrypted after an average of m/2 attempts. If the blockchain node that executes the specific process of the above-mentioned transaction decryption processing method is not in the priority queue, that is, the blockchain node is not a priority node, then the blockchain node continues to traverse the public key list pk_list. When the key pki is used, the public key pki is passed through the number field inversion algorithm (ie, the elliptic curve point field inverse element algorithm) to generate the decrypted public key pk', that is, pk'=-pki, and at the same time, the other key in the public key list pk_list is sequentially taken out One public key pkj, the other public key pkj is any public key taken out in sequence in the public key list pk_list. According to the decrypted public key pk' and another public key pkj, a decrypted segment T is generated, that is, T=(-pki,pkj). Then, the decrypted segment T and the first priority commitment P in the first priority transaction are passed through the bilinear mapping algorithm to generate the decrypted transaction tx_try, that is, tx_try=P*T, until the correct result hash (tx_try) is traversed. Assuming that there are m blockchain nodes in the blockchain network, an average of m*(m-1)/2 attempts are made to successfully decrypt the transaction.
或者,针对任一区块链节点,该区块链节点在通过第一优先交易中所包含的元素数量确定k为1时,采用k为1所对应的交易解密处理方式,即,将该区块链节点的私钥通过数域求逆算法,生成第一解密私钥,以及从第一优先交易中获取第一优先占位符,并根据该第一解密私钥和该第一优先占位符,生成第一解密分片,该第一解密分片用于辅助该区块链节点解密出第一解密交易。再将第一解密分片以及第一优先交易中的第一优先承诺通过双线性映射算法,生成第一解密交易,并通过判断该第一解密交易的哈希值是否与该交易的哈希值相等来判断该区块链节点是否真的成功解密出该交易,从而确定是否由该区块链节点来执行针对该交易的出块操作。也即是,在确定该第一解密交易的哈希值与该交易的哈希值相等后,将该第一解密交易以及该第一解密交易的哈希值打包为区块,并将该区块同步给其它区块链节点进行共识验证,如果确定其它各区块链节点共识成功,则将该区块进行上链。此外,在优先节点的数量k为1的情况下,如果该区块链节点确定自己通过上述方式未成功解密出交易,且确定其它m-1个区块链节点对应的各第一解密交易的哈希值与交易的哈希值均不相等,则可以另外一种交易解密处理方式进行处理。具体地,从区块链上获取m个区块链节点的公钥,并针对任一区块链节点的公钥,将该区块链节点的公钥通过数域求逆算法,生成第一解密公钥,并基于第一解密公钥和第一优先交易中的第一优先占位符,生成第三解密分片。再通过双线性映射算法,根据第三解密分片以及第一优先交易中的第一优先承诺,生成第三解密交易,然后判断该第三解密交易的哈希值是否与 该交易的哈希值相等来判断该区块链节点是否真的成功解密出该交易,从而确定是否由该区块链节点来执行针对该交易的出块操作。也即是,在确定相等后,由该区块链节点将该第三解密交易以及该第三解密交易的哈希值打包为区块,并将该区块同步给其它区块链节点进行共识验证,如果确定共识成功,则将该区块进行上链。Or, for any blockchain node, when the blockchain node determines that k is 1 through the number of elements contained in the first priority transaction, it adopts the transaction decryption processing method corresponding to k being 1, that is, the block The private key of the block chain node generates the first decryption private key through the number field inversion algorithm, and obtains the first priority placeholder from the first priority transaction, and according to the first decryption private key and the first priority placeholder symbol to generate a first decrypted segment, and the first decrypted segment is used to assist the block chain node to decrypt the first decrypted transaction. Then pass the first decryption fragment and the first priority commitment in the first priority transaction through the bilinear mapping algorithm to generate the first decryption transaction, and judge whether the hash value of the first decryption transaction is consistent with the hash value of the transaction Values are equal to determine whether the blockchain node has successfully decrypted the transaction, so as to determine whether the blockchain node performs the block generation operation for the transaction. That is, after it is determined that the hash value of the first decrypted transaction is equal to the hash value of the transaction, the first decrypted transaction and the hash value of the first decrypted transaction are packaged into a block, and the block is The block is synchronized to other blockchain nodes for consensus verification. If it is determined that the consensus of other blockchain nodes is successful, the block will be uploaded to the chain. In addition, when the number k of priority nodes is 1, if the block chain node determines that it has not successfully decrypted the transaction through the above method, and determines the first decrypted transaction corresponding to the other m-1 block chain nodes If the hash value and the hash value of the transaction are not equal, another transaction decryption processing method can be used for processing. Specifically, the public keys of m blockchain nodes are obtained from the blockchain, and for the public key of any blockchain node, the public key of the blockchain node is generated through the number field inversion algorithm to generate the first The public key is decrypted, and a third decrypted segment is generated based on the first decrypted public key and the first priority placeholder in the first priority transaction. Then, through the bilinear mapping algorithm, according to the third decryption segment and the first priority commitment in the first priority transaction, a third decryption transaction is generated, and then it is judged whether the hash value of the third decryption transaction is consistent with the hash value of the transaction Values are equal to determine whether the blockchain node has successfully decrypted the transaction, so as to determine whether the blockchain node performs the block generation operation for the transaction. That is, after the equality is determined, the blockchain node packs the third decrypted transaction and the hash value of the third decrypted transaction into a block, and synchronizes the block to other blockchain nodes for consensus Verification, if it is determined that the consensus is successful, the block will be uploaded to the chain.
示例性地,继续以上述区块链网络中有5个区块链节点为例进行描述,比如,以区块链节点1检测到第一优先交易为例,该区块链节点1通过读取第一优先交易,确定该第一优先交易中所包含的元素数量为3个,即(P,h,R),此时通过区块链网络与客户端之间所共知的一种对应关系,即优先交易中所包含的数量与优先节点的数量之间的对应关系,可判断出k为1,也即是优先队列中有1个优先节点,如此即可采用k为1所对应的交易解密处理方式。该交易解密处理方式的具体过程为:Exemplarily, continue to take five blockchain nodes in the above blockchain network as an example for description, for example, take blockchain node 1 detecting the first priority transaction as an example, the blockchain node 1 reads The first priority transaction, determine that the number of elements contained in the first priority transaction is 3, namely (P, h, R), at this time through a well-known correspondence between the blockchain network and the client , that is, the corresponding relationship between the number contained in the priority transaction and the number of priority nodes, it can be judged that k is 1, that is, there is 1 priority node in the priority queue, so the transaction corresponding to k being 1 can be used Decryption processing method. The specific process of the transaction decryption processing method is as follows:
步骤a、区块链节点1将自己的私钥r1通过数域求逆算法,生成第一解密私钥rv,即rv=-r1。Step a, blockchain node 1 generates the first decryption private key rv through its own private key r1 through the number field inversion algorithm, that is, rv=-r1.
步骤b、该区块链节点1根据第一解密私钥rv和第一优先交易中的第一优先占位符R,生成第一解密分片T,即T=(rv*G,R)。Step b. The blockchain node 1 generates a first decryption segment T according to the first decryption private key rv and the first priority placeholder R in the first priority transaction, that is, T=(rv*G, R).
步骤c、该区块链节点1将该第一解密分片T和第一优先交易中的第一优先承诺P通过双线性映射算法,生成第一解密交易tx_try,即tx_try=P*T。具体地,在计算第一解密交易tx_try时,可通过下述方式进行计算,即,tx_try=e(pk1,R)*tx*e(rv*G,R)=e(r1*G,r*G)*tx*e(-r1*G,r*G)=tx*e(G,G)^r1r*e(G,G)^-r1r=tx*e(G,G)^(r1r-r1r)=tx*e(G,G)^0=tx。Step c, the blockchain node 1 generates the first decrypted transaction tx_try through the first decrypted segment T and the first priority commitment P in the first priority transaction through a bilinear mapping algorithm, that is, tx_try=P*T. Specifically, when calculating the first decrypted transaction tx_try, it can be calculated in the following manner, that is, tx_try=e(pk1,R)*tx*e(rv*G,R)=e(r1*G,r* G)*tx*e(-r1*G,r*G)=tx*e(G,G)^r1r*e(G,G)^-r1r=tx*e(G,G)^(r1r- r1r)=tx*e(G,G)^0=tx.
步骤d、该区块链节点1通过设定的哈希算法,比如MD5或SHA256算法等,对该第一解密交易tx_try进行哈希运算,生成该第一解密交易tx_try的哈希值h’,即h’=hash(tx_try)。Step d, the blockchain node 1 performs a hash operation on the first decrypted transaction tx_try through a set hash algorithm, such as MD5 or SHA256 algorithm, to generate a hash value h' of the first decrypted transaction tx_try, That is h'=hash(tx_try).
步骤e、该区块链节点1确定该第一解密交易tx_try的哈希值h’是否与第一优先交易中的交易的哈希值h相等。如果确定相等,则可以将该第一解密交易tx_try以及该第一解密交易tx_try的哈希值h’打包为区块,并将该区块同步给其它区块链节点进行共识验证,如果确定其它各区块链节点共识成功,则将该区块进行上链,同时确定自己为优先节点,并会终止运算。如果确定不相等,则执行步骤f。Step e, the blockchain node 1 determines whether the hash value h' of the first decrypted transaction tx_try is equal to the hash value h of the transaction in the first priority transaction. If it is determined that they are equal, the first decrypted transaction tx_try and the hash value h' of the first decrypted transaction tx_try can be packaged into a block, and the block is synchronized to other blockchain nodes for consensus verification. If the consensus of each block chain node is successful, the block will be uploaded to the chain, and at the same time, it will be determined as the priority node and the operation will be terminated. If it is determined that they are not equal, step f is performed.
步骤f、该区块链节点1确定是否有其它区块链节点同步针对该交易的区块,如果有,则通过设定的哈希运算对区块中的解密交易进行哈希运算,确定出该解密交易的哈希值,并验证该解密交易的哈希值是否与区块中交易的哈希值相等,如确定相等,则终止运算,如果确定不相等,则执行步骤g。Step f, the blockchain node 1 determines whether there are other blockchain nodes synchronizing the block for the transaction, and if so, performs a hash operation on the decrypted transaction in the block through the set hash operation to determine the Decrypt the hash value of the transaction, and verify whether the hash value of the decrypted transaction is equal to the hash value of the transaction in the block. If it is determined that they are equal, the operation is terminated. If it is determined that they are not equal, step g is performed.
步骤g、该区块链节点1从区块链上读取区块链节点公钥列表pk_list={pk1,pk2,…,pkm},该公钥列表pk_list可以作为区块确认解密参数。Step g, the blockchain node 1 reads the blockchain node public key list pk_list={pk1,pk2,...,pkm} from the blockchain, and the public key list pk_list can be used as a block confirmation decryption parameter.
步骤h、该区块链节点1依次遍历该公钥列表pk_list中的每个元素,比如遍历到公钥pki,将该公钥pki通过数域求逆算法(即椭圆曲线点域逆元算法),生成解密公钥pkv,即pkv=-pki。Step h, the blockchain node 1 traverses each element in the public key list pk_list in turn, such as traversing to the public key pki, and passes the public key pki through the number field inversion algorithm (ie, the elliptic curve point field inverse element algorithm) , to generate the decryption public key pkv, that is, pkv=-pki.
步骤i、该区块链节点1根据该解密公钥pkv和第一优先交易中的第一优先占位符R,生成第三解密分片T,即T=(pkv,R)。Step i, the block chain node 1 generates a third decryption segment T according to the decryption public key pkv and the first priority placeholder R in the first priority transaction, that is, T=(pkv, R).
步骤j、该区块链节点1将该第三解密分片T和第一优先交易中的第一优先承诺P通过双线性映射算法,生成第三解密交易tx_try,即tx_try=P*T。具体地,在计算第一解密交易tx_try时,可通过下述方式进行计算,即,tx_try=e(pk1,R)*tx*e(pkv,R)= e(r1*G,r*G)*tx*e(-ri*G,r*G)=tx*e(G,G)^r1r*e(G,G)^-rir=tx*e(G,G)^(r1r-rir)。如此可知,ri=r1时,则r1r-rir=r1r-r1r=0,即可得到tx_try=tx*e(G,G)^0=tx。Step j, the blockchain node 1 generates the third decrypted transaction tx_try by using the third decrypted segment T and the first priority commitment P in the first priority transaction through a bilinear mapping algorithm, that is, tx_try=P*T. Specifically, when calculating the first decrypted transaction tx_try, the calculation can be performed in the following manner, that is, tx_try=e(pk1,R)*tx*e(pkv,R)=e(r1*G,r*G) *tx*e(-ri*G,r*G)=tx*e(G,G)^r1r*e(G,G)^-rir=tx*e(G,G)^(r1r-rir) . It can be seen that, when ri=r1, then r1r-rir=r1r-r1r=0, tx_try=tx*e(G,G)^0=tx can be obtained.
步骤k、该区块链节点1通过设定的哈希算法,比如MD5或SHA256算法等,对该第一解密交易tx_try进行哈希运算,生成该第一解密交易tx_try的哈希值h’,即h’=hash(tx_try)。Step k, the blockchain node 1 performs a hash operation on the first decrypted transaction tx_try through a set hash algorithm, such as MD5 or SHA256 algorithm, to generate a hash value h' of the first decrypted transaction tx_try, That is h'=hash(tx_try).
步骤l、该区块链节点1确定该第一解密交易tx_try的哈希值h’是否与第一优先交易中的交易的哈希值h相等。如果确定相等,则可以将该第三解密交易tx_try以及该第三解密交易tx_try的哈希值h’打包为区块,并将该区块同步给其它区块链节点进行共识验证,如果确定其它各区块链节点共识成功,则将该区块进行上链。如果确定不相等,则重新执行步骤h至步骤l,直至有其它区块链节点同步出正确的tx_try,或者直至成功得到该第三解密交易tx_try的哈希值h′与第一优先交易中的交易的哈希值h相等。Step 1, the blockchain node 1 determines whether the hash value h' of the first decrypted transaction tx_try is equal to the hash value h of the transaction in the first priority transaction. If it is determined that they are equal, the third decrypted transaction tx_try and the hash value h' of the third decrypted transaction tx_try can be packaged into a block, and the block is synchronized to other blockchain nodes for consensus verification. If the consensus of each blockchain node is successful, the block will be uploaded to the chain. If it is determined that they are not equal, re-execute step h to step l until the correct tx_try is synchronized by other blockchain nodes, or until the hash value h' of the third decrypted transaction tx_try and the hash value h' of the first priority transaction are successfully obtained The hash values h of the transactions are equal.
需要说明的是,如果执行上述交易解密处理方式的具体过程的区块链节点处于优先队列中,也即是该区块链节点为优先节点,则只需执行一次执行上述交易解密处理方式的具体过程即可成功解密出交易,也即是解密得到的第一解密交易是客户端所需处理的交易。如果执行上述交易解密处理方式的具体过程的区块链节点不处于优先队列中,假设区块链网络中有m个区块链节点,则平均需要尝试m/2次才可成功解密出交易。It should be noted that if the blockchain node that executes the specific process of the above transaction decryption processing method is in the priority queue, that is, the blockchain node is the priority node, then only one time is required to execute the specific process of the above transaction decryption processing method. The transaction can be successfully decrypted during the process, that is, the first decrypted transaction obtained by decryption is the transaction that the client needs to process. If the blockchain node that performs the specific process of the above transaction decryption processing method is not in the priority queue, assuming that there are m blockchain nodes in the blockchain network, it will take m/2 attempts on average to successfully decrypt the transaction.
或者,针对任一区块链节点,该区块链节点在通过第二优先交易中所包含的元素数量确定k为0时,采用k为0所对应的交易解密处理方式,即,从第二优先交易中获取两个不相等的第二优先占位符和第三优先占位符,并根据第二优先占位符和第三优先占位符,生成第二解密分片。再通过双线性映射算法,根据该第二解密分片以及第二优先交易中的第二优先承诺,生成第二解密交易,并判断该第二解密交易的哈希值是否与该交易的哈希值相等来判断该区块链节点是否真的成功解密出该交易,从而确定是否由该区块链节点来执行针对该交易的出块操作。也即是,在确定相等后,由该区块链节点将该第二解密交易以及该第二解密交易的哈希值打包为区块,并将该区块同步给其它区块链节点进行共识验证,如果确定共识成功,则将该区块进行上链。Or, for any blockchain node, when the blockchain node determines that k is 0 through the number of elements contained in the second priority transaction, it adopts the transaction decryption processing method corresponding to k being 0, that is, from the second Two unequal second priority placeholders and third priority placeholders are obtained in the priority transaction, and a second decryption fragment is generated according to the second priority placeholder and the third priority placeholder. Then, through the bilinear mapping algorithm, according to the second decryption fragment and the second priority commitment in the second priority transaction, generate the second decryption transaction, and judge whether the hash value of the second decryption transaction is consistent with the hash value of the transaction The hash values are equal to determine whether the block chain node has successfully decrypted the transaction, so as to determine whether the block chain node performs the block production operation for the transaction. That is, after the equality is determined, the blockchain node packs the second decrypted transaction and the hash value of the second decrypted transaction into a block, and synchronizes the block to other blockchain nodes for consensus Verification, if it is determined that the consensus is successful, the block will be uploaded to the chain.
示例性地,继续以上述区块链网络中有5个区块链节点为例进行描述,比如,以区块链节点1检测到第二优先交易为例,该区块链节点1通过读取第二优先交易,确定该第二优先交易中所包含的元素数量为4个,即(P,h,Ra,Rb),此时通过区块链网络与客户端之间所共知的一种对应关系,即优先交易中所包含的数量与优先节点的数量之间的对应关系,可判断出k为0,也即是优先队列中有0个优先节点,如此即可采用k为0所对应的交易解密处理方式。该交易解密处理方式的具体过程为:Exemplarily, continue to take five blockchain nodes in the above blockchain network as an example for description, for example, take blockchain node 1 detecting the second priority transaction as an example, the blockchain node 1 reads For the second priority transaction, it is determined that the number of elements contained in the second priority transaction is 4, namely (P, h, Ra, Rb). Correspondence, that is, the corresponding relationship between the number contained in the priority transaction and the number of priority nodes, it can be judged that k is 0, that is, there are 0 priority nodes in the priority queue, so the corresponding relationship between k and 0 can be used transaction decryption processing method. The specific process of the transaction decryption processing method is as follows:
步骤a、区块链节点1从第二优先交易中获取到第二优先占位符Ra和第三优先占位符Rb,并根据第二优先占位符Ra和第三优先占位符Rb,生成第二解密分片T,即T=(-Ra,Rb)。Step a, blockchain node 1 obtains the second priority placeholder Ra and the third priority placeholder Rb from the second priority transaction, and according to the second priority placeholder Ra and the third priority placeholder Rb, Generate the second decryption segment T, that is, T=(-Ra, Rb).
步骤b、该区块链节点1将该第二解密分片T和第二优先交易中的第二优先承诺P通过双线性映射算法,生成第二解密交易tx_try,即tx_try=P*T。具体地,在计算第一解密交易tx_try时,可通过下述方式进行计算,即,tx_try=e(Ra,Rb)*tx*e(-Ra,Rb)=e(ra*G,rb*G)*tx*e(-ra*G,rb*G)=tx*e(G,G)^rarb*e(G,G)^-rarb=tx*e(G,G)^(rarb-rarb)=tx*e(G,G)^0=tx。Step b. The blockchain node 1 generates a second decrypted transaction tx_try by using the second decrypted segment T and the second priority commitment P in the second priority transaction through a bilinear mapping algorithm, that is, tx_try=P*T. Specifically, when calculating the first decrypted transaction tx_try, it can be calculated in the following manner, that is, tx_try=e(Ra, Rb)*tx*e(-Ra, Rb)=e(ra*G, rb*G )*tx*e(-ra*G,rb*G)=tx*e(G,G)^rarb*e(G,G)^-rarb=tx*e(G,G)^(rarb-rarb )=tx*e(G,G)^0=tx.
步骤c、该区块链节点1通过设定的哈希算法,比如MD5或SHA256算法等,对该第二解密交易tx_try进行哈希运算,生成该第二解密交易tx_try的哈希值h”,即h”=hash(tx_try)。Step c, the blockchain node 1 performs a hash operation on the second decrypted transaction tx_try through a set hash algorithm, such as MD5 or SHA256 algorithm, to generate a hash value h" of the second decrypted transaction tx_try, That is h"=hash(tx_try).
步骤d、该区块链节点1确定该第二解密交易tx_try的哈希值h”是否与第二优先交易 中的交易的哈希值h相等。如果确定相等,则可以将该第二解密交易tx_try以及该第二解密交易tx_try的哈希值h”打包为区块,并将该区块同步给其它区块链节点进行共识验证,如果确定其它各区块链节点共识成功,则将该区块进行上链。如果确定不相等,则提示交易异常,终止交易。Step d, the block chain node 1 determines whether the hash value h" of the second decrypted transaction tx_try is equal to the hash value h" of the transaction in the second priority transaction. If it is determined to be equal, the second decrypted transaction can be tx_try and the hash value h” of the second decrypted transaction tx_try are packaged into a block, and the block is synchronized to other blockchain nodes for consensus verification. If it is determined that the consensus of other blockchain nodes is successful, the block Go to the chain. If it is determined that they are not equal, it will prompt that the transaction is abnormal and terminate the transaction.
上述实施例表明,由于现有技术方案的区块链网络中各区块链节点的关系是对等的,且各区块链节点的计算能力相同,如此该现有技术方案所涉及的区块确认算法也是针对处于对等关系的各区块链节点,那么也就无法支持具有优先节点要求(即指定一些区块链节点优先处理交易)的区块确认过程,同时由于现有技术方案的各区块链节点计算能力相同,没有节点能够率先完成区块确认的过程,如此就需要各区块链节点耗费较长的时间通过工作量证明机制进行区块的确认,从而导致区块上链的效率低。基于此,本发明中的技术方案通过指定部分区块链节点作为优先节点,如此在区块链网络中各区块链节点的计算能力相同或接近时,客户端所指定的优先节点有极大的概率能够率先完成区块确认的过程,因此可以节省区块确认的过程所耗费的时间,从而可以有效地提高区块上链的效率。具体来说,针对任一交易,客户端从m个区块链节点中可确定出k个区块链节点作为优先节点,并基于该k个优先节点的公钥,生成第一混淆因子。再基于第一混淆因子和该交易,生成第一优先承诺,该第一优先承诺作为节点交易确认的凭证,并在基于第一优先承诺和该交易的哈希值生成第一优先交易后,将该第一优先交易发送给区块链网络,区块链网络中的某一区块链节点(比如优先节点)可率先通过该第一优先交易中的第一优先承诺恢复出该交易。如此,该方案可以在区块链网络中各区块链节点的计算能力相同或接近的情况下,客户端所指定的优先节点有极大的概率能够率先通过该第一优先交易中的第一优先承诺恢复出该交易,从而快速完成区块确认的过程,即使在各区块链节点的计算能力不相同的情况下,优先节点也有极大的概率能够率先通过该第一优先交易中的第一优先承诺恢复出该交易,以此快速完成区块确认的过程,以此可以有效地提高区块上链的效率。同时,由于客户端并没有直接向区块链网络发送该交易,而是通过第一混淆因子对该交易进行混淆处理,并将交易的哈希值以及混淆处理后所得到的第一优先承诺发送区块链网络,因此可以避免交易数据存在泄露的风险,从而可以有助于确保交易数据的隐私安全性。The above-mentioned embodiment shows that, since the relationship of each blockchain node in the blockchain network of the prior art solution is equal, and the computing power of each blockchain node is the same, the block confirmation algorithm involved in this prior art solution It is also aimed at each blockchain node in a peer-to-peer relationship, so it cannot support the block confirmation process with priority node requirements (that is, specifying some blockchain nodes to process transactions first). With the same computing power, no node can complete the block confirmation process first, so it takes a long time for each blockchain node to confirm the block through the workload proof mechanism, resulting in low efficiency of block chaining. Based on this, the technical solution in the present invention designates some blockchain nodes as priority nodes, so that when the computing capabilities of each blockchain node in the blockchain network are the same or close to each other, the priority nodes designated by the client have a great Probability can be the first to complete the block confirmation process, so it can save the time spent in the block confirmation process, thereby effectively improving the efficiency of block chaining. Specifically, for any transaction, the client can determine k blockchain nodes as priority nodes from the m blockchain nodes, and generate the first confusion factor based on the public keys of the k priority nodes. Based on the first confusion factor and the transaction, generate the first priority commitment, which is used as the node transaction confirmation certificate, and after generating the first priority transaction based on the first priority commitment and the hash value of the transaction, the The first priority transaction is sent to the block chain network, and a block chain node (such as a priority node) in the block chain network can take the lead in recovering the transaction through the first priority commitment in the first priority transaction. In this way, under the condition that the computing capabilities of each blockchain node in the blockchain network are the same or close to each other, the priority node designated by the client has a great probability of being the first to pass the first priority transaction in the first priority transaction. Promise to restore the transaction, so as to quickly complete the block confirmation process. Even if the computing power of each blockchain node is different, the priority node has a great probability to be the first to pass the first priority in the first priority transaction. Promise to restore the transaction, so as to quickly complete the block confirmation process, which can effectively improve the efficiency of block chaining. At the same time, since the client does not directly send the transaction to the blockchain network, but uses the first obfuscation factor to obfuscate the transaction, and sends the hash value of the transaction and the first priority commitment obtained after the obfuscation to Blockchain network, so the risk of transaction data leakage can be avoided, which can help ensure the privacy and security of transaction data.
基于相同的技术构思,图2示例性的示出了本发明实施例提供的一种区块确认装置,该装置可以执行区块确认方法的流程。其中,该区块确认方法适用于具有m个区块链节点的区块链网络。Based on the same technical concept, FIG. 2 exemplarily shows a block confirmation device provided by an embodiment of the present invention, and the device can execute the flow of the block confirmation method. Wherein, the block confirmation method is applicable to a blockchain network with m blockchain nodes.
如图2所示,该装置包括:As shown in Figure 2, the device includes:
确定单元201,用于针对任一交易,从所述m个区块链节点中确定出k个区块链节点作为优先节点;The determination unit 201 is configured to determine k blockchain nodes from the m blockchain nodes as priority nodes for any transaction;
第一处理单元202,用于基于k个优先节点的公钥,生成第一混淆因子;基于所述第一混淆因子和所述交易,生成第一优先承诺;基于所述第一优先承诺和所述交易的哈希值生成第一优先交易,并将所述第一优先交易发送给所述区块链网络。The first processing unit 202 is configured to generate a first confusion factor based on the public keys of the k priority nodes; generate a first priority commitment based on the first confusion factor and the transaction; and generate a first priority commitment based on the first priority commitment and the The hash value of the transaction is used to generate a first priority transaction, and the first priority transaction is sent to the block chain network.
可选地,所述第一处理单元202具体用于:Optionally, the first processing unit 202 is specifically configured to:
在确定优先节点的个数k为2时,将所述k个优先节点的公钥通过双线性映射算法,生成所述第一混淆因子;When determining that the number k of priority nodes is 2, the public keys of the k priority nodes are passed through a bilinear mapping algorithm to generate the first confusion factor;
所述第一处理单元202具体用于:The first processing unit 202 is specifically used for:
对所述交易进行哈希运算,生成所述交易的哈希值;performing a hash operation on the transaction to generate a hash value of the transaction;
根据所述第一优先承诺和所述交易的哈希值,生成所述第一优先交易。The first priority transaction is generated according to the first priority commitment and the hash value of the transaction.
可选地,所述第一处理单元202具体用于:Optionally, the first processing unit 202 is specifically configured to:
在确定优先节点的个数k为1时,基于椭圆曲线确定第一优先占位符,并将所述第一优先占位符以及所述k个优先节点的公钥通过双线性映射算法,生成所述第一混淆因子;When determining that the number k of priority nodes is 1, determine a first priority placeholder based on an elliptic curve, and pass the first priority placeholder and the public keys of the k priority nodes through a bilinear mapping algorithm, generating said first aliasing factor;
所述第一处理单元202具体用于:The first processing unit 202 is specifically used for:
对所述交易进行哈希运算,生成所述交易的哈希值;performing a hash operation on the transaction to generate a hash value of the transaction;
根据所述第一优先承诺、所述第一优先占位符和所述交易的哈希值,生成所述第一优先交易。The first priority transaction is generated according to the first priority commitment, the first priority placeholder, and the hash value of the transaction.
可选地,所述第一处理单元202还用于:Optionally, the first processing unit 202 is further configured to:
在确定优先节点的个数k为0时,基于椭圆曲线确定两个不相等的第二优先占位符和第三优先占位符,并将所述第二优先占位符和所述第三优先占位符通过双线性映射算法,生成第二混淆因子;When it is determined that the number k of priority nodes is 0, two unequal second priority placeholders and third priority placeholders are determined based on the elliptic curve, and the second priority placeholder and the third priority placeholder The first placeholder generates the second confusion factor through the bilinear mapping algorithm;
基于所述第二混淆因子和所述交易,生成第二优先承诺;generating a second priority commitment based on the second obfuscation factor and the transaction;
根据所述第二优先承诺、所述第二优先占位符、所述第三优先占位符和所述交易的哈希值,生成所述第二优先交易,并将所述第二优先交易发送给所述区块链网络。Generate the second priority transaction according to the second priority commitment, the second priority placeholder, the third priority placeholder, and the hash value of the transaction, and convert the second priority transaction sent to the blockchain network.
可选地,所述第一处理单元202具体用于:Optionally, the first processing unit 202 is specifically configured to:
将所述第一混淆因子和所述交易,通过椭圆曲线点域乘法算法,生成第一优先承诺。Using the first confusion factor and the transaction through an elliptic curve point domain multiplication algorithm to generate a first priority commitment.
基于相同的技术构思,图3示例性的示出了本发明实施例提供的另一种区块确认装置,该装置可以执行区块确认方法的流程。其中,该区块确认方法适用于具有m个区块链节点的区块链网络。Based on the same technical concept, FIG. 3 exemplarily shows another block confirmation device provided by an embodiment of the present invention, and the device can execute the flow of the block confirmation method. Wherein, the block confirmation method is applicable to a blockchain network with m blockchain nodes.
如图3所示,该装置包括:As shown in Figure 3, the device includes:
生成单元301,用于针对所述m个区块链节点中的任一区块链节点,在检测到第一优先交易时,基于所述区块链节点的私钥生成第一解密分片;所述第一优先交易是客户端基于第一优先承诺和交易的哈希值生成的;所述第一优先承诺是所述客户端基于第一混淆因子和所述交易生成的;所述第一混淆因子是所述客户端基于所述客户端从所述m个区块链节点中确定出的k个优先节点的公钥生成的;The generating unit 301 is configured to generate a first decrypted segment based on the private key of the blockchain node for any one of the m blockchain nodes when the first priority transaction is detected; The first priority transaction is generated by the client based on the first priority commitment and the hash value of the transaction; the first priority commitment is generated by the client based on the first confusion factor and the transaction; the first The confusion factor is generated by the client based on the public keys of the k priority nodes determined by the client from the m blockchain nodes;
第二处理单元302,用于通过双线性映射算法,根据所述第一解密分片以及所述第一优先交易中的第一优先承诺,生成第一解密交易;在确定所述第一解密交易的哈希值与所述第一优先交易中的交易的哈希值相等时,将所述第一解密交易打包为区块进行上链。The second processing unit 302 is configured to use a bilinear mapping algorithm to generate a first decrypted transaction according to the first decrypted fragment and the first priority commitment in the first priority transaction; When the hash value of the transaction is equal to the hash value of the transaction in the first priority transaction, the first decrypted transaction is packed into a block and uploaded to the chain.
可选地,所述生成单元301具体用于:Optionally, the generating unit 301 is specifically configured to:
在通过所述第一优先交易中所包含的元素数量指示k为2时,将所述区块链节点的私钥通过数域求逆算法,生成第一解密私钥;When the number of elements contained in the first priority transaction indicates that k is 2, the private key of the blockchain node is passed through a number field inversion algorithm to generate a first decryption private key;
从区块链上获取所述m个区块链节点的公钥,并针对任一区块链节点的公钥,根据所述第一解密私钥和所述区块链节点的公钥,生成所述第一解密分片。Obtain the public keys of the m blockchain nodes from the blockchain, and generate according to the first decryption private key and the public key of the blockchain node for the public key of any blockchain node The first decrypted segment.
可选地,所述生成单元301具体用于:Optionally, the generating unit 301 is specifically configured to:
在通过所述第一优先交易中所包含的元素数量指示k为1时,将所述区块链节点的私钥通过数域求逆算法,生成第一解密私钥;When the number of elements contained in the first priority transaction indicates that k is 1, the private key of the blockchain node is passed through a number field inversion algorithm to generate a first decryption private key;
从所述第一优先交易中获取第一优先占位符,并根据所述第一解密私钥和所述第一优先占位符,生成所述第一解密分片。Obtain a first priority placeholder from the first priority transaction, and generate the first decryption fragment according to the first decryption private key and the first priority placeholder.
可选地,所述第二处理单元302还用于:Optionally, the second processing unit 302 is further configured to:
在检测到第二优先交易时,从所述第二优先交易中获取两个不相等的第二优先占位符和第三优先占位符;所述第二优先交易中所包含的元素数量指示k为0;When a second priority transaction is detected, two unequal second priority placeholders and a third priority placeholder are obtained from the second priority transaction; an indication of the number of elements contained in the second priority transaction k is 0;
根据所述第二优先占位符和所述第三优先占位符,生成第二解密分片;generating a second decrypted segment according to the second priority placeholder and the third priority placeholder;
通过双线性映射算法,根据所述第二解密分片以及所述第二优先交易中的第二优先承诺,生成第二解密交易;generating a second decrypted transaction according to the second decrypted fragment and the second priority commitment in the second priority transaction through a bilinear mapping algorithm;
在确定所述第二解密交易的哈希值与所述第二优先交易中的交易的哈希值相等时,将所述第二解密交易打包为区块进行上链。When it is determined that the hash value of the second decrypted transaction is equal to the hash value of the transaction in the second priority transaction, the second decrypted transaction is packaged into a block and uploaded to the chain.
可选地,所述第二处理单元302还用于:Optionally, the second processing unit 302 is further configured to:
在确定所述m个区块链节点对应的各第一解密交易的哈希值与所述第一优先交易中的交易的哈希值均不相等时,从区块链上获取m个区块链节点的公钥,并针对任一区块链节点的公钥,将所述区块链节点的公钥通过数域求逆算法,生成第一解密公钥;When it is determined that the hash values of the first decrypted transactions corresponding to the m blockchain nodes are not equal to the hash values of the transactions in the first priority transaction, m blocks are obtained from the blockchain The public key of the chain node, and for the public key of any blockchain node, the public key of the blockchain node is passed through the number field inversion algorithm to generate the first decryption public key;
基于所述第一解密公钥,生成第三解密分片;generating a third decryption slice based on the first decryption public key;
通过双线性映射算法,根据所述第三解密分片以及所述第一优先交易中的第一优先承诺,生成第三解密交易;generating a third decrypted transaction according to the third decrypted segment and the first priority commitment in the first priority transaction through a bilinear mapping algorithm;
在确定所述第三解密交易的哈希值与所述第一优先交易中的交易的哈希值相等时,将所述第三解密交易打包为区块进行上链。When it is determined that the hash value of the third decrypted transaction is equal to the hash value of the transaction in the first priority transaction, the third decrypted transaction is packaged into a block and uploaded to the chain.
基于相同的技术构思,本发明实施例还提供了一种计算设备,如图4所示,包括至少一个处理器401,以及与至少一个处理器连接的存储器402,本发明实施例中不限定处理器401与存储器402之间的具体连接介质,图4中处理器401和存储器402之间通过总线连接为例。总线可以分为地址总线、数据总线、控制总线等。Based on the same technical concept, the embodiment of the present invention also provides a computing device, as shown in FIG. 4 , including at least one processor 401 and a memory 402 connected to the at least one processor. The specific connection medium between the processor 401 and the memory 402, the bus connection between the processor 401 and the memory 402 in FIG. 4 is taken as an example. The bus can be divided into address bus, data bus, control bus and so on.
在本发明实施例中,存储器402存储有可被至少一个处理器401执行的指令,至少一个处理器401通过执行存储器402存储的指令,可以执行前述的区块确认方法中所包括的步骤。In the embodiment of the present invention, the memory 402 stores instructions that can be executed by at least one processor 401, and at least one processor 401 can execute the steps included in the aforementioned block confirmation method by executing the instructions stored in the memory 402.
其中,处理器401是计算设备的控制中心,可以利用各种接口和线路连接计算设备的各个部分,通过运行或执行存储在存储器402内的指令以及调用存储在存储器402内的数据,从而实现数据处理。可选的,处理器401可包括一个或多个处理单元,处理器401可集成应用处理器和调制解调处理器,其中,应用处理器主要处理操作系统、用户界面和应用程序等,调制解调处理器主要处理下发指令。可以理解的是,上述调制解调处理器也可以不集成到处理器401中。在一些实施例中,处理器401和存储器402可以在同一芯片上实现,在一些实施例中,它们也可以在独立的芯片上分别实现。Among them, the processor 401 is the control center of the computing device, which can use various interfaces and lines to connect various parts of the computing device, by running or executing instructions stored in the memory 402 and calling data stored in the memory 402, thereby realizing data deal with. Optionally, the processor 401 may include one or more processing units, and the processor 401 may integrate an application processor and a modem processor. The call processor mainly handles issuing instructions. It can be understood that the foregoing modem processor may not be integrated into the processor 401 . In some embodiments, the processor 401 and the memory 402 can be implemented on the same chip, and in some embodiments, they can also be implemented on independent chips.
处理器401可以是通用处理器,例如中央处理器(CPU)、数字信号处理器、专用集成电路(Application Specific Integrated Circuit,ASIC)、现场可编程门阵列或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件,可以实现或者执行本发明实施例中公开的各方法、步骤及逻辑框图。通用处理器可以是微处理器或者任何常规的处理器等。结合区块确认方法实施例所公开的方法的步骤可以直接体现为硬件处理器执行完成,或者用处理器中的硬件及软件模块组合执行完成。The processor 401 can be a general processor, such as a central processing unit (CPU), a digital signal processor, an application specific integrated circuit (Application Specific Integrated Circuit, ASIC), a field programmable gate array or other programmable logic devices, discrete gates or transistors Logic devices and discrete hardware components can implement or execute the methods, steps and logic block diagrams disclosed in the embodiments of the present invention. A general purpose processor may be a microprocessor or any conventional processor or the like. The steps of the method disclosed in the embodiment of the block confirmation method can be directly implemented by a hardware processor, or implemented by a combination of hardware and software modules in the processor.
存储器402作为一种非易失性计算机可读存储介质,可用于存储非易失性软件程序、非易失性计算机可执行程序以及模块。存储器402可以包括至少一种类型的存储介质,例如可以包括闪存、硬盘、多媒体卡、卡型存储器、随机访问存储器(Random Access Memory,RAM)、静态随机访问存储器(Static Random Access Memory,SRAM)、可编程只读存储 器(Programmable Read Only Memory,PROM)、只读存储器(Read Only Memory,ROM)、带电可擦除可编程只读存储器(Electrically Erasable Programmable Read-Only Memory,EEPROM)、磁性存储器、磁盘、光盘等等。存储器402是能够用于携带或存储具有指令或数据结构形式的期望的程序代码并能够由计算机存取的任何其他介质,但不限于此。本发明实施例中的存储器402还可以是电路或者其它任意能够实现存储功能的装置,用于存储程序指令和/或数据。The memory 402, as a non-volatile computer-readable storage medium, can be used to store non-volatile software programs, non-volatile computer-executable programs and modules. Memory 402 can include at least one type of storage medium, for example, can include flash memory, hard disk, multimedia card, card memory, random access memory (Random Access Memory, RAM), static random access memory (Static Random Access Memory, SRAM), Programmable Read Only Memory (PROM), Read Only Memory (ROM), Electrically Erasable Programmable Read-Only Memory (EEPROM), Magnetic Memory, Disk , CD, etc. Memory 402 is, but is not limited to, any other medium that can be used to carry or store desired program code in the form of instructions or data structures and that can be accessed by a computer. The memory 402 in the embodiment of the present invention may also be a circuit or any other device capable of implementing a storage function, and is used for storing program instructions and/or data.
基于相同的技术构思,本发明实施例还提供了一种计算机可读存储介质,其存储有可由计算设备执行的计算机程序,当所述程序在所述计算设备上运行时,使得所述计算设备执行上述区块确认方法的步骤。Based on the same technical idea, an embodiment of the present invention also provides a computer-readable storage medium, which stores a computer program executable by a computing device, and when the program is run on the computing device, the computing device Execute the steps of the block confirmation method described above.
本领域内的技术人员应明白,本发明的实施例可提供为方法、系统、或计算机程序产品。因此,本发明可采用完全硬件实施例、完全软件实施例、或结合软件和硬件方面的实施例的形式。而且,本发明可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。Those skilled in the art should understand that the embodiments of the present invention may be provided as methods, systems, or computer program products. Accordingly, the present invention can take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) having computer-usable program code embodied therein.
本发明是参照根据本发明的方法、设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to the invention. It should be understood that each procedure and/or block in the flowchart and/or block diagram, and a combination of procedures and/or blocks in the flowchart and/or block diagram can be realized by computer program instructions. These computer program instructions may be provided to a general purpose computer, special purpose computer, embedded processor, or processor of other programmable data processing equipment to produce a machine such that the instructions executed by the processor of the computer or other programmable data processing equipment produce a An apparatus for realizing the functions specified in one or more procedures of the flowchart and/or one or more blocks of the block diagram.
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing apparatus to operate in a specific manner, such that the instructions stored in the computer-readable memory produce an article of manufacture comprising instruction means, the instructions The device realizes the function specified in one or more procedures of the flowchart and/or one or more blocks of the block diagram.
尽管已描述了本发明的优选实施例,但本领域内的技术人员一旦得知了基本创造性概念,则可对这些实施例作出另外的变更和修改。所以,所附权利要求意欲解释为包括优选实施例以及落入本发明范围的所有变更和修改。While preferred embodiments of the invention have been described, additional changes and modifications to these embodiments can be made by those skilled in the art once the basic inventive concept is appreciated. Therefore, it is intended that the appended claims be construed to cover the preferred embodiment as well as all changes and modifications which fall within the scope of the invention.
显然,本领域的技术人员可以对本发明进行各种改动和变型而不脱离本发明的精神和范围。这样,倘若本发明的这些修改和变型属于本申请权利要求及其等同技术的范围之内,则本发明也意图包含这些改动和变型在内。Obviously, those skilled in the art can make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of this application and their equivalent technologies, the present invention also intends to include these modifications and variations.

Claims (14)

  1. 一种区块确认方法,其特征在于,适用于具有m个区块链节点的区块链网络,所述方法包括:A block confirmation method is characterized in that it is applicable to a block chain network with m block chain nodes, and the method comprises:
    针对任一交易,客户端从所述m个区块链节点中确定出k个区块链节点作为优先节点;For any transaction, the client determines k blockchain nodes from the m blockchain nodes as priority nodes;
    所述客户端基于k个优先节点的公钥,生成第一混淆因子;The client generates a first confusion factor based on the public keys of the k priority nodes;
    所述客户端基于所述第一混淆因子和所述交易,生成第一优先承诺;The client generates a first priority commitment based on the first confusion factor and the transaction;
    所述客户端基于所述第一优先承诺和所述交易的哈希值生成第一优先交易,并将所述第一优先交易发送给所述区块链网络。The client generates a first priority transaction based on the first priority commitment and a hash value of the transaction, and sends the first priority transaction to the blockchain network.
  2. 如权利要求1所述的方法,其特征在于,所述客户端基于k个优先节点的公钥,生成第一混淆因子,包括:The method according to claim 1, wherein the client generates a first confusion factor based on the public keys of k priority nodes, comprising:
    所述客户端在确定优先节点的个数k为2时,将所述k个优先节点的公钥通过双线性映射算法,生成所述第一混淆因子;When the client determines that the number k of priority nodes is 2, the public keys of the k priority nodes are generated through a bilinear mapping algorithm to generate the first confusion factor;
    所述客户端基于所述第一优先承诺和所述交易的哈希值生成第一优先交易,包括:The client generates a first priority transaction based on the first priority commitment and the hash value of the transaction, including:
    所述客户端对所述交易进行哈希运算,生成所述交易的哈希值;The client performs a hash operation on the transaction to generate a hash value of the transaction;
    所述客户端根据所述第一优先承诺和所述交易的哈希值,生成所述第一优先交易。The client generates the first priority transaction according to the first priority commitment and the hash value of the transaction.
  3. 如权利要求1所述的方法,其特征在于,所述客户端基于k个优先节点的公钥,生成第一混淆因子,包括:The method according to claim 1, wherein the client generates a first confusion factor based on the public keys of k priority nodes, comprising:
    所述客户端在确定优先节点的个数k为1时,基于椭圆曲线确定第一优先占位符,并将所述第一优先占位符以及所述k个优先节点的公钥通过双线性映射算法,生成所述第一混淆因子;When determining that the number k of priority nodes is 1, the client determines a first priority placeholder based on an elliptic curve, and passes the first priority placeholder and the public keys of the k priority nodes through a double line A property mapping algorithm that generates the first confusion factor;
    所述客户端基于所述第一优先承诺和所述交易的哈希值生成第一优先交易,包括:The client generates a first priority transaction based on the first priority commitment and the hash value of the transaction, including:
    所述客户端对所述交易进行哈希运算,生成所述交易的哈希值;The client performs a hash operation on the transaction to generate a hash value of the transaction;
    所述客户端根据所述第一优先承诺、所述第一优先占位符和所述交易的哈希值,生成所述第一优先交易。The client generates the first priority transaction according to the first priority commitment, the first priority placeholder, and the hash value of the transaction.
  4. 如权利要求1所述的方法,其特征在于,还包括:The method of claim 1, further comprising:
    所述客户端在确定优先节点的个数k为0时,基于椭圆曲线确定两个不相等的第二优先占位符和第三优先占位符,并将所述第二优先占位符和所述第三优先占位符通过双线性映射算法,生成第二混淆因子;When the client determines that the number k of priority nodes is 0, it determines two unequal second priority placeholders and third priority placeholders based on elliptic curves, and uses the second priority placeholder and the third priority placeholder The third priority placeholder generates a second confusion factor through a bilinear mapping algorithm;
    所述客户端基于所述第二混淆因子和所述交易,生成第二优先承诺;The client generates a second priority commitment based on the second confusion factor and the transaction;
    所述客户端根据所述第二优先承诺、所述第二优先占位符、所述第三优先占位符和所述交易的哈希值,生成第二优先交易,并将所述第二优先交易发送给所述区块链网络。The client generates a second priority transaction according to the second priority commitment, the second priority placeholder, the third priority placeholder, and the hash value of the transaction, and sends the second priority Priority transactions are sent to the blockchain network.
  5. 如权利要求1至3任一项所述的方法,其特征在于,所述客户端基于所述第一混淆因子和所述交易,生成第一优先承诺,包括:The method according to any one of claims 1 to 3, wherein the client generates a first priority commitment based on the first confusion factor and the transaction, including:
    所述客户端将所述第一混淆因子和所述交易,通过椭圆曲线点域乘法算法,生成第一优先承诺。The client uses the first confusion factor and the transaction to generate a first priority commitment through an elliptic curve dot field multiplication algorithm.
  6. 一种区块确认方法,其特征在于,适用于具有m个区块链节点的区块链网络,所述方法包括:A block confirmation method is characterized in that it is applicable to a block chain network with m block chain nodes, and the method comprises:
    针对所述m个区块链节点中的任一区块链节点,所述区块链节点在检测到第一优先交易时,基于所述区块链节点的私钥生成第一解密分片;所述第一优先交易是客户端基于第 一优先承诺和交易的哈希值生成的;所述第一优先承诺是所述客户端基于第一混淆因子和所述交易生成的;所述第一混淆因子是所述客户端基于所述客户端从所述m个区块链节点中确定出的k个优先节点的公钥生成的;For any one of the m blockchain nodes, when the blockchain node detects the first priority transaction, it generates a first decrypted segment based on the private key of the blockchain node; The first priority transaction is generated by the client based on the first priority commitment and the hash value of the transaction; the first priority commitment is generated by the client based on the first confusion factor and the transaction; the first The confusion factor is generated by the client based on the public keys of the k priority nodes determined by the client from the m blockchain nodes;
    所述区块链节点通过双线性映射算法,根据所述第一解密分片以及所述第一优先交易中的第一优先承诺,生成第一解密交易;The blockchain node generates a first decrypted transaction according to the first decrypted fragment and the first priority commitment in the first priority transaction through a bilinear mapping algorithm;
    所述区块链节点在确定所述第一解密交易的哈希值与所述第一优先交易中的交易的哈希值相等时,将所述第一解密交易打包为区块进行上链。When the block chain node determines that the hash value of the first decrypted transaction is equal to the hash value of the transaction in the first priority transaction, it packs the first decrypted transaction into a block and uploads it to the chain.
  7. 如权利要求6所述的方法,其特征在于,所述区块链节点在检测到第一优先交易时,基于所述区块链节点的私钥生成第一解密分片,包括:The method according to claim 6, wherein, when the blockchain node detects the first priority transaction, generating a first decrypted segment based on the private key of the blockchain node, comprising:
    所述区块链节点在通过所述第一优先交易中所包含的元素数量指示k为2时,将所述区块链节点的私钥通过数域求逆算法,生成第一解密私钥;When the block chain node indicates that k is 2 through the number of elements contained in the first priority transaction, the private key of the block chain node is generated through a number field inversion algorithm to generate a first decryption private key;
    所述区块链节点从区块链上获取所述m个区块链节点的公钥,并针对任一区块链节点的公钥,根据所述第一解密私钥和所述区块链节点的公钥,生成所述第一解密分片。The block chain node obtains the public keys of the m block chain nodes from the block chain, and for the public key of any block chain node, according to the first decryption private key and the block chain The public key of the node is used to generate the first decrypted fragment.
  8. 如权利要求6所述的方法,其特征在于,所述区块链节点在检测到第一优先交易时,基于所述区块链节点的私钥生成第一解密分片,包括:The method according to claim 6, wherein, when the blockchain node detects the first priority transaction, generating a first decrypted segment based on the private key of the blockchain node, comprising:
    所述区块链节点在通过所述第一优先交易中所包含的元素数量指示k为1时,将所述区块链节点的私钥通过数域求逆算法,生成第一解密私钥;When the block chain node indicates that k is 1 through the number of elements contained in the first priority transaction, the private key of the block chain node is generated through a number field inversion algorithm to generate a first decryption private key;
    所述区块链节点从所述第一优先交易中获取第一优先占位符,并根据所述第一解密私钥和所述第一优先占位符,生成所述第一解密分片。The blockchain node obtains a first priority placeholder from the first priority transaction, and generates the first decryption segment according to the first decryption private key and the first priority placeholder.
  9. 如权利要求6所述的方法,其特征在于,还包括:The method of claim 6, further comprising:
    所述区块链节点在检测到第二优先交易时,从所述第二优先交易中获取两个不相等的第二优先占位符和第三优先占位符;所述第二优先交易中所包含的元素数量指示k为0;When the blockchain node detects the second priority transaction, it obtains two unequal second priority placeholders and third priority placeholders from the second priority transaction; The number of elements included indicates that k is 0;
    所述区块链节点根据所述第二优先占位符和所述第三优先占位符,生成第二解密分片;The block chain node generates a second decryption fragment according to the second priority placeholder and the third priority placeholder;
    所述区块链节点通过双线性映射算法,根据所述第二解密分片以及所述第二优先交易中的第二优先承诺,生成第二解密交易;The blockchain node generates a second decrypted transaction according to the second decrypted fragment and the second priority commitment in the second priority transaction through a bilinear mapping algorithm;
    所述区块链节点在确定所述第二解密交易的哈希值与所述第二优先交易中的交易的哈希值相等时,将所述第二解密交易打包为区块进行上链。When the block chain node determines that the hash value of the second decrypted transaction is equal to the hash value of the transaction in the second priority transaction, it packs the second decrypted transaction into a block and uploads it to the chain.
  10. 如权利要求6所述的方法,其特征在于,还包括:The method of claim 6, further comprising:
    所述区块链节点在确定所述m个区块链节点对应的各第一解密交易的哈希值与所述第一优先交易中的交易的哈希值均不相等时,从区块链上获取m个区块链节点的公钥,并针对任一区块链节点的公钥,将所述区块链节点的公钥通过数域求逆算法,生成第一解密公钥;When the block chain node determines that the hash values of the first decrypted transactions corresponding to the m block chain nodes are not equal to the hash values of the transactions in the first priority transaction, from the block chain Obtain the public keys of m block chain nodes, and for the public key of any block chain node, use the public key of the block chain node through the number field inversion algorithm to generate the first decryption public key;
    所述区块链节点基于所述第一解密公钥,生成第三解密分片;The block chain node generates a third decrypted segment based on the first decrypted public key;
    所述区块链节点通过双线性映射算法,根据所述第三解密分片以及所述第一优先交易中的第一优先承诺,生成第三解密交易;The blockchain node generates a third decrypted transaction according to the third decrypted fragment and the first priority commitment in the first priority transaction through a bilinear mapping algorithm;
    所述区块链节点在确定所述第三解密交易的哈希值与所述第一优先交易中的交易的哈希值相等时,将所述第三解密交易打包为区块进行上链。When the block chain node determines that the hash value of the third decrypted transaction is equal to the hash value of the transaction in the first priority transaction, it packs the third decrypted transaction into a block and uploads it to the chain.
  11. 一种区块确认装置,其特征在于,适用于具有m个区块链节点的区块链网络,所述装置包括:A block confirmation device is characterized in that it is suitable for a block chain network with m block chain nodes, and the device includes:
    确定单元,用于针对任一交易,从所述m个区块链节点中确定出k个区块链节点作为 优先节点;A determining unit is used for determining k blockchain nodes from the m blockchain nodes as priority nodes for any transaction;
    第一处理单元,用于基于k个优先节点的公钥,生成第一混淆因子;基于所述第一混淆因子和所述交易,生成第一优先承诺;基于所述第一优先承诺和所述交易的哈希值生成第一优先交易,并将所述第一优先交易发送给所述区块链网络。The first processing unit is configured to generate a first confusion factor based on the public keys of k priority nodes; generate a first priority commitment based on the first confusion factor and the transaction; and generate a first priority commitment based on the first priority commitment and the The hash value of the transaction generates a first priority transaction, and sends the first priority transaction to the blockchain network.
  12. 一种区块确认装置,其特征在于,适用于具有m个区块链节点的区块链网络,所述装置包括:A block confirmation device is characterized in that it is suitable for a block chain network with m block chain nodes, and the device includes:
    生成单元,用于针对所述m个区块链节点中的任一区块链节点,在检测到第一优先交易时,基于所述区块链节点的私钥生成第一解密分片;所述第一优先交易是客户端基于第一优先承诺和交易的哈希值生成的;所述第一优先承诺是所述客户端基于第一混淆因子和所述交易生成的;所述第一混淆因子是所述客户端基于所述客户端从所述m个区块链节点中确定出的k个优先节点的公钥生成的;A generating unit, configured to generate a first decrypted segment based on the private key of the blockchain node when a first priority transaction is detected for any one of the m blockchain nodes; The first priority transaction is generated by the client based on the first priority commitment and the hash value of the transaction; the first priority commitment is generated by the client based on the first confusion factor and the transaction; the first confusion The factor is generated by the client based on the public keys of k priority nodes determined by the client from the m blockchain nodes;
    第二处理单元,用于通过双线性映射算法,根据所述第一解密分片以及所述第一优先交易中的第一优先承诺,生成第一解密交易;在确定所述第一解密交易的哈希值与所述第一优先交易中的交易的哈希值相等时,将所述第一解密交易打包为区块进行上链。The second processing unit is configured to generate a first decrypted transaction according to the first decrypted fragment and the first priority commitment in the first priority transaction through a bilinear mapping algorithm; when determining the first decrypted transaction When the hash value of is equal to the hash value of the transaction in the first priority transaction, the first decrypted transaction is packaged as a block and uploaded to the chain.
  13. 一种计算设备,其特征在于,包括至少一个处理器以及至少一个存储器,其中,所述存储器存储有计算机程序,当所述程序被所述处理器执行时,使得所述处理器执行权利要求1至10任一权利要求所述的方法。A computing device, characterized by comprising at least one processor and at least one memory, wherein the memory stores a computer program that, when the program is executed by the processor, causes the processor to perform claim 1 The method according to any one of claims 10 to 10.
  14. 一种计算机可读存储介质,其特征在于,其存储有可由计算设备执行的计算机程序,当所述程序在所述计算设备上运行时,使得所述计算设备执行权利要求1至10任一权利要求所述的方法。A computer-readable storage medium, characterized in that it stores a computer program executable by a computing device, and when the program runs on the computing device, the computing device executes any one of claims 1 to 10 method as described.
PCT/CN2021/135349 2021-10-27 2021-12-03 Block confirmation method and device WO2023070831A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202111254334.8A CN113706150B (en) 2021-10-27 2021-10-27 Block confirmation method and device
CN202111254334.8 2021-10-27

Publications (1)

Publication Number Publication Date
WO2023070831A1 true WO2023070831A1 (en) 2023-05-04

Family

ID=78647086

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/135349 WO2023070831A1 (en) 2021-10-27 2021-12-03 Block confirmation method and device

Country Status (2)

Country Link
CN (1) CN113706150B (en)
WO (1) WO2023070831A1 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113706150B (en) * 2021-10-27 2022-02-08 深圳前海微众银行股份有限公司 Block confirmation method and device

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20180097614A1 (en) * 2016-09-30 2018-04-05 Intel Corporation Cascading multivariate quadratic identification schemes for chain of trust
CN109359974A (en) * 2018-08-30 2019-02-19 阿里巴巴集团控股有限公司 Block chain method of commerce and device, electronic equipment
CN111709738A (en) * 2020-05-18 2020-09-25 杜晓楠 Method for hiding transaction amount in blockchain system, computer readable storage medium and blockchain system
CN112383389A (en) * 2021-01-08 2021-02-19 索信达(北京)数据技术有限公司 Block chain random number generation method and system
US20210258164A1 (en) * 2017-03-15 2021-08-19 NuID, Inc. Methods and systems for universal storage and access to user-owned credentials for trans-institutional digital authentication
CN113706150A (en) * 2021-10-27 2021-11-26 深圳前海微众银行股份有限公司 Block confirmation method and device

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
GB201715423D0 (en) * 2017-09-22 2017-11-08 Nchain Holdings Ltd Computer-implemented system and method
US11277389B2 (en) * 2018-11-27 2022-03-15 Advanced New Technologies Co., Ltd. System and method for information protection
CN109840771A (en) * 2019-04-01 2019-06-04 西安电子科技大学 A kind of block chain intimacy protection system and its method based on homomorphic cryptography
US11036872B2 (en) * 2019-07-25 2021-06-15 Sap Se Privacy-preserving sum-based consistency checks for blockchains
US11373171B2 (en) * 2020-01-22 2022-06-28 Mastercard International Incorporated Method and system for prevention of lost currency in blockchain networks to missing wallets
CN112365252A (en) * 2020-07-31 2021-02-12 深圳市网心科技有限公司 Account model-based privacy transaction method and device and related equipment

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20180097614A1 (en) * 2016-09-30 2018-04-05 Intel Corporation Cascading multivariate quadratic identification schemes for chain of trust
US20210258164A1 (en) * 2017-03-15 2021-08-19 NuID, Inc. Methods and systems for universal storage and access to user-owned credentials for trans-institutional digital authentication
CN109359974A (en) * 2018-08-30 2019-02-19 阿里巴巴集团控股有限公司 Block chain method of commerce and device, electronic equipment
CN111709738A (en) * 2020-05-18 2020-09-25 杜晓楠 Method for hiding transaction amount in blockchain system, computer readable storage medium and blockchain system
CN112383389A (en) * 2021-01-08 2021-02-19 索信达(北京)数据技术有限公司 Block chain random number generation method and system
CN113706150A (en) * 2021-10-27 2021-11-26 深圳前海微众银行股份有限公司 Block confirmation method and device

Also Published As

Publication number Publication date
CN113706150A (en) 2021-11-26
CN113706150B (en) 2022-02-08

Similar Documents

Publication Publication Date Title
CN111181720B (en) Service processing method and device based on trusted execution environment
WO2021238527A1 (en) Digital signature generation method and apparatus, computer device, and storage medium
KR101999188B1 (en) Secure personal devices using elliptic curve cryptography for secret sharing
CN110391900B (en) Private key processing method based on SM2 algorithm, terminal and key center
CN110881063B (en) Storage method, device, equipment and medium of private data
CN110032876B (en) Method, node and storage medium for implementing privacy protection in block chain
US11616636B2 (en) Hash updating methods and apparatuses of blockchain integrated station
CN110033266B (en) Method, node and storage medium for implementing privacy protection in block chain
WO2022078398A1 (en) Blockchain-based sub-account transaction processing method and system, device and medium
CN110601855B (en) Root certificate management method and device, electronic equipment and storage medium
CN110351297B (en) Verification method and device applied to block chain
WO2020020127A1 (en) Private key storage and reading method and apparatus, and hardware device
CN113326525B (en) Data processing method and device based on intelligent contract
CN110059497B (en) Method, node and storage medium for implementing privacy protection in block chain
WO2021109718A1 (en) Verification method and apparatus based on block chain system
CN110716724B (en) Method and device for realizing privacy block chain based on FPGA
CN111523889B (en) Multiple signature implementation method, device, equipment and storage medium
WO2023070831A1 (en) Block confirmation method and device
CN112287366A (en) Data encryption method and device, computer equipment and storage medium
CN115834064B (en) Secure multi-party computing method, device, system, equipment and storage medium
JP2016157055A (en) Encryption system, authentication system, encryption device, decryption device, authenticator generation device, verification device, encryption method, and authentication method
CN111460463B (en) Electronic certificate preserving and notarizing method, device, equipment and storage medium
CN117155549A (en) Key distribution method, key distribution device, computer equipment and storage medium
CN115118411B (en) Method, device and equipment for down-link multi-party trusted computing and storage medium
CN114553557B (en) Key calling method, device, computer equipment and storage medium

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 21962174

Country of ref document: EP

Kind code of ref document: A1