Byzantine fault-tolerant consensus method fusing Hash compression and signature aggregation

By reducing the dimensionality and performing secondary aggregation on the hash values ​​in the blockchain distributed system, and by batch aggregating the signatures, the problems of hash expansion and low communication efficiency in the Byzantine fault-tolerant consensus algorithm are solved, and a more efficient consensus process is achieved.

CN121509442APending Publication Date: 2026-02-10SHIHEZI UNIVERSITY
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511695966.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-11-19
Publication Date
2026-02-10

AI Technical Summary

Technical Problem

In existing technologies, the Byzantine fault-tolerant consensus algorithm in blockchain distributed systems suffers from problems such as transaction hash inflation, excessive storage and verification burden, and low communication efficiency. In particular, as the number of nodes increases, the hash transmission complexity and network bandwidth usage increase exponentially, leading to increased storage and computing costs.

Method used

The Byzantine fault-tolerant consensus method, which integrates hash compression and signature aggregation, reduces the number of bytes in the hash value by performing dimensionality reduction and secondary aggregation on the hash value of the transaction data, and performs batch aggregation on the signature to optimize communication overhead and transmission efficiency.

Benefits of technology

It effectively compresses the number of bytes in hash values, reduces memory and bandwidth usage, improves transmission efficiency, and reduces network overhead through signature aggregation, thereby improving communication efficiency and optimizing the consensus process of blockchain distributed systems.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121509442A_ABST
    Figure CN121509442A_ABST
Patent Text Reader

Abstract

The invention discloses a Byzantine fault-tolerant consensus method fusing Hash compression and signature aggregation, which is applied to a current main node in a block chain distributed system, and a plurality of nodes in the block chain distributed system serve as the current main node in sequence according to a sorting result. Carrying out dimension reduction on the hash value of the transaction data of the created current block, and carrying out secondary aggregation on the hash value after dimension reduction to obtain a root hash value; after a proposal message carrying a root hash value is broadcasted to the slave node, the received ready effective signatures are aggregated in batches according to the arrival time, the current round of consensus of the current master node is completed within the preset time based on the number of the ready effective signatures, the ready aggregated signatures and the preset legal number, and then the local block chain is adjusted; then, according to a sorting result, taking a node of a next order as a new current main node to start a next round of consensus; and continuously repeating until a consensus stop instruction is received, and automatically terminating the consensus process to complete the consensus of the block chain distributed system.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of distributed systems and blockchain technology, and relates to but is not limited to a Byzantine fault-tolerant consensus method combining hash compression and signature aggregation. BACKGROUND

[0002] In the field of distributed systems and blockchain technology, the Byzantine fault-tolerant consensus algorithm (Practical Byzantine Fault Tolerance, PBFT) is a key supporting technology for realizing the consistency of data of distributed nodes. However, with the expansion of the node scale, PBFT has a serious transaction hash inflation defect. For example, a single transaction needs to go through multiple rounds of network-wide broadcast and verification, causing the hash transmission complexity to be high, and the storage cost and network bandwidth occupation of redundant hashes to increase exponentially. At the same time, the storage and computing costs increase linearly with the length of the blockchain. When the transaction volume of the blockchain exceeds a critical threshold, it will cause storage and verification coupling delay, communication load surge, and view switching avalanche effect, significantly reducing the communication efficiency.

[0003] In related technologies, the communication complexity is optimized to a linear level based on the combination of chain sorting and threshold signature technology, and the efficient confirmation of blocks is realized through a pipeline mechanism. However, on the one hand, this method has a chain structure that forces each new block to carry and verify historical transaction hashes, resulting in an increasing storage and verification burden and reducing communication efficiency. On the other hand, the aggregation and verification overhead of the signature increases linearly with the number of nodes, and the parallel optimization space is limited. Once an error occurs, it can easily trigger a view switch, causing additional communication overhead.

[0004] Therefore, how to efficiently and accurately optimize the communication overhead and transmission efficiency of a blockchain distributed system has become a problem to be solved. SUMMARY

[0005] Therefore, the embodiments of the present application provide a Byzantine fault-tolerant consensus method combining hash compression and signature aggregation, which at least solves the problem that related technologies cannot efficiently and accurately optimize the communication overhead and transmission efficiency of a blockchain distributed system.

[0006] According to a first aspect of the embodiments of the present application, a Byzantine fault-tolerant consensus method combining hash compression and signature aggregation is provided, which is applied to a current primary node in a blockchain distributed system. A plurality of nodes in the blockchain distributed system take turns to serve as the current primary node according to a sorting result, and the method comprises the following steps: processing the transaction data of the created current block to obtain a first hash value, and performing dimension reduction processing on the first hash value to obtain a second hash value; The second hash value is secondarily aggregated to obtain a root hash value; and a proposal message is broadcast to the follower nodes in the blockchain distributed system, the proposal message including a view number, the root hash value and a predecessor quorum proof; The preparation valid signatures sent by the follower nodes for the proposal message are received, and the preparation valid signatures are batch-aggregated according to the arrival time to obtain preparation aggregated signatures; Within a preset time, the current round of consensus of the current primary node is completed based on the number of preparation valid signatures, the preparation aggregated signatures and a preset quorum number, and the local blockchain is adjusted according to the current round of consensus of the current primary node to obtain an adjusted local blockchain; According to the sorting result, the node with the next sequence is taken as a new current primary node to start the next round of consensus; The above steps are repeated until the consensus process is automatically terminated when a consensus stop instruction is received, so as to complete the consensus of the blockchain distributed system.

[0007] According to a second aspect of the embodiment of the present application, an electronic device is provided, which comprises a processor, a memory, a communication interface and a communication bus, the processor, the memory and the communication interface complete communication with each other through the communication bus; the memory is used for storing at least one executable instruction, and the executable instruction causes the processor to perform the operation corresponding to the method according to the first aspect.

[0008] According to a third aspect of the embodiment of the present application, a computer storage medium is provided, which stores a computer program, and the program is executed by a processor to realize the method according to the first aspect.

[0009] According to the scheme provided by the embodiment of the application, the current master node in the blockchain distributed system, the plurality of nodes in the blockchain distributed system take turns to serve as the current master node according to the sorting result, processes the transaction data of the created current block to obtain a first hash value, performs dimension reduction processing on the first hash value to obtain a second hash value, performs secondary aggregation on the second hash value to obtain a root hash value, broadcasts a proposal message to the slave nodes in the blockchain distributed system, the proposal message including a view number, the root hash value and a predecessor quorum proof, receives the prepared valid signature sent by the slave nodes in response to the proposal message, and batches the prepared valid signature according to the arrival time to obtain a prepared aggregated signature, completes the current round of consensus of the current master node based on the number of prepared valid signatures, the prepared aggregated signature and a preset quorum number within a preset time, adjusts the local blockchain according to the current round of consensus of the current master node to obtain an adjusted local blockchain, takes the node of the next sequence as a new current master node to start the next round of consensus according to the sorting result, and repeats the above steps until the consensus process is automatically terminated when a consensus stop instruction is received to complete the consensus of the blockchain distributed system. In this process, the transaction data of the created current block is processed to obtain a first hash value, and the first hash value is processed by dimension reduction, and the hash value after dimension reduction is aggregated twice, so that the number of bytes of the hash value is compressed, the memory bandwidth occupation is reduced, and the transmission efficiency of the blockchain distributed system is improved. The prepared valid signature is batch aggregated, and the aggregated prepared valid signature is sent to the slave node, which reduces the line cost and improves the line efficiency. BRIEF DESCRIPTION OF DRAWINGS

[0010] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed in the embodiment description will be briefly introduced. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor. Figure 1 A flowchart of a Byzantine fault-tolerant consensus method fusing hash compression and signature aggregation provided by the embodiment of the present application; Figure 2 A structural diagram of an electronic device of the embodiment of the present application. DETAILED DESCRIPTION

[0011] In order to make the objects, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are some but not all of the embodiments of the present application. The following embodiments are used to describe the present application, but not to limit the scope of the present application. Based on the embodiments in the present application, all other embodiments obtained by a person of ordinary skill in the art without creative work fall within the protection scope of the present application.

[0012] In the following description, "some embodiments" are related to a subset of all possible embodiments, but it can be understood that "some embodiments" can be the same subset or different subsets of all possible embodiments, and can be combined with each other without conflict.

[0013] It should be noted that the terms "first", "second", "third" involved in the embodiments of the present application are only to distinguish similar objects, and do not represent the specific order of the objects. It can be understood that "first", "second", "third" can be interchanged in specific order or sequence as allowed, so that the embodiments of the present application described herein can be implemented in an order other than that illustrated or described herein.

[0014] Those skilled in the art can understand that, unless otherwise defined, all terms (including technical terms and scientific terms) used herein have the same meaning as generally understood by those skilled in the art to which the embodiments of the present application belong. It should also be understood that terms such as those defined in a general dictionary should be understood as having meanings consistent with those in the context of the prior art, and should not be interpreted in an idealized or overly formal sense unless specifically defined as such herein.

[0015] Figure 1 A flowchart of a Byzantine fault-tolerant consensus method combining hash compression and signature aggregation provided by the embodiments of the present application, the Byzantine fault-tolerant consensus method combining hash compression and signature aggregation provided by the embodiments of the present application can be executed by an electronic device, which can be a computer, a server, etc.

[0016] As shown in Figure 1 The Byzantine fault-tolerant consensus method combining hash compression and signature aggregation includes: S101, processing the transaction data of the created current block to obtain a first hash value, and performing dimension reduction processing on the first hash value to obtain a second hash value.

[0017] In the embodiment of the present application, the blockchain distributed system includes a plurality of nodes, the plurality of nodes include honest nodes and Byzantine nodes, the plurality of nodes take turns to be the current master node according to the sorting result, the current master node is the node selected to generate the current block in the current round, the current master node packs the transaction data sent by the client which has not been confirmed into the current block, and then processes the transaction data by using a preset hash function such as a SHA256 hash function to obtain a first hash value, the first hash value can be 32 bytes, and then lossless dimension reduction processing is performed on the first hash value to obtain a second hash value, the second hash value can be 16 bytes. When performing dimension reduction of the hash value, the transaction hash compression module in the blockchain distributed system can be called to perform byte compression according to the exclusive or folding compression algorithm therein.

[0018] Exemplarily, if the blockchain distributed system includes n=4 nodes, the Byzantine nodes are f=1, and the condition n≥3f+1 is met. The subsequent preset mandatory quantity can be 2f+1, and the Byzantine nodes are nodes simulating malicious behavior, such as randomly sending invalid signatures or refusing to send signatures.

[0019] S102, the second hash value is twice aggregated to obtain a root hash value; and a proposal message is broadcasted to the slave nodes in the blockchain distributed system, the proposal message including a view number, the root hash value and a previous quorum proof.

[0020] In the embodiment of the present application, the second hash value can be taken as a leaf node, and the leaf node is aggregated twice by using the previous preset hash function to obtain a root hash value. The view number is used to identify the current master node identity and the consensus round which is currently being performed, the root hash value is a unique and fixed digital fingerprint obtained by the current master node performing multi-level hash compression and aggregation on all transaction data in the current block, and is used to represent the integrity and consistency of the transaction data in the current block, and the previous quorum proof is used to prove that the previous stage of the consensus protocol has obtained enough node votes and is successfully completed. The view number is taken as 1, the previous quorum proof is taken as empty, and the root hash value is combined to constitute the proposal information of the preparation stage, and the proposal message is broadcasted to the slave nodes in the blockchain distributed system.

[0021] Exemplarily, the current master node generates a proposal message in the format of <PREPARE, v=1, B_hash=H_agg,prev_QC=null> and broadcasts it to the whole network. Wherein, PREPARE is the preparation stage, v is the view number, B_hash is the hash value of the current block, H_agg is the root hash value, prev_QC is the previous quorum proof, and null is empty.

[0022] S103, receiving the preparation valid signature sent by the node for the proposal message, and batch-aggregating the preparation valid signature according to the arrival time to obtain the preparation aggregated signature.

[0023] In the embodiment of the application, the node independently calculates the root hash value according to the same method as S101 to S102 after receiving the transaction data of the current block sent by the current primary node, restores the hash value carried in the proposal message by using the XOR operation, and compares and verifies the independently calculated hash value and the restored hash value, when the verification is successful, simultaneously verifies the validity of the view number, the digital signature of the current primary node and the previous quorum proof, when all the verifications are successful, broadcasts the preparation message carrying the valid signature (i.e. the preparation valid signature) of itself to all nodes, the current primary node receives the preparation valid signature sent by the node for the proposal message, and divides the preparation valid signature according to the time threshold, and then aggregates the preparation valid signature of different batches to obtain the preparation aggregated signature of the preparation stage. When the batch-aggregation of the signature is performed, the aggregation optimization module in the blockchain distributed system can be called for distribution and aggregation.

[0024] Further, after the preparation aggregated signature is obtained, the corresponding batch size can be obtained by the preparation aggregated signature, the small batch signature request uses the memory cache, and the large batch signature request uses the disk cache.

[0025] S104, within a preset time, based on the number of preparation valid signatures, the preparation aggregated signature and the preset quorum number, completing the current round of consensus of the current primary node, and adjusting the local blockchain according to the current round of consensus of the current primary node to obtain the adjusted local blockchain.

[0026] In the embodiment of the application, a fixed time range is set, within the time range, it is judged whether the number of received preparation valid signatures reaches the preset quorum number, according to the judgment result, the current round of consensus result of the current primary node is completed in combination with the preparation aggregated signature, the current round of consensus of the current primary node includes consensus success and consensus failure. Finally, the local blockchain is adjusted according to the obtained current round of consensus of the current primary node to obtain the highly adjusted local blockchain, and then the transactions in the current block are executed, the local blockchain ledger and the world state are updated, and the submission stage quorum proof generated in the current round is updated as the previous quorum proof required for the next round of consensus.

[0027] S105, according to the sorting result, taking the node with the next sequence as the new current primary node to start the next round of consensus.

[0028] S106, repeat the above steps until the consensus process is automatically terminated when the consensus stop instruction is received, to complete the consensus of the blockchain distributed system.

[0029] In some embodiments of the present application, after the current round of consensus is completed by the current primary node, if the current round of consensus is successful, the node with the next sequence position is selected as the new primary node of the next round according to the sorting result of the plurality of nodes, and the next round of consensus is started. If the current round of consensus fails, the view switching protocol is triggered, the current primary node is removed by voting, the node with the next sequence position is selected as the primary node of the next round according to the sorting result of the plurality of nodes, and then the next round of consensus is started by the new primary node. The above steps of each node taking turns to act as the primary node according to the sorting result and then performing consensus are repeatedly repeated until a consensus stop instruction is received or a certain external event triggers, such as a higher priority task preemption, resource exception or attack detection, to automatically terminate the consensus process, so as to complete the consensus of the blockchain distributed system.

[0030] It can be understood that in the embodiments of the present application, the transaction data of the created current block is processed to obtain a first hash value; the first hash value is processed by dimension reduction to obtain a second hash value; the second hash value is aggregated twice to obtain a root hash value; a proposal message is broadcasted to the secondary nodes in the blockchain distributed system, the proposal message including a view number, a root hash value and a previous quorum proof; a prepared valid signature sent by the secondary nodes in response to the proposal message is received, and the prepared valid signatures are batch-aggregated according to the arrival time to obtain a prepared aggregated signature; within a preset time, the current round of consensus of the primary node is completed based on the number of prepared valid signatures, the prepared aggregated signature and a preset quorum number, and the local blockchain is adjusted according to the current round of consensus of the primary node to obtain an adjusted local blockchain; according to the sorting result, the node with the next sequence position is selected as the new primary node to start the next round of consensus; the above steps are repeated until the consensus process is automatically terminated when a consensus stop instruction is received, so as to complete the consensus of the blockchain distributed system. In this process, the transaction data of the created current block is processed to obtain a first hash value; the first hash value is processed by dimension reduction, and the hash value after dimension reduction is aggregated twice, so that the number of bytes of the hash value is compressed, the memory bandwidth occupation is reduced, and the transmission efficiency of the blockchain distributed system is improved. The obtained prepared valid signatures are batch-aggregated, and the aggregated prepared valid signatures are sent to the secondary nodes, which reduces the line cost and improves the line efficiency.

[0031] In some embodiments of the present application, the completion of the current round of consensus of the primary node based on the number of received prepared valid signatures, the prepared aggregated signature and the preset quorum number within a preset time in S104 can be implemented by S1041, which is described by the following steps.

[0032] S1041. When the number of valid signatures received within the preset time reaches the preset quorum, the first quorum proof for the preparation phase is generated based on the prepared aggregate signature, view number, and root hash value. Based on the first quorum proof, the current master node enters and successfully completes the pre-commit phase, the commit phase, and the decision phase in sequence, and then completes the consensus of the current master node in this round.

[0033] In an embodiment of the invention, if the number of valid signatures received by the current master node within a preset time period reaches a preset quorum, the prepared aggregated signature, view number, and root hash value are fixed as verifiable credentials for the preparation phase, i.e., the first quorum proof for the preparation phase. Then, the pre-commit phase begins. The current master node broadcasts a pre-commit message carrying the first quorum proof to the slave nodes. After the slave nodes successfully verify the prepared aggregated signature, view number, and root hash value, they broadcast a pre-commit message carrying the pre-committed signature (i.e., locking the valid signature) to all nodes. When the number of pre-committed signatures received by the current master node within the preset time period meets the preset quorum, the pre-committed signatures are aggregated in batches to obtain the pre-committed aggregated signature. The pre-commit aggregate signature, view number, and root hash value are fixed as verifiable credentials for the pre-commit phase, i.e., the quorum proof for the pre-commit phase. Then, in the commit phase, the current master node broadcasts a commit message carrying the quorum proof from the pre-commit phase to the slave nodes. After successful verification by the slave nodes, they send commit signatures to all nodes. The current master node performs the same judgment and allocation aggregation processing on the commit signatures to obtain the quorum proof for the commit phase. After generating and broadcasting the quorum proof for the commit phase, the current master node automatically enters the decision phase, connecting the current block to the local blockchain. Simultaneously, after receiving and successfully verifying the quorum proof for the commit phase, the slave nodes also independently enter the decision phase and perform the same connection operation. If any of the above stages is incomplete, the process proceeds to the view switching step. During the pre-commit phase and subsequent stages such as the commit phase, the aggregate signature for the subsequent stages can be obtained using the hash values ​​stored in the signature repository and the corresponding prepared valid signatures. First, the valid signatures received in the subsequent stages are processed using a preset hash function to obtain the corresponding hash values. These hash values ​​are then matched with the stored hash values ​​to obtain the final aggregate signature. At the same time, the aggregate signatures corresponding to different stages can be obtained by batch aggregation.

[0034] In some embodiments of the present invention, the local blockchain is adjusted according to the current consensus of the current master node in S104, and the adjusted local blockchain can be implemented through S104A, which is explained through the following steps.

[0035] S104A: Connect the current block that has reached consensus in this round to the local blockchain to obtain the adjusted local blockchain.

[0036] In some embodiments of the present invention, the current master node appends the current block, which has been finally confirmed by all nodes in this round, as the latest block to the local blockchain copy of the current master node, thereby obtaining the adjusted local blockchain, and the same applies to the slave nodes.

[0037] In some embodiments of the present invention, after S103 aggregates the prepared valid signatures in batches according to the arrival time to obtain the prepared aggregated signatures, it also includes S10 to S11, which are described through the following steps.

[0038] S10. When the number of valid signatures received within the preset time does not reach the preset statutory number, broadcast a view switching message to the slave node, and when the number of valid view switching signatures sent by the slave node in response to the view switching message received by the new current master node reaches the preset statutory number, obtain the corresponding target aggregate signature based on the valid view switching signature.

[0039] In some embodiments of the present invention, if the current master node fails to receive a preset number of valid signatures within a preset time period, various reasons may cause the consensus of this round to fail. At this time, the current master node broadcasts a view switching message to the slave node. The view switching message carries an incrementing view number and the quorum proof corresponding to the highest stage. After the slave node successfully verifies the message, it sends a valid view switching signature to the new current master node (i.e., the node next in the order of the current master node according to the sorting result). When the number of valid view switching signatures reaches the preset number, the consensus of this round of the current master node is terminated, and the valid view switching signatures are aggregated in batches. The valid view switching signatures within the first arrival time can be aggregated using elliptic curve point addition to obtain a first aggregated signature; and then aggregated with the valid view switching signatures within the second arrival time through a preset synchronization channel to obtain a target aggregated signature.

[0040] S11. Based on the target aggregate signature and the quorum proof corresponding to the highest stage, complete the view switch and complete the current round of consensus for the current master node.

[0041] In some embodiments of the present invention, a quorum proof for view switching is generated based on the target aggregate signature. This quorum proof, combined with the quorum proof corresponding to the highest stage and an incrementing view number, completes the view switching. Once the view switching is complete, the current consensus of the master node is finished for this round. The quorum proof corresponding to the highest stage is the quorum proof generated by the last successfully completed consensus stage in the currently failed consensus round.

[0042] In some embodiments of the present invention, the local blockchain is adjusted according to the current consensus of the current master node in S104, and the adjusted local blockchain can be implemented through S104a, which is explained through the following steps.

[0043] S104a. Based on the failure of the current master node in this round of consensus, keep the local blockchain unchanged.

[0044] In some embodiments of the present invention, when a view switch is required, it is proven that the current master node's consensus in this round has failed, and the local blockchain remains unchanged.

[0045] In some embodiments of the present invention, the dimensionality reduction processing of the first hash value in S101 to obtain the second hash value can be implemented through S1011, as described in the following steps.

[0046] S1011. Divide the first hash value according to the number of bytes to obtain the hash value of the first preset number of bytes and the hash value of the second preset number of bytes; and perform an XOR operation on the hash value of the first preset number of bytes and the hash value of the second preset number of bytes to obtain the second hash value.

[0047] In some embodiments of the present invention, the first hash value is divided according to the number of bytes to obtain the hash value of the first 16 bytes and the hash value of the last 16 bytes. Then, an XOR operation is performed on the hash value of the first 16 bytes and the hash value of the last 16 bytes to obtain the second hash value.

[0048] For example, the hash value of the first 16 bytes (i.e., the hash value of the first preset number of bytes) is H1[0:15]=0x1234567890abcdef1234567890abcdef, and the hash value of the last 16 bytes (i.e., the hash value of the last preset number of bytes) is H1[16:31]=0xfedcba0987654321fedcba0987654321; the operation is performed by XOR operation, specifically C1=H1[0:15]⊕H1[16:31] to generate a 16-byte compressed hash, C1=0xece8ec7117ce8eceece8ec7117ce8ece, which is the second hash value.

[0049] In some embodiments of the present invention, the second aggregation of the second hash value in S102 to obtain the root hash value can be implemented through S102A, which will be explained through the following steps.

[0050] S102A. The second hash value is used as a leaf node, and the leaf nodes are aggregated in pairs to construct a Merkle tree. The root hash value is obtained through the Merkle tree.

[0051] In some embodiments of the present invention, each second hash value is used as a leaf node, and then the second hash values ​​are aggregated in pairs using the aforementioned preset hash function to finally construct a Merkle tree, and the hash value at the top of the constructed Merkle tree is used as the root hash value.

[0052] In some embodiments of the present invention, the batch aggregation of the prepared valid signatures according to the arrival time in S102 to obtain the prepared aggregated signatures can be implemented through S1021, which will be described through the following steps.

[0053] S1021. Aggregate the ready-to-be-valid signatures within the first arrival time using elliptic curve point addition to obtain the first aggregated signature; and aggregate them with the ready-to-be-valid signatures within the second arrival time through a preset synchronization channel to obtain the ready-to-be-aggregated signature.

[0054] In some embodiments of the present invention, the arrival times of preparing valid signatures are divided according to a time threshold. Then, an aggregated parallel processing coroutine is enabled, and the valid signatures prepared within the first arrival time are taken as the first batch, the valid signatures prepared within the second arrival time are taken as the second batch, and so on. Then, the results of each batch are aggregated.

[0055] For example, batch 1 calculates A1 = s1 + s2 using elliptic curve point addition, and batch 2 calculates A2 = s3; the total aggregate signature agg_sig = A1 + A2 is obtained by merging the batch results through the channel, where s1, s2, and s3 are the prepared valid signatures. Specifically, when calculating using elliptic curve point addition, the prepared valid signatures are treated as multiple points on the elliptic curve, and the standard elliptic curve point addition rules are used, i.e., point addition operations are performed on the prepared valid signatures sequentially, and the sum of all prepared valid signatures is finally used as the prepared aggregate signature.

[0056] In some embodiments of the present invention, after S103, the prepared valid signatures are aggregated in batches according to the arrival time to obtain the prepared aggregated signatures, S201 to S202 are further included, which are described by the following steps.

[0057] S201. Arrange the prepared valid signatures in a preset order to obtain the arranged prepared valid signatures, and then concatenate the arranged prepared valid signatures to obtain the concatenated prepared valid signatures.

[0058] S202. Process the concatenated prepared valid signature using a preset hash function to obtain the stored hash value, and store the stored hash value and the corresponding prepared aggregated signature.

[0059] In some embodiments of the present invention, the prepared valid signatures can be sorted according to the identity identifiers corresponding to the slave nodes to obtain sorted prepared valid signatures. Then, the sorted prepared valid signatures are concatenated to obtain a long string, namely the concatenated prepared valid signature. The concatenated prepared valid signature is calculated using the previously preset function to generate a unique stored hash value. Then, the stored hash value and the corresponding prepared valid signature are stored in a signature database for subsequent use.

[0060] The blockchain distributed system also includes a storage layer, which stores the calculated hash value and the corresponding aggregate signature for later use.

[0061] Reference Figure 2 The diagram shows a structural schematic of an electronic device according to an embodiment of the present invention. The specific embodiments of the present invention do not limit the specific implementation of the electronic device.

[0062] like Figure 2 As shown, the electronic device may include: a processor 502, a communications interface 504, a memory 506, and a communications bus 508.

[0063] in: The processor 502, communication interface 504, and memory 506 communicate with each other via communication bus 508.

[0064] Communication interface 504 is used to communicate with other electronic devices or servers.

[0065] The processor 502 is used to execute program 510, specifically the relevant steps in the above method embodiments.

[0066] Specifically, program 510 may include program code that includes computer operation instructions.

[0067] Processor 502 may be a central processing unit (CPU), an application-specific integrated circuit (ASIC), or one or more integrated circuits configured to implement embodiments of the present invention. The smart device may include one or more processors of the same type, such as one or more CPUs; or it may include processors of different types, such as one or more CPUs and one or more ASICs.

[0068] Memory 506 is used to store program 510. Memory 506 may include high-speed RAM memory, and may also include non-volatile memory, such as at least one disk storage device.

[0069] Specifically, program 510 can be used to cause processor 502 to perform the operations corresponding to the methods described in the above method embodiments.

[0070] The specific implementation of each step in program 510 can be found in the corresponding descriptions of the steps and units in the above method embodiments, and will not be repeated here. Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working process of the devices and modules described above can be referred to the corresponding process descriptions in the foregoing method embodiments, and will not be repeated here.

[0071] It should be noted that, depending on the implementation needs, the various components / steps described in the embodiments of the present invention can be broken down into more components / steps, or two or more components / steps or parts of the operation of components / steps can be combined into new components / steps to achieve the purpose of the embodiments of the present invention.

[0072] The methods described above according to embodiments of the present invention can be implemented in hardware, firmware, or as software or computer code that can be stored in a recording medium (such as a CD-ROM, RAM, floppy disk, hard disk, or magneto-optical disk), or as computer code originally stored on a remote recording medium or a non-transitory machine-readable medium and subsequently stored on a local recording medium, downloaded via a network. Thus, the methods described herein can be processed by software stored on a recording medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware (such as an ASIC or FPGA). It is understood that the computer, processor, microprocessor controller, or programmable hardware includes storage components (e.g., RAM, ROM, flash memory, etc.) capable of storing or receiving software or computer code, which, when accessed and executed by the computer, processor, or hardware, implements the methods described herein. Furthermore, when a general-purpose computer accesses code used to implement the methods shown herein, the execution of the code transforms the general-purpose computer into a dedicated computer for executing the methods shown herein.

[0073] Those skilled in the art will recognize that the units and method steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of the embodiments of the present invention.

[0074] The above embodiments are only used to illustrate the embodiments of the present invention, and are not intended to limit the embodiments of the present invention. Those skilled in the art can make various changes and modifications without departing from the spirit and scope of the embodiments of the present invention. Therefore, all equivalent technical solutions also fall within the scope of the embodiments of the present invention, and the patent protection scope of the embodiments of the present invention should be defined by the claims.

Claims

1. A Byzantine fault-tolerant consensus method integrating hash compression and signature aggregation, characterized in that, The current master node is used in a blockchain distributed system. Multiple nodes in the blockchain distributed system take turns serving as the current master node according to a sorting order, including: The transaction data of the created current block is processed to obtain the first hash value; and the first hash value is then reduced in dimensionality to obtain the second hash value. The second hash value is aggregated again to obtain the root hash value; and a proposal message is broadcast to the slave nodes in the blockchain distributed system. The proposal message includes the view number, the root hash value, and the previous quorum proof. Receive the prepared valid signatures sent by the slave nodes for the proposal message, and aggregate the prepared valid signatures in batches according to their arrival time to obtain the prepared aggregated signatures; Within a preset time, based on the number of valid signatures prepared, the number of aggregated signatures prepared, and the preset legal quantity, the current master node completes the consensus of this round, and adjusts the local blockchain according to the current master node's consensus of this round, to obtain the adjusted local blockchain; Based on the sorting results, the node in the next order will be selected as the new current master node to start the next round of consensus. Repeat the above steps until a consensus stop instruction is received, at which point the consensus process will automatically terminate, thus completing the consensus on the blockchain distributed system.

2. The method according to claim 1, characterized in that, The process of completing the current round of consensus for the master node within a preset time period, based on the number of valid signatures prepared, the number of aggregated signatures prepared, and the preset legal quantity, includes: When the number of valid signatures received within the preset time reaches the preset quorum, the first quorum proof for the preparation phase is generated based on the prepared aggregate signature, view number, and root hash value. Based on the first quorum proof, the current master node enters and successfully completes the pre-commit phase, commit phase, and decision phase in sequence, thus completing the consensus of the current master node in this round. The process of adjusting the local blockchain based on the current master node's consensus in this round, resulting in an adjusted local blockchain, includes: Connect the current block that has reached consensus in this round to the local blockchain to obtain the adjusted local blockchain.

3. The method according to claim 1, characterized in that, After aggregating the prepared valid signatures in batches according to their arrival time to obtain the prepared aggregated signatures, the method further includes: When the number of valid signatures received within the preset time does not reach the preset statutory number, a view switching message is broadcast to the slave node. When the number of valid view switching signatures sent by the slave node in response to the view switching message received by the new current master node reaches the preset statutory number, the corresponding target aggregate signature is obtained based on the valid view switching signature. The view switch is completed based on the target aggregate signature and the quorum proof corresponding to the highest stage, thus completing the current round of consensus for the current master node; The process of adjusting the local blockchain based on the current master node's consensus in this round, resulting in an adjusted local blockchain, includes: Based on the failure of the current master node in this round of consensus, the local blockchain remains unchanged.

4. The method according to claim 1, characterized in that, The step of reducing the dimensionality of the first hash value to obtain the second hash value includes: The first hash value is divided according to the number of bytes to obtain a hash value with a preset number of bytes before and a hash value with a preset number of bytes after. Then, an XOR operation is performed on the hash value with the preset number of bytes before and the hash value with the preset number of bytes after to obtain the second hash value.

5. The method according to claim 1, characterized in that, The process of performing a secondary aggregation on the second hash value to obtain the root hash value includes: The second hash value is used as a leaf node, and the leaf nodes are aggregated in pairs to construct a Merkle tree. The root hash value is then obtained through the Merkle tree.

6. The method according to claim 1, characterized in that, The process of aggregating the prepared valid signatures in batches according to their arrival time to obtain the prepared aggregated signatures includes: The first aggregated signature is obtained by aggregating the prepared valid signatures within the first arrival time using elliptic curve point addition; and the prepared aggregated signature is obtained by aggregating it with the prepared valid signatures within the second arrival time through a preset synchronization channel.

7. The method according to claim 1, characterized in that, After aggregating the prepared valid signatures in batches according to their arrival time to obtain the prepared aggregated signatures, the method further includes: Arrange the prepared valid signatures in a preset order to obtain the arranged prepared valid signatures, and then concatenate the arranged prepared valid signatures to obtain the concatenated prepared valid signature. The concatenated prepared valid signature is processed using a preset hash function to obtain the stored hash value, and the stored hash value and the corresponding prepared aggregated signature are stored together.