Network for realizing multi-node high-performance protocol based on PBFT optimization

文档序号:195898 发布日期:2021-11-02 浏览:37次 中文

阅读说明:本技术 一种应用基于pbft优化实现多节点高性能协议的网络 (Network for realizing multi-node high-performance protocol based on PBFT optimization ) 是由 戴晓 张嗣昆 许骏洲 丁旋 赵曦滨 唐华云 李�荣 于 2021-07-12 设计创作,主要内容包括:本发明公开一种应用基于PBFT优化实现多节点高性能协议的网络,网络包括主节点和多个副节点,网络的节点总数N不小于3f+1,其中,f为拜占庭节点的数量,f和N均为正整数,本发明中,主节点根据提前准备信息生成N-1份子信息,将各子信息发送至各副节点,由于主节点仅向各副节点发送了一份子信息,而不是整个提前准备信息,因此减少了主节点与副节点之间的网络带宽消耗,主节点通过发送聚合签名至各副节点而不是发送多个签名的方式,进一步减少主节点与副节点之间的网络带宽消耗,并且除了进行子信息获取以外,各副节点之间无需进行信息传递,大大减少了各个副节点之间的网络带宽消耗,综上能够保证网络共识成功,提高交易确认成功率。(The invention discloses a network for realizing multi-node high-performance protocol based on PBFT optimization, which comprises a main node and a plurality of secondary nodes, wherein the total number N of the nodes of the network is not less than 3f +1, wherein f is the number of Byzantine nodes, and f and N are positive integers, in the invention, the main node generates N-1 parts of sub information according to the advance preparation information and sends each part of sub information to each secondary node, because the main node only sends one part of sub information to each secondary node instead of the whole advance preparation information, the network bandwidth consumption between the main node and the secondary nodes is reduced, the main node further reduces the network bandwidth consumption between the main node and the secondary nodes by sending aggregated signatures to each secondary node instead of sending a plurality of signatures, and the information transmission is not needed between each secondary node except for obtaining the sub information, thereby greatly reducing the network bandwidth consumption between each secondary node, therefore, the success of network consensus can be ensured, and the success rate of transaction confirmation is improved.)

1. A network for realizing multi-node high-performance protocol based on PBFT optimization is characterized by comprising a main node and a plurality of secondary nodes, wherein the total number N of the nodes of the network is not less than 3f +1, wherein f is the number of Byzantine nodes, and f and N are positive integers;

the method comprises the steps that a main node receives a transaction request containing transaction information sent by a client, determines current view rotation counter information of the network, signs the transaction information and the current view rotation counter information to obtain a first signature, generates N-1 parts of sub information according to the advance preparation information by taking the transaction information, the current view rotation counter information and the first signature as advance preparation information, and sends the sub information to each auxiliary node, wherein the current view rotation counter information represents the rotation condition of the main node of the network;

aiming at each secondary node in each secondary node, the secondary node receives the sub-information, respectively sends sub-information acquisition requests to other secondary nodes except the secondary node, receives the sub-information acquisition requests sent by other secondary nodes, sends the sub-information received by the secondary node to other secondary nodes, combines all the received sub-information into the advanced preparation information, signs the advanced preparation information according to a BLS algorithm to generate a second signature when the first signature is verified successfully, and sends the advanced preparation information and the second signature as preparation information to the primary node;

the main node receives the preparation information sent by each secondary node, verifies second signatures in the preparation information according to the BLS algorithm, aggregates all the successfully verified second signatures to obtain first aggregated signatures when the number of the successfully verified second signatures reaches 2f +1, and sends the first aggregated signatures to each secondary node as preparation confirmation information;

for each secondary node in each secondary node, the secondary node receives the preparation confirmation information, verifies the first aggregated signature according to the BLS algorithm, signs the preparation information and the preparation confirmation information according to the BLS algorithm to obtain a third signature if the verification is successful, and sends the preparation information, the preparation confirmation information and the third signature to the primary node as submission information;

the main node receives the submitted information sent by each secondary node, verifies third signatures in each submitted information according to the BLS algorithm, aggregates all the successfully verified third signatures to obtain second aggregated signatures when the number of the successfully verified third signatures reaches 2f +1, and sends the second aggregated signatures to each secondary node as submitted confirmation information;

and aiming at each secondary node in each secondary node, the secondary node receives the submission confirmation information, verifies the second aggregate signature according to the BLS algorithm, and sends transaction confirmation information to the client if the verification is successful.

2. The network of claim 1, wherein the master node performs binary transformation on the provisioning information to generate a binary file, divides the binary file into N-1 parts of sub-files, and uses the N-1 parts of sub-files as the N-1 parts of sub-information.

3. The network of claim 1, wherein the master node divides the transaction information into N-1 sub-transaction information, and generates N-1 sub-transaction information according to the N-1 sub-transaction information, the current view rotation counter information, and the first signature, wherein each sub-transaction information includes one sub-transaction information, the current view rotation counter information, and the first signature, and the sub-transaction information included in each sub-transaction information is different from each other.

4. The network of claim 1, wherein for each of the secondary nodes, the secondary node signs the advance preparation information with its own corresponding private key in the BLS algorithm and a preset hash function to generate a second signature;

and the main node decrypts the second signature in each preparation message according to the corresponding public key of each auxiliary node in the BLS algorithm, and if decryption is successful, verification is confirmed to be successful.

5. The network of claim 1, wherein the master node adds all successfully verified second signatures to obtain a first aggregated signature.

6. The network of claim 1, wherein for each of the secondary nodes, the secondary node verifies the first aggregated signature according to a verification scheme in the BLS algorithm.

7. The network of claim 1, wherein, for each of the secondary nodes, the secondary node signs the preparation information and the preparation confirmation information by using its own corresponding private key and a preset hash function in the BLS algorithm to obtain a third signature;

and the main node decrypts the third signature in each submitted message according to the corresponding public key of each auxiliary node in the BLS algorithm, and if decryption is successful, verification is confirmed to be successful.

8. The network of claim 1, wherein the master node adds all verified third signatures to obtain a second aggregate signature.

9. The network of claim 1, wherein for each of the secondary nodes, the secondary node verifies the second aggregate signature according to a verification scheme in the BLS algorithm.

10. The network of claim 1, wherein the PBFT-based optimization enables multi-node high performance protocols to be applied to open source federation chain framework Fabric.

Technical Field

The invention relates to the technical field of block chains, in particular to a network for realizing a multi-node high-performance protocol based on PBFT optimization.

Background

Currently, PBFT (Practical Byzantine Fault Tolerance algorithm) is widely used in block chains.

However, when transaction validation is performed in the actual blockchain, the multi-step, multi-transmission and repetitive transmission characteristics of the PBFT severely limit the overall system performance such as transaction throughput and transaction delay, and the limitation on network performance increases dramatically as the number of nodes in the network increases. When the number of nodes in the network is too large and far exceeds four nodes designed by the PBFT initial protocol, for example, the number of nodes in the network exceeds one hundred nodes, the master node in the network needs to interact with one hundred slave nodes, and the slave nodes also interact with each other, which results in that the overall network bandwidth cannot guarantee the state synchronization between the nodes, which leads to failure of network consensus, and further leads to failure of transaction confirmation.

Disclosure of Invention

The invention provides a network for realizing multi-node high-performance protocol based on PBFT optimization, which can ensure successful network consensus and improve the success rate of transaction confirmation. The specific technical scheme is as follows.

In a first aspect, the invention provides a network for realizing a multi-node high-performance protocol based on PBFT optimization, wherein the network comprises a main node and a plurality of secondary nodes, the total number N of the nodes of the network is not less than 3f +1, wherein f is the number of Byzantine nodes, and f and N are positive integers;

the method comprises the steps that a main node receives a transaction request containing transaction information sent by a client, determines current view rotation counter information of the network, signs the transaction information and the current view rotation counter information to obtain a first signature, generates N-1 parts of sub information according to the advance preparation information by taking the transaction information, the current view rotation counter information and the first signature as advance preparation information, and sends the sub information to each auxiliary node, wherein the current view rotation counter information represents the rotation condition of the main node of the network;

aiming at each secondary node in each secondary node, the secondary node receives the sub-information, respectively sends sub-information acquisition requests to other secondary nodes except the secondary node, receives the sub-information acquisition requests sent by other secondary nodes, sends the sub-information received by the secondary node to other secondary nodes, combines all the received sub-information into the advanced preparation information, signs the advanced preparation information according to a BLS algorithm to generate a second signature when the first signature is verified successfully, and sends the advanced preparation information and the second signature as preparation information to the primary node;

the main node receives the preparation information sent by each secondary node, verifies second signatures in the preparation information according to the BLS algorithm, aggregates all the successfully verified second signatures to obtain first aggregated signatures when the number of the successfully verified second signatures reaches 2f +1, and sends the first aggregated signatures to each secondary node as preparation confirmation information;

for each secondary node in each secondary node, the secondary node receives the preparation confirmation information, verifies the first aggregated signature according to the BLS algorithm, signs the preparation information and the preparation confirmation information according to the BLS algorithm to obtain a third signature if the verification is successful, and sends the preparation information, the preparation confirmation information and the third signature to the primary node as submission information;

the main node receives the submitted information sent by each secondary node, verifies third signatures in each submitted information according to the BLS algorithm, aggregates all the successfully verified third signatures to obtain second aggregated signatures when the number of the successfully verified third signatures reaches 2f +1, and sends the second aggregated signatures to each secondary node as submitted confirmation information;

and aiming at each secondary node in each secondary node, the secondary node receives the submission confirmation information, verifies the second aggregate signature according to the BLS algorithm, and sends transaction confirmation information to the client if the verification is successful.

Optionally, the master node performs binary conversion on the advance preparation information to generate a binary file, divides the binary file into N-1 parts of sub-files, and uses the N-1 parts of sub-files as the N-1 parts of sub-information.

Optionally, the master node divides the transaction information into N-1 parts of sub-transaction information, and generates N-1 parts of sub-information according to the N-1 parts of sub-transaction information, the current view rotation counter information, and the first signature, where each part of sub-information includes one part of sub-transaction information, the current view rotation counter information, and the first signature, and the sub-transaction information included in each part of sub-information is different from each other.

Optionally, for each secondary node in each secondary node, the secondary node signs the preparation-ahead information by using a private key corresponding to the secondary node in the BLS algorithm and a preset hash function to generate a second signature;

and the main node decrypts the second signature in each preparation message according to the corresponding public key of each auxiliary node in the BLS algorithm, and if decryption is successful, verification is confirmed to be successful.

Optionally, the master node adds all the successfully verified second signatures to obtain a first aggregated signature.

Optionally, for each secondary node in the secondary nodes, the secondary node checks the first aggregated signature according to a signature checking manner in the BLS algorithm.

Optionally, for each secondary node in each secondary node, the secondary node signs the preparation information and the preparation confirmation information by using a private key and a preset hash function corresponding to the secondary node in the BLS algorithm to obtain a third signature;

and the main node decrypts the third signature in each submitted message according to the corresponding public key of each auxiliary node in the BLS algorithm, and if decryption is successful, verification is confirmed to be successful.

Optionally, the master node adds all the successfully verified third signatures to obtain a second aggregate signature.

Optionally, for each secondary node in the secondary nodes, the secondary node checks the second aggregate signature according to a signature checking method in the BLS algorithm.

Optionally, the PBFT-based optimization-based multi-node high performance protocol is applied to an open source alliance chain framework Fabric.

As can be seen from the above, in the data synchronization method, the processor, and the vehicle-mounted terminal provided in the embodiments of the present invention, the network of the embodiment includes a master node and a plurality of slave nodes, and a total number N of nodes of the network is not less than 3f +1, where f is the number of byzantine nodes, and f and N are both positive integers, the master node receives a transaction request including transaction information sent by a client, determines current view rotation counter information of the network, signs the transaction information and the current view rotation counter information to obtain a first signature, uses the transaction information, the current view rotation counter information, and the first signature as advance preparation information, generates N-1 parts of sub information according to the advance preparation information, and sends each part of sub information to each slave node, where the current view rotation counter information represents a rotation condition of the master node of the network, and for each slave node in each slave node, the secondary node receives the sub-information, respectively sends sub-information acquisition requests to other secondary nodes except the secondary node, receives the sub-information acquisition requests sent by other secondary nodes, sends the sub-information received by the secondary node to other secondary nodes, combines all the received sub-information into advance preparation information, signs the advance preparation information according to a BLS algorithm to generate a second signature when a first signature is verified successfully, takes the advance preparation information and the second signature as preparation information and sends the preparation information to the primary node, the primary node receives the preparation information sent by the secondary nodes, verifies the second signature in the preparation information according to the BLS algorithm, aggregates all the second signatures verified successfully to obtain a first aggregated signature when the number of the second signatures verified successfully reaches 2f +1, sends the first aggregated signature as preparation confirmation information to each secondary node, and aims at each secondary node in each secondary node, the secondary node receives the preparation validation information, verifies the first aggregate signature according to the BLS algorithm, if the verification is successful, signing the preparation information and the preparation confirmation information according to the BLS algorithm to obtain a third signature, taking the preparation information, the preparation confirmation information and the third signature as submission information and sending the submission information to the main node, receiving the submission information sent by each secondary node by the main node, and verifying the third signature in each submitted message according to the BLS algorithm, wherein when the number of the third signatures which are successfully verified reaches 2f +1, aggregating all the successfully verified third signatures to obtain a second aggregated signature, sending the second aggregated signature as submission confirmation information to each secondary node, aiming at each secondary node in each secondary node, the secondary node receives the submission confirmation information, verifies the second aggregate signature according to the BLS algorithm, and sends transaction confirmation information to the client if verification is successful. In the application, the main node generates N-1 parts of sub-information according to the advance preparation information, sends each part of sub-information to each auxiliary node, since the master node sends only one piece of sub-information to each slave node, rather than the entire advance preparation information, thus, network bandwidth consumption between the primary node and the secondary nodes is reduced, the primary node further reduces network bandwidth consumption between the primary node and the secondary nodes by sending an aggregated signature to each secondary node instead of sending multiple signatures, the performance of the whole network is not completely limited by the main node, the network bandwidth bottleneck of the main node is removed, besides sub-information acquisition, information transmission is not needed among all the auxiliary nodes, network bandwidth consumption among all the auxiliary nodes is greatly reduced, network consensus success can be guaranteed, and transaction confirmation success rate is improved. Of course, not all of the advantages described above need to be achieved at the same time in the practice of any one product or method of the invention.

The innovation points of the embodiment of the invention comprise:

1. the main node generates N-1 parts of sub information according to the advance preparation information, sends each part of sub information to each auxiliary node, since the master node sends only one piece of sub-information to each slave node, rather than the entire advance preparation information, thus, network bandwidth consumption between the primary node and the secondary nodes is reduced, the primary node further reduces network bandwidth consumption between the primary node and the secondary nodes by sending an aggregated signature to each secondary node instead of sending multiple signatures, the performance of the whole network is not completely limited by the main node, the network bandwidth bottleneck of the main node is removed, besides sub-information acquisition, information transmission is not needed among all the auxiliary nodes, network bandwidth consumption among all the auxiliary nodes is greatly reduced, network consensus success can be guaranteed, and transaction confirmation success rate is improved.

2. The PBFT optimization-based multi-node high-performance protocol is applied to the open source alliance chain framework Fabric, so that the alliance chain network with large number of nodes can also realize high-performance and high-expansibility consensus and state synchronization, namely, the throughput of the alliance chain network is reduced slowly along with the increase of the number of the nodes.

Drawings

In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below. It is to be understood that the drawings in the following description are merely exemplary of some embodiments of the invention. For a person skilled in the art, without inventive effort, further figures can be obtained from these figures.

Fig. 1 is a schematic structural diagram of a network implementing a multi-node high performance protocol based on PBFT optimization according to an embodiment of the present invention;

FIG. 2 is a schematic diagram of stages of implementing a multi-node high performance protocol based on PBFT optimization;

FIG. 3(a) is a schematic diagram of a cut;

fig. 3(b) is a schematic view of replication.

Detailed Description

The technical solution in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. It is to be understood that the described embodiments are merely a few embodiments of the invention, and not all embodiments. All other embodiments, which can be obtained by a person skilled in the art without inventive effort based on the embodiments of the present invention, are within the scope of the present invention.

It is to be noted that the terms "comprises" and "comprising" and any variations thereof in the embodiments and drawings of the present invention are intended to cover non-exclusive inclusions. A process, method, network, article, or apparatus that comprises a list of steps or elements is not limited to the listed steps or elements but may alternatively include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.

The embodiment of the invention discloses a network for realizing a multi-node high-performance protocol by applying PBFT optimization, which can ensure successful network consensus and improve the success rate of transaction confirmation. The following provides a detailed description of embodiments of the invention.

Fig. 1 is a schematic structural diagram of a network that implements a multi-node high-performance protocol based on PBFT optimization according to an embodiment of the present invention. Referring to fig. 1, the network includes a master node P and a plurality of slave nodes, and the total number N of nodes of the network is not less than 3f +1, where f is the number of byzantine nodes, and f and N are positive integers, that is, there are f byzantine nodes in the network, the network can tolerate that f nodes do not transmit or transmit error information, and the network has more than or equal to 3f +1 nodes, which can ensure the well-known normal operation. The number of the secondary nodes in fig. 1 is 3, which are the a secondary node, the B secondary node and the C secondary node, respectively, and n represents the number of transactions.

The application provides a PBFT optimization protocol utilizing slice replication and aggregation signature, namely a PBFT optimization-based multi-node high-performance protocol, according to the characteristics of a PBFT (Practical Byzantine Fault Tolerance) initial protocol.

Fig. 2 is a schematic diagram of stages of implementing a multi-node high-performance protocol based on PBFT optimization, which includes five stages derived from a PBFT initial protocol and two additional stages proposed in the present application, see fig. 2. The five phases derived from the PBFT initial protocol are a request phase, a pre-prepare advance preparation phase, a prepare preparation phase, a commit phase and a reply phase respectively, and the two additional phases are a prepare-ack preparation acknowledgement phase and a commit-ack commit acknowledgement phase respectively. The consensus of the network occurs in a pre-prepare early stage, a prepare preparation stage and a commit stage, the node confirmation consensus in the network occurs in a prepare-ack preparation confirmation stage and a commit-ack commit confirmation stage, and the network interaction with the client occurs in a request stage and a reply stage. Arrows in fig. 2 represent the direction of information transfer, 0 represents a primary node, 1-3 represent secondary nodes, and C represents a client.

The slice replication is utilized to reduce the network bandwidth consumption of primary node replication backup to secondary nodes in the stage of pre-prepare in PBFT in advance, and the network bandwidth bottleneck of the primary node is removed. The aggregation signature is utilized to simplify the preparation stage of the prefix and the commit stage in the PBFT, the main node collects the signature, the bandwidth consumption of the auxiliary node is reduced, and the two are combined to respectively optimize the node transmission of the preparation stage of the prefix, the preparation stage of the prefix and the commit stage.

The following describes in detail a transaction confirmation process between a network and a client, which is applied to implement a multi-node high-performance protocol based on PBFT optimization, according to an embodiment of the present invention:

in a request stage, a client sends a transaction request containing transaction information to a main node in a network, in a pre-prepare stage, the main node receives the transaction request containing the transaction information sent by the client, determines current view rotation counter information of the network, signs the transaction information and the current view rotation counter information to obtain a first signature, wherein the current view rotation counter information represents the rotation condition of the main node of the network, and determines which node in the network is the main node according to the current view rotation counter information.

The method for obtaining the first signature by signing the transaction information and the current view rotation counter information by the master node may be any signature method in the prior art, and the embodiment of the present invention does not limit this.

The main node takes the transaction information, the current view rotation counter information and the first signature as advance preparation information, generates N-1 parts of sub information according to the advance preparation information, namely slices, and then sends each part of sub information to each auxiliary node, namely each part of sub information is sent to different auxiliary nodes.

Illustratively, the advance preparation information m is<txs,view,Signprimary>Txs is transaction information and view is current view rotation counter information, SignprimaryIs the first signature.

The main node generates N-1 parts of sub information according to the preparation information in advance in various ways, including but not limited to the following two ways:

the first mode is as follows:

and the main node performs binary conversion on the advance preparation information to generate a binary file, divides the binary file into N-1 parts of sub-files, and takes the N-1 parts of sub-files as N-1 parts of sub-information.

In the method, the main node divides the advance preparation information, the main node firstly binarizes the advance preparation information to generate a binary file, then divides the binary file into N-1 parts of sub-files, and takes the N-1 parts of sub-files as the N-1 parts of sub-information. The manner of dividing the binary file into N-1 parts of sub-files may be any one of the dividing manners in the prior art, and the comparison in the embodiment of the present invention is not limited at all.

The second mode is as follows:

the main node divides the transaction information into N-1 parts of sub-transaction information, and generates N-1 parts of sub-information according to the N-1 parts of sub-transaction information, the current view rotation counter information and the first signature, wherein each part of sub-information comprises one part of sub-transaction information, the current view rotation counter information and the first signature, and the sub-transaction information contained in each part of sub-information is different.

In the mode, the main node divides the transaction information, divides the transaction information into N-1 parts of sub-transaction information, and then generates the N-1 parts of sub-transaction information according to the N-1 parts of sub-transaction information, the current view rotation counter information and the first signature.

For example: FIG. 3(a) is a schematic diagram of a segmentation, referring to FIG. 3(a), assuming that the total number of nodes N is 4 and N-1 is 3, N-1 sub-messages are<txs1,view,Signprimary>、<txs2,view,Signprimary>And<txs3,view,Signprimary>wherein txs1, txs2 and txs3 are 1/3 different from txs, and the sum of the three is txs.

If the transaction information is N transactions, the N transactions are divided into N-1 parts, and each part of the N-1 parts of sub information contains N/N-1 transactions.

For each secondary node in each secondary node, the secondary node receives the sub-information, and at this time, the secondary node obtains only the sub-information which is not complete advance preparation information, and therefore, the sub-information needs to be copied, namely, the sub-information acquisition requests are respectively sent to the other secondary nodes except the secondary node, the sub-information acquisition requests sent by the other secondary nodes are received, the sub-information received by the secondary node is sent to the other secondary nodes, all the received sub-information is merged into the advance preparation information, namely, after each secondary node receives the sub-information, the missing sub-information needs to be received from the other secondary nodes, and then all the received sub-information is merged into the advance preparation information, so that each secondary node obtains the complete advance preparation information.

For example: FIG. 3(b) is a schematic diagram of replication, see FIG. 3(b), with each secondary node collecting missing sub-information from the remaining secondary nodes.

Because the main node only sends a sub-message to each secondary node instead of preparing the message in advance, the network bandwidth consumption between the main node and the secondary nodes is reduced, the performance of the whole network is not limited by the main node completely, the network bandwidth bottleneck of the main node is removed, the success of network consensus is ensured, and the success rate of transaction confirmation is improved.

After all the secondary nodes obtain the complete advance preparation information, the first signature needs to be verified, and the verification of the first signature can be performed in a signature verification mode corresponding to a signature mode for generating the first signature.

In the preparation stage of the prefix, when the first signature is successfully verified, the secondary node signs the advanced preparation information according to the BLS algorithm to generate a second signature for each secondary node in the secondary nodes, and the advanced preparation information and the second signature serve as preparation information and are sent to the primary node.

Illustratively, the preparation information is<m,Signid>Where m is advance preparation information, SignidIs the second signature.

For each secondary node in the secondary nodes, the signing the advance preparation information by the secondary node according to the BLS algorithm to generate the second signature may be:

and for each secondary node in each secondary node, the secondary node signs the pre-preparation information by adopting a private key and a preset hash function which are self-corresponding in the BLS algorithm to generate a second signature.

In the embodiment of the invention, the purpose of using the BLS algorithm is to aggregate the second signatures after the primary node collects enough second signatures, thereby reducing the transmission amount of information bandwidth. In the BLS algorithm, a node may select its own private key by itself, and assume that the private key selected by the i node is si, that is, the private key corresponding to the i node in the BLS algorithm, and a public key pi corresponding to the i node in the BLS algorithm is si × G, where G is a starting point coordinate of an elliptic curve.

Wherein each secondary node generates a second signature according to the following formula:

Si=si*hash(m)

the hash is a preset hash function, Si is a private key corresponding to the inode in the BLS algorithm, Si is a second signature, and m is advance preparation information.

And the main node receives the preparation information sent by each secondary node, verifies the second signatures in each preparation information according to the BLS algorithm, aggregates all the successfully verified second signatures to obtain a first aggregated signature when the number of the successfully verified second signatures reaches 2f +1, and sends the first aggregated signature serving as preparation confirmation information to each secondary node.

The main node may verify the second signature in each preparation message according to the BLS algorithm as follows:

and the main node decrypts the second signature in each preparation message according to the corresponding public key of each auxiliary node in the BLS algorithm, and if the decryption is successful, the verification is confirmed to be successful.

The master node in the network stores the public key corresponding to each slave node in the BLS algorithm, so the master node can decrypt the second signature in each piece of provisioning information according to the public key corresponding to each slave node in the BLS algorithm, that is, decrypt the Si in each piece of provisioning information using pi.

When the number of the successfully verified second signatures reaches 2f +1, it indicates that enough secondary nodes accept the transaction request provided by the primary node, and at this time, the primary node aggregates all the successfully verified second signatures to obtain a first aggregated signature.

The aggregating, by the master node, all the successfully verified second signatures to obtain a first aggregated signature may be: and the master node adds all the successfully verified second signatures to obtain a first aggregated signature.

In the preparation-acknowledgement phase, the primary node sends the first aggregate signature to each secondary node as preparation-acknowledgement information, illustratively, the preparation-acknowledgement information is<Signall>Wherein SignallIs the first aggregate signature.

For each of the secondary nodes, the secondary node receives the preparation validation information, verifies the first aggregate signature according to the BLS algorithm, the purpose of verifying the first aggregate signature being to confirm whether 2f +1 secondary node validation preparation information really exists in the network.

In the commit stage, if the verification is successful, the secondary node signs the preparation information and the preparation confirmation information according to the BLS algorithm to obtain a third signature, and sends the preparation information, the preparation confirmation information and the third signature to the primary node as commit information.

The above step of, for each secondary node in the secondary nodes, receiving the preparation confirmation information, and verifying the first aggregated signature according to the BLS algorithm may be:

and for each secondary node in the secondary nodes, the secondary node checks the first aggregated signature according to a signature checking mode in the BLS algorithm.

Wherein, the signature verification mode in the BLS algorithm can be as follows:

verifying whether e (G, S) ═ e (pk1, hash (m)) e (pk2, hash (m)).. e (pkn, hash (m)) holds, and if so, determining that the signature verification is successful.

Wherein, G is a starting point coordinate of the elliptic curve, S is a first aggregation signature, pk1 … … pkn is a node identifier of each secondary node, m is advance preparation information, and e is a bilinear mapping function.

And the main node receives the submission information sent by each secondary node, verifies the third signatures in each submission information according to the BLS algorithm, aggregates all the successfully verified third signatures to obtain second aggregated signatures when the number of the successfully verified third signatures reaches 2f +1, and sends the second aggregated signatures to each secondary node as submission confirmation information.

For each secondary node in the secondary nodes, the signing, by the secondary node, of the preparation information and the preparation confirmation information according to the BLS algorithm to obtain a third signature may be:

for each secondary node in each secondary node, the secondary node signs the standby information and the preparation confirmation information by adopting a private key and a preset hash function which are self-corresponding in a BLS algorithm to obtain a third signature;

correspondingly, the step of receiving, by the master node, the submission information sent by each of the slave nodes, and verifying, according to the BLS algorithm, the third signature in each of the submission information may be:

and the main node decrypts the third signature in each submitted message according to the corresponding public key of each auxiliary node in the BLS algorithm, and if the decryption is successful, the verification is confirmed to be successful.

The manner of performing the third signature and verifying the third signature is the same as the manner of performing the second signature and verifying the second signature, and reference may be specifically made to the description of performing the second signature and verifying the second signature, which is not described herein again.

When the number of the third signatures which are successfully verified reaches 2f +1, it indicates that enough secondary nodes approve the transaction request provided by the primary node, and at the moment, the primary node aggregates all the third signatures which are successfully verified to obtain a second aggregated signature.

The aggregating, by the master node, all the successfully verified third signatures to obtain a second aggregated signature may be: and the master node adds all the successfully verified third signatures to obtain a second aggregate signature.

And after the primary node obtains the second aggregate signature, the second aggregate signature is used as submission confirmation information and is sent to each secondary node, so that each secondary node performs final confirmation by the reply of the primary node.

And in the commit-ack submission confirmation stage, aiming at each secondary node in the secondary nodes, the secondary node receives submission confirmation information, verifies the second aggregate signature according to the BLS algorithm, and sends transaction confirmation information to the client if the verification is successful.

For each of the secondary nodes, the secondary node may verify the second aggregate signature according to the BLS algorithm by:

and for each secondary node in the secondary nodes, the secondary node checks the second aggregate signature according to a signature checking mode in the BLS algorithm.

The signature verification method in the BLS algorithm refers to the above description of signature verification of the first aggregated signature, and is not described herein again.

The secondary node verifies the second aggregate signature successfully, which indicates that the secondary node agrees with the secondary nodes in most networks, and at this time, the secondary node enters a reply response stage and sends transaction confirmation information to the client. And the client receives the transaction confirmation information and learns that the transaction confirmation is successful. Thus, the flow of the transaction confirmation successfully carried out by the network is completed.

For example, implementing multi-node high performance protocols based on PBFT optimization may be applied to open source federation chain framework Fabric.

The PBFT optimization-based multi-node high-performance protocol is developed on the existing open source alliance chain framework Fabric, and a pluggable consensus protocol of the Fabric and convenient node system arrangement are mainly utilized. In the specific implementation, the Orderer code covering the Fabric v1.4 version integrates an Orderer function, sequencing nodes are realized, and each sequencing node is deployed with a multi-node high-performance protocol based on PBFT optimization, so that a request phase, a pre-prepare advance preparation phase, a prepare preparation phase, a pre-ack preparation confirmation phase, a commit submission phase, a commit-ack submission confirmation phase and a reply response phase are realized.

The request phase can realize the Order interface function of the chain, so that a transaction request submitted by a Fabric client can be finally forwarded to a main node and then a pre-prepare advanced preparation phase is started, the reply phase realizes that the transaction is written into a block by applying the support interface function, and then a deliverer sends the block to a Fabric peer to confirm the block. The rest stages are realized by a distributed network conforming to the protocol, and all nodes communicate by using an http protocol.

As can be seen from the above, the network of this embodiment includes a master node and a plurality of slave nodes, where N is the total number of nodes in the network, and is not less than 3f +1, where f is the number of byzantine nodes, and f and N are positive integers, the master node receives a transaction request including transaction information sent by a client, determines current view rotation counter information of the network, signs the transaction information and the current view rotation counter information to obtain a first signature, uses the transaction information, the current view rotation counter information, and the first signature as advance preparation information, generates N-1 parts of sub information according to the advance preparation information, and sends each part of sub information to each slave node, where the current view rotation counter information represents a rotation condition of the network, and for each slave node in each slave node, the slave node receives the sub information and sends a sub information acquisition request to the other slave nodes except itself, receiving sub-information acquisition requests sent by other sub-nodes, sending self-received sub-information to other sub-nodes, merging all the received sub-information into advance preparation information, when a first signature is verified successfully, signing the advance preparation information according to a BLS algorithm to generate a second signature, using the advance preparation information and the second signature as preparation information and sending the preparation information to a main node, receiving the preparation information sent by each sub-node by the main node, verifying the second signature in each preparation information according to the BLS algorithm, when the number of the second signatures verified successfully reaches 2f +1, aggregating all the second signatures verified successfully to obtain a first aggregated signature, using the first aggregated signature as preparation confirmation information and sending the first aggregated signature to each sub-node, receiving preparation confirmation information by each sub-node aiming at each sub-node in each sub-node, verifying the first aggregated signature according to the BLS algorithm, if the verification is successful, signing the preparation information and the preparation confirmation information according to a BLS algorithm to obtain a third signature, taking the preparation information, the preparation confirmation information and the third signature as submission information and sending the submission information to the main node, receiving the submission information sent by each secondary node by the main node, verifying the third signature in each submission information according to the BLS algorithm, aggregating all the successfully verified third signatures when the number of the successfully verified third signatures reaches 2f +1 to obtain a second aggregated signature, taking the second aggregated signature as the submission confirmation information and sending the submission confirmation information to each secondary node, receiving the submission confirmation information by each secondary node, verifying the second aggregated signature according to the BLS algorithm, and sending transaction confirmation information to the client if the verification is successful. In the application, the main node generates N-1 parts of sub-information according to the advance preparation information, sends each part of sub-information to each auxiliary node, since the master node sends only one piece of sub-information to each slave node, rather than the entire advance preparation information, thus, network bandwidth consumption between the primary node and the secondary nodes is reduced, the primary node further reduces network bandwidth consumption between the primary node and the secondary nodes by sending an aggregated signature to each secondary node instead of sending multiple signatures, the performance of the whole network is not completely limited by the main node, the network bandwidth bottleneck of the main node is removed, besides sub-information acquisition, information transmission is not needed among all the auxiliary nodes, network bandwidth consumption among all the auxiliary nodes is greatly reduced, network consensus success can be guaranteed, and transaction confirmation success rate is improved.

And applying a multi-node high-performance protocol based on PBFT optimization to the open source alliance chain framework Fabric, so that the alliance chain network with large number of nodes can also realize high-performance and high-expansibility consensus and state synchronization, namely, the throughput of the alliance chain network is reduced slowly along with the increase of the number of the nodes.

Those of ordinary skill in the art will understand that: the figures are merely schematic representations of one embodiment, and the blocks or flow diagrams in the figures are not necessarily required to practice the present invention.

Those of ordinary skill in the art will understand that: modules in the devices in the embodiments may be distributed in the devices in the embodiments according to the description of the embodiments, or may be located in one or more devices different from the embodiments with corresponding changes. The modules of the above embodiments may be combined into one module, or further split into multiple sub-modules.

Finally, it should be noted that: the above examples are only intended to illustrate the technical solution of the present invention, but not to limit it; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present invention.

14页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:一种运维审计系统SSH会话恢复的方法

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!

技术分类