A method and device for processing blockchain transactions

By using the first auxiliary information of the transaction cluster in blockchain transactions to link the previous transaction and only sign the last transaction, the problem of heavy workload of the transaction initiator and verification party is solved, and transaction efficiency and security are improved sex.

CN112348673BActive Publication Date: 2025-01-10WEBANK (CHINA)
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202011124587.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-10-20
Publication Date
2025-01-10
Estimated Expiration
2040-10-20

AI Technical Summary

Technical Problem

In the existing blockchain transaction processing methods, the transaction initiator and the transaction verification party need to sign and verify each transaction, resulting in an increase in workload and affecting transaction efficiency.

Method used

By using the first auxiliary information to link the previous transaction in the transaction cluster, a transaction chain is formed and only the last transaction in the transaction cluster is signed, reducing the amount of signature data and verification work.

Benefits of technology

It reduces the computing load of transaction initiators and transaction verification parties, improves the efficiency of transaction initiation and verification, and avoids network congestion and insufficient memory.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112348673B_ABST
    Figure CN112348673B_ABST
Patent Text Reader

Abstract

The present invention discloses a method and device for processing blockchain transactions, including: a transaction initiator determines the first auxiliary information of the current transaction and the second auxiliary information of the current transaction, wherein the first auxiliary information is used to link the previous transaction to form a transaction chain of a transaction cluster, and the second auxiliary information is used to indicate the last transaction in the transaction cluster, and the second auxiliary information is the signature information obtained by signing the last transaction in the transaction cluster, and then constructs a transaction message of the current transaction and sends it to a transaction verifier, wherein the transaction message includes transaction content, the first auxiliary information and the second auxiliary information. The transaction initiator links the previous transaction according to the first auxiliary information of the current transaction to prevent the previous transaction from being tampered with. When the transaction initiator generates the last transaction in the transaction cluster, only the last transaction in the transaction cluster is signed, which reduces the workload of the transaction initiator in generating signatures and reduces the data volume of transaction signatures.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of financial technology (Fintech), and in particular to a method and device for blockchain transaction processing. Background Art

[0002] With the development of computer technology, more and more technologies (such as blockchain, cloud computing or big data) are being applied in the financial field. The traditional financial industry is gradually transforming into financial technology, and big data technology is no exception. However, due to the security and real-time requirements of the financial and payment industries, higher requirements are also placed on big data technology.

[0003] The transaction processing method in the blockchain network is as follows: the transaction initiator generates transactions and signs each transaction, and then broadcasts the signed transactions to the blockchain network. After receiving the newly generated transaction, the transaction verifier will verify the signature and transaction content (such as the legitimacy of the transaction account). If the transaction verification is successful, the transaction will be placed in the local transaction pool of the transaction verifier, and then the transactions will be packaged into blocks in order from the transaction pool. The packaged blocks will be verified by the consensus node and consensus will be uploaded to the chain.

[0004] According to the above transaction processing method, it can be seen that each transaction needs to be signed, which increases the workload of the transaction initiator to generate the signature on the one hand, and on the other hand, the transaction verifier needs to verify the signature of each transaction, which also increases the workload of the transaction verifier to verify the signature. Therefore, it is necessary to provide a new transaction construction scheme and transaction verification scheme to reduce the workload of the transaction initiator and the transaction verifier. Summary of the invention

[0005] The embodiments of the present invention provide a method and device for blockchain transaction processing, which are used to reduce the amount of data in transaction signatures and improve the efficiency of transaction verification.

[0006] In a first aspect, an embodiment of the present invention provides a method for blockchain transaction processing, comprising:

[0007] The transaction initiator determines the first auxiliary information of the current transaction and the second auxiliary information of the current transaction; wherein the first auxiliary information is used to link the previous transaction to form a transaction chain of the transaction cluster; the second auxiliary information is used to indicate the last transaction in the transaction cluster, and the second auxiliary information is the signature information obtained by signing the last transaction in the transaction cluster;

[0008] The transaction initiator constructs a transaction message of the current transaction and sends it to the transaction verifier; wherein the transaction message includes transaction content, first auxiliary information and second auxiliary information.

[0009] In the above technical solution, the transaction initiator links the previous transaction according to the first auxiliary information of the current transaction to prevent the previous transaction from being tampered with, so that the transaction initiator can send the generated transaction to the transaction verifier, connect the transactions according to the first auxiliary information, thereby forming a transaction chain of the transaction cluster, and verify the previous transaction by the current transaction to prevent the sent transaction from being tampered with. When the transaction initiator generates the last transaction in the transaction cluster, it only needs to sign the content of the last transaction to obtain the signature information, instead of signing the content of all transactions, which reduces the signature information generated by the transaction initiator for the transaction, and verifies the authenticity of all transactions in the transaction cluster through the last signature, reduces the amount of transaction signature data, and improves the efficiency of the transaction initiator initiating transactions.

[0010] Optionally, the transaction initiator determines the first auxiliary information of the current transaction, including:

[0011] The transaction initiator obtains the transaction message of the previous transaction of the current transaction according to the transaction number of the current transaction;

[0012] The transaction initiator hashes the transaction message of the previous transaction to obtain the first auxiliary information of the current transaction.

[0013] In the above technical scheme, the transaction message of the previous transaction of the current transaction in the transaction cluster is determined according to the transaction number, and then the first auxiliary information of the current transaction is obtained. The current transaction is linked to the previous transaction according to the first auxiliary information to form a transaction chain to prevent the previous transaction from being tampered with. In this way, the transaction initiator can send the generated transactions in parallel (generate and send) to the transaction verifier without the need for batch accumulation of unified methods, thus avoiding network congestion when the transaction initiator is sending the transaction and avoiding tampering of the sent transactions.

[0014] Optionally, the transaction initiator determines the second auxiliary information of the current transaction, including:

[0015] The transaction initiator determines that the current transaction is the last transaction in the transaction cluster, and then signs the transaction content of the current transaction and the first auxiliary information of the current transaction to obtain the second auxiliary information of the current transaction;

[0016] The transaction initiator determines that the current transaction is not the last transaction in the transaction cluster, and then sets the second auxiliary information of the current transaction to a null value.

[0017] In the above technical solution, when the transaction initiator determines that the current transaction is the last transaction in the transaction cluster, the current transaction is signed, otherwise it is not signed. That is to say, for a transaction chain of a transaction cluster, the content of the last transaction on the transaction chain is signed, not the content of all transactions in the transaction chain of the transaction cluster. This reduces the signature information generated by the transaction initiator, reduces the amount of calculation for the signature by the transaction initiator, shortens the calculation time for the transaction initiator to generate the transaction, and avoids insufficient memory when signing due to the excessive amount of content data of the batch transactions when sending transactions in batches.

[0018] Optionally, the transaction initiator determines that the current transaction is the last transaction in the transaction cluster, including:

[0019] The transaction initiator determines the quantity threshold of the transaction cluster according to the transaction number of the current transaction; or the transaction initiator determines the duration threshold of the transaction cluster according to the transaction timestamp of the current transaction.

[0020] Optionally, the transaction content includes the transaction timestamp, the blockchain account address of the transaction initiator, the blockchain account address of the transaction recipient, the transaction amount and the transaction number.

[0021] In a second aspect, an embodiment of the present invention provides a method for blockchain transaction processing, including:

[0022] For any transaction message in the transaction cluster sent by the transaction initiator, the transaction verifier performs message verification on the transaction message after receiving the transaction message; wherein the message verification includes: determining whether the transaction content in the transaction message is legal, determining whether the first auxiliary information in the transaction message is linked to the previous transaction in the transaction cluster, and determining whether the second auxiliary information in the transaction message of the last transaction in the transaction cluster is the signature of the transaction initiator for the last transaction in the transaction cluster;

[0023] After verifying each transaction message in the transaction cluster, the transaction verifier uses each transaction message in the transaction cluster as a transaction to be packaged.

[0024] In the above technical solution, the transaction verifier determines whether any received transaction is correct based on the transaction content, determines whether the current transaction is linked to the previous transaction in the transaction cluster based on the first auxiliary information, and then determines that each transaction on the transaction chain of the transaction cluster is signed and sent by the transaction initiator based on the second auxiliary information, and then uses each transaction as a transaction to be packaged into a block. The transaction verifier can also verify the previous transaction based on the first auxiliary information to avoid tampering with the previous transaction received. When the last transaction in the transaction cluster is received, it only needs to verify the label information of the last transaction, and there is no need to verify the label information of each transaction again, which reduces the workload of the transaction verifier in verifying transactions, avoids the increase in the transaction verifier's computing load and computing time due to the batch sending of transactions by the transaction initiator, and improves the efficiency of the transaction verifier in verifying transactions.

[0025] Optionally, determining whether the first auxiliary information in the transaction message is linked to a previous transaction in the transaction cluster includes:

[0026] Get the transaction message of the previous transaction;

[0027] Hash the transaction message of the previous transaction to obtain a first hash result;

[0028] Determine whether the first hash result is the same as the first auxiliary information.

[0029] In the above technical solution, if the first hash result is the same as the first auxiliary information, the current transaction is linked after the previous transaction, which not only constitutes a transaction chain, but also verifies the previous transaction, prevents the content of the previous transaction from being tampered with, and avoids security risks.

[0030] Optionally, determining whether the second auxiliary information in the transaction message of the last transaction in the transaction cluster is a signature of the transaction initiator for the last transaction in the transaction cluster includes:

[0031] Hash the transaction content and the first auxiliary information in the transaction message of the last transaction to obtain a second hash result;

[0032] Decrypting the second auxiliary information using the public key of the transaction initiator to obtain a third hash result;

[0033] Determine whether the second hash result is the same as the third hash result.

[0034] In the above technical solution, if the second hash result is the same as the second auxiliary information, the signature verification of the transaction is passed. Since the signature information is the last transaction in the transaction cluster, each transaction in the transaction cluster is also verified. Moreover, since they are all transactions on the transaction chain, the security of each transaction is guaranteed, and there is no need to verify each transaction again, which reduces the workload of the transaction verifier in verifying the transaction and improves the efficiency of the transaction verifier in verifying the transaction.

[0035] In a third aspect, an embodiment of the present invention provides a device for blockchain transaction processing, including:

[0036] A processing module, used to determine first auxiliary information of a current transaction and second auxiliary information of the current transaction; wherein the first auxiliary information is used to link a previous transaction to form a transaction chain of a transaction cluster; the second auxiliary information is used to indicate the last transaction in the transaction cluster, and the second auxiliary information is signature information obtained by signing the last transaction in the transaction cluster;

[0037] The sending module is used to construct a transaction message of the current transaction and send it to the transaction verifier; wherein the transaction message includes transaction content, first auxiliary information and second auxiliary information.

[0038] Optionally, the processing module is specifically used for:

[0039] Obtaining a transaction message of a transaction before the current transaction according to the transaction number of the current transaction;

[0040] The transaction message of the previous transaction is hashed to obtain the first auxiliary information of the current transaction.

[0041] Optionally, the processing module is specifically used for:

[0042] Determining that the current transaction is the last transaction in the transaction cluster, signing the transaction content of the current transaction and the first auxiliary information of the current transaction to obtain the second auxiliary information of the current transaction;

[0043] If it is determined that the current transaction is not the last transaction in the transaction cluster, the second auxiliary information of the current transaction is set to a null value.

[0044] Optionally, the processing module is specifically used for:

[0045] According to the transaction number of the current transaction, a quantity threshold of the transaction cluster is determined; or according to the transaction timestamp of the current transaction, a duration threshold of the transaction cluster is determined.

[0046] Optionally, the transaction content includes the transaction timestamp, the blockchain account address of the transaction initiator, the blockchain account address of the transaction recipient, the transaction amount and the transaction number.

[0047] In a fourth aspect, an embodiment of the present invention provides a device for blockchain transaction processing, including:

[0048] The verification unit performs message verification on any transaction message in the transaction cluster sent by the transaction initiator after receiving the transaction message; wherein the message verification includes: determining whether the transaction content in the transaction message is legal, determining whether the first auxiliary information in the transaction message is linked to the previous transaction in the transaction cluster, and determining whether the second auxiliary information in the transaction message of the last transaction in the transaction cluster is the signature of the transaction initiator for the last transaction in the transaction cluster;

[0049] The processing unit, after verifying each transaction message in the transaction cluster, uses each transaction message in the transaction cluster as a transaction to be packaged.

[0050] Optionally, the verification unit is specifically used for:

[0051] Get the transaction message of the previous transaction;

[0052] Hash the transaction message of the previous transaction to obtain a first hash result;

[0053] Determine whether the first hash result is the same as the first auxiliary information.

[0054] Optionally, the verification unit is specifically used for:

[0055] Hash the transaction content and the first auxiliary information in the transaction message of the last transaction to obtain a second hash result;

[0056] Decrypting the second auxiliary information using the public key of the transaction initiator to obtain a third hash result;

[0057] Determine whether the second hash result is the same as the third hash result.

[0058] In a fifth aspect, an embodiment of the present invention further provides a computing device, including:

[0059] A memory for storing program instructions;

[0060] The processor is used to call the program instructions stored in the memory and execute the above-mentioned blockchain transaction processing method according to the obtained program.

[0061] In a sixth aspect, an embodiment of the present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer-executable instructions, and the computer-executable instructions are used to enable a computer to execute the above-mentioned blockchain transaction processing method. BRIEF DESCRIPTION OF THE DRAWINGS

[0062] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0063] Figure 1 A schematic diagram of a system architecture provided for an embodiment of the present invention;

[0064] Figure 2 A flowchart of a method for processing blockchain transactions provided by an embodiment of the present invention;

[0065] Figure 3 A schematic diagram of a blockchain transaction chain provided by an embodiment of the present invention;

[0066] Figure 4 A schematic diagram of a blockchain transaction process provided by an embodiment of the present invention;

[0067] Figure 5 A schematic diagram of a blockchain transaction process provided by an embodiment of the present invention;

[0068] Figure 6 A schematic diagram of a blockchain transaction process provided by an embodiment of the present invention;

[0069] Figure 7 A flowchart of a method for processing blockchain transactions provided by an embodiment of the present invention;

[0070] Figure 8 A schematic diagram of a blockchain transaction verification provided by an embodiment of the present invention;

[0071] Fig. 9 A schematic diagram of a blockchain transaction processing structure provided by an embodiment of the present invention;

[0072] Fig.10 A schematic diagram of the structure of a blockchain transaction processing provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0073] In order to make the purpose, technical scheme and advantages of the present invention clearer, the present invention will be further described in detail below with reference to the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0074] In the prior art, in order to reduce the workload of the transaction initiator and the transaction verifier, the transaction processing method of aggregated signatures is generally used to speed up the transaction verification speed and reduce the storage of voting signatures in the process of packaging transactions into blocks (such as: 21 Byzantine nodes are used in the EOS consensus mechanism, and 7 Byzantine nodes are used in the NEO consensus mechanism). The batch transaction processing method is used to reduce the generation of transaction signatures. However, the above two transaction processing methods have the following disadvantages:

[0075] The disadvantage of the transaction processing method of aggregate signatures is that each node generally has a copy of the block, which makes the storage cost of the transaction very high. Each transaction in the block needs to store its signature, which consumes a lot of storage space. In addition, the transaction method of aggregate signatures only reduces the storage of voting signatures when packaging transactions, and does not reduce the time spent by the block generation node and consensus node to verify the signature of each transaction. Therefore, the block generation speed and consensus speed are inefficient, resulting in low performance of the blockchain.

[0076] The disadvantage of batch transaction processing is that the initiator of the transaction blocks the sending of transactions until a certain number of transactions are accumulated or a certain time interval is reached, and then signs the batch transactions and sends them to other nodes. However, sending a large number of transactions at one time can easily lead to insufficient memory and network congestion during calculation, and transactions cannot be sent and verified in parallel (i.e., one transaction is generated and sent at a time). When signing, all transaction contents stored in the batch are hashed and then signed, which consumes a lot of computing power on the transaction initiator.

[0077] An embodiment of the present invention provides a method for processing blockchain transactions, which is used to reduce the workload of a transaction initiator and a transaction verifier.

[0078] Figure 1 A system architecture applicable to an embodiment of the present invention is exemplarily shown, and the system architecture includes a transaction initiator 110 and a transaction verifier 120 .

[0079] Among them, the transaction initiator 110 can be a client, server, etc. of an organization, or an SDK (Software Development Kit) for initiating transactions, wherein the first auxiliary information in the current transaction initiated is obtained by hashing the transaction message of the previous transaction, and the second auxiliary information is obtained by signing the last transaction in the transaction cluster determined by the transaction initiator 110 according to the quantity threshold or time threshold.

[0080] The transaction verifier 120 can be any server, client, etc. The transaction verifier 120 is a participant with a unique identity in the blockchain network, has a complete copy of the ledger, and has the ability to participate in the blockchain network consensus and ledger maintenance. It is used to verify the legitimacy of the transaction when it is received, and pack the verified transactions into blocks as blocks to be agreed upon.

[0081] It should be noted that the above Figure 1 The structure shown is only an example and is not limited to this embodiment of the present invention.

[0082] Based on the above description, Figure 2 The process of a blockchain transaction processing method provided by an embodiment of the present invention is exemplarily shown, and the process can be executed by a transaction processing device.

[0083] like Figure 2 As shown in the figure, the process specifically includes:

[0084] Step 210: The transaction initiator determines the first auxiliary information of the current transaction and the second auxiliary information of the current transaction.

[0085] In the embodiment of the present invention, the first auxiliary information is used to link the previous transaction to form a transaction chain of the transaction cluster, and the second auxiliary information is used to indicate the last transaction in the transaction cluster, and the second auxiliary information is the signature information obtained by signing the last transaction in the transaction cluster. The first auxiliary information is determined according to the transaction message of the previous transaction, and the previous transaction is determined according to the transaction number in each transaction.

[0086] Furthermore, the transaction initiator obtains the transaction message of the previous transaction according to the transaction number of the current transaction, and then hashes the transaction message of the previous transaction to obtain the first auxiliary information of the current transaction.

[0087] In the embodiment of the present invention, the transaction message of the previous transaction includes the timestamp of the previous transaction, the blockchain account address of the transaction initiator, the blockchain account address of the transaction recipient, the transaction amount, the transaction number and the first auxiliary information. The transaction message of the previous transaction is hashed to obtain the first auxiliary information of the current transaction, and then the previous transaction is linked to the first auxiliary information of the current transaction to form a transaction chain of the transaction cluster. For example, Figure 3 A schematic diagram of a blockchain transaction chain is shown as an example. Figure 3As shown in the figure, if the transaction number of the current transaction is 4, and the previous transaction is the transaction number 3, then the first auxiliary information of the transaction number 4 is obtained by hashing the entire content of the transaction number 3. It should be noted that if the previous transaction is the first transaction in a transaction cluster, the first auxiliary information of the first transaction in the transaction cluster is set to empty, such as the transaction number 2 is the first transaction in the transaction cluster, that is, the first auxiliary information is empty.

[0088] Furthermore, if the transaction initiator determines that the current transaction is the last transaction in the transaction cluster, the transaction content of the current transaction and the first auxiliary information of the current transaction are signed to obtain the second auxiliary information of the current transaction. If it is determined that the current transaction is not the last transaction in the transaction cluster, the second auxiliary information of the current transaction is set to a null value.

[0089] In the embodiment of the present invention, the current transaction is determined to be the last transaction in the transaction cluster according to a preset quantity threshold or time threshold. Specifically, the transaction initiator determines the quantity threshold of the transaction cluster according to the transaction number of the current transaction, or determines the time threshold of the transaction cluster according to the transaction timestamp of the current transaction. For example, if the quantity threshold is 100, the transaction initiator determines the current transaction to be the last transaction in the transaction cluster according to the transaction number of the current transaction (such as 101).

[0090] It should be noted that the quantity threshold and the duration threshold are values ​​that can be preset by the user based on experience, such as the quantity threshold is 100 and the duration threshold is 1 minute.

[0091] Step 220: the transaction initiator constructs a transaction message of the current transaction and sends it to the transaction verifier.

[0092] In an embodiment of the present invention, the transaction message includes transaction content, first auxiliary information and second auxiliary information. The transaction content includes a transaction timestamp, a blockchain account address of a transaction initiator, a blockchain account address of a transaction recipient, a transaction amount and a transaction number.

[0093] In order to better explain the above technical solution, it will be described in detail in the following specific examples.

[0094] Example 1

[0095] based on Figure 3 Describe, Figure 4 is a schematic diagram showing an exemplary blockchain transaction process, such as Figure 4As shown, the SDK generates a transaction as the first transaction in the transaction cluster and sends it to the node connected in the blockchain network (transaction initiator). For example, if 100 digital assets on the blockchain are transferred to Bob through the SDK, the transaction initiator obtains the current time, determines the timestamp, the blockchain account address of the SDK, the blockchain address of Bob (transaction recipient), the transaction amount, and queries its own transaction number in the blockchain network (such as the transaction number is 1) and adds one as the transaction number (2) of the current transaction (the first transaction TX1). Because the current transaction is the first transaction in the transaction cluster, the first auxiliary information is empty. The current transaction is not the last transaction in the transaction cluster, so the second auxiliary information is empty.

[0096] Based on the above description, Figure 5 is a schematic diagram showing an exemplary blockchain transaction process, such as Figure 5 As shown, the SDK generates the second transaction in the transaction cluster and sends it to the transaction initiator in the blockchain network. For example, if the digital assets on 42 blockchains are sent to Tony through the SDK, the transaction initiator determines the timestamp of the current transaction (the second transaction TX2) according to the above description, the blockchain account address of the SDK, the blockchain address of Tony (transaction recipient), the transaction amount, and queries its own transaction number (2) in the blockchain network and adds one as the transaction number (3) of the current transaction (the second transaction TX2). Because the current transaction is the second transaction in the transaction cluster, the first auxiliary information of the second transaction TX2 is obtained by hashing the transaction message of the first transaction TX1. If the current transaction is not the last transaction in the transaction cluster, the second auxiliary information is empty.

[0097] Based on the above description, Figure 6 is a schematic diagram showing an exemplary blockchain transaction process, such as Figure 6As shown, when the number of transactions reaches the number threshold, or the timestamp from the first transaction reaches the time threshold, the generated transaction is the last transaction in the transaction cluster. For example, when the SDK generates the 100th (number threshold) transaction, it sends 89 digital assets on the blockchain to Lucy. The transaction initiator determines the timestamp of the current transaction (the 100th transaction TX100) according to the above description, the blockchain account address of the SDK, the blockchain address of Lucy (transaction recipient), the transaction amount, and queries its own transaction number (100) in the blockchain network and adds one as the transaction number (101) of the current transaction (the 100th transaction TX100). Because the current transaction is the last transaction in the transaction cluster, the first auxiliary information of the 100th transaction TX100 is obtained by hashing the transaction message of the 99th transaction TX99. Then the SDK hashes the transaction message of the 100th transaction TX100 to obtain the signature hash, and signs the signature hash with the private key corresponding to its own blockchain account to determine the signature information.

[0098] In the embodiment of the present invention, the authenticity of each transaction in the transaction cluster can be proved by a signature (the signature of the last transaction). The transactions in the transaction cluster form a chain structure, and the transaction at the end of the chain has the signature of the transaction initiator. If an attacker attempts to modify the content of one of the transactions, the hash value of this transaction will change, which will not match the first auxiliary information in the next transaction, resulting in the forged transaction not being recognized. Therefore, the transaction chain ensures that the transactions in the transaction cluster are not tampered with, and one signature proves the authenticity of the transactions in the entire transaction cluster. And the transaction cluster construction can be completed in parallel, only need to sign at the end of the chain, no need to block transactions, and batch calculate hashes after the transaction collection is completed and then sign. The embodiment of the present invention completes a transaction and can send it to the transaction verifier, which can avoid the centralized calculation of the transaction generator, insufficient memory and network congestion during the sending process.

[0099] Figure 7 The process of a blockchain transaction processing method provided by an embodiment of the present invention is exemplarily shown, and the process can be executed by a transaction processing device.

[0100] like Figure 7 As shown, the specific process includes:

[0101] Step 710: For any transaction message in the transaction cluster sent by the transaction initiator, the transaction verifier performs message verification on the transaction message after receiving the transaction message.

[0102] In an embodiment of the present invention, message verification includes: determining whether the transaction content in the transaction message is legal, determining whether the first auxiliary information in the transaction message is linked to the previous transaction in the transaction cluster, and determining whether the second auxiliary information in the transaction message of the last transaction in the transaction cluster is the signature of the transaction initiator for the last transaction in the transaction cluster.

[0103] Furthermore, verifying a transaction includes verifying the timestamp of the current transaction (if the time interval between the timestamp of the current transaction and the timestamp of the previous transaction is less than a preset time value, the verification is passed), the blockchain account address of the transaction initiator (if the blockchain account address of the transaction initiator of the current transaction is consistent with the blockchain account address of each transaction in the transaction cluster, the verification is passed), the transaction amount (if the amount in the blockchain account of the transaction initiator meets the transaction amount of the current transaction, the verification is passed), and the transaction number (if the current transaction number is continuous with the transaction number of the previous transaction, the verification is passed). For example, in combination with the above Figure 2 The technical solution is that after the transaction verifier receives the first transaction TX1, it verifies the timestamp of TX1, the blockchain account address of the transaction initiator, the blockchain account address of the transaction recipient, the transaction amount and the transaction number. If the verification is successful, TX1 is placed in the transaction pool.

[0104] In an embodiment of the present invention, after the transaction verifier obtains the second transaction, the current transaction is verified based on the previous transaction. Specifically, the transaction message of the previous transaction is obtained, the transaction message of the previous transaction is hashed to obtain a first hash result, and it is determined whether the first hash result is the same as the first auxiliary information. If they are the same, the verification is passed, and the current transaction belongs to a transaction in the transaction cluster.

[0105] When the current transaction is the last transaction in the transaction cluster, it is necessary not only to verify the first auxiliary information of the current transaction, but also to determine whether the second auxiliary information of the current transaction is the signature of the transaction initiator for the last transaction in the transaction cluster. Specifically, the transaction content and the first auxiliary information in the transaction message of the last transaction are hashed to obtain the second hash result, and then the second auxiliary information is decrypted using the public key of the transaction initiator to obtain the third hash result, and it is determined whether the second hash result is the same as the third hash result. If they are the same, the second auxiliary information of the current transaction is verified, and the transaction cluster is a verified legal transaction cluster.

[0106] In order to better explain the above technical solution, it will be described in detail below with reference to a specific example.

[0107] Example 2

[0108] Combined with the above Figures 4 to 6 , Figure 8 A schematic diagram of blockchain transaction verification is shown as an example. Figure 8 As shown, after receiving the last transaction of the transaction cluster sent by the transaction initiator A, the transaction verifier B verifies the content of the current transaction (the 100th transaction TX100 in the transaction cluster), including the timestamp of TX100, the blockchain account address of the transaction initiator, the transaction amount and the transaction number, and then verifies the first auxiliary information of TX100 according to the transaction message of TX99. Then, the first auxiliary information, timestamp, blockchain account address of the transaction initiator, transaction amount and transaction number of TX100 that has passed the verification are hashed, and the public key sent by the transaction initiator is used to verify the second auxiliary information in TX100. If the signature verification passes, it proves that TX100 is indeed generated by the transaction initiator. And the first auxiliary information of TX100 indicates TX99 in the transaction cluster, that is, TX99 is also generated and approved by the transaction initiator. By analogy, from TX1 to TX100 are all generated and approved by the transaction initiator, so this transaction cluster is a legal transaction cluster that has passed the verification.

[0109] Step 720: After verifying each transaction message in the transaction cluster, the transaction verifier uses each transaction message in the transaction cluster as a transaction to be packaged.

[0110] In the embodiment of the present invention, only after the last transaction is verified, each transaction message in the transaction cluster is used as a transaction to be packaged. Only the tag information of the last transaction needs to be verified, and there is no need to verify the tag information of each transaction. This reduces the workload of the transaction verifier in verifying transactions, avoids the increase in the transaction verifier's computing load and computing time due to the batch sending of transactions by the transaction initiator, and improves the efficiency of the transaction verifier in verifying transactions.

[0111] Based on the same technical concept, Fig. 9 The structure of a blockchain transaction processing device provided by an embodiment of the present invention is exemplarily shown, and the device can execute the process of the blockchain transaction processing method.

[0112] like Fig. 9 As shown, the device specifically includes:

[0113] Processing module 910 is used to determine the first auxiliary information of the current transaction and the second auxiliary information of the current transaction; wherein the first auxiliary information is used to link the previous transaction to form a transaction chain of the transaction cluster; the second auxiliary information is used to indicate the last transaction in the transaction cluster, and the second auxiliary information is the signature information obtained by signing the last transaction in the transaction cluster;

[0114] The sending module 920 is used to construct a transaction message of the current transaction and send it to the transaction verifier; wherein the transaction message includes transaction content, first auxiliary information and second auxiliary information.

[0115] Optionally, the processing module 910 is specifically used for:

[0116] Obtaining a transaction message of a transaction before the current transaction according to the transaction number of the current transaction;

[0117] The transaction message of the previous transaction is hashed to obtain the first auxiliary information of the current transaction.

[0118] Optionally, the processing module 910 is specifically used for:

[0119] Determining that the current transaction is the last transaction in the transaction cluster, signing the transaction content of the current transaction and the first auxiliary information of the current transaction to obtain the second auxiliary information of the current transaction;

[0120] If it is determined that the current transaction is not the last transaction in the transaction cluster, the second auxiliary information of the current transaction is set to a null value.

[0121] Optionally, the processing module 910 is specifically used for:

[0122] According to the transaction number of the current transaction, a quantity threshold of the transaction cluster is determined; or according to the transaction timestamp of the current transaction, a duration threshold of the transaction cluster is determined.

[0123] Optionally, the transaction content includes the transaction timestamp, the blockchain account address of the transaction initiator, the blockchain account address of the transaction recipient, the transaction amount and the transaction number.

[0124] Based on the same technical concept, Fig.10 The structure of a blockchain transaction processing device provided by an embodiment of the present invention is exemplarily shown, and the device can execute the process of the blockchain transaction processing method.

[0125] like Fig.10 As shown, the device specifically includes:

[0126] The verification unit 1010 performs message verification on any transaction message in the transaction cluster sent by the transaction initiator after receiving the transaction message; wherein the message verification includes: determining whether the transaction content in the transaction message is legal, determining whether the first auxiliary information in the transaction message is linked to the previous transaction in the transaction cluster, and determining whether the second auxiliary information in the transaction message of the last transaction in the transaction cluster is the signature of the transaction initiator for the last transaction in the transaction cluster;

[0127] The processing unit 1020, after verifying each transaction message in the transaction cluster, takes each transaction message in the transaction cluster as a transaction to be packaged.

[0128] Optionally, the verification unit 1010 is specifically used for:

[0129] Get the transaction message of the previous transaction;

[0130] Hash the transaction message of the previous transaction to obtain a first hash result;

[0131] Determine whether the first hash result is the same as the first auxiliary information.

[0132] Optionally, the verification unit 1010 is specifically used for:

[0133] Hash the transaction content and the first auxiliary information in the transaction message of the last transaction to obtain a second hash result;

[0134] Decrypting the second auxiliary information using the public key of the transaction initiator to obtain a third hash result;

[0135] Determine whether the second hash result is the same as the third hash result.

[0136] Based on the same technical concept, an embodiment of the present invention further provides a computing device, including:

[0137] A memory for storing program instructions;

[0138] The processor is used to call the program instructions stored in the memory and execute the above-mentioned blockchain transaction processing method according to the obtained program.

[0139] Based on the same technical concept, an embodiment of the present invention also provides a computer-readable storage medium, which stores computer-executable instructions, and the computer-executable instructions are used to enable a computer to execute the above-mentioned blockchain transaction processing method.

[0140] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.

[0141] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0142] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0143] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0144] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.

Claims

1. A method for blockchain transaction processing, characterized in that: include: The transaction initiator determines the first auxiliary information of the current transaction and the second auxiliary information of the current transaction; wherein the first auxiliary information is used to link the previous transaction to form a transaction chain of the transaction cluster; the second auxiliary information is used to indicate the last transaction in the transaction cluster, and the second auxiliary information is the signature information obtained by signing the last transaction in the transaction cluster; The transaction initiator determines the first auxiliary information of the current transaction, including: the transaction initiator obtains the transaction message of the previous transaction of the current transaction according to the transaction number of the current transaction; the transaction initiator performs hashing on the transaction message of the previous transaction to obtain the first auxiliary information of the current transaction; The transaction initiator constructs a transaction message of the current transaction and sends it to the transaction verifier; wherein the transaction message includes transaction content, first auxiliary information and second auxiliary information.

2. The method according to claim 1, characterized in that The transaction initiator determines the second auxiliary information of the current transaction, including: The transaction initiator determines that the current transaction is the last transaction in the transaction cluster, and then signs the transaction content of the current transaction and the first auxiliary information of the current transaction to obtain the second auxiliary information of the current transaction; The transaction initiator determines that the current transaction is not the last transaction in the transaction cluster, and then sets the second auxiliary information of the current transaction to a null value.

3. The method according to claim 2, characterized in that The transaction initiator determines that the current transaction is the last transaction in the transaction cluster, including: The transaction initiator determines, according to the transaction number of the current transaction, a quantity threshold that satisfies the transaction cluster; or The transaction initiator determines, according to the transaction timestamp of the current transaction, a time threshold for satisfying the transaction cluster.

4. The method according to any one of claims 1 to 3, characterized in that The transaction content includes the transaction timestamp, the blockchain account address of the transaction initiator, the blockchain account address of the transaction recipient, the transaction amount and the transaction number.

5. A method for processing blockchain transactions, characterized in that: include: For any transaction message in the transaction cluster sent by the transaction initiator, the transaction verifier performs message verification on the transaction message after receiving the transaction message; wherein the message verification includes: determining whether the transaction content in the transaction message is legal, determining whether the first auxiliary information in the transaction message is linked to the previous transaction of the transaction corresponding to the transaction message in the transaction cluster, and determining whether the second auxiliary information in the transaction message of the last transaction in the transaction cluster is the signature of the transaction initiator for the last transaction in the transaction cluster; the first auxiliary information is obtained by hashing the transaction message of the previous transaction of the transaction corresponding to the transaction message; wherein determining whether the first auxiliary information in the transaction message is linked to the previous transaction of the transaction corresponding to the transaction message in the transaction cluster includes: obtaining the transaction message of the previous transaction of the transaction corresponding to the transaction message; hashing the transaction message of the previous transaction of the transaction corresponding to the transaction message to obtain a first hash result; determining whether the first hash result is the same as the first auxiliary information; After verifying each transaction message in the transaction cluster, the transaction verifier uses each transaction message in the transaction cluster as a transaction to be packaged.

6. The method according to claim 5, characterized in that Determining whether the second auxiliary information in the transaction message of the last transaction in the transaction cluster is the signature of the transaction initiator for the last transaction in the transaction cluster includes: Hash the transaction content and the first auxiliary information in the transaction message of the last transaction to obtain a second hash result; Decrypting the second auxiliary information using the public key of the transaction initiator to obtain a third hash result; Determine whether the second hash result is the same as the third hash result.

7. A device for blockchain transaction processing, characterized in that: include: A processing module, used to determine the first auxiliary information of the current transaction and the second auxiliary information of the current transaction; wherein the first auxiliary information is used to link the previous transaction to form a transaction chain of the transaction cluster; the second auxiliary information is used to indicate the last transaction in the transaction cluster, and the second auxiliary information is the signature information obtained by signing the last transaction in the transaction cluster; wherein the processing module is used to obtain the transaction message of the previous transaction of the current transaction according to the transaction number of the current transaction when determining the first auxiliary information of the current transaction; and hash the transaction message of the previous transaction to obtain the first auxiliary information of the current transaction; The sending module is used to construct a transaction message of the current transaction and send it to the transaction verifier; wherein the transaction message includes transaction content, first auxiliary information and second auxiliary information.

8. A device for processing blockchain transactions, characterized in that: include: The verification unit performs message verification on any transaction message in the transaction cluster sent by the transaction initiator after receiving the transaction message; wherein the message verification includes: determining whether the transaction content in the transaction message is legal, determining whether the first auxiliary information in the transaction message is linked to the previous transaction in the transaction cluster, and determining whether the second auxiliary information in the transaction message of the last transaction in the transaction cluster is the signature of the transaction initiator for the last transaction in the transaction cluster; wherein determining whether the first auxiliary information in the transaction message is linked to the previous transaction of the transaction corresponding to the transaction message in the transaction cluster includes: obtaining the transaction message of the previous transaction of the transaction corresponding to the transaction message; hashing the transaction message of the previous transaction of the transaction corresponding to the transaction message to obtain a first hash result; and determining whether the first hash result is the same as the first auxiliary information; The processing unit, after verifying each transaction message in the transaction cluster, uses each transaction message in the transaction cluster as a transaction to be packaged.

9. A computing device, characterized in that include: A memory for storing program instructions; A processor, configured to call the program instructions stored in the memory, and execute the method according to any one of claims 1 to 4 or 5 to 6 according to the obtained program.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, and the computer-executable instructions are used to enable a computer to execute the method according to any one of claims 1 to 4 or 5 to 6.

Citation Information

Patent Citations

  • Signature method, signature device and terminal equipment

    CN107911220A

  • Blockchain-based digital asset transaction consistency maintenance method

    CN108282474A