CN112783983A - Self-adaptive consensus method based on major-minor block diagram chain structure block chain account book design - Google Patents

Self-adaptive consensus method based on major-minor block diagram chain structure block chain account book design Download PDF

Info

Publication number
CN112783983A
CN112783983A CN202110169779.XA CN202110169779A CN112783983A CN 112783983 A CN112783983 A CN 112783983A CN 202110169779 A CN202110169779 A CN 202110169779A CN 112783983 A CN112783983 A CN 112783983A
Authority
CN
China
Prior art keywords
block
graph
chain
blocks
height
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
CN202110169779.XA
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.)
National University of Defense Technology
Original Assignee
National University of Defense Technology
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 National University of Defense Technology filed Critical National University of Defense Technology
Priority to CN202110169779.XA priority Critical patent/CN112783983A/en
Publication of CN112783983A publication Critical patent/CN112783983A/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
    • 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/22Indexing; Data structures therefor; Storage structures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/62Protecting access to data via a platform, e.g. using keys or access control rules
    • G06F21/6218Protecting access to data via a platform, e.g. using keys or access control rules to a system of files or objects, e.g. local or distributed file system or database

Abstract

The invention discloses a self-adaptive consensus method based on a master and slave block graph chain structure block chain account book design, which automatically divides an effective block generated by node probability into a master block and a slave block, wherein the master block adopts the longest chain principle to achieve consensus, the master block organizes a large number of slave blocks by a directed acyclic graph structure in the generation process, the transaction throughput can be improved to the maximum extent, and simultaneously, a block sequencing algorithm is provided, the inter-graph sequencing, the intra-graph block sequencing and the intra-block transaction sequencing are sequentially performed on the graph chain structure, so that illegal transactions are prevented from being recorded by a system, the transaction throughput is automatically adjusted by the system according to network bandwidth, the bandwidth utilization rate is maximized, and the block chain can be prevented from being upgraded in a traditional bifurcation mode.

Description

Self-adaptive consensus method based on major-minor block diagram chain structure block chain account book design
Technical Field
The invention relates to the technical field of block chains, in particular to a self-adaptive consensus method based on a block chain account book design of a main block graph chain and an auxiliary block graph chain structure.
Background
In a traditional blockchain public chain system, all nodes can participate in the system, and the accounting right is obtained through a workload proving mechanism or a stock right proving mechanism. Typically the blocks generated by a node each contain a hash of the previous block, forming a chain of blocks. This simple chain structure, however, possesses good properties, it is simple enough to make it difficult to create attacks from principle and reality, and the characteristics of the chain structure make it traceable and tamper-resistant. Each node can participate in the maintenance of the blockchain, thereby having the capability of decentralizing and preventing DoS attacks. In addition, the chain structure of each block chain naturally endows the blocks with full sequencing, and double-flower attack on the block chain account book is effectively avoided.
However, the traditional single-chain structure has a plurality of inherent defects, and the extremely low transaction throughput rate is an important reason for limiting the further development of the traditional single-chain structure; meanwhile, the extremely low transaction throughput rate causes high transaction cost, so that the transaction cost is difficult to apply to a small-amount transaction system; secondly, the traditional blockchain system is very difficult to realize the on-line upgrade of the throughput of the system, and the whole-node client needs to be updated to perform forking to realize the on-line upgrade, so that a serious safety problem is caused.
There are many current schemes for conventional blockchain improvement. Some systems assign a leader for a period of time in order to enhance the expandability of the system, allowing the leader to submit many blocks individually. Some systems select some nodes from participants to form a committee at intervals, and then only agree on the committee. In general a small number of accounting nodes will lead to a centralisation of the system, making it more vulnerable to DoS attacks etc. There are also many systems that organize blocks into a Directed Acyclic Graph (DAG) under a global view by changing the organization of the blocks without affecting the degree of decentralization, such as using a DAG structure, and some systems use a multi-parallel chain structure, so that the mining difficulty of each parallel chain is reduced, allowing multiple parallel chains to grow simultaneously.
Both of these schemes increase the generation rate of tiles and thus increase transaction throughput. However, these techniques have some drawbacks: 1) the DAG structure of the global view causes that the blocks do not have clear sequence due to the defects of the DAG structure. In the DAG, only the relative ordering of a subset of blocks can be determined, while other orderings are uncertain, which is called partial ordering. The uncertainty in the order of the blocks results in a more vulnerable blockchain of the DAG structure in the face of a double flower attack. 2) The parallel chain architecture can make the system face a special attack, and the node can concentrate the owned mining force on a single chain to carry out attacks such as selfish mining, and the like, so that the single chain is more prone to be forked, which is unacceptable.
Disclosure of Invention
In order to solve the technical problems, the invention provides a self-adaptive consensus method based on a block chain book design of a primary and secondary block map chain structure, which has the advantages of simple algorithm, high efficiency of a consensus mechanism and high broadband utilization rate.
The technical scheme for solving the problems is as follows: a self-adaptive consensus method based on a master and slave block diagram link structure block chain account book design comprises the following steps:
the method comprises the following steps: automatically dividing effective blocks generated by node probability into main blocks and auxiliary blocks;
step two: the main block and the auxiliary block form a graph chain structure, graph chain consensus is carried out by adopting the longest chain principle, and the longest graph chain is selected as a consensus graph chain;
step three: sorting blocks in the longest graph chain structure among graphs and sorting blocks in graphs;
step four: and establishing a transaction throughput regulating mechanism based on the graph-link structure, and automatically regulating according to the network condition to reach the optimal throughput.
The adaptive consensus method based on the book design of the primary and secondary block map-link structure block links specifically includes the following steps:
each node produces a block in a competition mode, and the generation difficulty of the auxiliary block is lower than that of the main block, so that the frequency generated by the auxiliary block is higher than that generated by the main block in the block production process;
when a new transaction is generated in the block chain system, the transaction is brought into a transaction pool by a node with the nearest distance and then broadcasted to other nodes, and when a node collects the transaction amount reaching a set value or reaches a set time interval, the node deletes the packaged transaction in the transaction pool and extracts the remaining unpacked transactions to enter the packaging process of a new block; in order to prevent the Sybil attack, the nodes also need to solve the workload proving problem of the new block, so that the new block becomes a legal block, and the process is mining;
assuming that a certain node generates an auxiliary block first, when the mining node receives the auxiliary blocks broadcast by other nodes, the validity of the auxiliary blocks is verified, and then the hash of the auxiliary blocks is included in the mining block; when one node successfully generates a main block, the block production of the next height is started immediately, and when other nodes receive the main block and verify the validity of the main block, the main block is received and the block production of the next height is started.
The adaptive consensus method based on the book design of the primary and secondary block map-link structure block-link accounts comprises the following steps:
the blockchain system is defined as: h (-) represents a hash function; dp=p(κ)2κWhere κ denotes the bit length of the hash function output value, p (κ) denotes the probability of solving the workload proving problem by one hash operation, and is related to κ, p (κ) is simply expressed in terms of p, DpRepresenting a difficulty value of the blockchain system; block Bi=(h-1η, v, m, h), where i represents the current block height, h-1Representing the hash value of the previous height block, eta representing a random new number for solving the workload certification problem, v representing a hash value set, m representing recorded data, h representing recorded dataHash value of the current block; pr [. A]Representing a probability function;
the master block is defined as: one block BiIs the main block, the following 3 conditions are satisfied: (1) h (Bi.h)-1,Bi.η,Bi.V,Bi.m)<Dp;(2)Bi-1.h=Bi.h-1In which B isi-1Is also a main block, and is,
Figure BDA0002940861920000044
Figure BDA0002940861920000045
represents a natural number; (3) b is0.h-1={0}κ(ii) a Wherein, according to the abstract model definition, Pr [ H (B)i.h-1,Bi.η,Bi.v,Bi.m)]=p;
The sub-block is defined as: one block BiIf it is a sub-block, the following 3 conditions are satisfied: (1) h (Bi.h)-1,Bi.η,Bi.v,Bi.m)<kDpWherein
Figure BDA0002940861920000041
Figure BDA0002940861920000042
Representing a real number, k being a throughput adjustment parameter; (2) b isi-1.h=Bi.h-1In which B isi-1Is a main block, which is a main block,
Figure BDA0002940861920000043
B0.h-1={0}κ(ii) a Wherein, according to the abstract model definition, Pr [ H (B)i.h-1,Bi.η,Bi.v,Bi.m)]=kp。
The adaptive consensus method based on the account book design of the primary and secondary block map link structure block chains comprises the following specific steps:
according to the process of the first step, each height block generates a directed acyclic graph structure with the main height block as a root block and the auxiliary height block as a child block, and as the height increases, the graph structure at the later height points to the graph structure at the previous height, so as to generate a graph chain structure; then, the block chain system adopts the longest chain principle to carry out figure chain consensus, selects the longest figure chain as a consensus figure chain, and removes the last figure structures of the consensus figure chain to confirm the figure structures.
The adaptive consensus method based on the book design of the primary and secondary block map-link structure block-link accounts comprises the following steps:
the graph structure is defined as: the graph structure is specifically a view of a directed acyclic graph
Figure BDA0002940861920000046
Representing, wherein i represents the height of the current graph;
Figure BDA0002940861920000047
representing the set of all blocks in the current graph and the height of each block is i; epsilon represents the set of all edges in the graph, e ═ a, B ∈ represents that tile a points to tile B, the mathematical expression is B.h ∈ A.v; r represents the root of the graph and is a main block;
the graph chain structure is defined as: the graph chain structure refers to a sequence composed of graph structures as units; for the chain sequence of the longest chain
Figure BDA0002940861920000051
Represents, wherein ^ is an initial graph structure; the sequence of the master blocks in the graph chain structure is
Figure BDA0002940861920000052
The adaptive consensus method based on the account book design of the primary and secondary block map link structure block chains comprises the following specific steps:
3-1) performing inter-graph ordering: the inter-graph sorting is performed according to the height of graph structures, wherein the graph structures with low height are arranged in front of the graph structures with high height; for a graph chain structure view, if there are graph partitionsFork, which admits only the longest chain as valid, thus, generates a map chain sequence
Figure BDA0002940861920000053
3-2) performing in-graph sequencing: the in-graph sorting is essentially to perform logic sorting on the blocks in a directed acyclic graph and establish an incorruptible block ordered set L1
(3-2-1) adding blocks without incomes in the graph to L1With hash-big blocks first added to L1
(3-2-2) subsequently, all of the L and L in the map are culled1Distinguishing the blocks and edges related to the blocks;
(3-2-3) find the block without income in the updated graph and add it to L1(ii) a Repeating the steps (3-2-1) to (3-2-3) until the figure is empty, and adding L1Obtaining a block sequence L by taking the reverse order;
3-3) combining the inter-diagram sorting and the intra-diagram sorting to finally form the block sorting of the block chain book of the whole diagram chain structure; the intra-map ordering result of the historical block height can be inherited, so that the ordering is progressive in time sequence, and the whole block chain book of the map chain structure does not need to be reordered every request.
The adaptive consensus method based on the account book design of the primary and secondary block map link structure block chains comprises the following specific steps:
in the operation process of the system, the system calculates the graph structure in the nearest height range every other preset height to obtain a measured value reflecting the network bandwidth and the delay, and then adjusts a throughput parameter k according to the change of the measured value so as to adjust the transaction throughput; since the measurement is related to the network delay, the network bandwidth, which is a parameter reflecting the current network conditions, the system automatically adjusts to reach an optimal throughput in accordance with the network conditions at run-time.
In the adaptive consensus method based on the primary and secondary block map chain structure block chain account book design, in the first step, the workload certification mechanism is applied in block generation, and the difficulty that the primary block needs to meet is DpWhile the difficulty that the sub-block needs to satisfy is kDpK varies during operation; when the node is mining, assuming that the block is a, other blocks at the same height are confirmed, assuming that the other blocks are B, the way that the block a confirms the block B is to incorporate the hash of B into a, namely B.h is inserted into A.v, wherein the hash set v is stored in the block in the form of Merkle root, and the application method of the workload proving mechanism in block generation is also applicable to a consensus mechanism of probability block generation with adjustable difficulty.
In the second step, a graph structure is uniquely determined by a main block, and in the process of achieving graph chain consensus, longest chain consensus taking the graph structure as a unit is adopted; to identify a graph and all blocks in the graph, an additional number of graph structures are extended on the basis of the graph.
In the fourth step, the measurement of the network condition in the throughput adjustment mechanism is calculated in relation to the edge delay and the block delay in the graph structure, and the concept of the edge delay and the block delay is defined as follows:
edge delay definition: assuming that an edge e in the graph structure is (a, B), the delay of the edge e is the length of the maximum path from block a to block B;
block delay definition: the block delay of a block B is equal to the maximum edge delay among the edges pointing to it, if no edge points to block B, then the edge delay of block B is 1;
the calculation method of the measured value tau is as follows:
Figure BDA0002940861920000061
wherein blockdelay (b) represents the block delay of block b, which means that every 1000 altitudes, the measured value τ is measured and calculated, and the value of τ is equal to the average value of the block delays of all blocks divided by k; in the operation process of the system, when the network bandwidth is unchanged, a lowest point exists along with the change of the k value tau, and when the network bandwidths are different, the k values corresponding to the lowest points are also different; each time a new measurement τ is calculated, the adjustment mechanism adjusts k to an optimum to maintain a minimum network condition measurement τ by comparing it to the previous calculation of the measurement τ, increasing k if the measurement τ decreases, and decreasing k if the measurement τ increases; the optimal k value corresponds to the optimal sub-block production efficiency, which corresponds to the optimal transaction throughput of the system.
The invention has the beneficial effects that:
1. the invention gives consideration to decentralization, safety and expansibility of the block chain network. The graph chain structure model provided by the invention is established on the assumption of the traditional block chain network, any node is allowed to be added or withdrawn without permission, any node is allowed to have the accounting possibility at any time, and the maximum decentralization of the system is ensured. The main block chain in the graph chain structure model inherits all the attributes of the bitcoin system naturally and has all the security attributes of the bitcoin system. In the aspect of expansibility, the block chain system fully utilizes the generation interval of the main block, allows a large number of auxiliary blocks to be generated simultaneously, an organization mode of a directed acyclic graph is formed between the auxiliary blocks and between the auxiliary blocks and the main block, and finally all the auxiliary blocks at each height are uniquely confirmed by the main block to form an image structure, so that the expansibility of the system is greatly improved.
2. The graph chain consensus mechanism provided by the invention has safety and high efficiency. The graph chain consensus mechanism provided by the invention is based on the existing mature Chinese traditional consensus mechanism which is tested by time, and the consensus of the graph chain structure is realized by taking the graph structure as a unit and adopting the longest chain principle to remove the graph structure of the last part quantity. The data organization structure of the directed acyclic graph is formed in the graph structure through hash connection, one main block can ignore the hash collision occurrence probability and uniquely determine one graph structure, and therefore one graph structure confirmation can confirm all auxiliary blocks in one graph structure. The graph chain consensus mechanism combines the safety of the conventional smart consensus mechanism and the efficiency of the multiple of the average number of blocks in the graph structure compared with the conventional smart protocol.
3. The block sorting algorithm has high efficiency and stability. The block ordering algorithm based on the graph chain structure model comprises inter-graph ordering and intra-graph ordering, wherein the inter-graph ordering has a natural order based on the longest chain principle, the intra-graph ordering adopts a mature DAG logic ordering algorithm, and the higher the difficulty generated by blocks with the same logic sequence is, the higher the priority of the blocks is. Compared with global DAG sequencing, the block sequencing algorithm based on the graph chain structure model can simply multiplex the graph structure sequencing result of the previous height, is more efficient, and has stability by proving that the block sequencing algorithm based on the graph chain structure model can determine a unique block sequence according to the same single graph chain structure.
4. The system runtime throughput optimization is automatically adjusted. The throughput regulating mechanism based on the graph chain structure model can automatically regulate to the optimal throughput according to the change of the network bandwidth when the system runs. Compared with the existing block chain protocol, the method realizes automatic upgrade of the system throughput rate on the protocol level for the first time. The change of the network bandwidth and the delay can be reflected on the state of the graph chain structure, the state is reflected through the measured value, and meanwhile, the generation rate of the auxiliary blocks can be automatically adjusted at regular intervals according to the measured value, so that the purpose of adjusting the throughput is achieved.
Drawings
FIG. 1 is a flow chart of the present invention.
Fig. 2 is a block chain protocol model based on the graph chain structure.
FIG. 3 is a diagram of a graph structure generative model with height i.
Detailed Description
The invention is further described below with reference to the accompanying drawings and examples.
As shown in fig. 1, an adaptive consensus method based on a master-slave block diagram link structure block chain ledger design includes the following steps:
the method comprises the following steps: the effective blocks generated by the node probability are automatically divided into main blocks and auxiliary blocks.
Each node produces the block in a competition mode, and the generation difficulty of the auxiliary block is lower than that of the main block, so that the frequency generated by the auxiliary block is higher than that generated by the main block in the block production process.
When a new transaction is generated in the block chain system, the transaction is brought into a transaction pool by a node with the nearest distance and then broadcasted to other nodes, and when a node collects the transaction amount reaching a set value or reaches a set time interval, the node deletes the packaged transaction in the transaction pool and extracts the remaining unpacked transactions to enter the packaging process of a new block; in order to prevent the witch attack, the nodes also need to solve the workload proving problem of the new block, so that the new block becomes a legal block, and the process is mining.
Method for applying workload certification mechanism in block generation, and difficulty to be met by main block is DpWhile the difficulty that the sub-block needs to satisfy is kDpK varies during operation; when the node digs the mine, assuming that the block is a, other blocks at the same height are confirmed, and other blocks are assumed to be B, block a confirms block B by including the hash of B into a, that is, B.h is inserted into A.v, wherein the hash set v is stored in the form of Merkle root in the block. The method for applying the workload certification mechanism in block generation can also be applied to a consensus mechanism of probability block generation with adjustable difficulty, such as a stock right certification mechanism (PoS).
Assuming that a certain node generates an auxiliary block first, when the mining node receives the auxiliary blocks broadcast by other nodes, the validity of the auxiliary blocks is verified, and then the hash of the auxiliary blocks is included in the mining block; when one node successfully generates a main block, the block production of the next height is started immediately, and when other nodes receive the main block and verify the validity of the main block, the main block is received and the block production of the next height is started.
Referring to fig. 2, a block generation manner and a growing manner based on the graph chain structure model are shown in fig. 2. The blocks are divided into main blocks and sub-blocks, each height map structure comprises a main block and a sub-block confirmed by the main block, and parents of all the blocksThe hashes all point to the hash of the previous high master chunk, with the initial chunk pointing to a particular value. In a graph structure, the blocks are grouped into pointed relationships by hash sets, such as
Figure BDA0002940861920000101
In (B)0Point of direction C0Represents B0Is stored in C0In the hash set v, the hash set v may be represented by a Merkle root when the encoding is implemented. When viewing fig. 1 in the sequence of the time axis, since the difficulty of the sub-block is lower than that of the main block, the frequency generated by the sub-block is greater than that generated by the main block during the block generation process.
The blockchain system is defined as: h (-) represents a hash function; dp=p(κ)2κWherein κ represents a bit length of an output value of the hash function, p (κ) represents a probability of solving a workload certification problem by one hash operation, and is related to κ, p (κ) is simply represented by p, and Dp represents a difficulty value of the block chain system; block Bi=(h-1η, v, m, h), where i represents the current block height, h-1Expressing the hash value of the previous height block, eta expressing a random new number for solving the workload certification problem, v expressing a hash value set, m expressing record data (fixed information such as transaction or message), and h expressing the hash value of the current block; pr [. A]A probability function is represented.
The master block is defined as: one block BiIs the main block, the following 3 conditions are satisfied: (1) h (B)i.h-1,Bi.η,Bi.v,Bi.m)<Dp;(2)Bi-1.h=Bi.h-1In which B isi-1Is also a main block, and is,
Figure BDA0002940861920000102
Figure BDA0002940861920000103
represents a natural number; (3) b is0.h-1={0}κ(ii) a Wherein, according to the abstract model definition, Pr [ H (B)i.h-1,Bi.η,Bi.v,Bi.m)]=p。
The sub-block is defined as: one block BiIf it is a sub-block, the following 3 conditions are satisfied: (1) h (Bi.h)-1,Bi.η,Bi.v,Bi.m)<kDpWherein
Figure BDA0002940861920000104
Figure BDA0002940861920000105
Representing a real number, k being a throughput adjustment parameter; (2) b isi-1.h=Bi.h-1In which B isi-1Is a main block, which is a main block,
Figure BDA0002940861920000106
B0.h-1={0}κ(ii) a Wherein, according to the abstract model definition, Pr [ H (B)i.h-1,Bi.η,Bi.v,Bi.m)]=kp。
Step two: the main block and the auxiliary block form a graph chain structure, graph chain consensus is carried out by adopting the longest chain principle, and the longest graph chain is selected as a consensus graph chain.
According to the process of the first step, each height block generates a directed acyclic graph structure with the main height block as a root block and the auxiliary height block as a child block, and as the height increases, the graph structure at the later height points to the graph structure at the previous height, so as to generate a graph chain structure; then, the block chain system adopts the longest chain principle to carry out figure chain consensus, selects the longest figure chain as a consensus figure chain, and removes the last figure structures of the consensus figure chain to confirm the figure structures.
A graph structure is uniquely identified by a main block, and in the process of achieving graph chain consensus, longest chain consensus taking the graph structure as a unit is adopted; to identify a graph and all blocks in the graph, an additional number of graph structures are extended on the basis of the graph.
The graph structure is defined as: the graph structure is specifically a view of a directed acyclic graph
Figure BDA0002940861920000111
Representing, wherein i represents the height of the current graph;
Figure BDA0002940861920000112
representing the set of all blocks in the current graph and the height of each block is i; epsilon represents the set of all edges in the graph, e ═ a, B ∈ represents that tile a points to tile B, the mathematical expression is B.h ∈ A.v; r represents the root of the graph and is a master tile.
The graph chain structure is defined as: the graph chain structure refers to a sequence composed of graph structures as units, similar to a block chain structure composed of blocks in a bitcoin; for the chain sequence of the longest chain
Figure BDA0002940861920000113
Represents, wherein ^ is an initial graph structure; the sequence of the master blocks in the graph chain structure is
Figure BDA0002940861920000114
Similar to the block chain structure of the bitcoin system.
The process of graph structure generation is shown in fig. 3, and without loss of generality, it is assumed that there are 4 nodes, node a, node B, node C, and node D. In slot 0, a secondary block B is dug by node BiThe other three nodes have received secondary block B in slot 1iWhile simultaneously mixing BiIs added to the hash set of the currently mining block to pair BiConfirmation is performed. In slot 1, node C digs into a secondary block CiSimilarly, the other 3 nodes receive the block in slot 2 and include the hash set of the block currently being mined. Two nodes in slot 2 dig into the sub-blocks, block AiAnd block C'iAnd other nodesThese two blocks will be received at slot 3, and in slot 3 each node will include the hashes of both blocks into the hash set of the block currently being mined, so that the local view changes from a single chain to a graph. In slot 3, again node A and node B produced secondary block A'iAnd sub block B'iBut due to the influence of network fluctuations, secondary block A'iAnd is not received by the other nodes in slot 4, node a is biased from the local view of the other three nodes in slot 4. In slot 4, node D again generates a sub-block Di. In slot 5, the view of all nodes becomes the same again. Meanwhile, in slot 5, node A and node B each generate a sub-block A ″)iAnd a main block B ″iThey are all received by other nodes in slot 6, but in slot 6 all nodes discard secondary block a ″iBecause it is not dominated by block B ″iIt is confirmed that all nodes start to enter the next round of the graph structure generation process since the master block of the current height has been received, similarly to the above steps. The blockchain system uses a semi-synchronous network model, assuming that messages will arrive at all nodes within a fixed time frame in the p2p network, similar to the real network environment, and therefore multiple different sub-blocks may be received in a slot, and if the network is fully synchronous, the graph structure is a pure chain structure, which is not consistent with the real environment.
Referring to FIG. 2, the graph structure is observed in units of graph structure as the graph chain grows
Figure BDA0002940861920000121
And
Figure BDA0002940861920000122
there is a bifurcation between the two, because the graph chain structure adopts the longest chain principle to achieve the consensus, a small number of branches will be generated during the operation of the system, and in order to confirm a graph structure more accurately, the longest graph chain where the graph chain is located needs to be selected, and meanwhile, the waiting time is needed to extend the additional number of graph structures for the chain. Of the chainGrowth is similar to that of the bitcoin block chain, with similar security. Focusing on a graph structure, a legal block must point to another legal block unless the block is illegal or hash collision occurs, and finally a graph structure is terminated by a legal main block to form a directed acyclic graph structure. A graph structure can be uniquely identified by a master tile.
Step three: and performing inter-graph sorting and intra-graph sorting on the blocks on the longest graph link structure.
The specific process is as follows:
3-1) performing inter-graph ordering: the inter-graph sorting is performed according to the height of graph structures, wherein the graph structures with low height are arranged in front of the graph structures with high height; for a map chain structure view, if there is a map bifurcation, only the longest chain is admitted to be valid, and therefore, a map chain sequence is generated
Figure BDA0002940861920000131
3-2) performing in-graph sequencing: the in-graph sorting is essentially to perform logic sorting on the blocks in a directed acyclic graph and establish an incorruptible block ordered set L1
(3-2-1) adding blocks without incomes in the graph to L1With hash-big blocks first added to L1
(3-2-2) subsequently, all of the L and L in the map are culled1Distinguishing the blocks and edges related to the blocks;
(3-2-3) find the block without income in the updated graph and add it to L1(ii) a Repeating the steps (3-2-1) to (3-2-3) until the figure is empty, and adding L1Obtaining a block sequence L by taking the reverse order;
3-3) combining the inter-diagram sorting and the intra-diagram sorting to finally form the block sorting of the block chain book of the whole diagram chain structure; the intra-map ordering result of the historical block height can be inherited, so that the ordering is progressive in time sequence, and the whole block chain book of the map chain structure does not need to be reordered every request.
Step four: and establishing a transaction throughput regulating mechanism based on the graph-link structure, and automatically regulating according to the network condition to reach the optimal throughput.
The specific process is as follows:
in the operation process of the system, the system calculates the graph structure in the nearest height range every other preset height to obtain a measured value reflecting the network bandwidth and the delay, and then adjusts a throughput parameter k according to the change of the measured value so as to adjust the transaction throughput; since the measurement is related to the network delay, the network bandwidth, which is a parameter reflecting the current network conditions, the system automatically adjusts to reach an optimal throughput in accordance with the network conditions at run-time.
The network condition measurement in the throughput adjustment mechanism is calculated in relation to the edge delay and the block delay in the graph structure, and the concept of defining the edge delay and the block delay is as follows:
edge delay definition: assuming that an edge e in the graph structure is (a, B), the delay of the edge e is the length of the maximum path from block a to block B.
Block delay definition: the block delay of one block B is equal to the largest edge delay among the edges pointing to it, and if no edge points to block B, the edge delay of block B is 1.
The calculation method of the measured value tau is as follows:
Figure BDA0002940861920000141
wherein blockdelay (b) represents the block delay of block b, which means that every 1000 altitudes, the measured value τ is measured and calculated, and the value of τ is equal to the average value of the block delays of all blocks divided by k; in the operation process of the system, when the network bandwidth is unchanged, a lowest point exists along with the change of the k value tau, and when the network bandwidths are different, the k values corresponding to the lowest points are also different; each time a new measurement τ is calculated, the adjustment mechanism adjusts k to an optimum to maintain a minimum network condition measurement τ by comparing it to the previous calculation of the measurement τ, increasing k if the measurement τ decreases, and decreasing k if the measurement τ increases; the optimal k value corresponds to the optimal sub-block production efficiency, which corresponds to the optimal transaction throughput of the system.

Claims (10)

1. A self-adaptive consensus method based on a master and slave block map link structure block chain account book design is characterized by comprising the following steps:
the method comprises the following steps: automatically dividing effective blocks generated by node probability into main blocks and auxiliary blocks;
step two: the main block and the auxiliary block form a graph chain structure, graph chain consensus is carried out by adopting the longest chain principle, and the longest graph chain is selected as a consensus graph chain;
step three: sorting blocks in the longest graph chain structure among graphs and sorting blocks in graphs;
step four: and establishing a transaction throughput regulating mechanism based on the graph-link structure, and automatically regulating according to the network condition to reach the optimal throughput.
2. The adaptive consensus method of claim 1, wherein the step comprises:
each node produces a block in a competition mode, and the generation difficulty of the auxiliary block is lower than that of the main block, so that the frequency generated by the auxiliary block is higher than that generated by the main block in the block production process;
when a new transaction is generated in the block chain system, the transaction is brought into a transaction pool by a node with the nearest distance and then broadcasted to other nodes, and when a node collects the transaction amount reaching a set value or reaches a set time interval, the node deletes the packaged transaction in the transaction pool and extracts the remaining unpacked transactions to enter the packaging process of a new block; in order to prevent the Sybil attack, the nodes also need to solve the workload proving problem of the new block, so that the new block becomes a legal block, and the process is mining;
assuming that a certain node generates an auxiliary block first, when the mining node receives the auxiliary blocks broadcast by other nodes, the validity of the auxiliary blocks is verified, and then the hash of the auxiliary blocks is included in the mining block; when one node successfully generates a main block, the block production of the next height is started immediately, and when other nodes receive the main block and verify the validity of the main block, the main block is received and the block production of the next height is started.
3. The adaptive consensus method of claim 2, wherein in step one:
the blockchain system is defined as: h (-) represents a hash function; dp=p(κ)2κWhere κ denotes the bit length of the hash function output value, p (κ) denotes the probability of solving the workload proving problem by one hash operation, and is related to κ, p (κ) is simply expressed in terms of p, DpRepresenting a difficulty value of the blockchain system; block Bi=(h-1η, v, m, h), where i represents the current block height, h-1Expressing the hash value of the previous height block, eta expressing a random new number for solving the workload certification problem, v expressing a hash value set, m expressing recorded data, and h expressing the hash value of the current block; pr [. A]Representing a probability function;
the master block is defined as: one block BiIs the main block, the following 3 conditions are satisfied: (1) h (B)i.h-1,Bi.η,Bi.v,Bi.m)<Dp;(2)Bi-1.h=Bi.h-1In which B isi-1Is also a main block, i ≧ 1,
Figure FDA0002940861910000024
Figure FDA0002940861910000025
represents a natural number; (3) b is0.h-1={0}κ(ii) a Wherein, according to the abstract model definition, Pr [ H (B)i.h-1,Bi.η,Bi.V,Bi.m)]=p;
The sub-block is defined as: aA block BiIf it is a sub-block, the following 3 conditions are satisfied: (1) h (B)i.h-1,Bi.η,Bi.v,Bi.m)<kDpWherein
Figure FDA0002940861910000021
Figure FDA0002940861910000022
Representing a real number, k being a throughput adjustment parameter; (2) b isi-1.h=Bi.h-1In which B isi-1Is a main block, i ≧ 1,
Figure FDA0002940861910000023
(3)B0.h-1={0}κ(ii) a Wherein, according to the abstract model definition, Pr [ H (B)i.h-1,Bi.η,Bi.v,Bi.m)]=kp。
4. The adaptive consensus method of claim 2, wherein the second step comprises:
according to the process of the first step, each height block generates a directed acyclic graph structure with the main height block as a root block and the auxiliary height block as a child block, and as the height increases, the graph structure at the later height points to the graph structure at the previous height, so as to generate a graph chain structure; then, the block chain system adopts the longest chain principle to carry out figure chain consensus, selects the longest figure chain as a consensus figure chain, and removes the last figure structures of the consensus figure chain to confirm the figure structures.
5. The adaptive consensus method of claim 4, wherein in step two:
the graph structure is defined as: the graph structure is specifically a view of a directed acyclic graph
Figure FDA0002940861910000031
Representing, wherein i represents the height of the current graph;
Figure FDA0002940861910000032
representing the set of all blocks in the current graph and the height of each block is i; epsilon represents the set of all edges in the graph, e ═ a, B ∈ represents that tile a points to tile B, the mathematical expression is B.h ∈ A.v; r represents the root of the graph and is a main block;
the graph chain structure is defined as: the graph chain structure refers to a sequence composed of graph structures as units; for the chain sequence of the longest chain
Figure FDA0002940861910000033
Represents, wherein ^ is an initial graph structure; the sequence of the master blocks in the graph chain structure is
Figure FDA0002940861910000034
6. The adaptive consensus method of claim 5, wherein the third specific process comprises:
3-1) performing inter-graph ordering: the inter-graph sorting is performed according to the height of graph structures, wherein the graph structures with low height are arranged in front of the graph structures with high height; for a map chain structure view, if there is a map bifurcation, only the longest chain is admitted to be valid, and therefore, a map chain sequence is generated
Figure FDA0002940861910000035
3-2) performing in-graph sequencing: the in-graph sorting is essentially to perform logic sorting on the blocks in a directed acyclic graph and establish an incorruptible block ordered set L1
(3-2-1) adding blocks without incomes in the graph to L1Hash big block firstIs added to L1
(3-2-2) subsequently, all of the L and L in the map are culled1Distinguishing the blocks and edges related to the blocks;
(3-2-3) find the block without income in the updated graph and add it to L1(ii) a Repeating the steps (3-2-1) to (3-2-3) until the figure is empty, and adding L1Obtaining a block sequence L by taking the reverse order;
3-3) combining the inter-diagram sorting and the intra-diagram sorting to finally form the block sorting of the block chain book of the whole diagram chain structure; the intra-map ordering result of the historical block height can be inherited, so that the ordering is progressive in time sequence, and the whole block chain book of the map chain structure does not need to be reordered every request.
7. The adaptive consensus method of claim 6, wherein the step four comprises:
in the operation process of the system, the system calculates the graph structure in the nearest height range every other preset height to obtain a measured value reflecting the network bandwidth and the delay, and then adjusts a throughput parameter k according to the change of the measured value so as to adjust the transaction throughput; since the measurement is related to the network delay, the network bandwidth, which is a parameter reflecting the current network conditions, the system automatically adjusts to reach an optimal throughput in accordance with the network conditions at run-time.
8. The adaptive consensus method as claimed in claim 5, wherein the first step is a method for applying a workload certification mechanism in block generation, and the difficulty to be satisfied by the primary block is DpWhile the difficulty that the sub-block needs to satisfy is kDpK varies during operation; when the node is mining, assuming that the block is A, other blocks at the same height are confirmed, and assuming that other blocks are B, the block A confirms the block B by including the hash of B into A, namely B.h is inserted into A.v, wherein the hash set v is stored in the form of Merkle root in the block, and the workerThe method of applying the proof-of-measure mechanism in block generation is also applicable to the consensus mechanism of probability block generation with adjustable difficulty.
9. The adaptive consensus method based on account book design of map-chain structure of major-minor blocks as claimed in claim 5, wherein in the second step, a map structure is uniquely identified by a major block, and during the process of achieving map-chain consensus, the longest chain consensus in units of map structures is adopted; to identify a graph and all blocks in the graph, an additional number of graph structures are extended on the basis of the graph.
10. The adaptive consensus method of claim 5, wherein in the fourth step, the measure of network conditions in the throughput adjustment algorithm is calculated in relation to edge delays and block delays in the graph structure, and the concept of edge delays and block delays is defined as follows:
edge delay definition: assuming that an edge e in the graph structure is (a, B), the delay of the edge e is the length of the maximum path from block a to block B;
block delay definition: the block delay of a block B is equal to the maximum edge delay among the edges pointing to it, if no edge points to block B, then the edge delay of block B is 1;
the calculation method of the measured value tau is as follows:
Figure FDA0002940861910000051
wherein blockdelay (b) represents the block delay of block b, which means that every 1000 altitudes, the measured value τ is measured and calculated, and the value of τ is equal to the average value of the block delays of all blocks divided by k; in the operation process of the system, when the network bandwidth is unchanged, a lowest point exists along with the change of the k value tau, and when the network bandwidths are different, the k values corresponding to the lowest points are also different; each time a new measurement τ is calculated, the adjustment mechanism adjusts k to an optimum to maintain a minimum network condition measurement τ by comparing it to the previous calculation of the measurement τ, increasing k if the measurement τ decreases, and decreasing k if the measurement τ increases; the optimal k value corresponds to the optimal sub-block production efficiency, which corresponds to the optimal transaction throughput of the system.
CN202110169779.XA 2021-02-07 2021-02-07 Self-adaptive consensus method based on major-minor block diagram chain structure block chain account book design Pending CN112783983A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110169779.XA CN112783983A (en) 2021-02-07 2021-02-07 Self-adaptive consensus method based on major-minor block diagram chain structure block chain account book design

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110169779.XA CN112783983A (en) 2021-02-07 2021-02-07 Self-adaptive consensus method based on major-minor block diagram chain structure block chain account book design

Publications (1)

Publication Number Publication Date
CN112783983A true CN112783983A (en) 2021-05-11

Family

ID=75762186

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110169779.XA Pending CN112783983A (en) 2021-02-07 2021-02-07 Self-adaptive consensus method based on major-minor block diagram chain structure block chain account book design

Country Status (1)

Country Link
CN (1) CN112783983A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114401099A (en) * 2021-08-17 2022-04-26 同济大学 Block chain PoW selfish mining attack defense method based on network topology
CN116188167A (en) * 2023-04-17 2023-05-30 之江实验室 Block chain system and consensus method based on DAG structure

Citations (16)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108985732A (en) * 2018-06-08 2018-12-11 中国地质大学(武汉) The common recognition and account book data organization method and system of DAG technology based on no block
CN109377232A (en) * 2018-12-20 2019-02-22 众安信息技术服务有限公司 The transaction method for sequencing and equipment of block chain based on DAG
CN109948003A (en) * 2019-03-20 2019-06-28 武汉大学 A kind of the block catenary system and its block production method of isomorphism bimodulus major-minor chain
CN110084596A (en) * 2019-04-01 2019-08-02 杜晓楠 A kind of method and apparatus of processing block chain mixing common recognition
CN110198233A (en) * 2019-05-09 2019-09-03 中国人民解放军国防科技大学 Block chain consensus method and system based on trusted execution environment and directed acyclic graph
CN110245951A (en) * 2019-06-19 2019-09-17 西南交通大学 A kind of alliance's chain principal and subordinate's multichain common recognition method based on tree structure
CN110431579A (en) * 2019-01-08 2019-11-08 张季恒 Transaction allocation method and apparatus based on structuring directed acyclic graph
US20200004788A1 (en) * 2018-06-27 2020-01-02 Alibaba Group Holding Limited Blockchain-based smart contract invocation method and apparatus, and electronic device
CN110659284A (en) * 2019-08-20 2020-01-07 北京清红微谷技术开发有限责任公司 Block sequencing method and system based on tree graph structure and data processing terminal
CN110673914A (en) * 2019-09-24 2020-01-10 支付宝(杭州)信息技术有限公司 View switching method for block chain consensus and block chain system
CN111080288A (en) * 2019-10-18 2020-04-28 湖南天河国云科技有限公司 Block chain consensus achieving method and device based on directed acyclic graph
CN111414373A (en) * 2020-03-18 2020-07-14 深圳市网心科技有限公司 Consensus method and consensus system
US20200228316A1 (en) * 2019-01-15 2020-07-16 Fisher-Rosemount Systems, Inc. Blockchain-based automation architecture cybersecurity
US20200250295A1 (en) * 2019-01-31 2020-08-06 Salesforce.Com, Inc. Systems, methods, and apparatuses for protecting consumer data privacy using solid, blockchain and ipfs integration
US20200366463A1 (en) * 2017-08-18 2020-11-19 Siemens Aktiengesellschaft Apparatuses for Providing a Set of Cryptographically Protected, Filtered, and Sorted Transaction Data Records of a Link of a Blockchain
CN112055048A (en) * 2020-07-29 2020-12-08 北京智融云河科技有限公司 P2P network communication method and system for high-throughput distributed account book

Patent Citations (16)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20200366463A1 (en) * 2017-08-18 2020-11-19 Siemens Aktiengesellschaft Apparatuses for Providing a Set of Cryptographically Protected, Filtered, and Sorted Transaction Data Records of a Link of a Blockchain
CN108985732A (en) * 2018-06-08 2018-12-11 中国地质大学(武汉) The common recognition and account book data organization method and system of DAG technology based on no block
US20200004788A1 (en) * 2018-06-27 2020-01-02 Alibaba Group Holding Limited Blockchain-based smart contract invocation method and apparatus, and electronic device
CN109377232A (en) * 2018-12-20 2019-02-22 众安信息技术服务有限公司 The transaction method for sequencing and equipment of block chain based on DAG
CN110431579A (en) * 2019-01-08 2019-11-08 张季恒 Transaction allocation method and apparatus based on structuring directed acyclic graph
US20200228316A1 (en) * 2019-01-15 2020-07-16 Fisher-Rosemount Systems, Inc. Blockchain-based automation architecture cybersecurity
US20200250295A1 (en) * 2019-01-31 2020-08-06 Salesforce.Com, Inc. Systems, methods, and apparatuses for protecting consumer data privacy using solid, blockchain and ipfs integration
CN109948003A (en) * 2019-03-20 2019-06-28 武汉大学 A kind of the block catenary system and its block production method of isomorphism bimodulus major-minor chain
CN110084596A (en) * 2019-04-01 2019-08-02 杜晓楠 A kind of method and apparatus of processing block chain mixing common recognition
CN110198233A (en) * 2019-05-09 2019-09-03 中国人民解放军国防科技大学 Block chain consensus method and system based on trusted execution environment and directed acyclic graph
CN110245951A (en) * 2019-06-19 2019-09-17 西南交通大学 A kind of alliance's chain principal and subordinate's multichain common recognition method based on tree structure
CN110659284A (en) * 2019-08-20 2020-01-07 北京清红微谷技术开发有限责任公司 Block sequencing method and system based on tree graph structure and data processing terminal
CN110673914A (en) * 2019-09-24 2020-01-10 支付宝(杭州)信息技术有限公司 View switching method for block chain consensus and block chain system
CN111080288A (en) * 2019-10-18 2020-04-28 湖南天河国云科技有限公司 Block chain consensus achieving method and device based on directed acyclic graph
CN111414373A (en) * 2020-03-18 2020-07-14 深圳市网心科技有限公司 Consensus method and consensus system
CN112055048A (en) * 2020-07-29 2020-12-08 北京智融云河科技有限公司 P2P network communication method and system for high-throughput distributed account book

Non-Patent Citations (6)

* Cited by examiner, † Cited by third party
Title
刘昊哲等: "基于信誉度的主从多链区块链共识机制", 《南京理工大学学报》 *
宋琪杰等: "面向物联网区块链的共识机制优化研究", 《电信科学》 *
徐宇芹: ""主从多链模型下的区块链共识性能研究"", 《中国优秀硕士学位论文全文数据库》 *
斯雪明等: "区块链安全研究综述", 《密码学报》 *
李斌等: "一种基于有向无环图的电网事故分析模型研究", 《中国管理信息化》 *
王壹铭等: "基于有向无环图的高效区块链共识算法", 《吉林大学学报(理学版)》 *

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114401099A (en) * 2021-08-17 2022-04-26 同济大学 Block chain PoW selfish mining attack defense method based on network topology
CN116188167A (en) * 2023-04-17 2023-05-30 之江实验室 Block chain system and consensus method based on DAG structure
CN116188167B (en) * 2023-04-17 2023-08-04 之江实验室 Block chain system and consensus method based on DAG structure

Similar Documents

Publication Publication Date Title
CN109508968B (en) Block chain system and control method thereof
CN110163600B (en) Block chain system and method using the same
CN109639430B (en) Safe high-speed lightweight block chain system and method
CN112783983A (en) Self-adaptive consensus method based on major-minor block diagram chain structure block chain account book design
CN109982435B (en) Spectrum access and management method based on block chain
CN110321074B (en) Consensus method for safety storage certification based on block chain and distributed storage system
US8301736B2 (en) Method for selecting and configuring network supernodes
CN110474846B (en) Method and device for block propagation in block chain
CN110868434B (en) Block chain consensus method and system of multilayer fragment architecture
CN109547211B (en) Grading concurrent byzantine consensus method and system applying digital signature technology
CN112769580A (en) Block chain layered excitation consensus algorithm
CN111159289A (en) Method and device for synchronizing blocks
CN112804101B (en) Master-slave multi-chain cross-link method and system based on voting and credit mechanism
KR102337760B1 (en) Apparatus and method for adaptively managing sharded blockchain network based on Deep Q Network
CN112468255B (en) Block link point time synchronization method based on network consensus and VRF algorithm
US20210073186A1 (en) Permissionless blockchain consensus method with adjusting block weight, system and p2p network
CN111798234B (en) Lightweight block chain system and construction method
Forestier et al. Blockclique: scaling blockchains through transaction sharding in a multithreaded block graph
CN111047439A (en) Transaction processing method based on block chain
CN114760135A (en) Optimization method of block chain fault-tolerant consensus scheme
Hou et al. Using throughput-centric byzantine broadcast to tolerate malicious majority in blockchains
CN111491020B (en) Data processing method, data processing device, computer equipment and storage medium
Berrang et al. Albatross–an optimistic consensus algorithm
Amelchenko et al. Blockchain abbreviation: Implemented by message passing and shared memory
Kanda et al. Block interval adjustment toward fair proof-of-work blockchains

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