Disclosure of Invention
The present invention is directed to a domain-based verification mechanism for a blockchain, which solves the problems of the prior art.
In order to achieve the purpose, the invention adopts the following technical scheme:
a block chain domain verification mechanism is characterized in that a block chain system is divided into a root area and sub-areas, nodes in the sub-areas are accessed to two root area nodes in a master-standby mode, the sub-areas are communicated with the root area, only one root area is provided, the root area is not divided, the sub-areas can be freely increased, and transactions of the block chain system are divided into intra-sub-area transactions, cross-sub-area transactions and roaming client transactions.
Preferably, the blockchain account address includes: the address prefix and the address suffix can be distributed orderly according to the sub-regions, and the address suffix is generated randomly according to the rule.
Preferably, the address prefix may be set to 16 bits, 32 bits, or other bits depending on the block chain itself.
Preferably, the flow of the transaction in the sub-area is as follows: (4.1), initiating a transaction between the user A and the user B in the subarea 1; (4.2) verifying the transaction by the node in the sub-area 1; (4.3) after the consensus verification is completed, reporting a verified result to the root region by the sub-region 1; and (4.4) after receiving the transaction verification result of the sub-area 1, the root area broadcasts the verification result of the transaction to other sub-areas to realize information synchronization.
Preferably, the flow of the cross-sub-region transaction is as follows: (5.1), initiating a transaction between the user A in the subarea 1 and the user C in the subarea 2; (5.2) judging that the transaction belongs to non-regional transaction according to the address prefix, and constructing a cross-domain transaction message by the nodes in the sub-region 1 and sending the cross-domain transaction message to the nodes in the root region; (5.3) the node of the root area finds the target sub-area 2 according to the address prefix information of the destination address, and sends the transaction information to the node of the sub-area 2 for verification; (5.4) after the node of the sub-area 2 completes transaction verification, feeding back verified information to the node of the sub-area 1; (5.5) if the transaction verification is not passed, immediately notifying to discard the transaction; if the transaction verification passes, the sub-region 1 and the sub-region 2 confirm the transaction verification information together, and then the node of the sub-region 1 reports the verification information of the cross-domain transaction to the root region; (5.6) after receiving the verification results of the cross-domain transactions of the sub-regions 1 and 2, the root region broadcasts the verification results of the cross-domain transactions to other sub-regions to realize information synchronization.
Preferably, the flow of the roaming client transaction is as follows: (6.1) when a client roams from the subarea 3 to the subarea 4, initiating a transaction; (6.2) the block chain system utilizes DNS to divide the physical region into sub-regions of the block chain, namely, the sub-region 4 is accessed nearby according to the DNS, and when the transaction is found not to be in the sub-region 3, the transaction is reported to the root region; (6.3) the root area finds out the corresponding sub-area 3 according to the source address, and gives the sub-area 3 the nodes to verify the transaction, and after the transaction is verified, the sub-area 3 reports the verification information of the transaction to the root area; (6.4) after the root region receives the transaction verification information, broadcasting the transaction to other sub-regions to realize information synchronization; and (6.5) after receiving the message that the transaction verification is successful, other sub-areas inform the client that the transaction is successful according to the access condition.
Preferably, the authentication transaction completed inside the sub-area 3 can directly inform the client that it has succeeded.
Compared with the prior art, the invention provides a domain-division verification mechanism of a block chain, which has the following beneficial effects: according to the domain division verification mechanism of the block chain, the whole block chain verification domain is subjected to multi-domain division, a plurality of domains are set according to network natural regions, transactions in each domain can automatically complete consensus verification, cross-domain verification is performed on cross-domain transactions, information synchronization is performed among the domains, a plurality of domains can process most transactions in parallel, and the throughput of the whole block chain system is greatly improved.
The parts which are not involved in the device are the same as or can be realized by adopting the prior art, and the device has the advantages of simple structure and convenient operation.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments.
Example 1
As shown in fig. 1, a block chain domain verification mechanism includes a block chain system divided into a root area and a sub-area, where nodes in the sub-area access two root area nodes in a master-slave manner, the sub-area is communicated with the root area, there is only one root area, the root area is not divisible, the sub-area can be freely increased, and transactions of the block chain system include intra-sub-area transactions, cross-sub-area transactions, and roaming client transactions.
Further, the blockchain account address includes: the address prefix and the address suffix can be distributed orderly according to the sub-regions, and the address suffix is generated randomly according to the rule.
Further, the address prefix may be set to 16 bits, 32 bits, or other bits depending on the block chain itself.
The root area is used as a core hub area of the whole system and is responsible for collecting verification information of all sub-area transactions and synchronizing the information to the sub-areas, and finally, the information synchronization of the whole area is realized; the sub-region is responsible for collecting the verification result information of the internal transaction of the sub-region and reporting the verification result information to the root region, and the sub-region receives the verification information from the root region and synchronizes to all nodes in the sub-region; by setting address prefix information in the block address, the possibility of double-flower operation during cross-domain transaction can be restrained, the transaction initiated by the user must be performed in the sub-region to which the user belongs, and the destination address can be any address.
Example 2
As shown in fig. 2-3, a domain-by-domain verification mechanism for blockchains, the flow of transactions in sub-domains is as follows:
(4.1), initiating a transaction between the user A and the user B in the subarea 1;
(4.2) the nodes in sub-area 1 verify the transaction;
(4.3) after the consensus verification is completed, the sub-region 1 reports the verified result to the root region;
and (4.4) after the root area receives the transaction verification result of the sub-area 1, broadcasting the verification result of the transaction to other sub-areas to realize information synchronization.
Example 3
As shown in fig. 4-5, a block chain domain verification mechanism, the process of cross-sub-region transaction is as follows:
(5.1), initiating a transaction between the user A in the subarea 1 and the user C in the subarea 2;
(5.2) judging that the transaction belongs to non-regional transaction according to the address prefix, and constructing a cross-domain transaction message by the nodes in the sub-region 1 and sending the cross-domain transaction message to the nodes in the root region;
(5.3) the node of the root area finds the target sub-area 2 according to the address prefix information of the destination address, and sends the transaction information to the node of the sub-area 2 for verification;
(5.4) after the transaction verification is completed by the nodes of the sub-area 2, feeding back verified information to the nodes of the sub-area 1;
(5.5) if the transaction verification is not passed, immediately notifying to discard the transaction; if the transaction verification passes, the sub-region 1 and the sub-region 2 confirm the transaction verification information together, and then the node of the sub-region 1 reports the verification information of the cross-domain transaction to the root region; cross-domain verification needs to be completed by cooperation of the sub-region 1, the sub-region 2 and the root region;
(5.6) after receiving the verification results of the cross-domain transactions of the sub-regions 1 and 2, the root region broadcasts the verification results of the cross-domain transactions to other sub-regions to realize information synchronization.
Example 4
As shown in fig. 6, a block chain domain authentication mechanism, a roaming client transaction flow is as follows:
(6.1) when a client roams from the subarea 3 to the subarea 4, initiating a transaction;
(6.2) the block chain system utilizes DNS to divide the physical region into sub-regions of the block chain, namely, the sub-region 4 is accessed nearby according to the DNS, and when the transaction is found not to be in the sub-region 3, the transaction is reported to the root region;
(6.3) the root area finds out the corresponding sub-area 3 according to the source address, and gives the sub-area 3 the nodes to verify the transaction, and after the transaction is verified, the sub-area 3 reports the verification information of the transaction to the root area;
(6.4) after receiving the transaction verification information, the root region broadcasts the transaction to other sub-regions to realize information synchronization;
and (6.5) after receiving the message that the transaction verification is successful, other sub-areas inform the client that the transaction is successful according to the access condition.
Further, a verification transaction completed within sub-area 3 may directly inform the client that it has succeeded.
The above description is only for the preferred embodiment of the present invention, but the scope of the present invention is not limited thereto, and any person skilled in the art should be considered to be within the technical scope of the present invention, and the technical solutions and the inventive concepts thereof according to the present invention should be equivalent or changed within the scope of the present invention.