A high TPS blockchain consensus method
Through the election summary node and sub-block technology, the problems of low user participation and questioned security in the DPOS mechanism are solved, and the blockchain consensus with high TPS and fairness are achieved, and the block production efficiency and data confirmation speed are improved.
Patent Information
- Application Number
- CN202111280857.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-01
- Publication Date
- 2024-11-05
- Estimated Expiration
- 2041-11-01
AI Technical Summary
The existing DPOS blockchain consensus mechanism has the problems of high block production efficiency but low user participation and doubts about security, and it is difficult to implement a high TPS blockchain consensus solution.
The summary node is generated through periodic election, the summary node exchanges high signatures, establishes sub-blocks and signs, eliminates duplicate transactions, and the summary node corresponding to the first sub-block generates blocks, and evenly distributes the transaction fee to the endorsement node, increasing the Block production efficiency and data confirmation speed.
It improves the block production efficiency and TPS of blockchain, stimulates the motivation for participation of endorsement nodes, ensures timely confirmation of data, and maintains the fairness of blockchain.
Smart Images

Figure CN114049116B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of blockchain technology, and in particular to a high TPS blockchain consensus method. Background Art
[0002] The most widely used blockchain consensus mechanism is the DPOS mechanism, i.e., the proxy proof of stake. In the DPoS consensus algorithm, the normal operation of the blockchain depends on the trustee. The main responsibilities of the trustee are: collecting transactions in the network, verifying transactions, packaging transactions into blocks, broadcasting blocks, and adding blocks to their own databases after verification by other nodes. The number of trustees in the blockchain is determined by the specific negotiation of the blockchain founders. The number of trustees commonly used is 101. Any user of the blockchain can participate in voting and election of trustees. Blockchain users can vote and withdraw their votes at any time, and the weight of the vote is proportional to the amount of coins they hold. In the DPOS mechanism, only the trustees need to reach a consensus to complete the consensus of the blockchain, so it has a very high efficiency of block generation. The trustees have a sorting order and generate blocks in order. Blocks that are not generated in order will not be accepted by the network, and the corresponding trustees will be punished and eliminated. Therefore, there is no competition between trustees, which can improve the efficiency of block generation and save energy. At the same time, the DPOS mechanism has also encountered some problems in practical applications. Since becoming a trustee requires certain hardware capabilities and technical level requirements, most users find it difficult to become a trustee. As a result, the trustees who maintain the blockchain are always concentrated in a small number of nodes. In addition, there is no benefit for users to participate in voting, so the enthusiasm for voting is not high, making the blockchain easy to be controlled. The security of the DOPS mechanism is therefore questioned. Although there is no competition between trustees in block generation, there is competition for transaction information held by each other. The transaction fees included in the block generation all belong to the block generation node, so the trustees have no motivation to share the transaction information they have collected. Although most transaction information is easily collected by the trustees who currently have the authority to generate blocks, there are also omissions. As a result, transaction information cannot always be confirmed by the blockchain in a timely manner, and there is more or less transaction waiting time. Therefore, it is necessary to continue to study the consensus mechanism of the blockchain. Summary of the invention
[0003] The technical problem to be solved by the present invention is: the technical problem of the lack of a high TPS blockchain consensus solution. A high TPS blockchain consensus method is proposed, which enables the blockchain to obtain a higher TPS and improves the efficiency of the blockchain consensus.
[0004] In order to solve the above technical problems, the technical solution adopted by the present invention is: a high TPS blockchain consensus method, comprising: blockchain nodes periodically elect a number of aggregation nodes, and the several aggregation nodes exchange the height signatures of the blocks to be produced, so as to collect a preset number of height signatures; in the first stage, the endorsement nodes associated with the transaction are signed, and the transactions that meet the number of endorsement node signatures are sent to one or more of the aggregation nodes; in the second stage, the several aggregation nodes respectively establish sub-blocks of the current height according to the transactions they receive, and the sub-blocks include a timestamp and a transaction list, and send the sub-blocks to several blockchain nodes for signature; after signing, the several aggregation nodes broadcast the sub-blocks they have established, and the sub-blocks are sorted according to the transactions they contain. The number of transactions is arranged in descending order, and the duplicate transactions contained in the sub-blocks with the lower order are removed; the summary node corresponding to the first sub-block establishes a block, the block includes a block header and a block body, the block header includes a block height, a hash value of the previous block, a block hash value and a timestamp, the block body includes a reward transfer transaction and several sub-blocks, the reward transfer transaction includes a block reward transaction and several sub-block reward transactions, the block reward transaction is to transfer the block reward to the summary node corresponding to the first sub-block, the sub-block reward transaction is to transfer a part of the transaction fee contained in the sub-block to the summary node corresponding to the sub-block, and the remaining part of the transaction fee is evenly distributed to the endorsement nodes of the transaction to complete the block generation.
[0005] Preferably, the number of sub-block transactions is calculated according to the transfer-out account, that is, transfer transactions from the same account to multiple accounts are counted as one transaction in the transaction quantity statistics. When the aggregation node establishes a sub-block, the transactions transferred from the same account are regularized, and the receiving account and the amount table are associated with the transfer-out account, and the total transfer amount is calculated. The transfer-out account, the total transfer amount, the receiving account and the amount table constitute one regularized transaction.
[0006] Preferably, when the aggregation node corresponding to the first sub-block establishes a block, the transfer-out transactions of the same account involved in the sub-block are regularized, the transfer-out transactions of the same account distributed in different sub-blocks are moved to the sub-block with the front sorting, and the total transfer amount is recalculated.
[0007] Preferably, in the first stage, after the node receiving the transaction information and the transaction signature information verifies the transaction and the transaction signature, it constructs a transaction body, wherein the transaction body includes the transaction information, the transaction signature information, the timestamp and the endorsement node table; the node signs the transaction information and writes it into the endorsement node table, and sends the transaction body to several other blockchain nodes; when the blockchain node receives the transaction body, it verifies the transaction information and the transaction signature, and then signs the transaction information and writes it into the endorsement node table, and determines whether the endorsement node table is full. If not, the transaction body is sent to several other blockchain nodes. If the endorsement node table is full, the transaction body is sent to any of the selected aggregation nodes.
[0008] Preferably, the height signatures exchanged by the aggregation nodes include a timestamp, and the latest timestamp among a preset number of height signatures is regarded as the starting time of the current block generation. The timestamps of the blocks established by several aggregation nodes must be in the time period [T1, T2] based on the starting time. Each aggregation node is only allowed to establish one block at each block height. If multiple blocks are established for the same height, only the earliest block whose timestamp satisfies the time period is accepted. After T2, the established blocks are exchanged between several aggregation nodes. After the final block of the current block height is generated, the aggregation node selects the transactions not included in the final block and includes them in the next block.
[0009] Preferably, after the aggregation node corresponding to the first sub-block establishes a block, it broadcasts the block to several aggregation nodes. After receiving the verification of the block from the aggregation node, it signs the next block height and broadcasts it in the aggregation node, collects several block height signatures, and associates the collected signatures of the next block height with the current block. When the blockchain node synchronizes the latest block to any aggregation node, it sends the block and the signature of the next block height to the blockchain node.
[0010] The substantial effects of the present invention are as follows: aggregation nodes are generated by election, and blocks can be generated when consensus is reached between aggregation nodes, thereby improving the efficiency of block generation; through the sub-block technical solution, the generated block contains data collected by all aggregation nodes, and there is competition for block generation but no competition for data, thereby improving the TPS of the blockchain; endorsement nodes can obtain benefits, and blockchain nodes are motivated to actively participate in voting and actively disseminate transaction data, so that data can be confirmed by the blockchain more quickly; the sub-block generation time interval is limited to avoid plagiarism between aggregation nodes, thereby maintaining the fairness of the blockchain. BRIEF DESCRIPTION OF THE DRAWINGS
[0011] Figure 1 This is a schematic diagram of the blockchain consensus method of Example 1.
[0012] Figure 2 A schematic diagram of a block is established for the first embodiment.
[0013] Figure 3 This is a schematic diagram of the method for associating an endorsement node signature in Example 1.
[0014] Among them: 101, summary node, 102, height signature, 103, sub-block, 104, block. DETAILED DESCRIPTION
[0015] The specific implementation of the present invention will be further described below through specific examples in conjunction with the accompanying drawings.
[0016] Embodiment 1:
[0017] A high TPS blockchain consensus method, please see the attached Figure 1 , including: step A01) the block 104 chain node periodically elects a number of aggregation nodes 101, and the several aggregation nodes 101 exchange the height signatures 102 to be produced, so as to collect a preset number of height signatures 102; step A02) in the first stage, the endorsement node signature associated with the transaction is signed, and the transaction that meets the number of endorsement node signatures is sent to one or more of the aggregation nodes 101; step A03) in the second stage, the several aggregation nodes 101 respectively establish the sub-block 103 of the current height according to the transactions they receive, and the sub-block 103 includes a timestamp and a transaction list, and sends the sub-block 103 to the several block 104 chain nodes for signature; step A04) after signing, the several aggregation nodes 101 broadcast the sub-blocks 103 they have established, and arrange the sub-blocks 103 in descending order according to the number of transactions contained, and arrange the sub-blocks 103 at the back of the order. 3 is removed; step A05) the aggregation node 101 corresponding to the first sub-block 103 establishes block 104, block 104 includes block 104 header and block 104 body, block 104 header includes block 104 height, previous block 104 hash value, block 104 hash value and timestamp, block 104 body includes reward transfer transaction and several sub-blocks 103, reward transfer transaction includes block 104 reward transaction and several sub-block 103 reward transactions, block 104 reward transaction is to transfer block 104 reward to the aggregation node 101 corresponding to the first sub-block 103, sub-block 103 reward transaction is to transfer part of the transaction fee contained in sub-block 103 to the aggregation node 101 corresponding to sub-block 103, and evenly distribute the remaining part of the transaction fee to the endorsement nodes of the transaction, and complete the generation of block 104.
[0018] Please see attached Figure 2, before establishing a block 104, several aggregation nodes 101 first synchronize the height of block 104. Aggregation node 101A signs the block 104 height 2235 to be generated with its own private key and broadcasts it among aggregation nodes 101. Other aggregation nodes 101 perform the same operation, so that aggregation nodes 101 collect all block 104 height signatures 102 of all aggregation nodes 101. In order to avoid the aggregation node 101 being able to generate blocks normally when it is offline, in this embodiment, the aggregation node 101 does not need to collect all block 104 height signatures 102, and only the block 104 height signatures 102 of 2 / 3 aggregation nodes 101 are collected. After obtaining a preset number of block 104 height signatures 102, in the second stage, the aggregation node 101 generates a sub-block 103, associates the sub-block 103 with the block 104 height signature 102, and only the sub-block 103 associated with a sufficient number of block 104 height signatures 102 will be recognized. If the chain node of block 104 recognizes subblock 103, it extracts the hash value of subblock 103, signs the hash value with its own private key, and sends it to the corresponding aggregation node 101. After the aggregation node 101 receives a sufficient number of signatures, it can broadcast its subblock 103 among the aggregation nodes 101. Several aggregation nodes 101 generate multiple subblocks 103, one of which will contain the largest number of transactions, and thus obtain the right to record the current block 104. The subblock 103 that is recognized and associated with a sufficient number of block 104 chain node signatures can be included in this block 104. And after sorting in descending order according to the number of transactions included, if the subblock 103 contains transactions that are not included in the previous block 104, the aggregation node 101 that generates the subblock 103 can still obtain the corresponding transfer fee. In this consensus method, although there is a certain degree of competition for block 104, there is no competition at all for transactions. In addition, endorsement nodes can also gain benefits, so the block 104 chain nodes that become endorsement nodes will try their best to spread and share transactions, so that transactions can be easily collected by the aggregation node 101. In this way, transactions can be included in block 104 at the fastest speed, which improves the TPS of the block 104 chain from a practical perspective, rather than improving the TPS that the block 104 chain can achieve in theory.
[0019] The number of transactions in subblock 103 is calculated according to the transfer-out account, that is, the transfer-out transaction from the same account to multiple accounts is counted as one transaction in the transaction number statistics. When the aggregation node 101 establishes subblock 103, the transactions transferred from the same account are regularized, the receiving account and the amount table are associated with the transfer-out account, and the total amount of transfer is calculated. The transfer-out account, the total amount of transfer, the receiving account and the amount table constitute one regularized transaction. When the aggregation node 101 corresponding to the first subblock 103 establishes block 104, the transfer-out transactions of the same account involved in the subblock 103 are regularized, and the transfer-out transactions of the same account distributed in different subblocks 103 are moved to the subblock 103 with the highest sorting, and the total amount of transfer is recalculated. Repeated transactions in subblock 103 are eliminated to avoid the phenomenon of repeated transactions. In order to avoid the same account transferring the same amount to another account twice, this embodiment only allows the same account to transfer to another account once when a block is generated. However, it is allowed for one account to transfer to multiple accounts within a block generation cycle. If the same account transfers the same amount to another account twice, only one will be confirmed. The other will be confirmed in the next block generation cycle.
[0020] This embodiment provides a specific solution for the endorsement node to associate the signature with the transaction. Figure 3, including: step B01) in the first stage, after the node receiving the transaction information and transaction signature information verifies the transaction and transaction signature, it constructs a transaction body, which includes the transaction information, transaction signature information, timestamp and endorsement node table; step B02) the node signs the transaction information and writes it into the endorsement node table, and sends the transaction body to several other block 104 chain nodes; step B03) when the block 104 chain node receives the transaction body, it verifies the transaction information and transaction signature, and then signs the transaction information and writes it into the endorsement node table, and determines whether the endorsement node table is full. If not, the transaction body is sent to several other block 104 chain nodes. If the endorsement node table is full, the transaction body is sent to any of the selected aggregation nodes 101. This embodiment constructs the transaction body as {Info={id:15474541,form:PubKey1,to:PubKey2,num:0.296},SignString=SignTrans(Info),checknodes={c1:NULL,c2:NULL,…,c10:NULL}}, and reserves positions for 10 endorsement nodes. SignTrans() indicates that the private key of the transfer-out account is used for the signature operation. If the block 104 chain node P1 wants to endorse the transaction body, it uses its own private key to sign Info and writes SignP1(Info) into the value of c1. After c1 to c10 are filled with values, it means that 10 block 104 chain nodes have endorsed, and the transaction body is sent to one or more of the aggregation nodes 101. After the block 104 chain node P1 endorses, the transaction body will be sent to multiple other block 104 chain nodes, which is equivalent to other block 104 chain nodes competing to fill in the value of c2. The first transaction body associated with the signatures of 10 endorsement nodes is sent to the aggregation node 101, and the aggregation node 101 will accept it and include it in the sub-block 103. Different aggregation nodes 101 may include the same transaction in the sub-block 103, and the nodes endorsing the transaction in the two sub-blocks 103 are also different. In this case, when the block 104 is finally generated, the transaction with the lower ranking in the sub-block 103 will be discarded, and the corresponding endorsement node will also lose the opportunity to obtain part of the transaction fee. Therefore, the chain node of block 104 must not only compete to complete the endorsement first, but also send the transaction body to multiple aggregation nodes 101 that they think are ranked higher. If the number of transactions of the aggregation nodes 101 is the same, they will be sorted according to the timestamp of the sub-block 103 completed by the aggregation node 101 first.
[0021] The height signatures 102 exchanged by the aggregation nodes 101 include timestamps. The latest timestamp among the preset number of height signatures 102 is regarded as the starting time of the current block 104. The timestamps of the blocks 104 established by several aggregation nodes 101 must be in the time period [T1, T2] based on the starting time. Each aggregation node 101 is only allowed to establish one block 104 at each block 104 height. If multiple blocks 104 are established at the same height, only the earliest block 104 with a timestamp that meets the time period is accepted. After T2, the established blocks 104 are exchanged between several aggregation nodes 101. After the final block 104 of the current block 104 height is generated, the aggregation node 101 selects the transactions not included in the final block 104 and includes them in the next block 104.
[0022] After the aggregation node 101 corresponding to the first sub-block 103 establishes block 104, it broadcasts block 104 to several aggregation nodes 101. After receiving the verification of the aggregation node 101 of block 104, it signs the next block 104 height and broadcasts it in the aggregation node 101, collects several block 104 height signatures 102, and associates the collected signature of the next block 104 height with the current block 104. When the block 104 chain node synchronizes the latest block 104 to any aggregation node 101, it sends the signatures of block 104 and the next block 104 height to the block 104 chain node together.
[0023] The beneficial technical effects of this embodiment are as follows: aggregation nodes 101 are generated by election, and blocks can be generated when consensus is reached between aggregation nodes 101, thereby improving the efficiency of block generation; through the sub-block 103 technical solution, the generated block contains all the data collected by the aggregation nodes 101, and there is competition for block generation but not for data, thereby improving the TPS of the block 104 chain; endorsement nodes can obtain benefits, and the block 104 chain nodes are motivated to actively participate in voting and actively disseminate transaction data, so that the data can be confirmed by the block 104 chain more quickly; the time interval for the generation of sub-blocks 103 is limited to avoid plagiarism between aggregation nodes 101, thereby maintaining the fairness of the block 104 chain.
[0024] The above-described embodiment is only a preferred solution of the present invention and does not limit the present invention in any form. There are other variations and modifications without exceeding the technical solution described in the claims.
Claims
1. A high TPS blockchain consensus method, characterized in that: include: Blockchain nodes periodically elect several summary nodes, and several summary nodes exchange the height signatures of the blocks to be produced, thereby collecting a preset number of height signatures; In the first phase, the endorsement nodes associated with the transaction sign, and the transaction that meets the number of endorsement node signatures is sent to one or more of the aggregation nodes; In the second stage, several aggregation nodes respectively create sub-blocks of the current height according to the transactions they receive. The sub-blocks include timestamps and transaction lists, and send the sub-blocks to several blockchain nodes for signature. After signing, several aggregation nodes broadcast their own sub-blocks, sort the sub-blocks in descending order according to the number of transactions they contain, and remove duplicate transactions contained in the sub-blocks with the lowest order; The aggregation node corresponding to the first sub-block establishes a block, the block includes a block header and a block body, the block header includes a block height, a hash value of the previous block, a block hash value and a timestamp, the block body includes a reward transfer transaction and several sub-blocks, the reward transfer transaction includes a block reward transaction and several sub-block reward transactions, the block reward transaction is to transfer the block reward to the aggregation node corresponding to the first sub-block, the sub-block reward transaction is to transfer a part of the transaction fee contained in the sub-block to the aggregation node corresponding to the sub-block, and evenly distribute the remaining part of the transaction fee to the endorsement nodes of the transaction, and complete the block generation; In the first stage, after receiving the transaction information and transaction signature information, the node verifies the transaction and transaction signature, and then constructs the transaction body, which includes the transaction information, transaction signature information, timestamp and endorsement node table; After signing the transaction information, the node writes it into the endorsement node table and sends the transaction body to several other blockchain nodes; When a blockchain node receives a transaction, it verifies the transaction information and transaction signature, then signs the transaction information and writes it into the endorsement node table, and determines whether the endorsement node table is full. If not, the transaction is sent to several other blockchain nodes. If the endorsement node table is full, the transaction is sent to any of the selected aggregation nodes. The height signatures exchanged by the aggregation nodes include a timestamp. The latest timestamp among the preset number of height signatures is regarded as the starting time of the current block. The timestamps of the blocks established by several aggregation nodes must be in the time period [T1, T2] based on the starting time. Each aggregation node is only allowed to establish one block at each block height. If multiple blocks are established for the same height, only the earliest block with a timestamp that meets the time period is accepted. After T2, the established blocks are exchanged between several aggregation nodes. After the final block of the current block height is generated, the aggregation node selects the transactions not included in the final block and includes them in the next block.
2. A high TPS blockchain consensus method according to claim 1, characterized in that: The number of sub-block transactions is calculated according to the transfer-out account, that is, the transfer-out transactions from the same account to multiple accounts are counted as one transaction in the transaction quantity statistics. When the aggregation node establishes a sub-block, the transactions transferred from the same account are regularized, and the receiving account and amount table are associated with the transfer-out account, and the total transfer amount is calculated. The transfer-out account, the total transfer amount, the receiving account and the amount table constitute one regularized transaction.
3. A high TPS blockchain consensus method according to claim 2, characterized in that: When the aggregation node corresponding to the first sub-block creates a block, it will organize the transfer transactions of the same account involved in the sub-block, move the transfer transactions of the same account distributed in different sub-blocks to the sub-block with the first sorting, and recalculate the total transfer amount.
4. A high TPS blockchain consensus method according to any one of claims 1 to 3, characterized in that: After the aggregation node corresponding to the first sub-block establishes the block, it broadcasts the block to several aggregation nodes. After receiving the block's aggregation node verification, it signs the next block height and broadcasts it in the aggregation node, collects several block height signatures, and associates the collected signatures of the next block height with the current block. When the blockchain node synchronizes the latest block to any aggregation node, it sends the block and the signature of the next block height to the blockchain node.
