CN-121984976-A - Method and system for realizing hybrid fragmentation two-stage consensus protocol
Abstract
The invention discloses a method and a system for realizing a mixed slice two-stage consensus protocol, wherein the method comprises the following steps of S1, in sub-slices, sub-slice chain nodes generate data to be recorded on sub-slice blocks and broadcast transaction data packets, S2, in sub-slices, sub-slice chain nodes form consensus results, S3, in sub-slices, sub-slice chain billing nodes generate blocks, storage blocks are in local sub-slice chains and broadcast block data packets, 4, in sub-slices, sub-slice chain node verification blocks are stored in local sub-slice chains, S5, in main slices, sub-slice block chain billing nodes submit sub-slice block Ha Xitou data and broadcast transaction data packets, S6, in main slices, main block chain link points form consensus results, S7, in main slices, main block chain billing nodes generate blocks, storage blocks are in local main block chains and broadcast block data packets, and the main block chain link verification blocks pass verification blocks are stored in local main block chains.
Inventors
- TONG WEI
- LI YUNLONG
- WU ZHOUMING
- WANG YINGRU
- CHEN RONG
- Yu shuaihua
- SHEN JIAN
- YANG SIYUAN
- JIN ZILONG
- WU ZHIHAO
- WANG YUJIA
- WANG ZIQING
- CHEN YANG
Assignees
- 浙江理工大学
- 国家工业信息安全发展研究中心
Dates
- Publication Date
- 20260505
- Application Date
- 20260123
Claims (8)
- 1. The mixed slicing consists of a main slicing and a plurality of sub-slicing, wherein the main slicing maintains a main block chain formed by a plurality of main block links, and the sub-slicing maintains a sub-block chain formed by a plurality of sub-block links, and the method is characterized by comprising the following steps: s1, sub-fragment transaction generation In the sub-fragments, any sub-block chain node can generate data to be recorded on the sub-block chain, generates transaction through packed data, private key signature and public key address information, and broadcasts transaction data packets; S2, sub-slice transaction consensus In any sub-segment, all sub-block chain nodes perform verification, processing and negotiation operations on the transaction together to form a consistency consensus result, if the transaction consensus is successful, executing a step S3, otherwise, returning to the step S1 to execute the next consensus; S3, generating sub-slice blocks In any sub-segment, the sub-block chain accounting node packages a consistency consensus result and private key signature information to generate a block, the storage block is in a local sub-block chain, and a block data packet is broadcast; S4, sub-sliced block storage In any sub-segment, each sub-block chain point verifies a block, and the verified block is stored in a local sub-block chain; S5, main slice transaction generation In the main segmentation, each sub-segmentation block chain accounting node submits the sub-segmentation block Ha Xitou data stored in the step S3, generates a transaction by packaging data, private key signature and public key address information, and broadcasts a transaction data packet; S6, main fragment transaction consensus In the main segmentation, all main block chain link points perform verification, processing and negotiation operations on the transaction together to form a consistency consensus result, if the transaction consensus is successful, executing a step S7, otherwise, returning to the step S1 to execute the next consensus; S7, generating a main slicing block In the main partition, a main block chain accounting node packages a consistency consensus result and private key signature information to generate a block, a storage block is in a local main block chain, and a block data packet is broadcast; s8, storing the main slicing block In the master shard, each master blockchain node validates blocks, and the validated blocks are stored in the local master blockchain.
- 2. The method of claim 1, wherein in step S3, the block is composed of a block header and a block body, wherein the sub-block header includes a pre-block hash value, a timestamp, a random number, and a Merker root field, and the block body includes a transaction, a hash value, and a Merker hash tree.
- 3. The method of claim 1, wherein in step S7, the block is composed of a block header and a block body, wherein the main block header includes a pre-block hash value, a timestamp, a random number, and a Merker root field, and the block body includes a hash value and a Merker hash tree.
- 4. The method for implementing the hybrid slicing two-phase consensus protocol as set forth in claim 2 or 3, wherein the hash value in the zone block is calculated by a hash function and transaction data: HASH value=hash (transaction data).
- 5. The method for implementing the hybrid slicing two-phase consensus protocol as claimed in claim 4, wherein the block hash value in the block header is calculated by a hash function, a timestamp, a random number, and a merck root: block HASH value-HASH (timestamp, random number, merck root).
- 6. The method of claim 5, wherein the transaction data format in the header of the main block includes sequence number, input and output, the input data format includes sequence number, index and address, and the output data format includes sequence number, hash value and signature.
- 7. The method of claim 6, wherein the transaction data format in the sub-block header includes sequence number, input and output, wherein the input data format includes sequence number, index and address, and the output data format includes sequence number, data and signature.
- 8. A hybrid-tile two-phase consensus protocol implementation system for performing the method according to any of claims 1-7, said hybrid-tile consisting of a main tile and a plurality of sub-tiles, wherein the main tile maintains a main blockchain formed by a plurality of main blocklinks and a sub-tile maintains a sub-blockchain formed by a plurality of sub-blocklinks, said system comprising: the sub-segment transaction generating module is used for generating data to be recorded on the sub-segment chain by any sub-segment chain node in the sub-segment, generating transaction by packaging data, private key signature and public key address information, and broadcasting transaction data packets; the sub-slice transaction consensus module is used for verifying, processing and negotiating the transaction together by all sub-slice chain nodes in any sub-slice to form a consistency consensus result, if the transaction consensus is successful, the sub-slice block generation module is used for executing the sub-slice transaction, otherwise, the sub-slice transaction generation module is used for executing the next consensus; The sub-block generation module is used for packing the consistency consensus result and the private key signature information to generate a block in any sub-block by the sub-block chain accounting node, and broadcasting a block data packet by the storage block in a local sub-block chain; the sub-block storage module is used for verifying the block by each sub-block chain link point in any sub-block, and storing the verified block in a local sub-block chain; In the main sharding, each sub-sharding block chain accounting node submits sub-sharding block Ha Xitou data stored by the sub-sharding block generating module, generates a transaction through packaging data, private key signature and public key address information, and broadcasts a transaction data packet; The main-fragment transaction consensus module is used for performing verification, processing and negotiation operations on the transaction together by all main-fragment chain link points in the main fragments to form a consistency consensus result, if the transaction consensus is successful, the main-fragment block generation module is used for executing the transaction, otherwise, the sub-fragment transaction generation module is returned to execute the next consensus; the master block chain accounting node packages the consistency consensus result and private key signature information to generate a block in the master block, and the storage block is in a local master block chain and broadcasts a block data packet; and the master block storage module is used for verifying the block by each master block chain node in the master block and storing the verified block in a local master block chain.
Description
Method and system for realizing hybrid fragmentation two-stage consensus protocol Technical Field The invention belongs to the technical field of block chains, and particularly relates to a method and a system for realizing a hybrid slicing two-stage consensus protocol. Background The blockchain consensus protocol is the core mechanism for a distributed network to achieve data consistency. The BFT type consensus protocol relies on full node verification, and has the problems of poor expansibility, low throughput and the like. However, these approaches face scalability bottlenecks in high concurrency scenarios. The fragmentation technique processes transactions in parallel to improve throughput by dividing the network nodes and transaction data into multiple fragments. With the application of the high-dynamic multi-cluster distributed system, the dynamics, diversity and grouping of the distributed system put higher requirements on the consensus protocol. The earliest blockchain slicing technology is proposed in the Etherfang 2.0 purple book, one blockchain network is expanded into a plurality of blockchain slicing networks, one blockchain is expanded into a plurality of blockchains, and parallel processing of blockchain transactions is realized, so that transaction throughput is improved (BUTERIN V. Ethereum 2.0 mauve paper[C ]// Ethereum Developer Conference:Vol 2.2016.). In Elastico scheme, the PoW protocol and PBFT protocol are combined, the PoW protocol is utilized to build a blockchain slicing network, so that the calculation power of each slice is as average as possible, then the PBFT protocol is utilized twice to process the transaction and store the final block (LUU L, NARAYANAN V, ZHENG C, et al. A secure sharding protocol for open blockchains[C]//Proceedings of the 2016 ACM Conference on Computer and Communications Security. 2016:17–30.).Tong and the like to design a consensus node election strategy based on trust value evaluation, the fault tolerance of the consensus protocol is improved elastically, and the scale of the consensus network is expanded (Tong W, Dong X, Shen Y, et al. A blockchain-driven data exchange model in multi-domain IoT with controllability and parallelity[J]. Future Generation Computer Systems, 2022, 135: 85-94.). In Aspen scheme, each fragment processes a service transaction, and the transaction submitted by each fragment is packaged again to the same final block through a secondary consensus mechanism, and then the final block storage uplink (GENCER A E, RENESSE R V, SIRER E G. Short paper: Service-oriented sharding for blockchains[C]//International Conference on Financial Cryptography and Data Security. 2017:393–401.).OmniLedger scheme comprises an identity chain and a plurality of fragment sub-chains, wherein the identity chain is commonly maintained by all fragments, and the fragment sub-chains are maintained by a certain fragment. Each slice independently and parallelly processes intra-slice transactions, omniLedger utilizes a time lock to ensure cross-slice transaction atomicity (KOKORIS-KOGIAS E, JOVANOVIC P, GASSER L, et al. Omniledger: A secure, scale-out, decentralized ledger via sharding[C]//2018 IEEE Symposium on Security and Privacy. 2018:583–598.). CHChain to construct a multi-slice Internet of things block chain model, and provides a trust-driven multi-slice layered consensus method to greatly improve the throughput of Internet of things block chain consensus (Tong W, Dong X, Shen Y, et al. CHChain: Secure and parallel crowdsourcing driven by hybrid blockchain[J]. Future Generation Computer Systems, 2022, 131: 279-291.). The existing method has the following defects: ① The existing consensus protocol has low throughput and high delay, BFT type consensus protocol needs multiple rounds of communication, and the consensus delay is obviously increased when the network scale is enlarged, so that the real-time application requirement can not be met. ② Block format rigidification, namely the existing block format is not designed for the fragments, and the cross-fragment transaction needs multiple references and verification, so that the storage overhead and the processing time are increased, and the cross-fragment transaction efficiency is low. Disclosure of Invention In order to solve the problems in the prior art, the invention provides a hybrid slicing two-stage consensus method and a system. In order to achieve the above purpose, the invention adopts the following technical scheme: The invention relates to a method for realizing a mixed slice two-stage consensus protocol, which consists of a main slice and a plurality of sub slices, wherein the main slice maintains a main block chain formed by a plurality of main block links, any sub slice maintains a sub-block chain formed by a plurality of sub-block links, and the two-stage consensus consists of one-stage consensus completed in the sub-slice and two-stage consensus completed in the main slice, and the method sp