CN117828647B - Block chain transaction uplink method, related device and medium - Google Patents
Block chain transaction uplink method, related device and medium Download PDFInfo
- Publication number
- CN117828647B CN117828647B CN202410244009.0A CN202410244009A CN117828647B CN 117828647 B CN117828647 B CN 117828647B CN 202410244009 A CN202410244009 A CN 202410244009A CN 117828647 B CN117828647 B CN 117828647B
- Authority
- CN
- China
- Prior art keywords
- transaction
- signature
- blockchain
- target
- uplink
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
- 238000000034 method Methods 0.000 title claims abstract description 100
- 238000012795 verification Methods 0.000 claims abstract description 118
- 238000012790 confirmation Methods 0.000 claims abstract description 29
- 238000004364 calculation method Methods 0.000 claims description 41
- 238000012545 processing Methods 0.000 claims description 39
- 238000013507 mapping Methods 0.000 claims description 34
- 238000004590 computer program Methods 0.000 claims description 16
- 230000015654 memory Effects 0.000 claims description 11
- 238000012216 screening Methods 0.000 claims description 9
- 238000005516 engineering process Methods 0.000 abstract description 19
- 238000013473 artificial intelligence Methods 0.000 abstract description 12
- 230000008569 process Effects 0.000 description 26
- 238000010586 diagram Methods 0.000 description 20
- 230000008901 benefit Effects 0.000 description 15
- 238000004422 calculation algorithm Methods 0.000 description 15
- 230000006870 function Effects 0.000 description 15
- 238000010200 validation analysis Methods 0.000 description 10
- 230000004044 response Effects 0.000 description 6
- 238000004891 communication Methods 0.000 description 4
- 230000003993 interaction Effects 0.000 description 4
- 238000012856 packing Methods 0.000 description 4
- 108010016634 Seed Storage Proteins Proteins 0.000 description 3
- 230000008878 coupling Effects 0.000 description 3
- 238000010168 coupling process Methods 0.000 description 3
- 238000005859 coupling reaction Methods 0.000 description 3
- 238000011160 research Methods 0.000 description 3
- 238000013459 approach Methods 0.000 description 2
- 238000013500 data storage Methods 0.000 description 2
- 230000001419 dependent effect Effects 0.000 description 2
- 238000013461 design Methods 0.000 description 2
- 230000000694 effects Effects 0.000 description 2
- 238000001914 filtration Methods 0.000 description 2
- 238000012549 training Methods 0.000 description 2
- 238000013475 authorization Methods 0.000 description 1
- 230000005540 biological transmission Effects 0.000 description 1
- 230000000903 blocking effect Effects 0.000 description 1
- 238000000354 decomposition reaction Methods 0.000 description 1
- 238000013135 deep learning Methods 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 239000000284 extract Substances 0.000 description 1
- 238000010801 machine learning Methods 0.000 description 1
- 238000012423 maintenance Methods 0.000 description 1
- 230000007246 mechanism Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000003058 natural language processing Methods 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 230000002085 persistent effect Effects 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
- 238000012360 testing method Methods 0.000 description 1
- 238000013519 translation Methods 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F21/00—Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
- G06F21/60—Protecting data
- G06F21/604—Tools and structures for managing or administering access control systems
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F21/00—Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
- G06F21/60—Protecting data
- G06F21/62—Protecting access to data via a platform, e.g. using keys or access control rules
- G06F21/6218—Protecting access to data via a platform, e.g. using keys or access control rules to a system of files or objects, e.g. local or distributed file system or database
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Computer Security & Cryptography (AREA)
- Bioethics (AREA)
- General Health & Medical Sciences (AREA)
- Computer Hardware Design (AREA)
- Health & Medical Sciences (AREA)
- Software Systems (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Databases & Information Systems (AREA)
- Automation & Control Theory (AREA)
- Financial Or Insurance-Related Operations Such As Payment And Settlement (AREA)
Abstract
The present disclosure provides a blockchain transaction chaining method, related apparatus and medium. The method is applied to a master consensus node of a plurality of consensus nodes on a blockchain, and comprises the following steps: receiving a pseudo-uplink request for a target transaction, wherein the pseudo-uplink request comprises a first transaction signature of the target transaction, and the first transaction signature does not accord with a first signing verification rule; recording the target transaction and the first transaction signature to a blockchain; receiving a uplink confirmation request aiming at a target transaction, wherein the uplink confirmation request comprises a second transaction signature of the target transaction, and the second transaction signature accords with a first signature verification rule; when it is determined that the uplink acknowledgement request matches a target transaction in the blockchain, the target transaction contained in the uplink acknowledgement request is recorded to the blockchain with a second transaction signature that allows the target transaction to be accessed. The method and the device can improve accuracy and flexibility of transaction uplink. The present disclosure is applicable to various scenarios of blockchain, artificial intelligence, cloud technology, and the like.
Description
Technical Field
The present disclosure relates to the field of blockchain technologies, and in particular, to a blockchain transaction uplink method, related devices, and medium.
Background
Currently, in a blockchain transaction chaining process, an object cannot be retired and altered once it submits a signed transaction to be chained to the blockchain system. This situation may cause that the transaction to be uplink submitted by the misoperation or the transaction to be uplink with higher risk cannot be confirmed twice or cannot be withdrawn in time, which may reduce flexibility and accuracy of the transaction uplink in the blockchain.
Disclosure of Invention
The embodiment of the disclosure provides a block chain transaction uplink method, a related device and a medium, which can improve the accuracy and flexibility of transaction uplink.
According to an aspect of the present disclosure, there is provided a blockchain transaction uplink method applied to a master consensus node among a plurality of consensus nodes on a blockchain, the method comprising:
Receiving a pseudo-uplink request for a target transaction, wherein the pseudo-uplink request includes a first transaction signature of the target transaction, the first transaction signature not conforming to a first signing rule that allows the first transaction signature to pass a first signing when the target transaction is recorded with the first transaction signature to a blockchain, thereby accessing the target transaction on the blockchain;
Recording the target transaction with the first transaction signature to the blockchain;
Receiving a uplink confirmation request aiming at the target transaction, wherein the uplink confirmation request comprises a second transaction signature of the target transaction, and the second transaction signature accords with a first signature verification rule;
when it is determined that the uplink acknowledgement request matches the target transaction in the blockchain, the target transaction contained in the uplink acknowledgement request is recorded to the blockchain along with the second transaction signature that allows the target transaction to be accessed.
According to an aspect of the present disclosure, there is provided a blockchain transaction uplink device for application to a master consensus node of a plurality of consensus nodes on a blockchain, the device comprising:
A first receiving unit configured to receive a pseudo-uplink request for a target transaction, where the pseudo-uplink request includes a first transaction signature of the target transaction, the first transaction signature not conforming to a first signing rule that allows the first transaction signature to pass a first signing when the target transaction is recorded with the first transaction signature to a blockchain, thereby accessing the target transaction on the blockchain;
A first recording unit configured to record the target transaction and the first transaction signature together to the blockchain;
A second receiving unit, configured to receive a uplink acknowledgement request for the target transaction, where the uplink acknowledgement request includes a second transaction signature of the target transaction, and the second transaction signature conforms to a first signature verification rule;
A second recording unit configured to record, when it is determined that the uplink acknowledgement request matches the target transaction in the blockchain, the target transaction included in the uplink acknowledgement request to the blockchain together with the second transaction signature, the second transaction signature allowing the target transaction to be accessed.
Optionally, the first recording unit includes:
a signature checking subunit, configured to perform a second signature checking on the first transaction signature;
A generation subunit configured to generate a proposal signature of the target transaction if the second verification passes, and generate a first target block based on the target transaction, the first transaction signature, and the proposal signature;
And the consensus subunit is used for sending the first target block to a slave consensus node in a plurality of consensus nodes, so that the slave consensus node can consensus the target transaction based on the proposal signature and record the target transaction and the first transaction signature together into the blockchain.
Optionally, the generating subunit is configured to:
Signing the target transaction by using a second private key of the main consensus node to obtain the proposal signature;
The consensus subunit is configured to:
and the slave consensus nodes check the target transaction based on the proposal signature by using a second public key of the master consensus node until a preset number of the slave consensus nodes pass the check, and the completion of the consensus is determined.
Optionally, the first transaction signature is obtained by double signing the target transaction based on a first private key of an object and a second public key of the master consensus node;
The check sub-unit is used for:
signing the first transaction signature based on a second private key of the primary consensus node and a first public key of the object;
if the first transaction signature is determined to be successfully signed, determining that the second signature passes;
if the first transaction signature is determined to fail to be signed, the second signature is determined to not pass, and the fake uplink request is rejected.
Optionally, the signing the first transaction signature based on the second private key of the primary consensus node and the first public key of the object includes:
Performing a first sub-signature verification on the first transaction signature by using a second private key of the main consensus node to obtain a first sub-signature verification result;
And carrying out second sub-signature verification on the first sub-signature verification result by using the first public key of the object.
Optionally, the first transaction signature is generated by:
Signing a first transaction abstract of the target transaction based on a first private key of the object to obtain an abstract signature result;
and signing the digest signature result based on a second public key of the main consensus node to obtain the first transaction signature.
Optionally, the target transaction in the blockchain has a first transaction digest, and the target transaction included in the uplink acknowledgement request has a second transaction digest;
The determining that the uplink acknowledgement request matches the target transaction in the blockchain includes:
comparing the second transaction digest with the first transaction digest;
If it is determined that the second transaction digest is consistent with the first transaction digest, determining that the uplink acknowledgment request matches the target transaction in the blockchain;
If it is determined that the second transaction digest is inconsistent with the first transaction digest, determining that the uplink acknowledgment request does not match the target transaction in the blockchain, rejecting the uplink acknowledgment request, and discarding the target transaction contained in the uplink acknowledgment request.
Optionally, the second recording unit is configured to:
Performing signature verification on the second transaction signature;
Generating a second target block based on the target transaction, the second transaction signature, if the signature verification passes;
the second target chunk is sent to a slave consensus node of a plurality of consensus nodes, such that the slave consensus node consensus the target transaction based on the second transaction signature and records the target transaction and the second transaction signature together to the blockchain.
Optionally, the signature verification of the second transaction signature includes:
Performing summary operation on the transaction content of the target transaction to obtain a target summary result;
Comparing the target abstract result with a first calculation result of a first public key of an object and a second calculation result of the second transaction signature and a preset reference parameter;
and if the first calculation result is determined to be consistent with the second calculation result, determining that the signature verification is passed.
Optionally, the predetermined reference parameter is determined by:
Determining a target elliptic curve from a plurality of candidate elliptic curves;
determining, for the target elliptic curve, an order parameter of the target elliptic curve in a predetermined finite field;
determining cofactors of the target elliptic curve based on the order parameters;
The predetermined reference parameter is determined based on the cofactor and a target point selected on the target elliptic curve.
Optionally, the target transaction included in the uplink acknowledgement request has a second transaction digest, and the blockchain includes a plurality of candidate transactions, each of which has a third transaction digest;
the blockchain transaction chaining device further includes a first updating unit configured to:
comparing the second transaction digest with a third transaction digest of the plurality of candidate transactions recorded on the blockchain;
setting the transaction state of the candidate transaction, in which the third transaction digest is consistent with the second transaction digest, to a confirmed state.
Optionally, the first public key of the object is obtained by:
determining an object identification and a blockchain address of the object;
Performing key screening on a plurality of candidate keys in a pre-acquired key mapping table based on the object identifier and the blockchain address, wherein the key mapping table comprises a plurality of candidate keys and candidate object identifiers and candidate blockchain addresses corresponding to the candidate keys;
the candidate key whose object identification is consistent with the object identification and whose blockchain address is consistent with the blockchain address is determined to be the first public key.
Optionally, the key mapping table is generated by:
obtaining candidate object identifiers and candidate blockchain addresses of a plurality of candidate objects, and object public keys of the candidate objects;
Determining the candidate object identification and the candidate blockchain address as keywords and determining the object public key as a value for each candidate object;
determining a plurality of mapping relationships based on the keywords and the values of the respective candidate objects;
And generating the key mapping table based on a plurality of mapping relations.
Optionally, the primary consensus node is determined by:
determining node credibility and node processing capacity of each consensus node;
The primary consensus node is determined from a plurality of the consensus nodes based on the node reputation and the node processing capability.
Optionally, the determining the primary consensus node from the plurality of consensus nodes based on the node reputation and the node processing capability includes:
determining, for each of the consensus nodes, a first score based on the node reputation;
determining, for each of the consensus nodes, a second score based on the node processing capabilities;
determining a total score for the consensus node based on the first score and the second score;
the primary consensus node is determined among a plurality of the consensus nodes based on the total score.
Optionally, the target transaction has a transaction timestamp;
the blockchain transaction chaining device further includes a second updating unit configured to:
Determining a time difference between the transaction timestamp and a current time;
and if the time difference is determined to be larger than a preset threshold value, setting the transaction state of the target transaction recorded on the blockchain to be a failure state.
Optionally, the first public key and the first private key of the object are generated by:
Determining a target random number for generating a key from a plurality of candidate random numbers in response to a key pair generation request of the object;
Determining the first private key of the object based on the target random number;
the first public key is generated based on the first private key and a predetermined reference parameter.
According to an aspect of the present disclosure, there is provided an electronic device comprising a memory storing a computer program and a processor implementing a blockchain transaction chaining method as described above when executing the computer program.
According to an aspect of the present disclosure, there is provided a computer readable storage medium storing a computer program which, when executed by a processor, implements a blockchain transaction chaining method as described above.
According to an aspect of the present disclosure, there is provided a computer program product comprising a computer program that is read and executed by a processor of a computer device to cause the computer device to perform the blockchain transaction chaining method as described above.
In the embodiment of the disclosure, the uplink of a transaction is divided into two stages aiming at the problem of poor uplink accuracy and flexibility caused by irrevocability once the signed transaction to be uplink is submitted for uplink in a block chain scene. In a first phase, a pseudo-uplink request is sent to a primary consensus node of the blockchain, the pseudo-uplink request having a target transaction and a first transaction signature, the first transaction signature being non-compliant with a first signing rule. When the target transaction and the corresponding signature are linked, the master consensus node and the slave consensus node can only read the target transaction from the blockchain if the signature meets the first signature verification rule. If the first signature verification rule is not met, even if the master consensus node and the slave consensus node see that the target transaction exists on the blockchain, the target transaction cannot be read, so after the target transaction and the first transaction signature are linked together, the target transaction is illegal, and the target transaction is equivalent to being in a state which can be withdrawn at any time. In the second phase, when a request for a target transaction is received, the actual request for a uplink acknowledgment includes a second transaction signature that complies with the first validation rule. After the target transaction and the second transaction signature are both uplink, the target transaction is allowed to be accessed, and the actual uplink of the target transaction is realized. The first time the dummy uplink is false, but the first time the uplink is still to be performed is in the sense that, because the master and slave consensus nodes are mutually in the multi-round consensus of the blockchain, the consensus node that received the uplink acknowledgement request may not already be the consensus node that received the dummy uplink request, and therefore it is not possible to compare locally whether the transaction indicated by the uplink acknowledgement request is a previously pseudo-uplink transaction. The method can realize the disclosure of the prior pseudo uplink information, is convenient for transaction comparison during uplink confirmation, and can better improve the accuracy and flexibility of transaction uplink.
Additional features and advantages of the disclosure will be set forth in the description which follows, and in part will be apparent from the description, or may be learned by practice of the disclosure. The objectives and other advantages of the disclosure will be realized and attained by the structure particularly pointed out in the written description and claims hereof as well as the appended drawings.
Drawings
The accompanying drawings are included to provide a further understanding of the disclosed embodiments and are incorporated in and constitute a part of this specification, illustrate embodiments of the disclosure and together with the description serve to explain, without limitation, the disclosed embodiments.
FIG. 1 is an architecture diagram of a system to which a blockchain transaction chaining method applies in accordance with embodiments of the present disclosure;
FIG. 2A is a schematic diagram of a blockchain transaction chaining method application in a transaction chaining scenario in accordance with the related art;
FIG. 2B is a schematic diagram of a blockchain transaction chaining method application in a transaction chaining scenario in accordance with an embodiment of the present disclosure;
FIG. 3 is a flow diagram of a blockchain transaction chaining method in accordance with an embodiment of the present disclosure;
FIG. 4 is a flow diagram of generating a first transaction signature according to one embodiment of the present disclosure;
FIG. 5 is a flow diagram of recording a target transaction with a first transaction signature to a blockchain in accordance with an embodiment of the present disclosure;
FIG. 6 is a flow chart of a second signing of a first transaction signature in accordance with one embodiment of the present disclosure;
FIG. 7 is a schematic diagram of an implementation process of recording a target transaction with a first transaction signature to a blockchain in accordance with an embodiment of the present disclosure;
FIG. 8 is a flow diagram of determining that a uplink acknowledgement request matches a target transaction in a blockchain in accordance with an embodiment of the present disclosure;
FIG. 9 is a flow diagram of recording a target transaction with a second transaction signature to a blockchain in accordance with an embodiment of the present disclosure;
FIG. 10 is a flow diagram of signature verification of a second transaction signature of a target transaction according to one embodiment of the present disclosure;
FIG. 11 is a schematic diagram of an implementation process of recording a target transaction with a second transaction signature to a blockchain in accordance with an embodiment of the present disclosure;
FIG. 12 is a flow chart of updating a transaction state of a target transaction according to one embodiment of the present disclosure;
FIG. 13 is a flow chart of updating a transaction state of a target transaction according to another embodiment of the present disclosure;
FIG. 14 is a flow chart of obtaining a first public key according to one embodiment of the present disclosure;
FIG. 15 is a flow chart of generating a key map according to one embodiment of the present disclosure;
FIG. 16 is a schematic diagram of the structure of a key map according to one embodiment of the present disclosure;
FIG. 17 is a flow chart of generating a first public key and a first private key according to one embodiment of the present disclosure;
FIG. 18 is a flow chart of determining a primary consensus node according to an embodiment of the present disclosure;
FIG. 19 is a flow chart of determining a primary consensus node based on a total score according to an embodiment of the present disclosure;
FIG. 20 is a schematic diagram of an implementation process of determining a total score for a consensus node according to an embodiment of the present disclosure;
FIG. 21 is a block diagram of a blockchain transaction chaining device in accordance with an embodiment of the present disclosure;
FIG. 22 is a terminal block diagram of a blockchain transaction chaining method in accordance with an embodiment of the present disclosure;
FIG. 23 is a server block diagram of a blockchain transaction chaining method in accordance with an embodiment of the present disclosure.
Detailed Description
In order to make the objects, technical solutions and advantages of the present disclosure more apparent, the present disclosure will be further described in detail with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the present disclosure.
Before proceeding to further detailed description of the disclosed embodiments, the terms and terms involved in the disclosed embodiments are described, which are applicable to the following explanation:
Artificial intelligence (ARTIFICIAL INTELLIGENCE, AI) is the theory, method, technique, and application system that simulates, extends, and extends human intelligence using a digital computer or a machine controlled by a digital computer, perceives the environment, obtains knowledge, and uses the knowledge to obtain optimal results. In other words, artificial intelligence is an integrated technology of computer science that attempts to understand the essence of intelligence and to produce a new intelligent machine that can react in a similar way to human intelligence. Artificial intelligence, i.e. research on design principles and implementation methods of various intelligent machines, enables the machines to have functions of sensing, reasoning and decision. The artificial intelligence technology is a comprehensive subject, and relates to the technology with wide fields, namely the technology with a hardware level and the technology with a software level. Artificial intelligence infrastructure technologies generally include, for example, sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, big data processing technologies, pre-training model technologies, operation/interaction systems, mechatronics, and the like. The pre-training model is also called a large model and a basic model, and can be widely applied to all large-direction downstream tasks of artificial intelligence after fine adjustment. The artificial intelligence software technology mainly comprises a computer vision technology, a voice processing technology, a natural language processing technology, machine learning/deep learning and other directions. With research and advancement of artificial intelligence technology, research and application of artificial intelligence technology is being developed in various fields, such as common smart home, smart wearable devices, virtual assistants, smart speakers, smart marketing, unmanned, automatic driving, unmanned aerial vehicles, robots, smart medical treatment, smart customer service, etc., and it is believed that with the development of technology, artificial intelligence technology will be applied in more fields and with increasing importance value.
Blockchain: blockchains are novel application modes of computer technologies such as distributed data storage, point-to-point transmission, consensus mechanisms, encryption algorithms, and the like. The blockchain is essentially a de-centralized database, which is a series of data blocks that are generated in association using cryptographic methods, each of which contains a batch of information for a transaction that verifies the validity (anti-counterfeit) of its information and associates with the previous block.
Currently, in a blockchain transaction chaining process, an object cannot be retired and altered once it submits a signed transaction to be chained to the blockchain system. This situation may cause that the transaction to be uplink submitted by the misoperation or the transaction to be uplink with higher risk cannot be confirmed twice or cannot be withdrawn in time, which may reduce the security and accuracy of the transaction uplink in the blockchain.
System architecture and scenario description applied to embodiments of the present disclosure
FIG. 1 is a system architecture diagram to which a blockchain transaction chaining method is applied in accordance with embodiments of the present disclosure. It includes an object terminal 140, the internet 130, a gateway 120, a blockchain server 110, etc.
The object terminal 140 includes various forms of a desktop computer, a laptop computer, a PDA (personal digital assistant), a mobile phone, a car terminal, a home theater terminal, a dedicated terminal, and the like. In addition, the device can be a single device or a set of a plurality of devices. The object terminal 140 may communicate with the internet 130 in a wired or wireless manner, exchanging data. Wherein the object terminal 140 comprises a transaction processing system for providing objects with a signature and a chaining of transactions.
Referring to the blockchain server 110 shown in fig. 1, it includes a consensus network 160. Consensus network 160, which refers to a network that performs a consensus of a transaction to be uplinked on a blockchain, includes a plurality of consensus nodes. The consensus node is the blockchain node. The common node or the blockchain node may be a server in the blockchain server or an object terminal in the access blockchain server, and the specific form of the common node or the blockchain node is not limited herein.
Gateway 120 is also known as an intersubnetwork connector, protocol converter. The gateway implements network interconnection on the transport layer, and is a computer system or device that acts as a translation. The gateway is a translator between two systems using different communication protocols, data formats or languages, and even architectures that are quite different. At the same time, the gateway may also provide filtering and security functions. The message sent by the subject terminal 140 to the blockchain server 110 is to be sent to the corresponding blockchain server 110 through the gateway 120. A message sent by the blockchain server 110 to the subject terminal 140 is also sent to the corresponding subject terminal 140 through the gateway 120.
The case where the related art transaction uplink method is applied to the transaction uplink scenario will be described in detail with reference to fig. 2A.
As shown in fig. 2A, when a transaction is to be uplink, an object a first signs a transaction M to be uplink by using its own object private key, so as to obtain a transaction M signed by the object private key. The object private key signed transaction M is then sent to the verifier, where the verifier refers to the master consensus node on the blockchain. Further, the master consensus node of the blockchain first verifies the signature of transaction M. After the signature verification of the transaction M passes, the master consensus node of the blockchain packages the transaction M into blocks, and after the block is commonly known, records the transaction M of the blocks onto the blockchain.
The method can record the transaction of which the object wants to be uplinked into the blockchain, and achieves the transaction uplinking. However, the transaction in this approach is a once signed transaction, which once sent to the primary consensus node of the blockchain, does not support revocation nor secondary validation. Therefore, when a transaction is sent to a main consensus node of a blockchain under the situation of misoperation or an attack with no goodwill is sent to the main consensus node of the blockchain, the transaction cannot be withdrawn in time, which causes a large security risk and resource loss to an object, and reduces the security and accuracy of the uplink of the transaction.
Compared with the related art, the embodiment of the disclosure provides a scheme for enabling an object to acknowledge or withdraw a transmitted transaction to be uplink, so that the transaction to be uplink is normally uplink after the object is acknowledged, and the security of the uplink of the transaction is improved. The embodiment of the disclosure can be applied to various scenes, such as a transaction uplink scene shown in fig. 2B.
As shown in fig. 2B, when a transaction is being uplinked, object a first broadcasts the pre-generated transaction to the consensus network such that the consensus network receives the pre-generated transaction at the master consensus node of the current consensus round. Wherein the pre-generated transaction is a twice signed transaction M to be chained. The primary consensus node of the consensus network at the current consensus round is the presenter 1. Next, the proposer 1 will check the signature of the pre-generated transaction, and after the signature of the pre-generated transaction passes the check, the proposer 1 will package the pre-generated transaction into the block X and uplink the block X so that the pre-generated transaction is recorded on the blockchain, wherein the pre-generated transaction is recorded on the blockchain and can indicate the specific content of the transaction M but is illegal. When the object is to withdraw the pre-generated transaction, and the transaction recorded on the blockchain and capable of indicating the concrete content of the transaction M is invalid, the object does not confirm the pre-generated transaction. If the object A confirms the pre-generated transaction, when the object A confirms the pre-generated transaction, a corresponding confirmation transaction is generated. Object a will then broadcast the acknowledgement transaction to the consensus network so that the consensus network receives the acknowledgement transaction at the master consensus node of the current consensus round, where the consensus network is the proposer 2. Further, the proposer 2 will check the signature of the validation transaction, and after the signature of the validation transaction passes, the proposer 2 will package the validation transaction into the block x+n and uplink the block x+n, so that the validation transaction is recorded on the blockchain. Where block x+n is the block that is to be uplinked after block X, the validation transaction is a legal transaction recorded on the blockchain and can indicate the specific contents of transaction M.
General description of embodiments of the disclosure
According to one embodiment of the present disclosure, a blockchain transaction chaining method is provided.
The blockchain transaction chaining method is generally applied to a blockchain service scenario in which a transaction supporting a chaining is required to be withdrawn or secondarily acknowledged, for example, a transaction chaining scenario shown in fig. 2B. The embodiment of the disclosure provides a scheme for enabling an object to confirm or withdraw a transmitted transaction to be uplink, so that the transaction to be uplink is normally uplink after the object is confirmed, and the flexibility and accuracy of the transaction uplink are improved.
The blockchain transaction chaining method of embodiments of the present disclosure may be performed by a master consensus node of a plurality of consensus nodes in a blockchain server.
As shown in fig. 3, a blockchain transaction chaining method according to one embodiment of the present disclosure may include:
Step 310, receiving a pseudo uplink request for a target transaction;
Step 320, recording the target transaction and the first transaction signature together into a blockchain;
step 330, receiving a ul acknowledgement request for the target transaction;
Step 340, when it is determined that the uplink acknowledgement request matches the target transaction in the blockchain, the target transaction contained in the uplink acknowledgement request is recorded to the blockchain along with the second transaction signature.
Steps 310-340 are described in detail below.
In step 310, a pseudo-uplink request for a target transaction is received.
A pseudo-uplink request is a request that the object wants to record a target transaction onto the blockchain. The pseudo-uplink request contains a first transaction signature of the target transaction.
The target transaction is used for indicating a resource interaction party, the number of resources interacted, the type of the resources and the like involved in a certain resource interaction process.
In the blockchain scenario, the transaction content of the transactions to be uplinked is used to indicate the process of transferring digital resources from one resource pool to another, each transaction to be uplinked is recorded onto the blockchain and needs to be validated and confirmed to be valid and legal.
The target transaction of an embodiment of the present disclosure is one of the transactions to be uplink.
The first transaction signature is obtained by encrypting the transaction contents of the target transaction. The first transaction signature is a signature obtained by at least two encryptions. The first transaction signature does not conform to the first signing rule.
In an embodiment of the disclosure, the first tag verification rule allows the first transaction signature to pass the first tag when the target transaction is recorded with the first transaction signature to the blockchain, thereby accessing the target transaction on the blockchain. Since the first transaction signature does not conform to the first signing rule, even if the target transaction and the first transaction signature are recorded together on the blockchain, the consensus node except the master consensus node cannot normally access the target transaction.
In this embodiment, when the object wants to uplink a certain transaction, the object encrypts the transaction at least twice, obtains a transaction signature of the transaction, takes the transaction as a target transaction, and takes the transaction signature as a first transaction signature. Further, the target transaction, and the first transaction signature are transmitted to a master consensus node of the plurality of consensus nodes of the blockchain in the form of a pseudo-uplink request. Based on this, the master consensus node of the blockchain receives a pseudo-uplink request for the target transaction, obtains the specific transaction content of the target transaction, and the first transaction signature.
In step 320, the target transaction is recorded to the blockchain along with the first transaction signature.
In a specific implementation of this embodiment, the master consensus node first performs signature verification on the first transaction signature, then packages the target transaction and the first transaction signature into blocks after successful signature verification, sends the blocks to the slave consensus node for consensus, and records the target transaction and the first transaction signature together into the blockchain after successful consensus.
Wherein, the slave consensus nodes refer to other consensus nodes except the master consensus node in the block chain in the current consensus round.
For economy, the specific implementation of the disclosed embodiments of recording a target transaction with a first transaction signature to a blockchain will be described in detail below. And will not be described in detail herein.
In step 330, a uplink acknowledgement request for the target transaction is received.
The uplink acknowledgement request contains a second transaction signature of the target transaction, the second transaction signature conforming to the first signing rule.
The second transaction signature is the result of signing the target transaction once.
In this embodiment, when the object wants to perform uplink acknowledgement on the target transaction, the object signs the target transaction once, so as to obtain a second transaction signature of the target transaction. Further, the target transaction and the second transaction signature are sent to a master consensus node of the plurality of consensus nodes of the blockchain in the form of a uplink acknowledgement request. Based on the information, the master consensus node of the blockchain receives the uplink confirmation request for the target transaction, obtains the specific transaction content of the target transaction, and the second transaction signature of the target transaction.
Further, when the object is to withdraw the target transaction, the object does not acknowledge the target transaction. Since the first transaction signature of the target transaction does not enable the target transaction to be normally accessed, the target transaction previously recorded onto the blockchain is illegal, and therefore the illegal target transaction recorded onto the blockchain is essentially invalid, the uncertainty of the object may be considered as a revocation to the target transaction.
In step 340, when it is determined that the uplink acknowledgement request matches the target transaction in the blockchain, the target transaction contained in the uplink acknowledgement request is recorded to the blockchain along with the second transaction signature.
In this embodiment, the master consensus node first matches a target transaction indicated by the uplink acknowledgement request with a plurality of uplink transactions recorded in the blockchain, and determines that the uplink acknowledgement request matches a target transaction in the blockchain when there is some uplink transaction that is the same as the target transaction indicated by the uplink acknowledgement. Further, the master consensus node performs signature verification on the second transaction signature, and after the signature verification is successful, the second transaction signature and the target transaction are packaged into blocks and sent to the slave consensus node for consensus and uplink. The second transaction signature accords with the first signing verification rule, so that when the target transaction and the second transaction signature are recorded together to the blockchain, the second transaction signature enables the target entity to be accessed through signing verification, and the second transaction signature enables the target transaction to be accessed.
For economy, the specific implementation of determining that the uplink acknowledgment request matches the target transaction in the blockchain, and recording the target transaction contained in the uplink acknowledgment request to the blockchain along with the second transaction signature in embodiments of the present disclosure will be described in detail below. And will not be described in detail herein.
Through steps 310-340 described above, the disclosed embodiments divide the uplink of a transaction into two phases, for the problem of poor uplink accuracy and flexibility caused by irrevocability once a signed transaction to be uplink is submitted for uplink in a blockchain scenario. In a first phase, a pseudo-uplink request is sent to a primary consensus node of the blockchain, the pseudo-uplink request having a target transaction and a first transaction signature, the first transaction signature being non-compliant with a first signing rule. When the target transaction and the corresponding signature are linked, the master consensus node and the slave consensus node can only read the target transaction from the blockchain if the signature meets the first signature verification rule. If the first signature verification rule is not met, even if the master consensus node and the slave consensus node see that the target transaction exists on the blockchain, the target transaction cannot be read, so after the target transaction and the first transaction signature are linked together, the target transaction is illegal, and the target transaction is equivalent to being in a state which can be withdrawn at any time. In the second phase, when a request for a target transaction is received, the actual request for a uplink acknowledgment includes a second transaction signature that complies with the first validation rule. After the target transaction and the second transaction signature are both uplink, the target transaction is allowed to be accessed, and the actual uplink of the target transaction is realized. The first time the dummy uplink is false, but the first time the uplink is still to be performed is in the sense that, because the master and slave consensus nodes are mutually in the multi-round consensus of the blockchain, the consensus node that received the uplink acknowledgement request may not already be the consensus node that received the dummy uplink request, and therefore it is not possible to compare locally whether the transaction indicated by the uplink acknowledgement request is a previously pseudo-uplink transaction. The method can realize the disclosure of the prior pseudo uplink information, is convenient for transaction comparison during uplink confirmation, and can better improve the accuracy and flexibility of transaction uplink.
The above is a general description of steps 310-340. Since steps 310 and 330 are detailed in the general description above, a detailed description will be developed below with respect to specific implementations of steps 320 and 340.
Detailed description of generating a first transaction signature for a target transaction of embodiments of the present disclosure
In order to realize the withdrawability of the transaction, the embodiment of the disclosure provides a transaction signature scheme based on double encryption, which can sign the transaction to be uplink for a plurality of times, so that the signed transaction to be uplink recorded on the blockchain supports withdrawal and secondary confirmation, thereby improving the flexibility and accuracy of the transaction uplink.
Referring to FIG. 4, in one embodiment, a first transaction signature for a target transaction is generated by:
step 410, signing a first transaction digest of the target transaction based on a first private key of the object to obtain a digest signing result;
And step 420, signing the digest signature result based on the second public key of the master consensus node to obtain a first transaction signature.
Steps 410-420 are described in detail below.
In step 410, a first transaction digest of the target transaction is signed based on the first private key of the object, resulting in a digest signature result.
The digest signature result is used to indicate the encryption result of the object private key on the pre-generated transaction.
When the embodiment is specifically implemented, when the object signs the target transaction, the object firstly extracts the transaction content of the target transaction; and then, performing digest operation on the transaction content by using a hash function on the elliptic curve to obtain a first transaction digest of the target transaction. Further, the object signs the first transaction digest by using the first private key stored in the local terminal, so as to obtain a digest signature result.
In step 420, the digest signature result is signed based on the second public key of the master consensus node, resulting in a first transaction signature.
The second public key refers to a public key of the master consensus node, and can be used for encryption or decryption of information encrypted by the second private key of the master consensus node.
In a common application scenario, the second public key of the master consensus node is generally public and freely available to the public.
In a specific implementation of this embodiment, the object first obtains the second public key of the primary consensus node from the public channel with authorized permissions. And then, signing the digest signing result by using the second public key to obtain a first transaction signature.
It should be noted that the signature process described above in the embodiments of the present disclosure may be a bilinear pair (bilinear pairing) based signature (BLS signature), elliptic curve signature, discrete logarithmic signature, or the like, without limitation.
Taking BLS signatures as an example, the first public-private key pair generated locally by the object is represented as { PKu, SKu }, where SKu is the first private key, PKu is the first public key, PKu = SKu ·g, G is the base point on the elliptic curve, and G is a disclosed predetermined reference parameter. Based on this, the object obtains the second public key PKp of the blockchain at the primary consensus node of the current round through the public channel with authorized permissions. Then, the object performs a digest operation on the transaction content m of the target transaction by using the hash function H (·) on the elliptic curve to obtain a first transaction digest H (m), and then the object signs the first transaction digest by using the first private key to obtain a digest signature result w, where w= SKu ·h (m). Further, the object signs the digest signature result based on the second public key of the primary consensus node, resulting in a first transaction signature Sp, sp=e (w, PKp).
It should be noted that e (·, ·) refers to bilinear pair encryption, which is an encryption algorithm in cryptography, and operations involved in the embodiments of the present disclosure are all operations on elliptic curves.
The method has the advantages that the target transaction is signed in a double-signature mode, the first private key is used for signing the transaction abstract of the target transaction, the signed transaction abstract is signed again by the second public key of the main consensus node to obtain the first transaction signature of the target transaction, the target transaction can be signed for multiple times, the target transaction recorded on the blockchain is changed into an illegal transaction, and accordingly the target transaction recorded on the blockchain supports withdrawal and secondary confirmation. In addition, the general signature verification rules of the blockchain in the related art all need to conform to a single signature, and as the second private key of the main consensus node and the first public key of the object can be utilized by the main consensus node to unlock the first transaction signature, the signature verification operation is completed, but the first transaction signature recorded on the blockchain is not the single signature and does not conform to the first signature verification rules, so that the target transaction on the blockchain cannot be read, and the flexibility and the accuracy of transaction uplink are improved.
Detailed description of step 320
In step 320, the target transaction is recorded to the blockchain along with the first transaction signature.
Referring to FIG. 5, in one embodiment, step 320 includes, but is not limited to, steps 510-530 including:
step 510, performing a second signature verification on the first transaction signature;
step 520, if the second verification passes, generating a proposal signature of the target transaction, and generating a first target block based on the target transaction, the first transaction signature, and the proposal signature;
Step 530, the first target chunk is sent to a slave consensus node of the plurality of consensus nodes to consensus the target transaction based on the proposal signature from the consensus node and record the target transaction with the first transaction signature to the blockchain.
Steps 510-530 are described in detail below.
In step 510, a second check is made on the first transaction signature.
The second verification tag is used to verify whether the target transaction provided in the pseudo-uplink request and the first transaction signature are satisfactory.
For economy, the specific implementation of the second signing of the first transaction signature according to embodiments of the present disclosure will be described in detail below. And will not be described in detail herein.
In step 520, if the second verification passes, a proposal signature for the target transaction is generated, and a first target block is generated based on the target transaction, the first transaction signature, and the proposal signature.
The proposal signature is used to indicate the result of the primary consensus node signing the target transaction.
The first target block refers to a block which is formed by packing a target transaction, a plurality of other transactions to be uplink and the like by a main consensus node in the current consensus round, but is not subjected to consensus by the other consensus nodes.
In a specific implementation of this embodiment, if it is determined that the second verification signature passes, it is indicated that the target transaction and the first transaction signature are satisfactory. Based on this, the master consensus node will first sign the target transaction, resulting in a proposal signature for the target transaction. Then, the master consensus node packages the target transaction, the first transaction signature and the proposal signature into chunks, resulting in a first target chunk.
For economy, the specific implementation of generating proposal signatures for target transactions according to embodiments of the present disclosure will be described in detail below. And will not be described in detail herein.
In step 530, the first target chunk is sent to a slave consensus node of the plurality of consensus nodes to consensus the target transaction based on the proposal signature from the consensus node and record the target transaction with the first transaction signature to the blockchain.
In a specific implementation of this embodiment, the master consensus node first transmits the first target block to the slave consensus node. Based on this, each slave consensus node first signs the proposal signature to realize the consensus of the target transaction of the first target block, and then broadcasts the consensus result of the target transaction. When a predetermined number of consensus results from the consensus nodes are successful, the target transaction is recorded with the first transaction signature to the blockchain.
It should be noted that the predetermined number may be set according to actual service requirements, and the predetermined number may be half or two thirds of the total number of the common nodes in the blockchain, and is not limited in particular.
When the target transaction is recorded with the first transaction signature to the blockchain, the first target block may be directly uplinked such that the target transaction, proposal signature, and first transaction signature are all recorded to the blockchain to improve the information comprehensiveness of the blockchain. The third target block may be generated based on the target transaction and the first transaction signature, and the third target block may be uplink to record the target transaction and the first transaction signature on the blockchain, but not record the proposal signature on the blockchain, so as to achieve the effect of saving the resource storage space of the blockchain.
Referring to FIG. 6, in one embodiment, a first transaction signature is obtained by double signing a target transaction based on a first private key of an object and a second public key of a primary consensus node; step 510 includes, but is not limited to, steps 610-630 including:
step 610, signing the first transaction signature based on the second private key of the primary consensus node and the first public key of the object;
Step 620, if it is determined that the first transaction signature is successfully signed, determining that the second signature passes;
step 630, if it is determined that the first transaction signature fails to be signed, it is determined that the second signature fails, and the pseudo uplink request is rejected.
Steps 610-630 are described in detail below.
In step 610, the first transaction signature is signed based on the second private key of the primary consensus node and the first public key of the object.
The first public key refers to a public key owned by the object, the first public key and the first private key are a pair of keys, and the first public key can be used for encryption and can also be used for decryption processing of information encrypted by the first private key.
In a common application scenario, the first public key is generally public and freely available to the public; the first private key is owned by the object in a private way and is generally stored in the local end of the object and cannot be disclosed externally.
The signing of the embodiment of the present disclosure refers to a process of decrypting a first transaction signature for verifying the first transaction signature.
In a specific implementation of this embodiment, the primary consensus node first obtains the first public key of the object, subject to the authorized license. And then, the primary consensus node performs a first sub-signature verification on the first transaction signature by using a second private key of the primary consensus node to obtain a first sub-signature verification result, wherein the first sub-signature verification result is used for indicating a result of using the second private key to perform signature decomposition on the first transaction signature. Further, the primary consensus node performs a second sub-signature verification on the first sub-signature verification result by using the first public key of the object, so as to realize signature decoding of the first transaction signature.
It should be noted that, when the primary consensus node uses the second private key and the first public key to decrypt the first transaction signature and obtains the second encrypted first transaction digest, the primary transaction signature is considered to be successfully decrypted; when the primary consensus node cannot decrypt the first transaction signature by using the second private key and the first public key and cannot normally acquire the secondarily encrypted first transaction digest, the first transaction signature is considered to be failed to be decrypted.
In step 620, if it is determined that the first transaction signature is successfully signed, then a second verification is determined to pass.
In a specific implementation of this embodiment, if it is determined that the signing of the first transaction is successful, it indicates that the target transaction is truly signed with the first private key and the second public key, and that the target transaction is satisfactory. Based on this, a second pass of the test signature is determined.
In step 630, if it is determined that the first transaction signature fails to sign, it is determined that the second signature fails and the pseudo-uplink request is denied.
In a specific implementation of this embodiment, if it is determined that the first transaction signature fails, it indicates that the target transaction is not signed with the first private key and the second public key, and that the target transaction is unsatisfactory. Based on this, it is determined that the second verification tag does not pass and the subject's pseudo-uplink request is denied.
Taking the BLS signature as an example, when performing the first verification on the target transaction based on the first transaction signature, the master consensus node may receive the target transaction and the first transaction signature according to the pseudo-ul request, where m is the transaction content of the target transaction TXpre and Sp is the first transaction signature of the target transaction TXpre, and the information in the pseudo-ul request may be represented as TXpre = { m, sp. Further, the master consensus node invokes its second private key SKp and the first public key PKu of the object, and calculates whether the equation sp=e (H (t) ·skp, PKu) holds, where H (t) is the result of the master consensus node performing the digest operation on the transaction content m of the target transaction. If the equation Sp=e (H (t). SKp, PKu) holds, it indicates that the signature of the first transaction is successfully signed, and the target transaction is satisfactory. If the equation sp=e (H (t) ·skp, PKu) does not hold, indicating that the first transaction signature untangling failed, the target transaction is unsatisfactory, the uplink request of the object is denied.
The method has the advantages that the primary consensus node can check the first transaction signature of the target transaction by using the second private key and the first public key of the object, and determine whether the target transaction and the first transaction signature meet the requirements according to the check condition, so that the rapid verification of the target transaction can be realized, and the uplink accuracy of the target transaction is improved.
In one embodiment, the generating the proposal signature of the target transaction includes:
and signing the target transaction by using a second private key of the main consensus node to obtain a proposal signature.
The second private key of the master consensus node refers to a private key of the master consensus node, and the second private key may be used for encryption or decryption of information encrypted by the second public key of the master consensus node.
In a common application scenario, the second private key of the master consensus node is generally not disclosed to the outside and is owned by the master consensus node.
In this embodiment, since the second private key of the master consensus node is stored in private by the master consensus node, after the signature verification of the first transaction signature of the target transaction is successful, the master consensus node may directly call the second private key corresponding to the second public key of the master consensus node. Further, the primary consensus node encrypts the first transaction signature with the second private key to represent its approval of the target transaction and obtain the proposal signature of the target transaction.
Taking the BLS signature as an example, when determining the proposed signature of the target transaction, the master consensus node obtains a calculation result S1 by using a calculation formula s1=skp·sp, takes the calculation result S1 as the proposed signature of the target transaction, packages the target transaction, the first transaction signature and the proposed signature together into the first target block, and stores the transaction content m of the target transaction, the first transaction signature Sp of the target transaction and the proposed signature S1 in the first target block Bi.
The method has the advantages that the main consensus node signs the target transaction by using the second private key owned by the main consensus node to obtain the proposal signature, so that the proposal signature can be used for indicating that the target transaction meets the requirement of the main consensus node, the target transaction is verified by the main consensus node, and the verification of the main consensus node is passed, so that the credibility of the target transaction is improved.
To increase the security of a blockchain system, all transactions that are up-linked to the blockchain need to be identified and verified by the identified nodes and are up-linked only after the identified nodes succeed. Based on the scheme, the scheme that the slave node carries out consensus and uplink on the target transaction of the first target block can improve the consensus safety and the consensus efficiency of the target transaction.
On the premise of using the second private key to produce the proposal signature, the above-mentioned slave consensus node performs consensus on the target transaction based on the proposal signature, and comprises:
the slave consensus nodes check the target transaction based on the proposal signature by using the second public key of the master consensus node until a preset number of slave consensus nodes determine that the consensus is completed through checking the signature.
In a specific implementation of this embodiment, for each slave consensus node, the slave consensus node first takes the second public key of the master consensus node under authorized permissions. Next, the public key is used to check the proposal signature from the consensus node. When the proposal signature can be normally signed by the second public key from the consensus node, the target transaction is considered to pass the signature verification; when the proposed signature cannot be normally signed by the secondary consensus node by using the second public key, the target transaction is considered to not pass the signature verification, and further, when a preset number of secondary consensus nodes in the blockchain are determined to pass the signature verification according to the signature verification condition of each secondary node, the consensus is considered to be completed, and the target transaction can be uplink. And when the number of the sub-consensus nodes passing through the tag verification in the blockchain is less than a preset number, the target transaction is considered to have a certain risk of being uplinked, and the target transaction cannot be uplinked.
Taking BLS signature as an example, when the master consensus node packages the target transaction, the first transaction signature, and the proposal signature into a first target block and sends the first target block to the slave consensus node, the slave consensus node uses the satisfaction or non-satisfaction of equation e (Sp, G) =e (S1, PKp) to perform consensus on the target transaction of the first target block. Where G is the base point on the elliptic curve, is a public predetermined reference parameter, sp is the first transaction signature, S1 is the proposal signature, PKp is the second public key. When verifying from the consensus node that equation e (Sp, G) =e (S1, PKp) holds, consider the target transaction to pass the tag verification, allowing the target transaction to be uplink; when the verification equation e (Sp, G) =e (S1, PKp) is not established from the consensus node, the target transaction is considered to have failed the verification and is not allowed to be uplink.
As shown in FIG. 7, a specific implementation of recording a first transaction signature along with a target transaction onto a blockchain is described. Specifically, the object first generates a target transaction at the local side and a first transaction signature for the target transaction, the implementation of which is similar to steps 410-420 described above. Then, the object sends the target transaction and the first transaction signature to the master node (the master consensus node) through the pseudo-uplink request, and the master node is the proposer of the blockchain in the current consensus round. Further, the master node verifies the first transaction signature in a manner similar to steps 610-630 described above. When the verification is passed, the master node feeds back the verification result to the object, and when the verification is not passed, the master node refuses the pseudo-uplink request of the object. Further, when the first transaction signature passes, the master node packages the first transaction signature and the target transaction to the proposed block, and broadcasts the proposed block to other consensus nodes of the blockchain network, so that the other consensus nodes of the blockchain network consensus and uplink the target transaction of the proposed block, and the specific implementation process is similar to steps 520-530 described above. For the sake of space saving, the description is omitted.
It should be noted that, when the object needs to withdraw the target transaction recorded on the blockchain, the target transaction recorded on the blockchain is inaccessible and is in a state that can be withdrawn, because the signature of the first transaction recorded on the blockchain does not conform to the first signature verification rule. At this time, the object only needs to not perform uplink confirmation on the target transaction on the blockchain. According to the first signing rule, only when a transaction is recorded on the blockchain together with a transaction signature, the transaction signature can be completely unwrapped with a public key corresponding to a private key that generated the transaction signature, the target transaction is considered to have been validated by the object, i.e., the transaction signature of the transaction validated by the object satisfies the single signing rule. The target transaction is still in a revocable state because the target transaction is considered to have been validated only if the first transaction signature can be directly unwrapped with the first public key corresponding to the first private key that generated the first transaction signature when the target transaction and the first transaction signature are both being chained together, but the first transaction signature of the present disclosure is generated via a double signature of the first private key and the master node public key, the first public key alone being unable to be fully unwrapped.
Taking BLS signature as an example, according to the first signing rule, when a target transaction and a first transaction signature are recorded together on a blockchain, only if the first transaction signature and a first public key satisfy equation e (G, S) = (h, PK), where G is a predetermined reference parameter of an elliptic curve, S is a signature (first transaction signature or second transaction signature), h is the transaction content of the target transaction, and PK is the first public key of the object, the target transaction is considered to be subject to validation. The first transaction signature and the first public key in the embodiments of the present disclosure do not satisfy the equation e (G, S) = (h, PK), so the target transaction that is based on the pseudo-uplink request is considered not a legal transaction and cannot be read. And when the target transaction and the second transaction signature are recorded together on the blockchain, the second transaction signature and the first public key can satisfy equation e (G, S) = (h, PK), so the target transaction and the second transaction signature that are to be uplinked based on the uplink acknowledgement request are legal. Based on this, when an object needs to retire a target transaction recorded on the blockchain, the transaction retirement can be achieved without performing a uplink acknowledgement for the target transaction.
Detailed description of step 340
In step 340, upon determining that the uplink acknowledgement request matches a target transaction in the blockchain, the target transaction contained in the uplink acknowledgement request is recorded to the blockchain along with a second transaction signature that allows the target transaction to be accessed.
In the disclosed embodiment, a target transaction in the blockchain has a first transaction digest and a target transaction contained in the uplink acknowledgement request has a second transaction digest and a second transaction signature.
The first transaction digest is used to indicate a digest result of transaction content for a target transaction in the pseudo-uplink request.
The second transaction digest is used to indicate a digest result of the transaction contents of the target transaction in the uplink acknowledgment request.
When the object sends the uplink acknowledgement request, the summary result (second transaction summary) of the transaction content of the target transaction in the uplink acknowledgement request is sent to the master consensus node. Wherein the second transaction digest may be represented as Hpre.
The second transaction signature is used to indicate the result of signing the target transaction once.
In the embodiment of the disclosure, the second transaction signature is a result obtained by signing the summary result of the transaction content of the target transaction by the object by using the first private key. Wherein, when the second transaction signature is generated by using the BLS signature algorithm, the second transaction signature Sc may be represented as sc=h (m) · SKu, where H (m) is a result of performing a digest operation on the transaction content m of the target transaction by using a hash function of an elliptic curve, and SKu is a first private key of the object. Based on this, the information contained in the uplink acknowledgement request is txc= { m, sc, hpre }, m is the transaction content of the target transaction, sc is the second transaction signature of the target transaction, hpre is the second transaction digest of the target transaction.
Referring to FIG. 8, in one embodiment, the process of determining that a uplink acknowledgment request matches a target transaction in a blockchain includes, but is not limited to, the steps 810-830 of:
Step 810, comparing the second transaction digest with the first transaction digest.
Step 820, if it is determined that the second transaction digest is consistent with the first transaction digest, then it is determined that the uplink acknowledgment request matches the target transaction in the blockchain.
If it is determined that the second transaction digest is inconsistent with the first transaction digest, then determining that the uplink acknowledgment request does not match the target transaction in the blockchain, rejecting the uplink acknowledgment request, and discarding the target transaction contained in the uplink acknowledgment request, step 830.
Steps 810-830 are described in detail below.
In step 810, the second transaction digest is compared to the first transaction digest.
In particular implementations of this embodiment, the transaction for which the object is to acknowledge the uplink needs to be a transaction that has been successfully recorded onto the blockchain by a pseudo-uplink request. Based on this, a second transaction digest of the target transaction indicated by the uplink acknowledgement request, as well as transaction digests of all transactions that have been recorded onto the blockchain, need to be acquired first. Wherein all transactions that have been recorded onto the blockchain are considered target transactions on the blockchain and the transaction digests of the individual transactions on the blockchain are considered first transaction digests. The second transaction digest is compared to the plurality of first transaction digests on the blockchain to determine whether the target transaction indicated by the uplink acknowledgment request has been recorded on the blockchain.
In step 820, if it is determined that the second transaction digest is consistent with the first transaction digest, it is determined that the uplink acknowledgment request matches the target transaction in the blockchain.
In particular implementations of this embodiment, if it is determined that the second transaction digest is consistent with the first transaction digest, indicating that the target transaction indicated by the uplink acknowledgment request is recorded on the blockchain, it is determined that the uplink acknowledgment request matches the target transaction in the blockchain. Wherein the target transaction in the blockchain is a transaction in which the transaction digest is consistent with the second transaction digest among all transactions of the blockchain record.
If it is determined in step 830 that the second transaction digest is not consistent with the first transaction digest, it is determined that the uplink acknowledgment request does not match the target transaction in the blockchain, the uplink acknowledgment request is denied, and the target transaction contained in the uplink acknowledgment request is discarded.
In particular implementations of this embodiment, if it is determined that the second transaction digest is inconsistent with the first transaction digest, indicating that the target transaction indicated by the uplink acknowledgment request is not recorded on the blockchain, it is determined that the uplink acknowledgment request does not match the target transaction in the blockchain, thereby rejecting the uplink acknowledgment request, and discarding the target transaction contained in the uplink acknowledgment request.
It should be noted that, for ease of understanding, in the embodiments of the present disclosure, the target transaction indicated in the pseudo-uplink request may be considered a first transaction and the target transaction indicated in the uplink acknowledgement request may be considered a second transaction. When the first transaction and the second transaction are the same transaction, the transaction content and the transaction digest of the first transaction and the second transaction are the same; when the first transaction and the second transaction are not the same transaction, the transaction content and the transaction digest of the two are different. Based on this, the blockchain transaction chaining method is to record the first transaction and the first transaction signature onto the blockchain first. When it is determined from the transaction digest that the second transaction matches the first transaction on the blockchain, it is indicated that there is a first transaction on the blockchain that indicates the same transaction content as the second transaction, and the uplink acknowledgement request is an acknowledgement request for a transaction that has been uplink but for which the transaction signature does not conform to the first signing rule. When it is determined from the transaction digest that the second transaction does not match the first transaction on the blockchain, it is indicated that there is no first transaction on the blockchain that indicates the same transaction content as the second transaction, and the uplink acknowledgement request is not an acknowledgement request for a transaction that has been uplink but for which the transaction signature does not conform to the first signing rule.
A benefit of this embodiment is that it looks up whether there is a target transaction recorded according to a pseudo-uplink request on the blockchain based on the consistency requirement of the second transaction digest of the target transaction in the uplink acknowledgement request and the first transaction digest of the target transaction already recorded on the blockchain, such that the target transaction indicated by the uplink acknowledgement request is the target transaction already recorded on the blockchain according to the pseudo-uplink request. When the second transaction abstract is inconsistent with the first transaction abstract, the target transaction indicated by the uplink confirmation request is not recorded on the blockchain, so that the uplink confirmation request is refused, the target transaction contained in the uplink confirmation request is discarded, the credibility and rationality of the uplink confirmation request are improved, and the uplink accuracy of the target transaction is further improved.
Referring to FIG. 9, in one embodiment, step 340 of recording the target transaction contained in the uplink acknowledgment request with the second transaction signature to the blockchain includes, but is not limited to, steps 910-930 including:
Step 910, performing signature verification on the second transaction signature;
step 920, if the signature verification passes, generating a second target block based on the target transaction and the second transaction signature;
step 930, transmitting the second target chunk to a slave consensus node of the plurality of consensus nodes to consensus the target transaction based on the second transaction signature from the consensus node and recording the target transaction and the second transaction signature together to the blockchain.
Steps 910-930 are described in detail below.
In step 910, a signature verification is performed on the second transaction signature.
The signature verification is used for verifying the signature of the second transaction by the master consensus node so as to judge whether the target transaction and the signature of the second transaction are legal or not.
For the sake of brevity, a specific implementation process of signature verification for the second transaction signature in the embodiments of the present disclosure will be described in detail below, which is not described herein.
In step 920, if the signature verification passes, a second target block is generated based on the target transaction, the second transaction signature.
Since the master and slave consensus nodes in the blockchain often vary in different consensus rounds, e.g., the master consensus node in a common blockchain system is often cyclically rotated by the individual consensus nodes, the master consensus node receiving the pseudo-uplink request and the master consensus node receiving the uplink acknowledgement request may not be the same consensus node.
Based on this, the second target block refers to a block that is formed by packing the target transaction and the plurality of other transactions to be uplink and the like by the current master consensus node in the latest current consensus round, but has not yet been consensus by the other consensus nodes.
In a specific implementation of this embodiment, if the signature verification is determined to pass, the target transaction and the second transaction signature are indicated as satisfactory, and the target transaction and the second transaction signature are legitimate. Based on this, the primary consensus node of the current consensus round packages the target transaction and the second transaction signature into blocks to obtain the second target block, and the specific implementation process is similar to the above step 520, except that step 520 generates the first target block based on the target transaction, the first transaction signature, and the proposal signature, and step 920 generates the second target block based on the target transaction and the second transaction signature, where the specific contents of the packages of the two are different. For the sake of space saving, the description is omitted.
In step 930, the second target chunk is sent to a slave consensus node of the plurality of consensus nodes to consensus the target transaction based on the second transaction signature from the consensus node and record the target transaction and the second transaction signature together to the blockchain.
In a specific implementation of this embodiment, the master consensus node first transmits the first target block to the slave consensus node. Based on this, each slave consensus node first signs the second transaction signature to realize the consensus of the target transaction of the second target block, and then broadcasts the consensus result of the target transaction. When the predetermined number of the consensus results from the consensus nodes are successful, the target transaction and the first transaction signature are recorded together into the blockchain, and the specific implementation process is similar to the above step 530, wherein the step 530 is to perform the consensus on the target transaction of the first target block according to the signature verification, the step 930 is to perform the consensus on the target transaction of the second target block according to the signature verification on the second transaction signature, and the consensus basis and the consensus mode of the target transaction and the first transaction signature are different. For the sake of space saving, the description is omitted.
Taking BLS signature as an example, when each slave consensus node first performs signature verification on the second transaction signature, whether the second transaction signature passes the signature verification is determined according to whether an equation e (G, sc) =e (H ', PKu) is satisfied, where H' =h (m) is used to indicate a result of performing summary operation on the transaction content m of the target transaction of the uplink confirmation request by using the hash function H (·) of the elliptic curve by each slave consensus node. G is the base point on the elliptic curve, is a public predetermined reference parameter, sc is the second transaction signature, PKu is the first public key of the object. When verifying from the consensus node that equation e (G, sc) =e (h', PKu) holds, consider that the second transaction signature passes the verification, the consensus result of the slave consensus node is that the consensus is successful, allowing the target transaction and the second transaction signature to be uplink; when the verification equation e (G, sc) =e (h', PKu) is not satisfied from the consensus node, the second transaction signature is considered to fail the verification, and the consensus result of the slave consensus node is that the consensus fails, and the target transaction and the second transaction signature are not allowed to be uplink.
It should be noted that, when the block is uplink, the first target block and the third target block are both uplink before the second target block.
The method has the advantages that the master consensus node packages the target transaction and the second transaction signature into the block after the signature passes according to the signature verification of the second transaction signature, and sends the block to each slave consensus node for consensus and uplink, so that the target transaction and the second transaction signature are uplink after the consensus and the confirmation, and the accuracy and the rationality of the transaction uplink can be improved.
Referring to FIG. 10, in one embodiment, the process of signature verification of a second transaction signature includes, but is not limited to, steps 1010-1030, including:
Step 1010, performing summary operation on the transaction content of the target transaction to obtain a target summary result;
step 1020, comparing the target digest result with a first calculation result of the first public key of the object, with a second transaction signature and a second calculation result of the predetermined reference parameter;
step 1030, if it is determined that the first calculation result is consistent with the second calculation result, determining that the signature verification is passed.
Steps 1010-1030 are described in detail below.
In step 1010, a summary operation is performed on the transaction content of the target transaction to obtain a target summary result.
The target summary result is used for indicating a result of the summary operation of the transaction content of the target transaction by the main consensus node.
In a specific implementation of this embodiment, the primary consensus node invokes a hash function H (·) on the elliptic curve with authorized permissions. Then, the master consensus node performs a digest operation on the transaction content m of the target transaction indicated in the uplink acknowledgement request by using the called hash function, so as to obtain a target digest result. Where the target digest result may be expressed as H ', H' =h (m).
In step 1020, a comparison is made of the target digest result with a first calculation of a first public key of the object, with a second transaction signature and a second calculation of a predetermined reference parameter.
The first calculation result is used for indicating a result of operating the target digest result and the first public key of the object by using the encryption algorithm.
The second calculation result is used for indicating the result of the operation of the second transaction signature and the preset reference parameter by using the encryption algorithm.
For example, when the encryption algorithm is a bilinear pair encryption algorithm, the first calculation result and the second calculation result are both results subjected to a bilinear encryption operation.
The predetermined reference parameter refers to a base point determined on the elliptic curve, and is a public parameter, and the determination process of the predetermined reference parameter will be described in detail below.
In the specific implementation of this embodiment, first, the encryption algorithm is used to encrypt the target digest result and the first public key of the object, so as to obtain a first calculation result. And then, carrying out encryption operation on the second transaction signature and the preset reference parameters by using the determined encryption algorithm to obtain a second calculation result. And finally, comparing the first calculation result with the second calculation result to realize verification of the second transaction signature.
It should be noted that the determined encryption algorithm includes, but is not limited to, a bilinear pair encryption algorithm, a discrete logarithm encryption algorithm, and the like.
In step 1030, if it is determined that the first calculation result is consistent with the second calculation result, it is determined that the second transaction signature verification passes.
In a specific implementation of this embodiment, if it is determined that the first calculation result is consistent with the second calculation result, it indicates that the second transaction signature can be successfully signed with the first public key of the object, and the second transaction signature indicated by the uplink confirmation request and the target transaction are legal, and signature verification of the second transaction signature passes. If the first calculation result is determined to be consistent with the second calculation result, the second transaction signature cannot be successfully signed by the first public key of the object, the second transaction signature indicated by the uplink confirmation request and the target transaction are not legal, and signature verification of the second transaction signature is not passed.
Taking BLS signature as an example, when the master consensus node first performs signature verification on the second transaction signature, whether the second transaction signature passes the signature verification is determined according to whether an equation e (G, sc) =e (H ', PKu) is satisfied, where H' =h (m) is used to indicate a result of performing summary operation on the transaction content m of the target transaction of the uplink confirmation request by using the hash function H (·) of the elliptic curve by each slave consensus node. G is the base point on the elliptic curve, is a public predetermined reference parameter, sc is the second transaction signature, PKu is the first public key of the object. e (G, sc) refers to the first calculation result, and e (h', PKu) refers to the second calculation result. When the primary consensus node verifies that the first calculation result is equal to the second calculation result, i.e. equation e (G, sc) =e (h', PKu) holds, the signature verification of the second transaction signature is considered to pass. When the primary consensus node verifies that the first calculation result is not equal to the second calculation result, i.e. equation e (G, sc) =e (h', PKu) is not true, it is considered that the signature verification of the second transaction signature is not passed.
The method has the advantages that the primary consensus node performs encryption operation on two groups of data respectively by using the first public key of the object and a set encryption algorithm, signature verification on a second transaction signature is realized by verifying consistency of encryption operation results of the two groups of data, efficiency and accuracy of signature verification can be improved, validity of a target transaction in a uplink confirmation request is judged according to the signature verification result, the target transaction and the second transaction signature are uplink under the condition that the target transaction and the second transaction signature are legal, and access to the target transaction can be based on verification signature of the second transaction signature recorded on a block chain, so that accuracy of transaction uplink and rationality of transaction access on the block chain are improved.
In one embodiment, the predetermined reference parameter is determined by:
Determining a target elliptic curve from a plurality of candidate elliptic curves;
determining an order parameter of the target elliptic curve in a predetermined finite field for the target elliptic curve;
determining cofactors of the target elliptic curve based on the order parameters;
A predetermined reference parameter is determined based on the cofactor and the target point selected on the target elliptic curve.
In the embodiment, first, in the case where the authorized license is made, one candidate elliptic curve is randomly selected as the target elliptic curve from the database storing a plurality of candidate elliptic curves. Next, a rank parameter N of the target elliptic curve in a predetermined finite field is calculated according to the Schoof algorithm, a subgroup of rank N is selected in the elliptic curve based on the rank parameter N, the subgroup of rank N includes a portion of points on the elliptic curve, N is a prime number, and N is a factor of N. Further, division is performed on the order parameter N and the order N of the subgroup, and the obtained division result is taken as a cofactor, wherein the cofactor h is expressed as h=n/N. Then, one of the points of the target elliptic curve is randomly selected as a target point, and the target point is denoted as a point P. Based on this, the result of the multiplication of the cofactor and the abscissa of the target point is taken as the abscissa of the predetermined reference parameter, where the predetermined reference parameter G is expressed as g=hp, and the predetermined reference parameter is expressed in the form of one coordinate point, having the abscissa and the ordinate.
As shown in FIG. 11, a specific implementation of recording a second transaction signature along with a target transaction onto a blockchain is described. Specifically, the object first generates a target transaction at the local side, and a second transaction signature of the target transaction. Then, the object sends the target transaction and the second transaction signature to the master node (the master consensus node) through the uplink acknowledgement request, and the master node is the proposer of the blockchain in the current consensus round. Further, the master node queries the blockchain for a target transaction that matches the uplink acknowledgment request, in a manner similar to steps 810-830 described above. Next, upon determining that there is a matching target transaction on the blockchain, the master node verifies the second transaction signature, in a manner similar to that described above with respect to steps 1010-1030. When the second transaction signature passes verification, the master node feeds back a verification result to the object, and when the verification fails, the master node refuses the uplink confirmation request. Further, the master node packages the target transaction and the second transaction signature to the proposal block, and broadcasts the block in the blockchain network, so that the slave consensus node of the blockchain network receives the proposal block and performs consensus on the target transaction of the proposal block, and the specific implementation process is similar to the steps 920-930, so that the description is omitted for saving the space.
Detailed description of updating transaction states of target transactions for one embodiment of the present disclosure
Since the first transaction signature is not in compliance with the first signing rule, after the first transaction signature and the target transaction are linked together, the first transaction signature cannot be signed by the first signing rule, and thus the target transaction cannot be accessed, the target transaction and the first transaction signature at this time support withdrawal, and the transaction state of the target transaction on the blockchain is set to be in a withdrawable state. However, when the target transaction is not confirmed by the uplink for a long time or the target transaction is confirmed by the object, if the transaction state of the target transaction on the blockchain is not updated timely, the correctness of the transaction information on the blockchain is often affected, and the normal maintenance of the blockchain is not facilitated.
In the disclosed embodiments, the target transaction has a transaction timestamp.
The transaction timestamp is used to indicate a point in time at which the target transaction was uplink based on the pseudo-uplink request.
Referring to FIG. 12, in one embodiment, after the target transaction is recorded with the first transaction signature to the blockchain, the blockchain transaction chaining method includes, but is not limited to, steps 1210-1220 including:
step 1210, determining a time difference between the transaction timestamp and the current time;
Step 1220, if it is determined that the time difference is greater than the preset threshold, the transaction state of the target transaction recorded on the blockchain is set to the invalid state.
Steps 1210-1220 are described in detail below.
In step 1210, a time difference between the transaction timestamp and the current time is determined.
The time difference is used to indicate a specific length of time between the current time and the transaction timestamp.
When the embodiment is specifically implemented, the master consensus node obtains a time point of uplink to the target transaction based on the pseudo uplink request under the condition of authorized permission, and obtains a transaction time stamp. And then, performing difference processing on the transaction timestamp and the current time in the time dimension to obtain the time difference between the transaction timestamp and the current time.
For example, when the transaction timestamp is 10 a.m., and the current time is 10 a.m., the time difference may indicate that the transaction timestamp and the current time differ by 30 minutes.
In step 1220, if it is determined that the time difference is greater than the preset threshold, the transaction state of the target transaction recorded on the blockchain is set to a disabled state.
The preset threshold is used for measuring whether the time difference reaches the standard of updating the transaction state of the target transaction.
The preset threshold of the embodiment of the disclosure may be determined according to actual requirements, actual service scenarios, the total number of consensus nodes of the blockchain, or the size of the total storage space of the blockchain, without specific limitation.
It should be noted that candidate transactions based on the pseudo-ul request record on the blockchain are supported for retirement before passing the object validation. Therefore, to clearly record the state of each transaction on the blockchain, the transaction state of candidate transactions on the blockchain that are recorded based on the pseudo-uplink request may be set to a retireable state.
In a specific implementation of this embodiment, the time difference is first compared to a preset threshold. If the determined time difference is smaller than or equal to the preset threshold value, the first transaction signature recorded on the blockchain based on the pseudo-uplink request and the existence time of the target transaction are short, a certain time is needed to be given to the object to send the uplink confirmation request for the target transaction, the transaction state of the target transaction is not modified temporarily, and the target transaction recorded on the blockchain is kept in a withdrawable state until the uplink confirmation request for the target transaction is received and the transaction state of the target transaction is modified again. And if the time difference is determined to be larger than the preset threshold value, the condition that the existence time of the first transaction signature and the target transaction recorded on the blockchain based on the pseudo-uplink request is longer is indicated, the target transaction is not confirmed by the object in a uplink way for a long time, the target transaction and the first transaction signature recorded on the blockchain are likely to be the target transaction to be withdrawn, the transaction state of the target transaction recorded on the blockchain is set to be a failure state, and the marking of the withdrawn target transaction and the first transaction signature is realized.
The embodiment has the advantages that according to the comparison of the transaction timestamp of the target transaction recorded on the blockchain based on the pseudo-uplink request and the current time, for the target transaction recorded on the blockchain for a longer time but not confirmed by the object in the uplink, the transaction state of the target transaction is updated timely, when the time difference is determined to be larger than the preset threshold value, the transaction state of the target transaction recorded on the blockchain is set from the withdrawable state to the invalid state, the state update of each transaction recorded on the blockchain can be realized, and the transaction information recorded on the blockchain is more accurate.
In an embodiment of the present disclosure, the target transaction included in the uplink acknowledgement request has a second transaction digest, and the blockchain includes a plurality of candidate transactions, each candidate transaction having a third transaction digest.
Candidate transactions refer to individual uplink transactions recorded on the blockchain.
The third transaction digest is used to indicate the result of the digest operation on each of the uplink transactions recorded on the blockchain.
Referring to FIG. 13, in one embodiment, prior to recording the target transaction contained in the uplink acknowledgement request with the second transaction signature to the blockchain, the blockchain transaction chaining method further includes, but is not limited to, steps 1310-1320 including:
Step 1310, comparing the second transaction digest with a third transaction digest of the plurality of candidate transactions recorded on the blockchain;
step 1320, sets the transaction state of the candidate transaction for which the third transaction digest is consistent with the second transaction digest to the validated state.
Steps 1310-1320 are described in detail below.
In step 1310, the second transaction digest is compared to a third transaction digest of the plurality of candidate transactions recorded on the blockchain.
In a specific implementation of this embodiment, the master consensus node first obtains, under authorized permission, a second transaction digest of the target transaction included in the uplink acknowledgement request, and a third transaction digest of each candidate transaction recorded on the blockchain. Next, the second transaction digest is compared with a third transaction digest of the plurality of candidate transactions recorded on the blockchain to determine whether the same transaction as the target transaction contained in the uplink acknowledgment request is recorded on the blockchain.
In step 1320, the transaction state of the candidate transaction for which the third transaction digest is consistent with the second transaction digest is set to the validated state.
In this embodiment, when there is a third transaction digest consistent with the second transaction digest, indicating that the same transaction as the target transaction included in the uplink acknowledgement request is recorded on the blockchain, the candidate transaction consistent with the third transaction digest with the second transaction digest may be regarded as the same transaction as the target transaction included in the uplink acknowledgement request, and the uplink acknowledgement request is an acknowledgement request for the candidate transaction consistent with the third transaction digest with the second transaction digest. Based on this, based on the uplink acknowledgement request, the transaction state of the candidate transaction for which the third transaction digest is consistent with the second transaction digest is set to the acknowledged state by the retireable state to indicate that the candidate transaction is object acknowledged and is not retireable.
The method has the advantages that the transaction state of each candidate transaction recorded on the blockchain is updated in time according to comparison of the second transaction digest of the target transaction contained in the chain confirmation request and the third transaction digest of each candidate transaction recorded on the blockchain, so that the transaction state of the candidate transaction indicated by the uplink confirmation request is set to a confirmed state from a withdrawable state, the state updating efficiency of the candidate transaction on the blockchain is improved, and the transaction information recorded on the blockchain is more accurate.
Detailed description of the first public key of the acquisition object of one embodiment of the present disclosure
Since in a blockchain transaction process, the signature verification for each transaction is often inseparable from the first public key of the object, it is often necessary to use the first public key of the object to implement the signature verification for the transaction signature of the transaction. For example, the object is directly applied to obtain the first public key of the object stored in the local end. This approach requires application to the subject each time the first public key is used, often requiring frequent disruption of the subject, and inefficient verification of the signature due to the subject's license delay. Based on this, the embodiment of the disclosure provides a scheme for acquiring the first public key of the object, which can improve the convenience of acquiring the first public key, and further improve the efficiency of signature verification based on the first public key.
In the disclosed embodiment, after the object generates the first public and private key at the local side, the object stores the first private key at the local side, and provides the first public key to the intelligent contract of the blockchain or the third party platform for storage. The intelligent contracts or platforms of the blockchain maintain a key mapping table, wherein the key mapping table is used for indicating the corresponding relation between candidate keys (first private keys) of all candidate objects and object information of all objects.
The key mapping table includes a plurality of candidate keys, and candidate object identifiers and candidate blockchain addresses corresponding to the candidate keys.
The candidate key is used to indicate a first public key of each candidate in the blockchain.
The candidate is an independent individual, or subject, that is recognized by the blockchain. For example, candidates include, but are not limited to including, network users, businesses, and related institutions, etc.
The candidate object identifiers are used to distinguish between different candidate objects, and the candidate object identifiers of the respective candidate objects are different.
The candidate blockchain address is used to indicate a specific location of the candidate on the blockchain.
Referring to FIG. 14, in one embodiment, the process of obtaining the first public key includes, but is not limited to, steps 1410-1430 including:
Step 1410, determining an object identification and a blockchain address of an object;
Step 1420, performing key screening on a plurality of candidate keys in a pre-acquired key mapping table based on the object identifier and the blockchain address;
step 1430, determining the candidate key having a candidate object identification consistent with the object identification and a candidate blockchain address consistent with the blockchain address as the first public key.
Steps 1410-1430 are described in detail below.
In step 1410, the object identification and blockchain address of the object are determined.
The object identification is used to distinguish the object that sent the pseudo-uplink request from other objects on the blockchain.
The blockchain address is used to indicate a specific location on the blockchain of the object that sent the pseudo-uplink request.
In a specific implementation of this embodiment, the master consensus node obtains the object identification and blockchain address of the object that sent the pseudo-uplink request, subject to the grant permission of the object.
In step 1420, a key filtering is performed on the plurality of candidate keys in the pre-acquired key map based on the object identification and the blockchain address.
In a specific implementation of this embodiment, the master consensus node first obtains a key map from a blockchain smart contract or third party platform. Then, the object identification is compared with the candidate object identification in the key mapping table, and the blockchain address is compared with the candidate blockchain address in the key mapping table, so that screening of a plurality of candidate keys in the key mapping table is realized.
In step 1430, a candidate key whose candidate object identification matches the object identification and whose candidate blockchain address matches the blockchain address is determined to be the first public key.
In this embodiment, when the candidate object identifier in the key map is consistent with the object identifier and the candidate blockchain address is consistent with the blockchain address, it is indicated that the candidate object identifier in the key map, the candidate object indicated by the candidate blockchain address, and the object that initiated the pseudo uplink request are the same object, and based on this, the candidate key whose candidate object identifier is consistent with the object identifier and whose candidate blockchain address is consistent with the blockchain address is determined as the first public key according to the correspondence between the candidate key in the key map, the candidate object identifier, and the candidate blockchain address.
The method and the device have the advantages that the first public key of the first object is obtained together based on the object identification of the object and the block address of the object, the first public key can be conveniently and rapidly obtained from the intelligent contract or the third party platform of the blockchain, convenience and accuracy in obtaining the first public key can be improved, and further efficiency in signature verification based on the first public key is improved.
Referring to FIG. 15, in one embodiment, the process of generating the key map includes, but is not limited to, steps 1510-1540, including:
step 1510, obtaining candidate object identifiers and candidate blockchain addresses of a plurality of candidate objects, and object public keys of the respective candidate objects;
step 1520, for each candidate, determining the candidate identification and candidate blockchain address as keywords, and the object public key as a value;
Step 1530, determining a plurality of mapping relationships based on the keywords and the values of the candidate objects;
step 1540, if it is determined that the time difference is greater than the preset threshold, setting the transaction state of the pre-generated transaction recorded on the blockchain to a failure state.
Steps 1510-1540 are described in detail below.
In step 1510, candidate object identifications and candidate blockchain addresses for a plurality of candidate objects, and object public keys for the respective candidate objects, are obtained.
The object public key refers to the first public key described above.
In a specific implementation of this embodiment, the master consensus node may obtain the candidate object identification, the candidate blockchain address, and the object public key of the candidate object from the local side of each candidate object, subject to the authorization permission of the object.
In step 1520, for each candidate, the candidate identification and candidate blockchain address are determined to be keywords, and the object public key is determined to be a value.
In the embodiment, for each candidate object, firstly, the candidate object identifier and the candidate blockchain address are used as key words of key value pairs together; then, the object public key is set as the value of the key value pair.
In step 1530, a plurality of mappings are determined based on the key and value of each candidate.
In this embodiment, for each candidate object, the key and the value of the candidate object may form a key pair, and the key pair is used to represent the mapping relationship between the candidate object identifier and the candidate blockchain address, and the object public key.
In step 1540, a key map is generated based on the plurality of mappings.
In a specific implementation of this embodiment, a plurality of mapping relationships are stored in a table in a predetermined format to obtain a key mapping table.
Wherein the predetermined format is used for indicating that the plurality of mapping relations are stored in the form of a hash table, or the like.
As shown in fig. 16, the key map includes six candidate objects, object D, object F, object C, object M, object N, and object P in this order. Wherein the candidate key (first public key) of object D whose candidate identification is K77 and whose candidate blockchain address is Qw12fg is 0x0211. The candidate key (first public key) for object F, whose candidate blockchain address is Mkp483, whose candidate identification is K88, is 0x0243. The candidate key (first public key) for object C, whose candidate blockchain address is Yor48w, whose candidate identification is K79, is 0x0248. The candidate key (first public key) of the object M whose candidate blockchain address is Pp70ec, whose candidate object identification is K33, is 0x0270. The candidate key (first public key) for object N whose candidate object identification is K74 and whose candidate blockchain address is Ky43N8 is 0x0238. The candidate key (first public key) for object P whose candidate object identification is K53 and whose candidate blockchain address is Taw146 is 0x0216.
The embodiment has the advantages that the key words of the candidate objects are formed based on the candidate object identifiers and the candidate block addresses of the candidate objects, and the values of the candidate objects are generated based on the first public keys of the candidate objects, so that the mapping relations between the candidate object identifiers and the candidate block addresses and the first public keys are clearly recorded in the key mapping table in the form of key value pairs, the storage rationality of the mapping relations can be improved, and the searching efficiency of the first public keys can also be improved.
Referring to FIG. 17, in one embodiment, the first public and private keys of the object are generated by a key generation server, and the process of the key generation server generating the first public and private keys of the object includes, but is not limited to, steps 1710-1730 including:
step 1710, determining a target random number for generating a key from a plurality of candidate random numbers in response to a key pair generation request of an object;
Step 1720, determining a first private key of the object based on the target random number;
step 1730, determining a plurality of mapping relationships based on the keywords and the values of the respective candidate objects.
Steps 1710-1730 are described in detail below.
In step 1710, a target random number for generating a key is determined among a plurality of candidate random numbers in response to a key pair generation request of an object.
The key pair generation request is a request generated when the object is to generate a public-private key.
The candidate random numbers of the embodiments of the present disclosure refer to a plurality of random seeds, which are often represented as one sequence number, and keys generated based on the same random seeds are often the same. The candidate random numbers are often stored in a predetermined seed storage space.
In a specific implementation of this embodiment, in response to a key pair generation request of an object, in a case where an access permission of a predetermined seed storage space is acquired, one candidate random number is randomly selected from a plurality of candidate random numbers of the predetermined seed storage space as a target random number for generating a key.
In step 1720, a first private key of the object is determined based on the target random number.
In a specific implementation of this embodiment, first, a predetermined generator is invoked, wherein the predetermined generator may be a pseudo-random number generator. Next, the target random number is input to a predetermined generator, and the output of the predetermined generator is taken as the first private key of the object.
In step 1730, a first public key is generated based on the first private key and the predetermined reference parameter.
In a specific implementation of this embodiment, the first private key and the predetermined reference parameter G are subjected to an operation on an elliptic curve to obtain the first public key.
For example, in response to a key pair generation request of an object, a candidate random number is randomly selected as a target random number, and the target random number is processed by a predetermined generator to generate a first private key SKu. Finally, the first private key and the predetermined reference parameter G are subjected to an operation on an elliptic curve to obtain a first public key PKu, wherein PKu = SKu ·g.
The embodiment has the advantages that the random number and the preset reference parameter are utilized to generate the first public key and the first private key, the public key and the private key of the object are generated by using the elliptic curve cryptography algorithm, and the generation efficiency and the generation accuracy of the first public key and the first private key can be improved.
Detailed description of one embodiment of the disclosure to determine a primary consensus node among a plurality of consensus nodes
Since the transaction processing capability and reputation of each consensus node are different in the blockchain network, when a consensus node with poor transaction processing capability is selected as a main consensus node, the block packing and block consensus efficiency of the whole blockchain network are also affected, and the throughput speed of the blockchain network is still poor. Based on the above, the scheme for jointly screening the main consensus nodes based on the node credibility and the node processing capacity of each consensus node is provided, so that the accuracy of screening the main consensus nodes can be improved.
Referring to FIG. 18, in one embodiment, the process of determining a primary consensus node among a plurality of consensus nodes includes, but is not limited to, steps 1810-1820:
Step 1810, determining node credibility and node processing capability of each consensus node;
step 1820, determining a primary consensus node among the plurality of consensus nodes based on the node reputation, and the node processing power.
Steps 1810 to 1820 are described in detail below.
In step 1810, node reputation, and node processing power of each consensus node are determined.
The node credibility is used for indicating the integrity of the nodes in consensus and broadcasting.
The node processing capability is used to indicate the out-block delay condition of the consensus node.
In this embodiment, the blocking, consensus, and broadcast conditions of the various consensus nodes over multiple consensus rounds in the past are all recorded in the server background by the blockchain network. Based on this, in the case of authorized permission, firstly, the log contents of the block, the consensus, and the broadcast of the plurality of consensus rounds of each consensus node in the past are extracted from the server background, and then, the node credibility and the node processing capability of each consensus node are determined from the plurality of log contents.
In step 1820, a primary consensus node is determined among the plurality of consensus nodes based on the node reputation, and the node processing power.
Referring to FIG. 19, in one embodiment, the process of determining a primary consensus node based on node reputation and node processing power includes, but is not limited to, steps 1910-1940 including:
step 1910, determining a first score for each consensus node based on node reputation;
step 1920, for each consensus node, determining a second score based on the node processing capabilities;
step 1930, determining a total score of the consensus node based on the first score and the second score;
Step 1940, determining a primary consensus node among the plurality of consensus nodes based on the total score.
Steps 1910 to 1940 are described in detail below.
In step 1910, for each consensus node, a first score is determined based on the node reputation.
In the embodiment, first, for each consensus node, the node reputation is substituted into a preset function, and the output result of the preset function is used as a first score. The preset function is an increasing function taking node credibility as an independent variable and taking a first score as a dependent variable.
In step 1920, for each consensus node, a second score is determined based on the node processing power.
In this embodiment, the implementation of step 1920 is similar to the implementation of step 1910 described above. For the sake of space saving, the description is omitted.
In step 1930, a total score for the consensus node is determined based on the first score and the second score.
In a specific implementation of this embodiment, first, a first weight, and a second weight are determined. The first weight is used for indicating the importance degree of the node credibility of the consensus node on the determination main consensus node, the second weight is used for indicating the importance degree of the node processing capacity of the consensus node on the determination main consensus node, and the sum of the first weight and the second weight is 1. Then, for each consensus node, the product of the first weight and the first score is added to the product of the second weight and the second score to obtain the total score of the consensus node.
In step 1940, a primary consensus node is determined among the plurality of consensus nodes based on the total score.
In the embodiment, in each consensus round, the consensus node with the largest total score is taken as the main consensus node of the consensus round according to the total score of each consensus node.
As shown in fig. 20, the blockchain includes six consensus nodes, namely, a consensus node 1, a consensus node 2, a consensus node 3, a consensus node 4, a consensus node 5, and a consensus node 6. When the first weight and the second weight are both 0.5, the total score of the consensus node 1 with the first score of 70 and the second score of 80 is 75; the total score of the consensus node 2 with the first score 74 and the second score 78 is 76; the total score of the consensus node 3 with the first score 88 and the second score 86 is 87; the total score of the consensus node 4 with the first score 90 and the second score 86 is 88; the total score of the consensus node 5 with the first score 66 and the second score 74 is 70; the total score of the consensus node 6 with the first score 83 and the second score 80 is 81.5. Based on this, since 70 < 75 < 76 < 81.5 < 87 < 88, the consensus node 4 with the total score of 88 is taken as the main consensus node.
The method has the advantages that the node screening is carried out by introducing the node scoring and the score weighting modes based on the node credibility and the node processing capacity of each consensus node, so that the accuracy of the screening of the main consensus node can be improved, the consensus node with better node processing capacity and better node credibility is screened out as the main consensus node, the block packing and block consensus efficiency of the whole block chain network are improved, and the throughput speed of the block chain network is further improved.
Apparatus and device descriptions of embodiments of the present disclosure
It will be appreciated that, although the steps in the various flowcharts described above are shown in succession in the order indicated by the arrows, the steps are not necessarily executed in the order indicated by the arrows. The steps are not strictly limited in order unless explicitly stated in the present embodiment, and may be performed in other orders. Moreover, at least some of the steps in the flowcharts described above may include a plurality of steps or stages that are not necessarily performed at the same time but may be performed at different times, and the order of execution of the steps or stages is not necessarily sequential, but may be performed in turn or alternately with at least a portion of the steps or stages in other steps or other steps.
In the embodiments of the present application, when related processing is performed according to data related to characteristics of a target object, such as attribute information or attribute information set of the target object, permission or consent of the target object is obtained first, and related laws and regulations and standards are complied with for collection, use, processing, etc. of the data. In addition, when the embodiment of the application needs to acquire the attribute information of the target object, the independent permission or independent consent of the target object is acquired through a popup window or a jump to a confirmation page or the like, and after the independent permission or independent consent of the target object is explicitly acquired, the necessary target object related data for enabling the embodiment of the application to normally operate is acquired.
Fig. 21 is a schematic diagram of a block chain transaction uplink device 2100 according to an embodiment of the present disclosure. The blockchain transaction uplink device 2100 is applied to a master consensus node of a plurality of consensus nodes on the blockchain, the blockchain transaction uplink device 2100 comprising:
A first receiving unit 2110, configured to receive a pseudo uplink request for a target transaction, where the pseudo uplink request includes a first transaction signature of the target transaction, and the first transaction signature does not conform to a first signing rule, and the first signing rule allows the first transaction signature to pass through the first signing when the target transaction is recorded to the blockchain together with the first transaction signature, so as to access the target transaction on the blockchain;
a first recording unit 2120 for recording the target transaction together with the first transaction signature to the blockchain;
A second receiving unit 2130, configured to receive a uplink acknowledgement request for a target transaction, where the uplink acknowledgement request includes a second transaction signature of the target transaction, and the second transaction signature conforms to the first signature verification rule;
the second recording unit 2140 is configured to record, when it is determined that the uplink acknowledgement request matches the target transaction in the blockchain, the target transaction included in the uplink acknowledgement request to the blockchain together with a second transaction signature, where the second transaction signature allows the target transaction to be accessed.
Alternatively, the first recording unit 2120 includes:
A signature verification subunit (not shown) for performing a second signature verification on the first transaction signature;
A generation subunit (not shown) for generating a proposal signature of the target transaction if the second verification passes, and generating a first target block based on the target transaction, the first transaction signature, and the proposal signature;
a consensus subunit (not shown) for transmitting the first target block to a slave consensus node of the plurality of consensus nodes for consensus the target transaction based on the proposal signature from the consensus node and recording the target transaction together with the first transaction signature to the blockchain.
Optionally, a generating subunit (not shown) is configured to:
signing the target transaction by using a second private key of the main consensus node to obtain a proposal signature;
A consensus subunit (not shown) is used for:
the slave consensus nodes check the target transaction based on the proposal signature by using the second public key of the master consensus node until a preset number of slave consensus nodes determine that the consensus is completed through checking the signature.
Optionally, the first transaction signature is obtained by double signing the target transaction based on the first private key of the object and the second public key of the primary consensus node;
A check-in subunit (not shown) is used to:
signing the first transaction signature based on the second private key of the master consensus node and the first public key of the object;
if the first transaction signature is determined to be successfully signed, determining that the second signature passes;
If it is determined that the first transaction signature fails to be signed, it is determined that the second signature fails and the fake uplink request is rejected.
Optionally, signing the first transaction signature based on the second private key of the primary consensus node and the first public key of the object comprises:
carrying out a first sub-signature verification on the first transaction signature by using a second private key of the main consensus node to obtain a first sub-signature verification result;
and carrying out second sub-signature verification on the first sub-signature verification result by using the first public key of the object.
Optionally, the first transaction signature is generated by:
Signing a first transaction abstract of the target transaction based on a first private key of the object to obtain an abstract signature result;
And signing the digest signature result based on the second public key of the main consensus node to obtain a first transaction signature.
Optionally, the target transaction in the blockchain has a first transaction digest, and the target transaction contained in the uplink acknowledgement request has a second transaction digest;
Determining that the uplink acknowledgement request matches a target transaction in the blockchain includes:
comparing the second transaction digest with the first transaction digest;
If it is determined that the second transaction digest is consistent with the first transaction digest, determining that the uplink acknowledgment request matches the target transaction in the blockchain;
If it is determined that the second transaction digest is inconsistent with the first transaction digest, determining that the uplink acknowledgment request does not match the target transaction in the blockchain, rejecting the uplink acknowledgment request, and discarding the target transaction contained in the uplink acknowledgment request.
Alternatively, the second recording unit 2140 is configured to:
signature verification is carried out on the second transaction signature;
if the signature verification is passed, generating a second target block based on the target transaction and a second transaction signature;
The second target chunk is sent to a slave consensus node of the plurality of consensus nodes to consensus the target transaction based on the second transaction signature from the consensus node and record the target transaction and the second transaction signature together to the blockchain.
Optionally, signature verification of the second transaction signature includes:
performing abstract operation on the transaction content of the target transaction to obtain a target abstract result;
Comparing the target abstract result with a first calculation result of a first public key of the object, a second transaction signature and a second calculation result of a preset reference parameter;
If the first calculation result is determined to be consistent with the second calculation result, the signature verification is determined to pass.
Optionally, the predetermined reference parameter is determined by:
Determining a target elliptic curve from a plurality of candidate elliptic curves;
determining an order parameter of the target elliptic curve in a predetermined finite field for the target elliptic curve;
determining cofactors of the target elliptic curve based on the order parameters;
A predetermined reference parameter is determined based on the cofactor and the target point selected on the target elliptic curve.
Optionally, the target transaction included in the uplink acknowledgement request has a second transaction digest, the blockchain includes a plurality of candidate transactions, and each candidate transaction has a third transaction digest;
The blockchain transaction chaining device 2100 also includes a first update unit (not shown) for:
Comparing the second transaction digest with a third transaction digest of the plurality of candidate transactions recorded on the blockchain;
The transaction state of the candidate transaction for which the third transaction digest is consistent with the second transaction digest is set to the validated state.
Optionally, the first public key of the object is obtained by:
Determining an object identification and a blockchain address of an object;
Performing key screening on a plurality of candidate keys in a pre-acquired key mapping table based on the object identification and the blockchain address, wherein the key mapping table comprises the plurality of candidate keys, and the candidate object identification and the candidate blockchain address corresponding to the candidate keys;
a candidate key whose candidate object identification is consistent with the object identification and whose candidate blockchain address is consistent with the blockchain address is determined as the first public key.
Optionally, the key map is generated by:
Acquiring candidate object identifiers and candidate blockchain addresses of a plurality of candidate objects, and object public keys of the candidate objects;
for each candidate object, determining a candidate object identification and a candidate blockchain address as keywords, and determining an object public key as a value;
Determining a plurality of mapping relationships based on the keywords and the values of the candidate objects;
A key map is generated based on the plurality of mappings.
Optionally, the primary consensus node is determined by:
Determining node credibility and node processing capacity of each consensus node;
a primary consensus node is determined among the plurality of consensus nodes based on the node reputation and the node processing power.
Optionally, determining a primary consensus node among the plurality of consensus nodes based on the node reputation, and the node processing capability, comprises:
Determining, for each consensus node, a first score based on node reputation;
Determining, for each consensus node, a second score based on node processing capabilities;
determining a total score for the consensus node based on the first score and the second score;
a primary consensus node is determined among the plurality of consensus nodes based on the total score.
Optionally, the target transaction has a transaction timestamp;
the blockchain transaction chaining device 2100 also includes a second update unit (not shown) that is configured to:
Determining a time difference between the transaction timestamp and the current time;
And if the time difference is determined to be larger than the preset threshold value, setting the transaction state of the target transaction recorded on the blockchain to be a failure state.
Optionally, the first public key and the first private key of the object are generated by:
Determining a target random number for generating a key from a plurality of candidate random numbers in response to a key pair generation request of an object;
determining a first private key of the object based on the target random number;
A first public key is generated based on the first private key and a predetermined reference parameter.
Referring to fig. 22, fig. 22 is a block diagram of a portion of a terminal implementing a blockchain transaction chaining method of an embodiment of the present disclosure, the terminal including: radio Frequency (RF) circuitry 2210, memory 2215, input unit 2230, display unit 2240, sensors 2250, audio circuitry 2260, wireless fidelity (WIRELESS FIDELITY, wiFi) module 2470, processor 2280, and power supply 2290. It will be appreciated by those skilled in the art that the terminal structure shown in fig. 22 is not limiting of a cell phone or computer and may include more or fewer components than shown, or may combine certain components, or a different arrangement of components.
The RF circuit 2210 may be used for receiving and transmitting signals during the process of receiving and transmitting information or communication, in particular, after receiving downlink information of the base station, it is processed by the processor 2280; in addition, the data of the design uplink is sent to the base station.
The memory 2215 may be used for storing software programs and modules, and the processor 2280 performs various functional applications of the object terminal and data processing by executing the software programs and modules stored in the memory 2215.
The input unit 2230 may be used to receive input numerical or character information and generate key signal inputs related to setting and function control of the object terminal. In particular, the input unit 2230 may include a touch panel 2431 and other input devices 2232.
The display unit 2240 may be used to display input information or provided information and various menus of the object terminal. The display unit 2240 may include a display panel 2241.
Audio circuitry 2260, speaker 2261, and microphone 2262 may provide an audio interface.
In this embodiment, the processor 2280 included in the terminal may perform the blockchain transaction chaining method of the previous embodiment.
Terminals of embodiments of the present disclosure include, but are not limited to, cell phones, computers, intelligent voice interaction devices, intelligent home appliances, vehicle terminals, aircraft, and the like. Embodiments of the present invention may be applied to a variety of scenarios including, but not limited to, data security, blockchain, data storage, information technology, and the like.
FIG. 23 is a block diagram of a portion of a server implementing a blockchain transaction chaining method of embodiments of the present disclosure. Servers may vary considerably in configuration or performance and may include one or more central processing units (Central Processing Units, simply CPUs) 2322 (e.g., one or more processors) and memory 2332, one or more storage mediums 2330 (e.g., one or more mass storage devices) that store applications 2342 or data 2344. Wherein memory 2332 and storage medium 2330 can be transitory or persistent. The program stored on the storage medium 2330 may include one or more modules (not shown), each of which may include a series of instruction operations on a server. Still further, the central processor 2322 may be arranged to communicate with the storage medium 2330, executing a series of instruction operations in the storage medium 2330 on a server.
The server(s) may also include one or more power supplies 2323, one or more wired or wireless network interfaces 2350, one or more input/output interfaces 2358, and/or one or more operating systems 2341, such as Windows Server, mac OS XTM, unixTM, linuxTM, freeBSDTM, and the like.
The central processor 2322 in the server may be used to perform the blockchain transaction chaining method of embodiments of the present disclosure.
Embodiments of the present disclosure also provide a computer readable storage medium storing program code for performing the blockchain transaction chaining method of the foregoing embodiments.
The disclosed embodiments also provide a computer program product comprising a computer program. The processor of the computer device reads the computer program and executes it to cause the computer device to perform the blockchain transaction chaining method described above.
The terms "first," "second," "third," "fourth," and the like in the description of the present disclosure and in the above-described figures, if any, are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate such that the embodiments of the disclosure described herein may be capable of operation in sequences other than those illustrated or described herein, for example. Furthermore, the terms "comprises," "comprising," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed or inherent to such process, method, article, or apparatus.
In the presently disclosed embodiments, the term "module" or "unit" refers to a computer program or a portion of a computer program having a predetermined function and working with other related portions to achieve a predetermined objective, and may be implemented in whole or in part by using software, hardware (such as a processing circuit or a memory), or a combination thereof. Also, a processor (or multiple processors or memories) may be used to implement one or more modules or units. Furthermore, each module or unit may be part of an overall module or unit that incorporates the functionality of the module or unit.
It should be understood that in this disclosure, "at least one" means one or more, and "a plurality" means two or more. "and/or" for describing the association relationship of the association object, the representation may have three relationships, for example, "a and/or B" may represent: only a, only B and both a and B are present, wherein a, B may be singular or plural. The character "/" generally indicates that the context-dependent object is an "or" relationship. "at least one of" or the like means any combination of these items, including any combination of single item(s) or plural items(s). For example, at least one (one) of a, b or c may represent: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", wherein a, b, c may be single or plural.
It should be understood that in the description of the embodiments of the present disclosure, the meaning of a plurality (or multiple) is two or more, and that greater than, less than, exceeding, etc. is understood to not include the present number, and that greater than, less than, within, etc. is understood to include the present number.
In the several embodiments provided in the present disclosure, it should be understood that the disclosed systems, devices, and methods may be implemented in other manners. For example, the apparatus embodiments described above are merely illustrative, e.g., the division of elements is merely a logical functional division, and there may be additional divisions of actual implementation, e.g., multiple elements or components may be combined or integrated into another system, or some features may be omitted, or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with each other may be an indirect coupling or communication connection via some interfaces, devices or units, which may be in electrical, mechanical or other form.
The units described as separate units may or may not be physically separate, and units shown as units may or may not be physical units, may be located in one place, or may be distributed over a plurality of network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional unit in each embodiment of the present disclosure may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units may be implemented in hardware or in software functional units.
The integrated units, if implemented in the form of software functional units and sold or used as stand-alone products, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present disclosure may be embodied in essence or a part contributing to the prior art or all or part of the technical solution in the form of a software product stored in a storage medium, including several instructions to cause a computer device (which may be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods of the various embodiments of the present disclosure. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (Random Access Memory RAM), a magnetic disk, or an optical disk, etc., which can store program codes.
It should also be appreciated that the various implementations provided by the embodiments of the present disclosure may be arbitrarily combined to achieve different technical effects.
The above is a specific description of the embodiments of the present disclosure, but the present disclosure is not limited to the above embodiments, and various equivalent modifications and substitutions can be made by those skilled in the art without departing from the spirit of the present disclosure, and are included in the scope of the present disclosure as defined in the claims.
Claims (20)
1. A blockchain transaction chaining method applied to a master consensus node of a plurality of consensus nodes on a blockchain, the blockchain transaction chaining method comprising:
Receiving a pseudo-uplink request for a target transaction, wherein the pseudo-uplink request includes a first transaction signature of the target transaction, the first transaction signature not conforming to a first signing rule that allows the first transaction signature to pass a first signing when the target transaction is recorded with the first transaction signature to a blockchain, thereby accessing the target transaction on the blockchain;
Recording the target transaction with the first transaction signature to the blockchain;
Receiving a uplink confirmation request aiming at the target transaction, wherein the uplink confirmation request comprises a second transaction signature of the target transaction, and the second transaction signature accords with a first signature verification rule;
when it is determined that the uplink acknowledgement request matches the target transaction in the blockchain, the target transaction contained in the uplink acknowledgement request is recorded to the blockchain along with the second transaction signature that allows the target transaction to be accessed.
2. The blockchain transaction chaining method of claim 1, wherein the recording the target transaction with the first transaction signature to the blockchain comprises:
performing a second signature verification on the first transaction signature;
if the second verification signature passes, generating a proposal signature of the target transaction, and generating a first target block based on the target transaction, the first transaction signature and the proposal signature;
The first target chunk is sent to a slave consensus node of a plurality of consensus nodes, such that the slave consensus node consensus the target transaction based on the proposal signature and records the target transaction with the first transaction signature to the blockchain.
3. The blockchain transaction chaining method of claim 2, wherein the generating the proposal signature of the target transaction comprises: signing the target transaction by using a second private key of the main consensus node to obtain the proposal signature;
the slave consensus node consensus the target transaction based on the proposal signature, comprising: and the slave consensus nodes check the target transaction based on the proposal signature by using a second public key of the master consensus node until a preset number of the slave consensus nodes pass the check, and the completion of the consensus is determined.
4. The blockchain transaction chaining method of claim 2, wherein the first transaction signature is obtained by double signing the target transaction based on a first private key of an object and a second public key of the master consensus node;
the second signing of the first transaction signature comprises the following steps:
signing the first transaction signature based on a second private key of the primary consensus node and a first public key of the object;
if the first transaction signature is determined to be successfully signed, determining that the second signature passes;
if the first transaction signature is determined to fail to be signed, the second signature is determined to not pass, and the fake uplink request is rejected.
5. The blockchain transaction chaining method of claim 4, wherein the disarming the first transaction signature based on a second private key of the master consensus node and a first public key of the object comprises:
Performing a first sub-signature verification on the first transaction signature by using a second private key of the main consensus node to obtain a first sub-signature verification result;
And carrying out second sub-signature verification on the first sub-signature verification result by using the first public key of the object.
6. The blockchain transaction chaining method of claim 1, wherein the first transaction signature is generated by:
Signing a first transaction abstract of the target transaction based on a first private key of the object to obtain an abstract signature result;
and signing the digest signature result based on a second public key of the main consensus node to obtain the first transaction signature.
7. The blockchain transaction chaining method of claim 1, wherein the target transaction in the blockchain has a first transaction digest and the target transaction contained in the chaining acknowledgement request has a second transaction digest;
The determining that the uplink acknowledgement request matches the target transaction in the blockchain includes:
comparing the second transaction digest with the first transaction digest;
If it is determined that the second transaction digest is consistent with the first transaction digest, determining that the uplink acknowledgment request matches the target transaction in the blockchain;
If it is determined that the second transaction digest is inconsistent with the first transaction digest, determining that the uplink acknowledgment request does not match the target transaction in the blockchain, rejecting the uplink acknowledgment request, and discarding the target transaction contained in the uplink acknowledgment request.
8. The blockchain transaction chaining method of claim 1, wherein the recording the target transaction included in the uplink acknowledgement request to the blockchain along with the second transaction signature includes:
Performing signature verification on the second transaction signature;
Generating a second target block based on the target transaction, the second transaction signature, if the signature verification passes;
the second target chunk is sent to a slave consensus node of a plurality of consensus nodes, such that the slave consensus node consensus the target transaction based on the second transaction signature and records the target transaction and the second transaction signature together to the blockchain.
9. The blockchain transaction chaining method of claim 8, wherein the signature verification of the second transaction signature includes:
Performing summary operation on the transaction content of the target transaction to obtain a target summary result;
Comparing the target abstract result with a first calculation result of a first public key of an object and a second calculation result of the second transaction signature and a preset reference parameter;
and if the first calculation result is determined to be consistent with the second calculation result, determining that the signature verification is passed.
10. The blockchain transaction chaining method of claim 9, wherein the predetermined reference parameter is determined by:
Determining a target elliptic curve from a plurality of candidate elliptic curves;
determining, for the target elliptic curve, an order parameter of the target elliptic curve in a predetermined finite field;
determining cofactors of the target elliptic curve based on the order parameters;
The predetermined reference parameter is determined based on the cofactor and a target point selected on the target elliptic curve.
11. The blockchain transaction uplink method of claim 1, wherein the target transaction included in the uplink acknowledgement request has a second transaction digest, wherein a plurality of candidate transactions are included in the blockchain, each of the candidate transactions having a third transaction digest;
Before said recording said target transaction included in said uplink acknowledgment request with said second transaction signature to said blockchain, said method further comprises:
comparing the second transaction digest with a third transaction digest of the plurality of candidate transactions recorded on the blockchain;
setting the transaction state of the candidate transaction, in which the third transaction digest is consistent with the second transaction digest, to a confirmed state.
12. The blockchain transaction chaining method of claim 4, wherein the first public key of the object is obtained by:
determining an object identification and a blockchain address of the object;
Performing key screening on a plurality of candidate keys in a pre-acquired key mapping table based on the object identifier and the blockchain address, wherein the key mapping table comprises a plurality of candidate keys and candidate object identifiers and candidate blockchain addresses corresponding to the candidate keys;
the candidate key whose object identification is consistent with the object identification and whose blockchain address is consistent with the blockchain address is determined to be the first public key.
13. The blockchain transaction chaining method of claim 12, wherein the key mapping table is generated by:
obtaining candidate object identifiers and candidate blockchain addresses of a plurality of candidate objects, and object public keys of the candidate objects;
Determining the candidate object identification and the candidate blockchain address as keywords and determining the object public key as a value for each candidate object;
determining a plurality of mapping relationships based on the keywords and the values of the respective candidate objects;
And generating the key mapping table based on a plurality of mapping relations.
14. The blockchain transaction chaining method of claim 1, wherein the master consensus node is determined by:
determining node credibility and node processing capacity of each consensus node;
The primary consensus node is determined from a plurality of the consensus nodes based on the node reputation and the node processing capability.
15. The blockchain transaction chaining method of claim 14, wherein the determining the master consensus node among a plurality of the consensus nodes based on the node reputation and the node processing capability comprises:
determining, for each of the consensus nodes, a first score based on the node reputation;
determining, for each of the consensus nodes, a second score based on the node processing capabilities;
determining a total score for the consensus node based on the first score and the second score;
the primary consensus node is determined among a plurality of the consensus nodes based on the total score.
16. The blockchain transaction chaining method of claim 1, wherein the target transaction has a transaction timestamp;
After said recording the target transaction and the first transaction signature together to the blockchain, the method further includes:
Determining a time difference between the transaction timestamp and a current time;
and if the time difference is determined to be larger than a preset threshold value, setting the transaction state of the target transaction recorded on the blockchain to be a failure state.
17. A blockchain transaction chaining apparatus for a master consensus node among a plurality of consensus nodes on a blockchain, the blockchain transaction chaining apparatus comprising:
A first receiving unit configured to receive a pseudo-uplink request for a target transaction, where the pseudo-uplink request includes a first transaction signature of the target transaction, the first transaction signature not conforming to a first signing rule that allows the first transaction signature to pass a first signing when the target transaction is recorded with the first transaction signature to a blockchain, thereby accessing the target transaction on the blockchain;
A first recording unit configured to record the target transaction and the first transaction signature together to the blockchain;
A second receiving unit, configured to receive a uplink acknowledgement request for the target transaction, where the uplink acknowledgement request includes a second transaction signature of the target transaction, and the second transaction signature conforms to a first signature verification rule;
A second recording unit configured to record, when it is determined that the uplink acknowledgement request matches the target transaction in the blockchain, the target transaction included in the uplink acknowledgement request to the blockchain together with the second transaction signature, the second transaction signature allowing the target transaction to be accessed.
18. An electronic device comprising a memory and a processor, the memory storing a computer program, wherein the processor, when executing the computer program, implements the blockchain transaction chaining method of any of claims 1 to 16.
19. A computer readable storage medium storing a computer program, wherein the computer program when executed by a processor implements the blockchain transaction chaining method of any of claims 1 to 16.
20. A computer program product comprising a computer program that is read and executed by a processor of a computer device to cause the computer device to perform the blockchain transaction chaining method of any of claims 1 to 16.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202410244009.0A CN117828647B (en) | 2024-03-04 | 2024-03-04 | Block chain transaction uplink method, related device and medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202410244009.0A CN117828647B (en) | 2024-03-04 | 2024-03-04 | Block chain transaction uplink method, related device and medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN117828647A CN117828647A (en) | 2024-04-05 |
CN117828647B true CN117828647B (en) | 2024-05-10 |
Family
ID=90519497
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202410244009.0A Active CN117828647B (en) | 2024-03-04 | 2024-03-04 | Block chain transaction uplink method, related device and medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN117828647B (en) |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111324425A (en) * | 2020-02-28 | 2020-06-23 | 百度在线网络技术(北京)有限公司 | Data access method, device, equipment and storage medium |
CN117203933A (en) * | 2021-04-13 | 2023-12-08 | 区块链许可股份公司 | System and method based on block chain |
CN117251889A (en) * | 2023-11-13 | 2023-12-19 | 腾讯科技(深圳)有限公司 | Block chain consensus method, related device and medium |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113568981B (en) * | 2021-09-24 | 2022-01-07 | 腾讯科技(深圳)有限公司 | Transaction data processing method, device, equipment and medium |
-
2024
- 2024-03-04 CN CN202410244009.0A patent/CN117828647B/en active Active
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111324425A (en) * | 2020-02-28 | 2020-06-23 | 百度在线网络技术(北京)有限公司 | Data access method, device, equipment and storage medium |
CN117203933A (en) * | 2021-04-13 | 2023-12-08 | 区块链许可股份公司 | System and method based on block chain |
CN117251889A (en) * | 2023-11-13 | 2023-12-19 | 腾讯科技(深圳)有限公司 | Block chain consensus method, related device and medium |
Non-Patent Citations (2)
Title |
---|
区块链隐私保护研究与实践综述;张奥 等;软件学报;20200515;第31卷(第5期);第1406-1434页 * |
支持陷门撤销和编辑次数限制的可编辑区块链;陈越 等;通信学报;20230731;第44卷(第7期);第100-113页 * |
Also Published As
Publication number | Publication date |
---|---|
CN117828647A (en) | 2024-04-05 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN112184222B (en) | Service processing method, device and equipment based on block chain | |
US9219722B2 (en) | Unclonable ID based chip-to-chip communication | |
US12003505B2 (en) | Custom authorization of network connected devices using signed credentials | |
EP4191430A1 (en) | Data processing method and apparatus applied to blockchain system | |
Cano et al. | Preserving data privacy in the internet of medical things using dual signature ECDSA | |
US9565211B2 (en) | Managing exchanges of sensitive data | |
CN104579649A (en) | Identity recognition method and system | |
CN111737720B (en) | Data processing method and device and electronic equipment | |
CN110096894B (en) | Data anonymous sharing system and method based on block chain | |
EP4412152A1 (en) | Authentication method and communication apparatus | |
AU2016325979A1 (en) | Information registration and authentication method and device | |
CN108549824A (en) | A kind of data desensitization method and device | |
JP2022528072A (en) | Local ledger blockchain for secure electronic controller updates | |
CN114629713B (en) | Identity verification method, device and system | |
CN117828647B (en) | Block chain transaction uplink method, related device and medium | |
US20100014675A1 (en) | Appraising Systems With Zero Knowledge Proofs | |
CN116090020B (en) | Block chain-based information storage method and device, electronic equipment and storage medium | |
CN114978645B (en) | Block chain-based data processing method, device, server and storage medium | |
CN114567425B (en) | Internet of things communication method and system, soC Sim and Internet of things terminal | |
CN115037484B (en) | Digital collection receiving method and device and electronic equipment | |
Dhal et al. | A new object searching protocol for multi-tag RFID | |
CN117499418A (en) | Block chain transaction uplink method, related device and medium | |
CN118520446A (en) | Identity verification method, related device and medium | |
CN117097552A (en) | Data communication method, device, equipment and medium | |
KR20230056251A (en) | Signature method and system based on key insulation |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |