A sharding blockchain system and dynamic sharding method based on repairable fountain code

By adopting a sharded blockchain system based on repairable fountain code in the sharded blockchain system, the shards are divided into original shards and coded shards, which solves the problem of not being able to dynamically increase the number of shards in the existing technology, and achieves the effect of improving system throughput and security as the number of shards increases.

CN116545588BActive Publication Date: 2025-05-13UNIV OF ELECTRONICS SCI & TECH OF CHINA +1

Patent Information

Application Number
CN202310668906.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-06-06
Publication Date
2025-05-13
Estimated Expiration
2043-06-06

AI Technical Summary

Technical Problem

The existing sharded blockchain system cannot dynamically increase the number of shards during the system operation, which makes it difficult to increase shards. After the sharding is added, the original block data processing plan is unclear or the processing cost is too high.

Method used

A sharded blockchain system based on repairable fountain code is adopted to divide the shard into original shards and coded shards. Through the coding rules and coding matrix of repairable fountain codes, the method of dynamically adding shards during operation, as well as data storage and retrieval methods in the system after adding new shards.

Benefits of technology

The dynamic increase in the number of system shards is achieved, while improving the system throughput and security, ensuring that the system throughput and security is synchronized with the increase in the number of shards.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116545588B_ABST
    Figure CN116545588B_ABST
Patent Text Reader

Abstract

The present invention discloses a sharding blockchain system and a dynamic sharding method based on a repairable fountain code. According to the characteristics of the repairable fountain code, the shards in the system are divided into original shards and coded shards, and a method for storing and retrieving data in the system after adding new shards is proposed. Based on the rateless nature of the repairable fountain code, the number of shards in the system can be continuously increased. In addition, the method also solves the problem that when adding shards, the current sharding system must perform a large amount of data migration between shards, which leads to a large network bandwidth consumption, and ensures that the system throughput and security are also improved synchronously with the increase in the number of shards.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of blockchain, and more specifically, relates to a sharding blockchain system and a dynamic sharding method based on repairable fountain codes. Background Art

[0002] In the existing sharded blockchain system, since the hash random number has the characteristic of uniform distribution, the transaction is distributed to each shard for verification according to the hash of the transaction, which can ensure that the verification load of a single shard will not be too high. Therefore, the mainstream method of sharding in the current blockchain system is to divide the hash of a transaction by the number of shards to find the remainder. The remainder is the shard serial number stored, which can quickly locate the shard where the historical content is called. However, in order to add new shards to the system to increase the system's ability to process transactions in parallel, all historical transactions must first be recalculated based on the hash to their shards, and then data must be exchanged between nodes, which will cause huge computing and communication costs. In addition, since blocks are constantly accumulated, as time goes by, the number of blocks in the blockchain increases, and the computing and communication costs of adding shards will become higher and higher. Therefore, the number of shards in most sharded blockchain systems cannot add new shards while the system is running.

[0003] In the Chinese invention patent application published on January 5, 2021, with publication number CN112184226A and invention name “A method and system for dynamic sharding of blockchain”, it is pointed out that the shards of existing sharded blockchains are all address shards. Once the shards are determined, any node belongs to the same shard during its life cycle. The invention proposes a process for address shard swapping operations, which reduces the proportion of cross-shard transactions between shards by address shard swapping, thereby reducing cross-shard consumption. However, the system does not increase the number of shards during operation. Its so-called dynamic sharding only allows account information to be transferred from one shard to another for storage during system operation.

[0004] Existing sharded blockchain systems cannot dynamically increase the number of shards during system operation. The paper "Dynamic Blockchain Sharding" proposes a method to increase the number of shards during system operation, but does not specify the specific processing method for the blocks stored in each shard before and after adding shards. Therefore, existing sharded blockchain systems have problems such as difficulty in adding shards, unclear processing schemes for original block data after adding shards, or excessive processing costs. Summary of the invention

[0005] The purpose of the present invention is to overcome the shortcomings of the prior art and provide a sharded blockchain system and a dynamic sharding method based on repairable fountain codes, which can achieve a dynamic increase in the number of system shards while increasing the system throughput and security as the number of shards increases.

[0006] To achieve the above-mentioned invention object, the present invention is a sharded blockchain system based on a repairable fountain code, characterized in that the system divides the shards into original shards and coded shards according to the coding characteristics of the repairable fountain code; the original shards store uncoded blocks, and the coded shards collect uncoded blocks of multiple original shards according to the coding matrix to generate and store coded blocks. According to the coding rules of the repairable fountain code, that is, one coding symbol bit is generated by multiple original symbol bits, and one original symbol bit participates in the generation of multiple coding symbol bits, the system sends a transaction to be verified to an original shard and multiple coded shards for joint verification, and when a shard in the system fails and the data in the shard is lost, the data in the failed shard can be restored through multiple shards associated with it.

[0007] As a further improvement, the coding slices are generated according to the coding rules of the repairable fountain code. The coding process specifically includes: each coding slice generates a random number through a random number generation algorithm, and broadcasts the respective random numbers to each slice. Each slice generates a coding matrix P through the received random number sequence. The structure of the coding matrix P is as follows:

[0008]

[0009] The matrix indicates that the system consists of k original slices and nk coded slices. The non-zero elements in each row represent which coded slices an original slice participates in generating; in the last nk columns of the matrix, the non-zero elements in each column represent which original slices participate in generating a coded slice. Each coded slice requests the latest uncoded block from the corresponding original slice according to the coding matrix and encodes it to obtain a coded block.

[0010] In addition, the present invention provides a dynamic sharding method for a sharded blockchain system based on a repairable fountain code, characterized in that it comprises the following steps:

[0011] (1) First, new shards appear in the system. Since the repairable fountain code has the property of zero bit rate, the number of coded shards in the sharded blockchain system can continue to increase, and more coded shards will participate in the verification of a transaction to be verified, which improves the security of the sharded system. However, more coded shards participating in the verification of a transaction will lead to the consumption of network bandwidth and the reduction of system throughput. Therefore, while adding coded shards, original shards should also be added to the system to reduce the transaction verification participated by a single original shard, thereby improving the system throughput. Therefore, new shards in the system need to choose to be either coded shards or original shards;

[0012] (2) When the newly generated shard is an original shard, all shards in the system need to save the number of original shards before the new shard is generated and the height of the last block before the new shard is generated. Based on this information, each shard can know which original shard and multiple related coded shards a transaction to be verified should be submitted to for verification. When the newly generated shard is a coded shard, each shard only needs to add one more column to the matrix when generating the coding matrix in each round of consensus, so that it can know which original shards the newly generated coded shard is related to;

[0013] (3) After the original shard is newly generated in the system, when the system performs a new round of transaction verification, the original shard where the UTXO information is located is calculated based on the height of the block where the UTXO information is located. The calculation formula is:

[0014]

[0015] Among them, Shardi represents the serial number of the original shard that can verify the transaction; UTXO.Bh represents the height of the block where the UTXO information is located; BNum(UTXO.Bh.) is a function that represents the height of the last block generated when the original shard was last added before the block where the UTXO information is located; ShardNum(UTXO.Bh) is a function that represents the number of original shards in the system when the block where the UTXO information is located is generated.

[0016] The object of the present invention is achieved in that:

[0017] In the existing sharded blockchain system, there are problems such as difficulty in adding shards, unclear data processing scheme of the original block after adding shards or excessive processing cost. In view of the above problems, the present invention proposes a sharded blockchain system and a dynamic sharding method based on repairable fountain codes. According to the characteristics of the repairable fountain code, the shards in the system are divided into original shards and coded shards, and a method for adding new shards during the operation of the system and a method for storing and retrieving data in the system after adding new shards are proposed. Based on the rateless nature of the repairable fountain code, the number of coded shards in the system can be continuously increased, and more coded shards can improve the security of the system. At the same time, increasing the number of original shards in the system can improve the throughput of the system, thereby ensuring that the throughput and security of the system are improved synchronously with the increase in the number of shards. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] Figure 1 A schematic diagram of a sharded blockchain system based on repairable fountain codes provided by the present invention;

[0019] Figure 2 A flow chart of a dynamic sharding method for a sharded blockchain based on repairable fountain codes provided by the present invention. DETAILED DESCRIPTION

[0020] The specific implementation of the present invention is described below in conjunction with the accompanying drawings so that those skilled in the art can better understand the present invention. It should be noted that in the following description, when the detailed description of known functions and designs may dilute the main content of the present invention, these descriptions will be omitted here.

[0021] In the existing sharded blockchain system, there are problems such as difficulty in adding shards, unclear data processing scheme of the original block after adding shards or excessive processing cost. In view of the above problems, the present invention proposes a sharded blockchain system and a dynamic sharding method based on repairable fountain codes. According to the characteristics of the repairable fountain code, the shards in the system are divided into original shards and coded shards, and a method for adding new shards during the operation of the system and a method for storing and retrieving data in the system after adding new shards are proposed. Based on the rateless nature of the repairable fountain code, the number of coded shards in the system can be continuously increased, and more coded shards can improve the security of the system. At the same time, increasing the number of original shards in the system can improve the throughput of the system, thereby ensuring that the throughput and security of the system are improved synchronously with the increase in the number of shards.

[0022] In order to better describe the above technical solution, the above technical solution will be described in detail below in conjunction with the accompanying drawings and specific implementation methods.

[0023] Embodiment 1

[0024] In this embodiment, we take a sharded blockchain system as an example. Assume that there are 10,000 server nodes in the system at a certain moment, and every 100 nodes form a shard, with a total of 100 shards. According to the encoding characteristics of the repairable fountain code, the shards are divided into original shards and encoded shards, such as Figure 1 As shown in the figure, 50 of them are original shards and 50 are coded shards. The original shards store uncoded blocks, and the coded shards collect uncoded blocks of multiple original shards according to the coding matrix to generate and store coded blocks. According to the coding rules of the repairable fountain code, the system sends a transaction to be verified to an original shard and multiple coded shards for joint verification. When a shard in the system fails and the data in the shard is lost, the data in the failed shard can be restored through multiple shards associated with it.

[0025] The coding slices are generated according to the coding rules of the repairable fountain code. The coding process specifically includes: each coding slice generates a random number through a random number generation algorithm, and broadcasts the respective random numbers to each slice. Each slice generates a coding matrix P through the received random number sequence, and the structure of the coding matrix P is as follows:

[0026]

[0027] The matrix indicates that the system consists of 50 original slices and 50 coded slices. The non-zero elements in each row represent which coded slices an original slice participates in generating; in the 51st to 100th columns of the matrix, the non-zero elements in each column represent which original slices participate in generating a coded slice. Each coded slice requests the latest uncoded block from the corresponding original slice according to the coding matrix and encodes it to obtain a coded block.

[0028] Embodiment 2

[0029] like Figure 2 As shown, in this embodiment, a dynamic sharding method for a sharded blockchain based on a repairable fountain code is implemented in the following steps:

[0030] (1) First, new shards appear in the system. Since the repairable fountain code has the property of zero bit rate, the number of coded shards in the sharded blockchain system can continue to increase, and more coded shards will participate in the verification of a transaction to be verified, which improves the security of the sharded system. However, more coded shards participating in the verification of a transaction will lead to the consumption of network bandwidth and the reduction of system throughput. Therefore, while adding coded shards, original shards should also be added to the system to reduce the transaction verification participated by a single original shard, thereby improving the system throughput. Therefore, new shards in the system need to choose to be either coded shards or original shards;

[0031] (2) When the newly generated shard is an original shard, all shards in the system need to save the number of original shards before the new shard is generated and the height of the last block before the new shard is generated. Based on this information, each shard can know which original shard and multiple related coded shards a transaction to be verified should be submitted to for verification. When the newly generated shard is a coded shard, each shard only needs to add one more column to the matrix when generating the coding matrix in each round of consensus, so that it can know which original shards the newly generated coded shard is related to;

[0032] (3) After the original shard is newly generated in the system, when the system performs a new round of transaction verification, the original shard where the UTXO information is located is calculated based on the height of the block where the UTXO information is located. The calculation formula is:

[0033]

[0034] Among them, Shardi represents the serial number of the original shard that can verify the transaction; UTXO.Bh represents the height of the block where the UTXO information is located; BNum(UTXO.Bh.) is a function that represents the height of the last block generated when the original shard was last added before the block where the UTXO information is located; ShardNum(UTXO.Bh) is a function that represents the number of original shards in the system when the block where the UTXO information is located is generated.

[0035] Although the above describes the illustrative specific embodiments of the present invention to facilitate those skilled in the art to understand the present invention, it should be clear that the present invention is not limited to the scope of the specific embodiments. For those of ordinary skill in the art, as long as various changes are within the spirit and scope of the present invention as defined and determined by the attached claims, these changes are obvious, and all inventions and creations using the concept of the present invention are protected.

Claims

1. A sharded blockchain system based on repairable fountain codes, characterized in that: The system divides the fragments into original fragments and encoded fragments according to the coding characteristics of the repairable fountain code; The original shard stores uncoded blocks, and the coded shard collects uncoded blocks of multiple original shards according to the coding matrix to generate and store coded blocks. The system uses the coding rules of the repairable fountain code, that is, one coded symbol bit is generated by multiple original symbol bits, and one original symbol bit participates in the generation of multiple coded symbol bits. A transaction to be verified is sent to an original shard and multiple coded shards for joint verification. When a shard in the system fails and the data in the shard is lost, the data in the failed shard is restored through multiple shards associated with it. The coding slices are generated according to the coding rules of the repairable fountain code. The coding process specifically includes: each coding slice generates a random number through a random number generation algorithm, and broadcasts the respective random numbers to each slice; each slice generates a coding matrix P through the received random number sequence. The structure of the coding matrix P is as follows: The matrix indicates that the system consists of k original slices and nk coded slices. The non-zero elements in each row represent which coded slices an original slice participates in generating. The non-zero elements in the last nk columns of the matrix represent which original slices participate in generating a coded slice. Each coded slice requests the latest uncoded block from the corresponding original slice and encodes it according to the coding matrix to obtain a coded block.

2. A dynamic sharding method based on the sharded blockchain system according to claim 1, characterized in that: The following steps are involved: (1) First, new shards appear in the system. Since the repairable fountain code has the property of zero bit rate, the number of coded shards in the sharded blockchain system continues to increase. More coded shards will participate in the verification of a transaction to be verified, which improves the security of the sharded system. However, more coded shards participating in the verification of a transaction will lead to the consumption of network bandwidth and the reduction of system throughput. Therefore, when adding coded shards, original shards should also be added to the system to reduce the transaction verification participated by a single original shard, thereby improving the system throughput. Therefore, new shards in the system need to choose to be either coded shards or original shards. (2) When the newly generated shard is an original shard, all shards in the system need to save the number of original shards before the new shard is generated and the height of the last block before the new shard is generated. Based on this information, each shard knows which original shard and multiple related coded shards a transaction to be verified should be submitted to for verification; when the newly generated shard is a coded shard, each shard only needs to add one more column to the matrix when generating the coding matrix in each round of consensus, that is, it knows which original shards the newly generated coded shard is related to; (3) After the original shard is newly generated in the system, when the system performs a new round of transaction verification, the original shard where the UTXO information is located is calculated according to the height of the block where the UTXO information is located; the calculation formula is: Among them, Shardi represents the serial number of the original shard that verifies the transaction; UTXO.Bh represents the height of the block where the UTXO information is located; BNum(UTXO.Bh.) is a function that represents the height of the last block generated when the original shard was last added before the block where the UTXO information is located; ShardNum(UTXO.Bh) is a function that represents the number of original shards in the system when the block where the UTXO information is located is generated.

Citation Information

Patent Citations

  • Block chain dynamic fragmentation method and system

    CN112184226A

  • Blockchain sharding method, system, and server based on locally repairable system codes

    US20240414228A1

Cited By

  • Smart contract fragmentation method

    CN121664368A