Block generating method based on permission issue
Technical Field
The invention relates to the technical field of block chains, in particular to a block generation method based on authority issuing.
Background
The block chain technology is an anonymous and decentralized technology, which is essentially decentralized, however, in reality, the calculation power of mining is too concentrated like Bizhou, and about one third of the total calculation power is concentrated in the first few mining factories.
In addition, in the block chain generating process, when the number of the blocks in the early stage is not enough and the de-centralization degree is not high, the blocks obtained by digging pits completely according to the calculation force are unscientific, so that the safety of verification of the blocks generated in the early stage in the block chain is not high.
Disclosure of Invention
In view of the above, the present invention provides a block generation method based on authority issue.
A block generation method based on authority issue comprises the following steps:
s1, configuring the initial authority of the founding block server; and configuring a block network protocol;
s2, when receiving the block generation request of the node for the first time, judging whether the block generation request of the node conforms to the block network protocol, and if so, generating a candidate block according to the block generation rule; and jumps to step S3;
s3, authenticating the candidate blocks according to the authority through the created block server, and jumping to the step S4 after the authentication is passed;
s4, the creating block server sends authentication information to the request node; the request node calculates the candidate block according to the authentication information to obtain a block, and jumps to step S5;
and S5, adjusting the authority of the created block server according to the authority distribution rule, and distributing the authority to the corresponding nodes of the block.
In the block generating method based on authority issue of the present invention,
the step S5 is followed by:
s6, when the block generation request of the node is received again, judging whether the block generation request of the node conforms to the block network protocol, and if so, generating a candidate block according to the block generation rule; and jumps to step S7;
s7, the node requesting again sends the candidate block information to the block network through the block network protocol to obtain the authentication information of the created block server and the corresponding nodes of all blocks in the block network; skipping to step S8 when the received authentication information meets the preset authentication condition;
s8, judging whether the created block server after the authority adjustment accords with an exit mechanism; jumping to step S10 if the exit mechanism is satisfied; otherwise, adjusting the authority of the creating block server according to the authority distribution rule, and jumping to the step S9;
s9, the creating block server sends authentication information to the request node; the request node calculates the candidate block according to the authentication information to obtain a block, and performs authority distribution on the node corresponding to the block generated this time, and the process is finished;
and S10, the request node calculates the candidate block according to the default authentication information to obtain a block, and allocates the authority to the node corresponding to the block generated this time, and the operation is finished.
In the block generating method based on authority issue of the present invention,
the step S6 of generating candidate tiles according to the tile generation rule includes:
s01, allocating block generation and distribution rules and calculation force identification rules in the candidate block generation process;
s02, generating the total number of blocks in the block chain through the block generation and distribution rule, and distributing the total number of blocks according to the network address segments to obtain the block pool corresponding to each network address segment;
s03, judging the network address segment where the requested node is located, judging whether the corresponding block pool in the network address segment reaches the upper limit, jumping to the step S06 when the upper limit is reached, otherwise jumping to the step S04;
s04, judging whether the power calculation abnormality occurs to the requested node through the power calculation identification rule, and jumping to the step S06 when the power calculation abnormality occurs, or jumping to the step S05;
s05, generating a candidate block according to the preset block generation rule information, and executing the step of jumping to the step S7;
s06, the block generation request of the node is rejected, and the process ends.
In the block generating method based on authority issue of the present invention,
the step S04 of determining whether or not computing power abnormality occurs in the requested node according to the computing power identification rule includes:
s41, sending a calculation force test program to the node, and receiving a calculation force test result fed back by the node;
and S42, judging whether the power calculation abnormality occurs in the requested node according to the power calculation test result.
In the block generating method based on authority issue of the present invention,
the step S41 is preceded by:
configuring a mutual exclusion rule of each network address segment internal node generation block chain according to the network address segment;
configuring corresponding node calculation force adjustment rules according to the mutual exclusion rules;
accordingly, the step S42 includes:
s421, judging whether the requested node accords with the mutual exclusion rule, and jumping to the step S5 when the requested node accords with the mutual exclusion rule; otherwise, jumping to step S422;
s422, adjusting the calculation power influence coefficient of the requested node item according to the node calculation power adjustment rule;
and S423, obtaining the computing power of the adjusted requested node through the computing power influence coefficient, and judging whether the computing power of the adjusted requested node is abnormal or not.
In the block generating method based on authority issue of the present invention,
in step S02, the step of allocating the total number of blocks according to the network address segments to obtain a block pool corresponding to each network address segment includes:
dividing the network address into network address sections of different levels;
and dividing the total number of the blocks according to the network address segments of different levels to obtain the block pool corresponding to the network address segment of each level.
In the block generating method based on authority issue of the present invention,
the mutually exclusive rule for configuring the node generation block chain in each network address field according to the network address field comprises the following steps:
configuring the standard request rate of the nodes in the network address fields of different levels according to the network address fields of different levels;
and generating a mutual exclusion rule for generating the block chain according to the standard request rate.
In the block generating method based on authority issue of the present invention,
the step S41 includes:
s411, sending a calculation force test program to a node, wherein the calculation force test program comprises a floating point operation and a node unique identification code acquisition program;
s422, receiving a calculation force test result fed back by the node, wherein the calculation force test result comprises a floating point operation result and a node unique identification code.
In the block generating method based on authority issue of the present invention,
the step S05 includes:
and generating the candidate block by taking the adjusted computing power of the node of the request as the contribution value.
The beneficial technical effects are as follows: compared with the prior art, the block generation method based on authority issuing can realize that: authenticating the candidate block according to the authority through the created block server, adjusting the authority of the created block server according to an authority distribution rule, and distributing the authority to the corresponding nodes of the block, so that the safety of the block generated in the early stage in verification in a block chain is higher; and the total number of blocks in the block chain is generated through a block generation and allocation rule, and the total number of blocks is allocated according to the network address segments to obtain the block pools corresponding to the network address segments, so that the blocks can be forcibly distributed according to regions, and the generation of most of the blocks monopolized by several top-ranked mine plants due to too concentrated mining calculation force is avoided.
Drawings
Fig. 1 is a flowchart of a block generation method based on right issue according to an embodiment of the present invention.
Detailed Description
As shown in fig. 1, in the embodiment of the present invention, a method for generating a block based on right issue includes the following steps:
s1, configuring the initial authority of the founding block server; and configuring a block network protocol;
by arranging the created block server, the candidate blocks generated early need to be authenticated by the created block server, so that the safety of verification of the blocks generated early in the block chain is higher. The allocated block network protocol is a condition required to be met by creating a block server, a node corresponding to the block and a requested node for communication. The invention is not limited to the specific form of the block network protocol.
S2, when receiving the block generation request of the node for the first time, judging whether the block generation request of the node conforms to the block network protocol, and if so, generating a candidate block according to the block generation rule; and jumps to step S3;
the block generation rule in this embodiment is not limited, and for example, a specific mathematical problem may be solved by calculation.
S3, authenticating the candidate blocks according to the authority through the created block server, and jumping to the step S4 after the authentication is passed;
this step is a significant difference between the present embodiment and the prior art, and in the prior art, the corresponding block can be generated as long as the block is suitable for meeting the preset condition. However, in the present embodiment, the generated candidate block is authenticated by the created block server. The authentication is not limited in this embodiment.
S4, the creating block server sends authentication information to the request node; the request node calculates the candidate block according to the authentication information to obtain a block, and jumps to step S5;
optionally, the requesting node calculates the candidate block according to the authentication information to obtain the block, where the authentication information includes a random number sent by the created block server, and performs SHA512 calculation on the candidate block by analyzing the random number in the authentication information.
And S5, adjusting the authority of the created block server according to the authority distribution rule, and distributing the authority to the corresponding nodes of the block.
In step S5, the authority of the created block server is adjusted, specifically, the weight value of the authority of the created block server is reduced, the authority is assigned to the node corresponding to the generated block, and the assigned object is assigned with the weight value of the authority. And the sum of the adjusted weight value of the permission of the created block server and the weight value of the distributed object to the permission is the weight value of the initial permission of the created block server.
Alternatively, the weight value of the authority of the created tile server is decremented, and the magnitude of the decrement of the weight value may be set according to the total amount of the number of generated tiles.
The purpose of this step is to gradually reduce the authority percentage of the created block server and gradually issue the authority of the created block server to the generated blocks.
By the embodiment, the blocks generated early are authenticated by the created block server, and the verification security in the block chain is higher.
In this embodiment, the created block server may be a general server, which aims to authenticate the candidate block according to the authority and send authentication information to the requesting node.
In the block generating method based on authority issue of the present invention,
the step S5 is followed by:
s6, when the block generation request of the node is received again, judging whether the block generation request of the node conforms to the block network protocol, and if so, generating a candidate block according to the block generation rule; and jumps to step S7;
s7, the node requesting again sends the candidate block information to the block network through the block network protocol to obtain the authentication information of the created block server and the corresponding nodes of all blocks in the block network; skipping to step S8 when the received authentication information meets the preset authentication condition;
the preset authentication condition may be that a block server is created in the block network that sends the authentication information, and the sum of weighted values of the permissions corresponding to the nodes corresponding to all blocks is greater than or equal to a preset weighted threshold.
S8, judging whether the created block server after the authority adjustment accords with an exit mechanism; jumping to step S10 if the exit mechanism is satisfied; otherwise, adjusting the authority of the creating block server according to the authority distribution rule, and jumping to the step S9;
by setting the exit mechanism, the created block server can exit authentication when the generated blocks reach a certain number, so that the decentralized of the block chain and the safety guarantee when the number of the early blocks is too small are balanced.
Optionally, the exit mechanism is that a weighted value of the weight of the created block server after the permission adjustment is smaller than a preset threshold.
S9, the creating block server sends authentication information to the request node; the request node calculates the candidate block according to the authentication information to obtain a block, and performs authority distribution on the node corresponding to the block generated this time, and the process is finished;
and S10, the request node calculates the candidate block according to the default authentication information to obtain a block, and allocates the authority to the node corresponding to the block generated this time, and the operation is finished.
Optionally, the default authentication information is a timestamp value when the candidate block is generated, and the SHA512 calculation is performed on the candidate block through the default authentication information.
In the block generating method based on authority issue of the present invention,
the step S6 of generating candidate tiles according to the tile generation rule includes:
s01, allocating block generation and distribution rules and calculation force identification rules in the candidate block generation process;
in the prior art, no distribution rule for block generation exists, the contribution value of a node for generating the deblocking money is often determined by the calculation power, and although the contribution value is determined in various ways, no distribution mechanism exists; and the contribution value is determined simply through the calculation power, so that a large entity enterprise concentrates a large number of high-performance computers or servers to obtain calculation power far larger than that of a common computer, and further obtain more blocks. In the step, the division generation can be distributed by generating the distribution rule and the calculation recognition rule, and the operation of a professional ore-digging mine plant can be limited to a certain extent, so that the operation cost is increased.
S02, generating the total number of blocks in the block chain through the block generation and distribution rule, and distributing the total number of blocks according to the network address segments to obtain the block pool corresponding to each network address segment;
alternatively, the total number of blocks can be distributed according to network address segments, and the total number of blocks can be determined by 1, segmentation by IP addresses, 2, a mode of combining the IP addresses and MAC addresses, or 3, IP address distribution rules in a backbone network and a local area network.
Alternatively,
in step S02, the step of allocating the total number of blocks according to the network address segments to obtain a block pool corresponding to each network address segment includes:
dividing the network address into network address sections of different levels;
and dividing the total number of the blocks according to the network address segments of different levels to obtain the block pool corresponding to the network address segment of each level.
In the preferred embodiment of the present invention, the network address is divided into network address segments of different hierarchies, and finally divided to obtain the block pool corresponding to each hierarchy network address segment, for example, the allocation rule is as follows:
the first level network address segment A, B, C and limits A, B, C the upper limit on the number of tiles in the corresponding tile pool.
Further, in the second-level network address segment, a is divided into a1, a2 and a3, and the upper limit of the number of blocks in the corresponding block pool of a1, a2 and a3 is limited, and the blocks can be subdivided successively.
Through the preferred embodiment of the invention, the requirement of the block pool in the network address field of the hierarchy is required to be met, and the requirement of the block pool corresponding to the network address field of the hierarchy above the network address field of the hierarchy is also required to be met, so that the block has more hierarchy for the limitation of the number when being generated.
Alternatively,
the mutually exclusive rule for configuring the node generation block chain in each network address field according to the network address field comprises the following steps:
configuring the standard request rate of the nodes in the network address fields of different levels according to the network address fields of different levels;
and generating a mutual exclusion rule for generating the block chain according to the standard request rate.
In the preferred embodiment of the present invention, the standard request rate is a ratio of nodes requested in the hierarchical network address segment to all nodes, and the standard request rate is a mutual exclusion rule for generating a block chain.
S03, judging the network address segment where the requested node is located, judging whether the corresponding block pool in the network address segment reaches the upper limit, jumping to the step S06 when the upper limit is reached, otherwise jumping to the step S04;
s04, judging whether the power calculation abnormality occurs to the requested node through the power calculation identification rule, and jumping to the step S06 when the power calculation abnormality occurs, or jumping to the step S05;
s05, generating a candidate block according to the preset block generation rule information, and executing the step of jumping to the step S7;
s06, the block generation request of the node is rejected, and the process ends.
In the block generating method based on authority issue of the present invention,
the step S04 of determining whether or not computing power abnormality occurs in the requested node according to the computing power identification rule includes:
s41, sending a calculation force test program to the node, and receiving a calculation force test result fed back by the node;
and S42, judging whether the power calculation abnormality occurs in the requested node according to the power calculation test result.
Alternatively,
the step S41 is preceded by:
configuring a mutual exclusion rule of each network address segment internal node generation block chain according to the network address segment;
and configuring corresponding node calculation force adjustment rules according to the mutual exclusion rules.
Optionally, configuring a corresponding node calculation force adjustment rule according to the mutual exclusion rule includes:
θ=δ1*δ2*...δnwhere θ is the nodal calculated force adjustment function, δ1For the standard request rate, δ, of the network address segment of the node at the current level2The standard request rate of the network address field of the node at the upper level is obtained, and the like, and n is the total level of the network address field of the node.
In the block generating method based on authority issue of the present invention,
the step S41 is preceded by:
configuring a mutual exclusion rule of each network address segment internal node generation block chain according to the network address segment;
configuring corresponding node calculation force adjustment rules according to the mutual exclusion rules;
accordingly, the step S42 includes:
s421, judging whether the requested node accords with the mutual exclusion rule, and jumping to the step S5 when the requested node accords with the mutual exclusion rule; otherwise, jumping to step S422;
s422, adjusting the calculation power influence coefficient of the requested node item according to the node calculation power adjustment rule;
optionally, the value of θ is the calculation power influence coefficient of the requested node item.
And S423, obtaining the computing power of the adjusted requested node through the computing power influence coefficient, and judging whether the computing power of the adjusted requested node is abnormal or not.
And the product of the computing power influence coefficient and the computing power of the requested node is used as the adjusted computing power of the requested node.
Optionally, a computation power abnormal threshold is set, the computation power of the adjusted requested node is compared with the computation power abnormal threshold, and if the computation power of the adjusted requested node is greater than the computation power abnormal threshold, the computation power of the adjusted requested node is confirmed to be abnormal.
In the block generating method based on authority issue of the present invention,
the step S41 includes:
s411, sending a calculation force test program to a node, wherein the calculation force test program comprises a floating point operation and a node unique identification code acquisition program;
s422, receiving a calculation force test result fed back by the node, wherein the calculation force test result comprises a floating point operation result and a node unique identification code.
In the block generating method based on authority issue of the present invention,
the step S05 includes:
and generating the candidate block by taking the adjusted computing power of the node of the request as the contribution value.
The beneficial technical effects are as follows: compared with the prior art, the block generation method based on authority issuing can realize that: the candidate blocks are authenticated by the created block server according to the authority, the authority of the created block server is adjusted according to the authority distribution rule, and the authority distribution is performed on the corresponding nodes of the blocks, so that the safety of verification of the blocks generated in the early stage in a block chain is higher; and the total number of blocks in the block chain is generated through a block generation and allocation rule, and the total number of blocks is allocated according to the network address segments to obtain the block pools corresponding to the network address segments, so that the blocks can be forcibly distributed according to regions, and the generation of most of the blocks monopolized by several top-ranked mine plants due to too concentrated mining calculation force is avoided.
It is understood that various other changes and modifications may be made by those skilled in the art based on the technical idea of the present invention, and all such changes and modifications should fall within the protective scope of the claims of the present invention.