Block chain storage method and block chain node

文档序号:1578092 发布日期:2020-01-31 浏览:17次 中文

阅读说明:本技术 区块链的存储方法和区块链的节点 (Block chain storage method and block chain node ) 是由 黄勤 权力 王祖林 于 2018-07-20 设计创作,主要内容包括:本申请提供了一种区块链的存储方法和区块链的节点。所述存储方法包括:存储完整区块链的区块头;以及存储根据规律规则对完整区块链的区块体进行降采样得到的区块体。根据本申请,克服了现有技术对区块链架构认识的局限,提出了一种区块链的存储方法和新型的节点,不仅能够降低全节点存储冗余,而且具有验证和广播能力。(The application provides block chain storage methods and nodes of the block chains, wherein the storage methods comprise a block head for storing a complete block chain and a block body obtained by downsampling the block body of the complete block chain according to rule rules.)

The storage method of the block chains comprises the steps of storing a block head of a complete block chain and storing a block body obtained by down-sampling the block body of the complete block chain according to rule rules.

2. A storage method according to claim 1, wherein the reserved set of blocks obtained by downsampling the blocks of the complete blockchain is determined from the probability distribution that each block in the blockchain is used by a new transaction.

3. The storage method as claimed in claim 2, wherein the probability density function of the survival block in the transaction state is obtained according to the statistical distribution probability of the survival block in the transaction state, and the probability distribution of each block containing the latest transaction state is calculated according to the probability density function of the survival block in the transaction state; and determining the reserved set according to the probability distribution of the latest transaction state contained in each block and a preset down-sampling threshold value.

4. The storage method according to claim 3, wherein the preset downsampling threshold is a preset information entropy threshold, wherein a block depth-based information entropy function of each block is obtained according to a probability distribution that each block contains the latest transaction state; and calculating the range of the depth of the reserved block according to the information entropy function and a preset information entropy threshold value to determine the reserved set.

5. The storage method of claim 4, further comprising: a latest transaction state pool is generated from the block body of the stored reserved set.

6. The storage method of claim 2, wherein the preset downsampling threshold is a preset downsampling rate, wherein a cardinality of the reserved set is calculated according to the downsampling rate and a total number of blocks; and calculating the range of the depth of the reserved blocks according to the cardinality of the reserved set and the probability distribution of each block containing the latest transaction state so as to determine the reserved set.

7. The storage method of claim 6, further comprising: a latest transaction state pool is generated from the block body of the stored reserved set.

8. The storage method of any preceding claim , further comprising storing a chunk of the unreserved set selected according to a random rule.

9. The storage method of claim 8, further comprising: a latest transaction state pool is generated based on the stored chunks of the reserved set and the stored chunks of the unreserved set selected by the random rule.

10, kinds of nodes of blockchains, including a block head and a block body, where the block head includes the block head of a complete blockchain, and the block body includes a block body obtained by down-sampling the block body of the complete blockchain according to rule rules.

11. The node of claim 10, wherein the block volume comprises a block volume of a reserved set of block volumes obtained by downsampling a block volume of a complete blockchain according to a probability distribution that each block in the blockchain is used by a new transaction.

12. The node of claim 11, wherein the block volume comprises a block volume of a reserved set obtained by: obtaining a probability density function of the survival block in the transaction state according to the statistical distribution probability of the survival block in the transaction state; calculating the probability distribution of each block containing the latest transaction state according to the probability density function of the survival block of the transaction state; and determining the reserved set according to the probability distribution of the latest transaction state contained in each block and a preset down-sampling threshold value.

13. The node of claim 12, wherein the preset downsampling threshold is a preset information entropy threshold, wherein a block depth-based information entropy function is obtained for each block according to a probability distribution that the block contains the latest transaction state; and calculating the range of the depth of the reserved block according to the information entropy function and a preset information entropy threshold value to determine the reserved set.

14. The node of claim 12, wherein the preset downsampling threshold is a preset downsampling rate, wherein a cardinality of a reserved set is calculated from the downsampling rate and a total number of blocks; and calculating the range of the depth of the reserved blocks according to the cardinality of the reserved set and the probability distribution of each block containing the latest transaction state so as to determine the reserved set.

15. The node of any of claims 10-14, wherein the tile volume further comprises a tile volume of a non-reserved set selected according to a random rule.

Technical Field

The application relates to a storage method of block chains and a node of the block chains.

Background

With the widespread application of distributed systems, blockchain technology has been rapidly developed for its remarkable features of distributed highly redundant storage, time series data, non-falsification and forgery, decentralized credit, smart contracts, security and privacy protection, and so on, which are typically digital currency, data storage, data authentication, financial transactions, asset management and voting, and so on.

With the advancement and development of blockchain technology, the blockchain expansion problem has become among the major problems that limit blockchain efficiency and scope of applications, blockchain requires that copies of complete blockchain data be backed up per full node, however with the rapid increase in universal applications and traffic of blockchain, it is extremely difficult for each node to store ever increasing amounts of data.

Especially for mobile terminals, with the increase of intelligent devices, mass data are generated continuously, and the transmission of important data consumes a large amount of bandwidth, time and energy, so that a large amount of devices need to be managed through a distributed self-organized mode.

Disclosure of Invention

The purpose of the application is to provide a storage method of block chains and a node of the block chains.

According to aspects of the application, a storage method of block chains is disclosed, which comprises the steps of storing a block head of a complete block chain and storing a block body obtained by down-sampling the block body of the complete block chain according to a rule.

According to aspects of the present application, a node of blockchains is disclosed, comprising a blockhead and a blockbody, the blockhead comprising the blockhead of a complete blockchain, and the blockbody comprising the blockbody down-sampled according to a rule for the complete blockchain.

According to the application, the limitation of the prior art on knowledge of the blockchain architecture is overcome, blockchain storage methods and novel nodes are provided, the storage redundancy of all nodes can be reduced, and the verification and broadcast capabilities are achieved.

Drawings

Fig. 1 shows a block chain structure of a distributed accounting system.

Fig. 2 shows a schematic diagram of blocks.

FIG. 3 shows a schematic diagram of transactions stored in a block of zones.

Fig. 4 shows a schematic diagram of a block chain storage method according to embodiments of the present application.

Fig. 5 shows a schematic diagram of nodes of a blockchain according to embodiments of the present application.

Fig. 6 shows embodiments of determining a reservation set according to a rule.

Fig. 7 shows a schematic diagram of probability density functions of survival tiles according to embodiments of the present application.

Fig. 8 shows a schematic diagram of a probability distribution of each tile being used by a new transaction according to embodiments of the present application.

Fig. 9 shows a schematic diagram of nodes of a blockchain according to embodiments of the present application.

Detailed Description

The following describes a block chain storage method and a block chain node disclosed in the present application in detail with reference to the accompanying drawings. For the sake of simplicity, the same or similar reference numerals are used for the same or similar devices in the description of the embodiments of the present application.

The block chain is decentralization shared general ledgers (Decentralized shared ledgers) which can combine data blocks into a specific data structure in a chain mode according to time sequence and is cryptographically guaranteed to be not falsifiable and counterfeitable, and can safely store simple, sequential and verifiable data in a system. -defined block chain technology is brand-new decentralization infrastructure and distributed computing paradigm which utilizes an encrypted chain block structure to verify and store data, utilizes a distributed node consensus algorithm to generate and update data, and utilizes an automated script code (intelligent contract) to program and operate data.

Since the blockchain uses the encrypted chained blockchain structure to verify and store data, the blockchain storage is highly redundant, and each full node must independently store copies of the complete blockchain data.

For example, a distributed accounting system provides publicly visible accounts through a network of block chains to record historical transaction states that have occurred fig. 1 shows a block chain structure of a distributed accounting system complete block chains are composed of N blocks stored sequentially from block 1 to block N as shown in fig. 1 each block includes a block body and a block head two parts, the block body of every blocks contains transactions and Merkle trees generated by the transactions, the block head of every blocks stores hash values of the block head of the first blocks of the block and data such as the Merkle root of the Merkle tree in the block body of the block, links different block orders at by storing the hash values of the first 7 block heads in the block head of the block, links the block and the block head at 355636 tightly by storing the block head root in the block head, thereby constructing complete block chains.

The generation mode of the merkle tree is to generate hash identifiers of transactions, the transaction identifiers are paired and hashed to obtain hash values of the paired data, and the pairing and hashing processes are repeated continuously until hash values are left, wherein the hash value is the merkle root of merkle trees.

FIG. 2 shows a schematic diagram of blocks, which includes four transactions (T1, T2, T3, T4) and merkle trees generated by the transactions, when blocks are generated, hash operations are performed on T1, T2, T3, and T4 to obtain hash identifiers Hash 0-0, Hash 0-1, Hash 1-0, and Hash 1-1, and then the transaction identifiers are paired in pairs and Hash operations are performed, wherein Hash identifiers Hash 0-0 and Hash 0-1 perform Hash operations together to obtain Hash 0, Hash 1-0 and Hash 1-1 perform Hash operations together to obtain Hash 1, and then the above paired Hash processes are repeated to obtain Hash 0 and Hash 1, so as to obtain merkle roots, and Hash values except for the merkle roots and transaction data are packaged to form blocks.

FIG. 3 shows a schematic diagram of transactions stored in a block of zones, transactions include inputs and Outputs, in the example of a Bitband network, the Outputs of transactions include Outputs of transactions that have been used and Outputs of transactions that have not been used (UpendTransaction Outputs, UTXOs). are legitimate new transactions, i.e., UTXOs that refer to some existing transactions as inputs to the transactions and generate new Outputs, only coinage transactions need not be input as special transactions that generate new Bitband.FIG. 3 shows a schematic diagram of the generation and use of 7 transactions (transactions 0-6), bits are equal to 0.00000001 bits.transaction 0 refers to UTXOs of some previous transaction as input 0, input 0 contains 100k bits smart.transaction 0 generates two Outputs, output 0 and output 1, these two Outputs respectively contain 40k and 50k bits smart, the difference between input and output is the payment for a transaction, transaction 0 contains 10k as transaction input 0, transaction output refers to transaction 0 as transaction input 0, transaction input 0 and output 1 as transaction input 0, transaction balance can be generated from transaction input 0, transaction input 0 can be considered as current transaction input, transaction balance is not shown as transaction input 0, transaction balance, transaction output can be generated from transaction input 0, transaction input 10k is equal to current transaction input 0, transaction input 10 is no transaction can be used, transaction fee.

When new transactions are sent to the network by a user, after the new transaction information is received by nodes in the network, whether the new transaction is legal or not is checked, specifically, whether input quoted by the transaction is UTXOs or not is checked, namely, the latest transaction state is checked, whether an address is legal or not can be checked, an initiating transactor is a legal owner of the input address and the like, whether the transaction is processed or not is checked, whether the sum of the input is greater than the sum of the output or not is checked, if the new transaction is checked to pass, the new transaction is marked as a legal unconfirmed new transaction, and broadcasting is carried out in the network.

After the node in the network verifies and broadcasts the new transaction, a transaction recorder is needed to write the new transaction into the block chain, namely, the new transaction becomes part of the new block, the transaction recorder uses the new transaction to generate a merkle tree, adds corresponding parameters of the block head, packs the new transaction into the block, enables the newly packed block to meet the consensus mechanism through operations such as calculation and the like, and broadcasts the new block .

The node in the network receives the new block (block N +1) and checks the contents of the block, i.e., the validity of the new transaction within the block, the node may also check the format of the block, including the data structure syntax, consensus mechanism, time, block size, and whether the coinage transaction is an th transaction.

If the new block check passes, new block N +1 is marked as a legitimate new block and an attempt is made to connect new block N +1 to the existing blockchain if the connection is successful, block N +1 is treated as part of the current blockchain and block N +1 is seeded within the network.

Under the block chain architecture, the prior art considers that a node must store all historical transaction states of a block chain, namely all nodes, if verification and broadcasting of all new transactions are supported, and the blocks are strictly formed into a complete block chain through the hash values and merkle roots of the first block heads in each block, so that the validity of the block chain is ensured.

But also a high redundancy of storage while ensuring a high degree of security. According to the current transaction amount, the block data of the bitcoin network is increased by about 50GB each year, and the accumulated block data is nearly 140 GB. For example, the data volume of bitcoin is rapidly increasing from less than 1GB in 2009 to nearly 140GB in 2017.

The data not only needs to be downloaded and stored, but also needs to consume a large amount of resources for verification, indexing and state updating, so that the storage overhead of the node is increased, and the transaction processing efficiency is reduced.

The light nodes reduce the storage amount, but the light nodes pay the cost that the working capacity of the light nodes depends on all the nodes, so that the working load of all the nodes is increased, the occupation of bandwidth resources is caused, and the safety of intelligent equipment using the light nodes is also reduced.

According to the application, the limitation of the prior art on knowledge of the blockchain architecture is overcome, and blockchain storage methods and novel blockchain link points are provided, so that the storage redundancy of the whole nodes can be reduced, and the verification and broadcasting capabilities are provided.

According to embodiments of the present application, a storage method of block chains is disclosed, as shown in fig. 4, in S100, a block header of a complete block chain is stored, and in S200, a block body obtained by down-sampling a block body of the complete block chain according to a rule is stored.

According to another implementation manners of the application, a storage method of block chains is disclosed, which comprises the steps of storing a block head of a complete block chain and storing blocks of a reserved set, wherein the reserved set of the blocks obtained by conducting downsampling on the blocks of the complete block chain is determined according to the probability distribution that each block in the block chain is used by a new transaction.

According to embodiments of the present application, a node of blockchains is also disclosed, the node including a blockhead and a blockbody, the blockhead of the node including a blockhead of a complete blockchain, the blockbody of the node including a blockbody obtained by down-sampling the blockbody of the complete blockchain according to a rule.

According to another embodiments of the present application, a node of blockchains is also disclosed, as shown in FIG. 5, the node includes a blockhead and a blockbody, the blockhead of the node includes a blockhead of a complete blockchain, the blockbody of the node includes a blockbody of a reserved set, wherein the reserved set is a reserved set of blockbodies obtained by downsampling the blockbody of the complete blockchain according to a probability distribution that each blockbody in the blockchain is used by a new transaction.

In the blockchain, all historical transaction states are stored in the blockbody, and the latest transaction state (most recent record) is part of the historical transaction state, the blockwith the latest transaction state is the blockneeded for transaction verification and broadcasting in the future, the latest transaction state can be the output UTXOs of the previous unused transaction, or account balance, and the like.

To indicate the distribution law of new transaction states (i.e., the probability of each block being used by a new transaction), in the present application, a "survivor block" is defined, which indicates the number of blocks that a certain transaction state in a block chain experiences from the latest transaction state at the time of generation until it is later altered by a transaction (i.e., to become a non-latest transaction state). The survival block of the transaction state reflects the inherent rule of the transaction state. For a certain network, although the distribution of the latest transaction status changes with the increase of the block height, the distribution of the transaction status survival block does not change, which means that the transaction status survival block has more general meaning. Thus, the probability of each block being used by a new transaction may be obtained by the probability density function of the surviving blocks for the transaction state.

Fig. 6 shows embodiments of determining a reservation set according to a rule.

As shown in the figure, in S210, a probability density function f (x) of the survival block in the transaction state is obtained according to the statistical distribution probability of the survival block x in the transaction state. The survival block x for each transaction state may be counted to obtain a statistically distributed probability for the survival block for the transaction state.

In S220, a probability distribution u (d) of each block including the latest transaction state is calculated according to the probability density function f (x) of the survival block x of the transaction state.

In S230, a reserved set is determined according to the probability distribution u (d) of the latest transaction state contained in each block and a preset downsampling threshold.

And (3) obtaining the probability density function f (x) of the survival block in the transaction state according to the statistical distribution probability of the survival block x in the transaction state, and calculating the probability distribution u (d) of each block containing the latest transaction state according to the probability density function f (x) of the survival block x in the transaction state. For example, when the transaction number in each block is uniform, u (d):

Figure BDA0001737778440000071

where d represents the block depth, as shown in fig. 5, the block depth is the position of a block from the latest block, where the latest block depth is 1.

According to embodiments of the present application, the preset downsampling threshold may be a preset information entropy threshold Ht. Obtaining an information entropy function of the block based on the block depth according to the probability distribution u (d) of each block containing the latest transaction state; and according to the information entropy function and a preset information entropy threshold value HtA range of reserved block depths is calculated to determine the reserved set.

To reflect how much information is provided in each block for verification and seeding of new transactions, information entropy, defined as h (a) ═ E [ -log P (a) ], where a is the block of indeterminate events used by the new transaction and P (a) is the probability of a.

Observing each block independently, the information entropy of the block with the block depth d at the current time is as follows:

H(A)=E[-log P(A)]=E[-log u(d)]=-u(d)log u(d)=H(d)。

according to embodiments of the present application, the reserved set can be obtained by obtaining an information entropy function H (d) of the block based on the block depth d according to the probability distribution of each block used by the new transaction, and obtaining a preset information entropy threshold value H according to the information entropy function H (d) and a preset information entropy threshold value HtCalculating the range of the reserved block depth to determine the reserved set, i.e. all satisfy H (d) ≧ HtDetermining a reserved set D according to the range of the reserved block depth; all chunk headers of the complete chunk chain and the chunks of the reserved set D are stored. Thus, canA new down-sampling node (DS node) according to the present application can be obtained.

According to embodiments of the present application, the DS node generates a latest transaction status pool from the stored block body of the reserved set, the DS node may perform verification and seeding of new transactions and new blocks according to the generated latest transaction status pool.

The DS node may also check if the transaction has been processed, if the input for the transaction is greater than the sum of the outputs, etc. if the check passes, the DS node marks the new transaction as an unprocessed legitimate transaction for .

The same is true for new block verification and seeding when the DS node receives newly generated blocks it will check the validity of all transactions within the verification block, if the check passes, the DS node marks the new block as a valid block for seeding.

On the basis of enabling the DS nodes provided by the application to have independent verification and broadcast capabilities, in order to improve the storage efficiency of the nodes and adapt to changeable application environments, data stored by each DS node can be downsampled according to the requirements of the application environments.

For the purpose of illustrating the performance of the present application, assume NtIs the number of historical transaction states of the complete blockchain, NuIs the number of latest transaction states of the complete blockchain, NstAnd NsuIs the number of historical transaction states and the number of recent transaction states for the DS node then the correct rate for the DS node to validate and broadcast the new transaction is Nsu/NuIf the number of historical transaction states in each tile is , then,

Figure BDA0001737778440000081

wherein

Figure BDA0001737778440000083

Is the DS node reservation set, δ is the number of blocks of the reservation zone, i.e. the cardinality of the reservation set.

According to embodiments of the present application, the storage efficiency of a node can be characterized by broadcast accuracy ratio R to storage amount:

wherein

Figure BDA0001737778440000084

Is the reserved set and δ is the number of reserved block.

The selection of tiles in the downsampled blockchain storage method is jobs because the reserved set D is stable despite the varying tile depthstOnly the complete node of DS needs to download delta of the block volume.

Through the research of the UTXOs, the distribution of the UTXOs can be found to accord with the rule determined by , the survival block x of each UTXOs can be counted to obtain the statistical distribution probability of the survival block of the UTXOs, and the probability density function f (x) of the survival block of the UTXOs is obtained according to the statistical distribution probability of the survival block x of the UTXOs:

(when x <0, f (x) ═ 0)

Where x is the survival block.

If the output number of transactions in each block is considered to be uniform, the probability distribution u (d) of each block containing UTXOs is calculated according to the probability density function f (x) of the surviving block x of UTXOs:

Figure BDA0001737778440000092

observing each block independently, the information entropy of the block with the block depth d at the current time is as follows:

H(d)=E[-log u(d)]=-u(d)log u(d)

here, we can downsample the block chain by the following steps:

the reserved set of block of the region to be downsampled and stored is obtained by the following steps: obtaining block depth-based information entropy function H (d) of each block according to the probability distribution of each block used by the new transaction; according to the information entropy function H (d) and a preset information entropy threshold value HtCalculating the range of the reserved block depth to determine the reserved set, i.e. solution H (d) ≧ HtObtaining a depth D range, wherein a set formed by the depth D range is a reserved set D; all chunk headers of the complete chunk chain and the chunks of the reserved set D are stored. In this way, a down-sampling node (DS node) according to the present application can be obtained.

In addition, the DS node also checks whether the transaction is processed and whether the input of the transaction is greater than the sum of the outputs, if the check is passed, the DS node marks the new transaction as an unprocessed legal transaction and carries out broadcasting.

The working steps are similar for newly generated blocks when newly generated blocks are received by DS nodes, it will check the validity of the transaction within the verification block, data structure, consensus mechanism, block time, and coinage transaction, if the check passes, DS nodes mark the new block as a valid block.

To illustrate the performance of the downsampled blockchain storage method on bitcoins, in Table 1, the full node, H, is shownt for DS node 0.23e-27Broadcast correct rate and R.

TABLE 1 full node, Ht broadcast accuracy and R for DS node 0.23e-27

broadcast accuracy R
DS node 1.000 0.006
Full node 1 6.049e-6

It can be seen that when the down-sampling rate is less than 1024, the DS node has broadcast correct rate similar to the full node, with a higher R than the full node.

In table 2, the average download block numbers of the full node and the DS node are shown.

TABLE 2 average download Block count for full node and DS node

H t 0 0.23e-27 0.22e-06
DS node 519893 508 127
Full node 519893 - -

It can be seen that a DS node with a suitable down-sampling rate only needs a small portion of the number of downloaded blocks for a complete node.

The probability distribution that each tile in the blockchain is used by a new transaction may be different depending on the type of blockchain. For example, in addition to bitcoins, the probability density function of the survivor blocks x of the transaction status of other blockchain networks may be changed, so as to obtain the corresponding probability distribution u (d) used by the new transaction for each block. However, it will be appreciated that the downsampled blockchain storage method and node operation is the same as the blockchain storage method described above.

For example, for an exemplary blockchain network, the survival block x of each transaction state may be counted to obtain a statistical distribution probability of the survival block of the transaction state, and a probability density function f (x) of the survival block of the transaction state is obtained according to the statistical distribution probability of the survival block x of the transaction state:

f(x)=e-x

(when x <0, f (x) ═ 0)

Where x is the survival block.

Calculating the probability distribution u (d) of each block containing the latest transaction state according to the probability density function f (x) of the survival block x of the transaction state:

Figure BDA0001737778440000111

observing each block independently, the information entropy of the block with the block depth d at the current time is as follows:

H(d)=E[-log u(d)]=-u(d)log u(d)=de-dlog e

here, we can downsample the block chain by the following steps:

the reserved set of block of the region to be downsampled and stored is obtained by the following steps: obtaining block depth-based information entropy function H (d) of each block according to the probability distribution of each block used by the new transaction; according to the information entropy function H (d) and a preset information entropy threshold value HtCalculating the range of the reserved block depth to determine the reserved set, i.e. solution H (d) ≧ HtObtaining a depth D range, wherein a set formed by the depth D range is a reserved set D; all chunk headers of the complete chunk chain and the chunks of the reserved set D are stored. In this way, a down-sampling node (DS node) according to the present application can be obtained.

According to another embodiments of the present application, the predetermined downsampling threshold is a predetermined downsampling rate, the cardinality of the reserved set may be calculated based on the downsampling rate and the total number of blocks, and the range of reserved block depths may be calculated based on the cardinality of the reserved set and a probability distribution that each block contains the most recent transaction state to determine the reserved set.

For example, the down-sampling rate may be preset to be M. The cardinality δ of the reserved set is calculated from the downsampling rate M and the total number of blocks. The range of reserved block depths is calculated from the cardinality δ of the reserved set and the probability distribution u (D) of each block used by the new transaction to determine the reserved set D. All chunk headers of the complete chunk chain and the chunks of the reserved set D are stored. In this way, a down-sampling node (DS node) according to the present application can be obtained.

According to another embodiments of the present application, for bitcoin networks, UTXOs represents the latest transaction status, and the new transaction is verified by the node using the UTXOs pool, the surviving block x of each UTXOs may be counted to obtain the statistical distribution probability of the surviving block of UTXOs, and the probability density function f (x) of the surviving block of UTXOs is obtained according to the statistical distribution probability of the surviving block x of UTXOs, as shown in fig. 7:

Figure BDA0001737778440000121

(when x <0, f (x) ═ 0)

Where x is the survival block.

If the output number of transactions in each block is considered to be uniform, then the probability u (d) that the block with block depth d contains all UTXOs (i.e., the probability distribution that each block is used by new transactions) is as shown in fig. 8:

Figure BDA0001737778440000122

here, we can downsample the block chain by the following steps: determining a down-sampling rate M; according to the down-sampling rate M and the total block number dmaxCalculating the cardinality delta, d of the reserved setmaxM, calculating a range of reserved block depths from the cardinality δ of the reserved set and the probability distribution u (D) of each block used by the new transaction to determine a reserved set D, D being the largest set of δ blocks of u (D), D being the first δ blocks of the full block chain block depth since u (D) is a monotonically decreasing function,

Figure BDA0001737778440000123

and storing all chunk headers of the complete chunk chain and the chunks of the reserved set D. In this way, a down-sampling node (DS node) according to the present application can be obtained.

In addition, the DS node also checks whether the transaction is processed and whether the input of the transaction is greater than the sum of the outputs, if the check is passed, the DS node marks the new transaction as an unprocessed legal transaction and carries out broadcasting.

The working steps are similar for newly generated blocks when newly generated blocks are received by DS nodes, it will check the validity of the transaction within the verification block, data structure, consensus mechanism, block time, and coinage transaction, if the check passes, DS nodes mark the new block as a valid block.

To illustrate the performance of the downsample blockchain storage method on bitcoins, in table 3, the broadcast correct rates and R for the full node, DS node with downsample rate M-1024 are shown.

Table 3 total node, broadcast correct rate and R for DS node with down-sampling rate M1024

broadcast accuracy R
DS node 1.000 0.006
Full node 1 6.049e-6

It can be seen that when the down-sampling rate is less than 1024, the DS node has broadcast correct rate similar to the full node, with a higher R than the full node.

In table 4, the average download block numbers of the full node and the DS node are shown.

TABLE 4 average download Block count for full node and DS node

M 1 16 256 1024 4096
DS node 519893 32494 2031 508 127
Full node 519893 - - - -

It can be seen that DS nodes with appropriate down-sampling rates have only 1/M of the average number of downloaded blocks of a complete node.

Further , random sampling can be introduced into the downsampled blockchain storage method for each blockchain, that is, on the basis of the downsampled blockchain storage method, block bodies of L unreserved sets are randomly stored to resist guessing of an attacker, wherein the unreserved sets are sets of the block bodies of the complete blockchain except for the reserved sets, according to embodiments of the present application, a storage method for blockchains is disclosed, which comprises storing a block header of the complete blockchain, and storing a block body of the reserved set and a block body of the unreserved set selected according to a random rule.

According to embodiments of the present application, a node of blockchains is disclosed, wherein the node comprises a blockhead and a blockbody, the blockhead of the node comprises the blockhead of the complete blockchain, the blockbody of the node comprises the blockbody obtained by down-sampling the blockbody of the complete blockchain according to a rule, and the blockbody of an unreserved set selected according to a random rule, as shown in FIG. 9, a random sequence j with a length L and not repeated can be randomly generated in the unreserved set1、j2、…jL,(j1Schematically shown in fig. 9) DS node stores not only the block of the reserved set but also the block depth j1、j2、…jLThe non-reserved set of blocks of (1). By introducing random sampling, the block of the area stored by the DS node cannot be fully predicted even if the attacker knows the downsampling storage method and the downsampled starting block depth. Thereby effectively preventing the possibility of a successful attack.

According to embodiments of the present application, a latest transaction status pool can be generated based on the stored blocks of reserved sets and the stored blocks of unreserved sets selected by a random rule.

Exemplary embodiments of the present application are described above with reference to the accompanying drawings. It will be appreciated by those skilled in the art that the above-described embodiments are merely exemplary for purposes of illustration and are not intended to be limiting, and that any modifications, equivalents, etc. that fall within the teachings of this application and the scope of the claims should be construed to be covered thereby.

19页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:风控方法、系统、装置及设备

网友询问留言

已有0条留言

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

精彩留言,会给你点赞!