CN111414421A - Sectional type block chain storage method and storage device - Google Patents

Sectional type block chain storage method and storage device Download PDF

Info

Publication number
CN111414421A
CN111414421A CN202010190406.6A CN202010190406A CN111414421A CN 111414421 A CN111414421 A CN 111414421A CN 202010190406 A CN202010190406 A CN 202010190406A CN 111414421 A CN111414421 A CN 111414421A
Authority
CN
China
Prior art keywords
block
segment
previous
node
blocks
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202010190406.6A
Other languages
Chinese (zh)
Inventor
黄伟兰
梁循
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Renmin University of China
Original Assignee
Renmin University of China
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Renmin University of China filed Critical Renmin University of China
Priority to CN202010190406.6A priority Critical patent/CN111414421A/en
Publication of CN111414421A publication Critical patent/CN111414421A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q40/00Finance; Insurance; Tax strategies; Processing of corporate or income taxes
    • G06Q40/04Trading; Exchange, e.g. stocks, commodities, derivatives or currency exchange

Abstract

The invention belongs to the field of block chains, and relates to a sectional type block chain storage method and a storage device, which comprise the following steps: s1, generating a new block, and dividing an original block chain into block sections comprising a plurality of blocks; s2, dividing the block in each block segment into a block containing the information of the previous block segment and a common block; and S3, each node in the regional chain can participate in mining, consensus and accounting of the block chain only by downloading the block segment corresponding to the new block and the blocks containing the information of the previous block segment in all the block segments. The method and the device reduce the threshold of the newly added node participating in the consensus accounting, and enable the interruption node to quickly synchronize the block information, so that the newly added node and the interruption node can participate in the block chain consensus accounting through shorter storage time and smaller storage space.

Description

Sectional type block chain storage method and storage device
Technical Field
The invention relates to a segmented block chain storage method and a storage device, and belongs to the technical field of block chains.
Background
The block chain technology originates from bitcoin, is essentially a technical scheme for collectively maintaining a reliable database in a distributed and high-trust mode, and the core technology of the block chain technology comprises a distributed book technology, an asymmetric encryption algorithm, intelligent contracts and the like, and has the characteristics of distribution, openness and transparency, traceability, high trust and the like.
In the existing block chain consensus accounting mechanism, no matter a public chain or a federation chain, all existing information on the block chain must be stored when a node participates in the consensus accounting, which is an essential requirement of a distributed ledger and is the most powerful guarantee for solving the problem of tamper resistance. However, as the transaction data increases and the information in the blockchain increases, the existing node and the newly joining node have to spend a lot of time and space to keep a copy of all data in order to participate in the consensus accounting, thereby causing a lot of waste of resources.
Disclosure of Invention
In view of the foregoing disadvantages of the prior art, an object of the present invention is to provide a method and a device for storing a segmented blockchain, which reduces a threshold of a newly added node participating in consensus accounting, and enables an interrupted node to quickly synchronize blockchain information, so that the newly added node and the interrupted node can participate in the blockchain consensus accounting through a shorter storage time and a smaller storage space.
In order to achieve the above object, the present invention provides a segmented blockchain storage method, which includes the following steps: s1, generating a new block, and dividing an original block chain into block sections comprising a plurality of blocks; s2, dividing the block in each block segment into a block containing the information of the previous block segment and a common block; and S3, each node in the regional chain can participate in mining, consensus and accounting of the block chain only by downloading the block segment corresponding to the new block and the blocks containing the information of the previous block segment in all the block segments.
Further, if the block chain has an offline node, when the offline node re-enters the block chain, the offline node only needs to store the block segment corresponding to the new block and all the blocks which are not stored in the blocks containing the previous block segment information of the block segment and contain the previous block segment information, and synchronously downloads the block segments and the blocks, so that the offline node can participate in mining, consensus and accounting of the block chain.
Furthermore, the first block in each block segment is called a segment header block, which is a block containing information of a previous block segment, and all the segment header blocks are connected in a manner of storing information of the previous segment header block.
Further, the normal block includes a block head and a block body; the segment head block comprises a block head, a block body and a block tail, and the information of the previous segment head block is stored in the block tail of the segment head block.
Further, the block header includes: the method comprises the following steps of firstly, obtaining a version number, a hash address of a previous block, a hash value of a Mercker tree root traded in the block, a creation timestamp of the block, a consensus target and a random parameter; the block body comprises: the number of bytes occupied by the transaction number, the transaction number and the transaction data; the block end includes: segment number, hash address of the previous segment header block, hash value of the mercker tree root traded in the block, consensus target of the segment header block, and random parameter.
Furthermore, the consensus of the block chains adopts a workload proving mechanism, and the generation speed of the new block is adjusted by adjusting the workload proving difficulty of the common block and the workload proving difficulty of the segment head block.
Further, the workload proving difficulty of the common block in each block segment is the same as the workload proving difficulty of the segment head block, and the workload proving difficulty of the common block in different block segments is different from the workload proving difficulty of the segment head block, that is, when entering the next block segment, the workload proving difficulty of the common block and the workload proving difficulty of the segment head block are adjusted.
Further, the specific process of generating the new tile in step S1 is as follows: for the common block, after the node finishes the workload certification, independently packaging the transaction records into a new block; for the segment head block, the node simultaneously stores the workload certification of the hash address of the previous block and the workload certification of the hash address of the previous segment head block, and independently packs the transaction records into a new block; each node independently checks the new block and assembles the new block into a block chain.
Further, in step S4, each node independently selects a blockchain, and selects, under the workload certification mechanism, a blockchain with the largest accumulated workload of the downloaded segment header blockchain and the largest accumulated workload of the latest segment blockchain.
Based on the same inventive concept, the invention also discloses a sectional block chain storage device, which comprises: a block chain segmentation module for dividing the block chain into block segments comprising a plurality of blocks; the block segment separation module is used for dividing the blocks in each block segment into blocks containing the information of the previous block segment and common blocks; the block generation module is used for generating a new block; and the node downloading module is used for downloading the block segment corresponding to the new block and the blocks containing the information of the previous block segment in all the block segments by the nodes in the block chain, and enabling the nodes to participate in mining, consensus and accounting of the block chain.
Due to the adoption of the technical scheme, the invention has the following advantages:
1. The method and the device reduce the threshold of the newly added node participating in the consensus accounting, and enable the interruption node to quickly synchronize the block information, so that the newly added node and the interruption node can participate in the block chain consensus accounting through shorter storage time and smaller storage space.
2. The newly added node only stores all the segment head blocks and all the blocks contained in the block segment corresponding to the new block, and can participate in ore digging, consensus and accounting of the block chain, and compared with the traditional public chain, the time and space cost is greatly reduced.
3. When the offline node is connected again, the existing block chain requires that the node must be added to all blocks of the block chain after being downloaded from the node offline, namely, the block chain is synchronous, and the process consumes a large amount of time and storage space.
Drawings
FIG. 1 is a block chain connection scheme according to an embodiment of the present invention;
Fig. 2 is a schematic structural diagram of a segment header block according to an embodiment of the present invention.
Detailed Description
The present invention is described in detail by way of specific embodiments in order to better understand the technical direction of the present invention for those skilled in the art. It should be understood, however, that the detailed description is provided for a better understanding of the invention only and that they should not be taken as limiting the invention. In describing the present invention, it is to be understood that the terminology used is for the purpose of description only and is not intended to be indicative or implied of relative importance.
Before explaining the technical scheme of the invention, firstly, technical terms in the invention need to be: the node and block chain account book is explained as follows:
The nodes in the invention comprise the following types:
1) A complete node for blockchain creation and maintenance that holds a complete copy of all information of the blockchain and checks for new transactions generated according to a consensus protocol used by a particular cryptocurrency or utility token.
2) A segment complete node for creation and maintenance of a blockchain, the segment complete node holding all block copies of all block segments of the blockchain containing a block of previous blocksegment information and a latest blocksegment and checking the resulting new transaction according to a consensus protocol used by a particular cryptocurrency or a utility token.
3) Common nodes, which are used by third parties to issue transactions and access the blockchain, hold part of the blockchain information, and may also be called light wallets, which are widely used in mobile devices or simply people who do not want to download the entire blockchain.
Block chain account book: the blockchain ledger is used to hold any information that any node or user wants to hold.
In the present invention both full nodes and segment full nodes can participate in consensus accounting, using the same consensus protocol to remain compatible with each other. The regular node may not participate in consensus accounting. That is, each node in the local chain can participate in mining, consensus and accounting of the block chain only by downloading the block segment corresponding to the new block and the block containing the previous block segment information of all the block segments. All block chains which store the block segments corresponding to the new blocks and the blocks containing the information of the previous block segments of all the block segments are called authoritative accounts.
The blockchain in the invention is composed of a founder block and a series of data structures which are connected with other blocks which are the same with the founder block. Wherein the created block has only one unique hash value. Except for the created block, each subsequently created block contains two hash values, one is the hash value of the block itself and the other is the hash value of the previous block. All blocks are connected in sequence through the front-back direction relation among the hash values.
Example one
The embodiment provides a segmented blockchain storage method, as shown in fig. 1, including the following steps:
S1, generating a new block, and dividing an original block chain into block sections comprising a plurality of blocks; the chunk segment in this embodiment preferably includes 2016 chunks, wherein chunks in the chunk segment are connected in a manner that preserves a hash value of a previous chunk.
S2, dividing the block in each block segment into a block containing the information of the previous block segment and a common block;
And S3, each node in the regional chain can participate in mining, consensus and accounting of the block chain only by downloading the block segment corresponding to the new block and the blocks containing the information of the previous block segment in all the block segments.
If the block chain has the offline node, when the offline node reenters the block chain, the mining, consensus and accounting of the block chain can be participated only by storing the block segment corresponding to the new block and all the unsaved blocks containing the information of the previous block segment in the blocks containing the information of the previous block segment of the block segment and synchronously downloading the two blocks.
In step S2, the first block in each block segment is called a segment header block, which is a block containing information of a previous block segment, and all the segment header blocks are connected in a manner of storing information of the previous segment header block. The normal block and the segment header block are connected in a manner of storing the hash value of the previous block.
As shown in fig. 2, the normal block includes a block head and a block body; the segment head block comprises a block head, a block body and a block tail, and the information of the previous segment head block is stored in the block tail of the segment head block. The block head includes: the method comprises the following steps of firstly, obtaining a version number, a hash address of a previous block, a hash value of a Mercker tree root traded in the block, a creation timestamp of the block, a consensus target and a random parameter; the block body comprises: the number of bytes occupied by the transaction number, the transaction number and the transaction data; the block end includes: segment number, hash address of the previous segment header block, hash value of the mercker tree root traded in the block, consensus target of the segment header block, and random parameter.
In step S1, the generating of the new tile includes two steps of generating a segment header tile and generating a normal tile. If the generated block is a normal block, a new block can be generated only by meeting the consensus mechanism of the block segment, and if the generated block is a segment head block, the consensus mechanism for solving the previous block in the block head and the consensus mechanism for the previous segment head block in the block tail are simultaneously met.
In this embodiment, the consensus of the block chain adopts a workload proving mechanism, and the generation speed of the new block is adjusted by adjusting the workload proving difficulty of the normal block and the workload proving difficulty of the segment head block, so that the generation speed of the block is about 10 minutes.
The workload proving difficulty of the common block in each block section is the same as the workload proving difficulty of the segment head block, and the workload proving difficulty of the common block in different block sections is different from the workload proving difficulty of the segment head block, namely, when entering the next block section, the workload proving difficulty of the common block and the workload proving difficulty of the segment head block are adjusted. The maximum difficulty target is specified as: 0x00000000 FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF. The difficulty targets in creating block headers and block trailers are specified as follows: 0x1D00 FFFF. The formula for adjusting the difficulty target in the block header every 2016 blocks is as follows: new difficulty value old difficulty value (previous 2016 blocks spent time length (seconds per unit)/2016 × 10 × 60). The formula for adjusting the difficulty target in the block tail every 2016 segment head blocks is as follows: new difficulty value old difficulty value (previous 2016 segment header blocks spent long (seconds per unit)/2016 × 10 × 60).
In step S1, based on the workload certification mechanism, the specific process of generating a new tile is: for the common block, after the node finishes the workload certification, independently packaging the transaction records into a new block; for the segment head block, the node simultaneously stores the workload certification of the hash address of the previous block and the workload certification of the hash address of the previous segment head block, and independently packs the transaction records into a new block; each node independently checks the new block and assembles the new block into a block chain. The process that each node independently checks the new block is as follows: and the node judges that a segment head block needs to be generated, generates a hash value in the block head of the segment head block by changing a random number, and if the hash value is smaller than the target difficulty value in the block head, the new block can be accepted by the block link point network. And meanwhile, a hash value is generated in the block tail of the block at the head of the segment by changing the random number, and if the hash value is smaller than the target difficulty value in the block tail, the new block can be accepted by the block chain node network. At this point, the node that generated the segment header block may be given double the billing fee because the mining node completes both workload proofs at the same time, making the calculation more complex.
In step S4, under the workload proving mechanism, each node independently checks and adds a new block in the block chain, and under the workload proving mechanism, selects the block chain with the largest cumulative workload of the download segment header block and the largest cumulative workload of the latest block segment. After selecting the block chain with the largest accumulated workload of the download segment head block and the largest accumulated workload of the newest block segment, all the nodes finally reach consensus in the whole network range of the block chain. As more workload justification is added to the chain, the node selects the chain that it wants to extend by "voting," and when a blockchain produces a new block and extends a chain, the new block itself represents its voting result.
Based on the same inventive concept, the invention also discloses a sectional block chain storage device, which comprises: a block chain segmentation module for dividing the block chain into block segments comprising a plurality of blocks; the block segment separation module is used for dividing the blocks in each block segment into blocks containing the information of the previous block segment and common blocks; the block generation module is used for generating a new block; and the node downloading module is used for downloading the block segment corresponding to the new block and the blocks containing the information of the previous block segment in all the block segments by the nodes in the block chain, and enabling the nodes to participate in mining, consensus and accounting of the block chain.
The above description is only for the specific embodiments of the present application, but the scope of the present application is not limited thereto, and any person skilled in the art can easily conceive of the changes or substitutions within the technical scope of the present application, and shall be covered by the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims (10)

1. A method for segmented blockchain storage, comprising the steps of:
S1, generating a new block, and dividing an original block chain into block sections comprising a plurality of blocks;
S2, dividing the block in each block segment into a block containing the information of the previous block segment and a common block;
And S3, each node in the regional chain can participate in mining, consensus and accounting of the block chain only by downloading the block segment corresponding to the new block and blocks containing the information of the previous block segment in all the block segments.
2. The segmented blockchain storage method according to claim 1, wherein if there is an offline node in the blockchain, the offline node only needs to save the blocksegment corresponding to the new blocksegment and all unsaved blocks containing information of the previous blocksegment in the blocksegment containing information of the previous blocksegment and synchronously download the blocksegment and the unsaved blocks containing information of the previous blocksegment when the blockchain is re-entered into the blockchain, so as to participate in mining, consensus and accounting of the blockchain.
3. The segmented blockchain storage method of claim 1, wherein a first block in each of the block segments is called a segment header block, the segment header block is the block containing segment information of a previous block, and all the segment header blocks are connected in a manner of storing the segment header block information of the previous block.
4. The segmented blockchain storage method of claim 3, wherein the normal block includes a block header and a block body; the segment head block comprises a block head, a block body and a block tail, and the information of the previous segment head block is stored at the block tail of the segment head block.
5. The segmented blockchain storage method of claim 4, wherein the blockhead comprises: the method comprises the following steps of firstly, obtaining a version number, a hash address of a previous block, a hash value of a Mercker tree root traded in the block, a creation timestamp of the block, a consensus target and a random parameter; the block body comprises: the number of bytes occupied by the transaction number, the transaction number and the transaction data; the block end includes: segment number, hash address of the previous segment header block, hash value of the mercker tree root traded in the block, consensus target of the segment header block, and random parameter.
6. The segmented blockchain storage method according to any one of claims 1 to 5, wherein the consensus of the blockchain employs a workload proving mechanism to adjust the generation speed of new blocks by adjusting the workload proving difficulty of the normal blocks and the workload proving difficulty of the segment head blocks.
7. The segmented blockchain storage method according to claim 6, wherein the workload proving difficulty of the normal block and the workload proving difficulty of the head block in each of the block segments are the same, and the workload proving difficulty of the normal block and the workload proving difficulty of the head block in different block segments are different, that is, when entering the next block segment, the workload proving difficulty of the normal block and the workload proving difficulty of the head block are adjusted.
8. The segmented blockchain storage method according to claim 7, wherein the specific process of generating new blocks in step S1 is as follows: for the common block, after the node finishes workload certification, independently packaging transaction records into a new block; for the segment head block, the node simultaneously stores the workload certification of the hash address of the previous block and the workload certification of the hash address of the previous segment head block, and independently packs the transaction records into a new block; each node independently checks the new block and assembles the new block into a block chain.
9. The segmented blockchain storage method according to claim 6, wherein in the step S4, each node independently selects the blockchain, and selects the blockchain with the largest download segment header blockchain accumulated workload and the largest latest blockchain accumulated workload under the workload proving mechanism.
10. A segmented blockchain storage device, comprising:
A block chain segmentation module for dividing the block chain into block segments comprising a plurality of blocks;
The block segment separation module is used for dividing blocks in each block segment into a block containing the information of the previous block segment and a common block;
The block generation module is used for generating a new block;
And the node downloading module is used for downloading the block section corresponding to the new block and the blocks containing the previous block section information of all the block sections by the nodes in the block chain, and enabling the nodes to participate in mine digging, consensus and accounting of the block chain.
CN202010190406.6A 2020-03-18 2020-03-18 Sectional type block chain storage method and storage device Pending CN111414421A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010190406.6A CN111414421A (en) 2020-03-18 2020-03-18 Sectional type block chain storage method and storage device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010190406.6A CN111414421A (en) 2020-03-18 2020-03-18 Sectional type block chain storage method and storage device

Publications (1)

Publication Number Publication Date
CN111414421A true CN111414421A (en) 2020-07-14

Family

ID=71491118

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010190406.6A Pending CN111414421A (en) 2020-03-18 2020-03-18 Sectional type block chain storage method and storage device

Country Status (1)

Country Link
CN (1) CN111414421A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113626260A (en) * 2021-10-11 2021-11-09 腾讯科技(深圳)有限公司 Data processing method, device, equipment and storage medium of block chain network

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109086139A (en) * 2018-08-15 2018-12-25 昧来网络科技(上海)有限公司 Dynamic Program Slicing method, equipment and computer storage medium
CN109474675A (en) * 2018-10-18 2019-03-15 尚维斯 A kind of block height split blade type date storage method based on block chain
US20190199515A1 (en) * 2017-12-26 2019-06-27 Akamai Technologies, Inc. Concurrent transaction processing in a high performance distributed system of record
CN110245190A (en) * 2019-06-11 2019-09-17 南京荣链科技有限公司 A kind of block data fragmented storage method, terminal and medium
CN110868434A (en) * 2018-08-27 2020-03-06 深圳金刚链计算技术有限公司 Block chain consensus method and system of multilayer fragment architecture

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20190199515A1 (en) * 2017-12-26 2019-06-27 Akamai Technologies, Inc. Concurrent transaction processing in a high performance distributed system of record
CN109086139A (en) * 2018-08-15 2018-12-25 昧来网络科技(上海)有限公司 Dynamic Program Slicing method, equipment and computer storage medium
CN110868434A (en) * 2018-08-27 2020-03-06 深圳金刚链计算技术有限公司 Block chain consensus method and system of multilayer fragment architecture
CN109474675A (en) * 2018-10-18 2019-03-15 尚维斯 A kind of block height split blade type date storage method based on block chain
CN110245190A (en) * 2019-06-11 2019-09-17 南京荣链科技有限公司 A kind of block data fragmented storage method, terminal and medium

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113626260A (en) * 2021-10-11 2021-11-09 腾讯科技(深圳)有限公司 Data processing method, device, equipment and storage medium of block chain network
CN113626260B (en) * 2021-10-11 2022-02-22 腾讯科技(深圳)有限公司 Data processing method, device, equipment and storage medium of block chain network

Similar Documents

Publication Publication Date Title
Bünz et al. Flyclient: Super-light clients for cryptocurrencies
Göbel et al. Increased block size and Bitcoin blockchain dynamics
KR102315473B1 (en) Systems and Methods for Parallel-Processing Blockchain Transactions
CN107078903B (en) Ore digging method and device for block chain and node equipment
CN109639430B (en) Safe high-speed lightweight block chain system and method
CN110046894B (en) Erasure code-based block chain establishing method capable of reconstructing groups
KR20210003234A (en) Maintaining blocks of a blockchain in a segmented blockchain network
US20200134578A1 (en) Blockchain consensus systems and methods involving a time parameter
CN109542979B (en) Fast synchronization and simple data storage mode of block chain system
Ren et al. A scale-out blockchain for value transfer with spontaneous sharding
CN111061769A (en) Consensus method of block chain system and related equipment
CN110474762B (en) Method for constructing ring-type editable block chain
EP3198783A1 (en) Method and system for reducing power consumption in bitcoin mining via data input hopping
US20210233068A1 (en) Settlement system, settlement method, user device, and settlement program
CN108600161A (en) A kind of fair efficient block chain common recognition method
EP4134893A1 (en) Method and device for preventing forking of blockchain
CN110941676B (en) Configuration method, device, equipment and medium
Forestier et al. Blockclique: scaling blockchains through transaction sharding in a multithreaded block graph
CN111861459A (en) Iota account book optimization system and method based on DPoS consensus algorithm
Kaligotla et al. A generalized agent based framework for modeling a blockchain system
CN114328518A (en) UTXO model-based low storage consumption method and system
CN111414421A (en) Sectional type block chain storage method and storage device
CN111444203A (en) Synchronous processing method, device, equipment and medium
CN109391643B (en) Block chain lightweight processing method, block chain node and storage medium
Azzolini et al. Modeling Bitcoin Protocols with Probabilistic Logic Programming.

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination