The present application claims priority of chinese patent application with application number 201910141900.0, entitled "public chain based subchain construction and application deployment method", filed by chinese patent office on 26/2/2019, the entire contents of which are incorporated herein by reference.
Disclosure of Invention
The application provides a public chain-based block chain sub-chain creation method and system, which aim to solve the problems that the traditional creation method is low in expansibility and cannot meet various service requirements.
In one aspect, the present application provides a block chain sub-chain creation method based on a public chain, including:
developing and deploying a sub-chain contract by nodes in the public chain network, and executing the sub-chain contract by partial nodes to form a sub-chain network;
implementing compatibility test on the sub-chain network through a test network in the public chain network;
the sub-chain deployment voting transaction is initiated through the sub-chain network of the compatibility test and the voting contract of the public chain standard, and the voting transaction is broadcasted in the public chain network;
nodes in the public link network feed back voting results according to the voting transactions and generate a sub-link node candidate list according to the voting results;
and if the fed voting result meets the preset voting requirement, connecting the nodes in the sub-chain node candidate list with the common link point to finish the chain linking.
Optionally, the sub-link is about a preset variety of transaction rules, including but not limited to: a subchain block data structure, a transaction consensus mechanism, a certification mechanism and an algorithm mechanism; developing and deploying the sub-chain contracts by nodes in the public chain network, wherein the sub-chain network is formed by the following steps:
defining a block data structure of the sub-chain network;
or multiplexing the block data structure of the public link as the block data structure of the sub-link network.
Optionally, the developing and deploying the child chain contract by the nodes in the public link network, and executing the child chain contract by a part of the nodes to form the child chain network, further includes:
if the sub-chain network has an independent evidence passing mechanism, defining the evidence passing quantity and the distribution mode of the sub-chain network;
a selected sub-chain network consensus mechanism, and a digest algorithm, an encryption algorithm, and a decryption algorithm of the selected sub-chain block data.
Optionally, if the child link network has an independent authentication mechanism, before completing uplink, the method further includes:
establishing an account corresponding to the sub-chain network in the public chain network;
transferring a preset number of sub-chain certificate connections and public chain certificate connections to a public chain through the created account;
generating an initial exchange rate according to the sub-chain permit quantity and all public chain permit quantities in the current public chain network;
storing the initial redemption rates in the public link network node and the child link network nodes.
Optionally, the step of performing the compatibility test on the sub-chain network through the test network in the public chain network includes:
the test network creates a test certification address in the sub-chain network;
acquiring a preset number of test certificates according to the test certificate addresses;
creating a test account in the sub-chain network, and transferring a preset number of test certificates to the test account to generate test block data;
and comparing the test block data with the block data template, and if the test block data is consistent with the block data template, passing the compatibility test.
Optionally, comparing the test block data with the predefined block data template includes:
the test network generates public link block data based on public link standards, and the public link block data is used as a block data template;
the sub-chain network generates sub-chain block data based on a sub-chain standard;
comparing the public link block data with the child link block data;
if the public link block data is consistent with the sub-link block data, the sub-link network passes a compatibility test.
Optionally, the initiating the sub-chain deployment voting transaction through the sub-chain network that completes and passes the compatibility test and the voting contract of the public chain standard includes:
the sub-chain network initiates a voting transaction through a voting contract of a public chain standard; the voting transaction comprises a preset amount of public link certificate paid by the project party;
the child chain network broadcasting the voting transaction to the public chain;
the node receiving the voting transaction generates voting results for the voting transaction, wherein the voting results comprise support and objection;
and transferring a preset number of public link certificates to the nodes supported by the voting result according to the voting contract.
Optionally, in the step of generating the child chain node candidate list according to the voting result, the public link node supported by the voting result is fed back and added to the child chain node candidate list, and the method further includes:
configuring the child chain contract for a common link point in the child chain node candidate list.
Optionally, if the fed-back voting result meets a preset voting requirement, the node in the candidate list of child chain nodes is in point-to-point connection with the common chain node, and the step of completing the uplink includes:
counting the fed voting results;
if the statistical voting result is that the number of the supported nodes is greater than or equal to a first judgment threshold value, the fed-back voting result meets the preset voting requirement;
or, within the preset voting deadline time for initiating the voting transaction, counting the voting result that the number of the supported nodes is greater than or equal to the second judgment threshold, wherein the fed-back voting result meets the preset voting requirement.
In another aspect, the present application further provides a public-chain-based blockchain sub-chain creation system, including a public-chain network in which nodes mutually establish P2P network connections, where the nodes of the public-chain network are configured to develop and deploy sub-chain contracts, and some nodes in the public-chain network are configured to execute the sub-chain contracts to form a sub-chain network; the public link network comprises a test network;
the public link network is further configured to perform the following procedural steps: implementing compatibility test on the sub-chain network through a test network in the public chain network; nodes in the public link network feed back voting results according to the voting transactions and generate a sub-link node candidate list according to the voting results; if the fed back voting result meets the preset voting requirement, connecting the nodes in the sub-chain node candidate list with the common link point to finish the chain linking;
the sub-chain network is further configured to perform the following procedural steps: the sub-chain deployment voting transaction is initiated by the sub-chain network completing and passing the compatibility test, by the voting contract of the public chain standard, and is broadcast in the public chain network.
According to the technical scheme, the block chain sub-chain creating method and system based on the public chain are provided, the sub-chain contract can be developed through the public chain node to form the sub-chain network, the voting transaction is initiated in the public chain network after the compatibility test is completed, and then the sub-chain node is in online butt joint with the public chain node according to the voting result to complete the uplink. The method can create a block link sub-chain network with new functions by utilizing the existing public link network, and directly complete the butt joint of the sub-chain and the public link through voting transaction, and the creation speed of the sub-chain is high and the cost is low. The created sub-chain network has the functions of a public chain and a sub-chain at the same time, the functions are mutually independent, free cross-chain transaction can be realized, the expansibility of a new chain is improved, and various service requirements can be met.
Detailed Description
Reference will now be made in detail to embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following examples do not represent all embodiments consistent with the present application. But merely as exemplifications of systems and methods consistent with certain aspects of the application, as recited in the claims.
In the technical solution provided by the present application, the blockchain network refers to a peer-to-peer (P2P) network with decentralized application architecture, and the blockchain network can perform distributed storage, public consensus, digital encryption, transaction accounting, and verification. I.e., a transaction platform that encompasses distributed technology, cryptography, P2P network architecture, and various consensus algorithms that may be applied. The block chain or block chain data refers to accounting information generated according to transaction information when transactions occur in the block chain network, namely a plurality of specific transactions form a block, and the plurality of blocks form an ordered block chain.
The blockchain network comprises nodes which establish point-to-point network connection with each other, and each node is configured with a corresponding consensus mechanism, such as an intelligent contract, and has enough computing power to perform transaction verification and accounting procedures. The nodes also have interface specifications that conform to some uniform standard to enable access to more nodes or other types of blockchain networks through the interface specifications.
Referring to fig. 1, a flow chart of a public chain-based block chain sub-chain creation method according to the present application is shown. Referring to fig. 2, a logic flow diagram of the block chain sub-chain creation method of the present application is shown. As can be seen from fig. 1 and fig. 2, the method for creating a public-chain-based blockchain sub-chain provided in the present application includes the following steps:
s1: and developing and deploying the sub-chain contract by the nodes in the public chain network, and executing the sub-chain contract by part of the nodes to form the sub-chain network.
In the technical scheme provided by the application, the public link is a public network established based on the same protocol, and the public link comprises a plurality of nodes so as to verify block chain transactions, distribute bookkeeping and the like. The public link network is used as a basic platform arranged in the whole network, and node interfaces of the public link network are accessed into a plurality of block link networks, such as an industry chain, a alliance chain and a private chain which are built based on public link interface specifications. Each blockchain network can be used as a development platform and provides corresponding services for the inside of the network. The public link definition and specification has standard interfaces and modes so as to facilitate other block links to carry out network docking. The public chain in the application has the capability of supporting cross-chain intermediary and also has decentralized application and intelligent contractual capability. The public chain provided by the application can be a block chain public chain based on a CNWW3 form, so that higher expansibility and cross-chain performance are obtained.
In practical application, part of nodes in the public link network can automatically assemble a new blockchain network according to needs, the new blockchain network can perform corresponding service expansion and customization on the basis of inheriting the public link capability, and the self blockchain network can be realized and deployed in the fastest mode to meet the requirement of accessing the service to the blockchain network. In the above sub-networks, if the standards of the private chain, the industry chain, and the alliance chain, which establish network connection with each other, are the same as the standards of the public chain, the private chain, the industry chain, and the alliance chain may be called child chains, that is, the child chains are service extensions and customizations performed on the basis of inheriting the capabilities of the public chain, thereby fulfilling the requirements of the service access blockchain network.
According to different service requirements, nodes in the public chain can jointly create a sub-chain contract so as to agree on a trading, verification, accounting and storage mode in the sub-chain network. Obviously, the sub-chain contract can also directly follow the public chain contract without redeveloping a complete contract form.
At a technical level, the basic capabilities of the sub-chain to obtain the public chain may include data storage capabilities, network capabilities, basic blockchain platform capabilities, such as password and security, transactions, accounts, consensus, certification, intelligent contracts, and the like, basic blockchain application capabilities, such as platform-based capabilities, development of business applications, and the like, and cross-chain capabilities, such as cross-chain contracts and docks to support the public chain, one-step cross-chains, and the like. Obviously, the public link capability inherited by the sub-chain is the most basic in the block chain network, and is also the part with the greatest development and implementation difficulty, so that the difficulty of block chain application development and deployment can be effectively reduced by the mode of inheriting the public link capability.
Furthermore, the sub-chain can be flexibly defined and extended based on the business and operation requirements of the sub-chain on the basis of inheriting the basic capability of the public chain, and the redefined and extended contents can be used as the contents of the sub-chain contract. That is, the sub-chain is about a preset variety of transaction rules, including but not limited to: the sub-chain block data structure, the transaction consensus mechanism, the certification mechanism, the algorithm mechanism and other rule contract forms, so that the sub-chain contract is developed by the nodes in the public link network, and the step of developing and deploying the sub-chain contract by the nodes in the public link network further comprises the following steps: defining a block data structure of the sub-chain network; or multiplexing the block data structure of the public link as the block data structure of the sub-link network.
In this embodiment, for the sub-chain block data structure, the sub-chain may have a block structure independent from the public chain. For the consensus mechanism, selection can be made from POW, POS, or autonomous implementation, but the sub-chains can be flexibly defined regardless of POW or POS, or other consensus methods. Meanwhile, the packaging mechanism, period, transaction number supported by the block and the like can be flexibly customized. For the certificate mechanism, the sub-chain can flexibly define an autonomous certificate mechanism, can directly follow the certificate mechanism of a public chain, and can also define a certificate-free sub-chain to aim at a specific technical field.
The algorithm mechanism of the sub-chain is mainly embodied on a password and a security algorithm mechanism. The subchain can be flexibly selected in cryptography, particularly in algorithms such as digest hash and the like. Meanwhile, the security of the data block, such as an access policy and the like, can also be defined autonomously. It should be noted that, the account number and the corresponding password (elliptic algorithm) can only use the public link mechanism in view of the overall security of the public link.
In this embodiment, a data query and access interface mechanism of the child chain may be defined, and in addition to implementing a public chain standard interface, the data query and access interface with the open child chain may also provide a corresponding overloading mechanism for providing richer access and access capabilities. Moreover, the transaction mechanism of the sub-chain can be defined, and the sub-chain can be flexibly and autonomously defined through a sub-chain contract for the contents of a transaction strategy, mode, cost, verification, multiple signatures and the like. In addition, the support mode of the intelligent contracts of the sub-chains can be defined, and functions such as support of the intelligent contracts, default intelligent contract types, intelligent contract running environments and languages can be selected.
In some embodiments of the present application, the developing and deploying the child chain contract by a node in the public chain network, executing the child chain contract by a part of nodes, and composing the child chain network further includes:
s101: if the sub-chain network has an independent evidence passing mechanism, defining the evidence passing quantity and the distribution mode of the sub-chain network;
s102: a selected sub-chain network consensus mechanism, and a digest algorithm, an encryption algorithm, and a decryption algorithm of the selected sub-chain block data.
In practical application, if the child chain network has an independent credential mechanism, while developing the child chain contract, it is necessary to define the credential number and allocation manner in the child chain network, and after defining the credential number and allocation manner, select a consensus mechanism of the child chain network, and select an abstract algorithm and an encryption/decryption algorithm of the data of the child chain block. Wherein, the selected abstract algorithm is default as SHA264, and can be realized autonomously. If the data has corresponding privacy requirements, encryption and decryption algorithms and strategies for block data need to be synchronously realized.
It should be noted that, in practical application, the nodes of the sub-chain may also adopt a new node-adding manner to arrange the sub-chain network instead of adopting the nodes in the public chain as the nodes; or partially adopting the nodes in the public chain as the nodes and partially adopting the newly added nodes as the nodes. However, in order to inherit the function and mechanism of the public link network, the newly added node needs to be subjected to hardware detection before being online and can be added as a new node after being tested. The method can be essentially regarded as the extension of public link network nodes, and then the extended network nodes form a sub-link network.
In addition, in the process of developing the sub-chain contract, besides defining the functions, a series of interfaces such as inheritance in the sub-chain or access, query and the like of data of sub-chain blocks can be set; determining the strategy of the transaction, such as the minimum cost, the verification mode and the like; and selecting an intelligent contract option, supporting an intelligent contract by default, and comprising several types of basic intelligent contracts and the like.
S2: and carrying out compatibility test on the sub-chain network through a test network in the public chain network.
After the development work of the sub-chain contract is completed, the function and mechanism of the sub-chain can be verified through a test network in a public chain network, namely the TestNet compatibility test is completed. The test network may be a private network consisting of a part of the nodes in a public chain network. In a test network, corresponding nodes may configure corresponding test contracts. On one hand, data compatibility test can be carried out according to the interface specification and the network transmission specification defined by the sub-chain contract, for example, whether the sub-chain network can adapt to the public link data transmission specification or not; on the other hand, the testing can be performed for the certificate transaction, and since the nodes in the sub-chain network are used as both the sub-chain nodes and the public chain nodes, the testing for the certificate transaction includes not only the sub-chain certificate transaction testing but also the public chain certificate transaction testing, and in addition, the certificate transaction testing for the cross-chain transaction (i.e., between the sub-chain and the public chain) is also required.
That is, in some embodiments of the present application, as shown in fig. 3, the step of performing the compatibility test on the sub-chain network through the test network in the public chain network includes:
s201: the test network creates a test certification address in the sub-chain network;
s202: acquiring a preset number of test certificates according to the test certificate addresses;
s203: creating a test account in the sub-chain network, and transferring a preset number of test certificates to the test account to generate test block data;
s204: and comparing the test block data with the block data template, and if the test block data is consistent with the block data template, passing the compatibility test.
In practical application, a link address applied to testing can be created in the sub-chain network through the testing network, and then a preset number of testing links are obtained from the sub-chain through the created link address, wherein the testing links can be sub-chain links or public link links. And then, a test account is created through the sub-chain, and a test certificate obtained before the test account is transferred to the test account, and as the test transaction occurs between the test network and the sub-chain network, block data, namely test block data, can be generated, and obviously, the generated test block data should conform to a preset block data form. Therefore, in this embodiment, the generated test data may be compared with a preset block data template, and if the two forms are consistent, it indicates that the current child chain network passes the compatibility test.
In the technical solution provided by the present application, since a node of the sub-chain network is both a sub-chain node and a public chain node, block data of the sub-chain and the public chain are generally stored in the sub-chain node at the same time. In order to enable the sub-chain to directly block data to the public chain synchronization block in the subsequent transaction process, the sub-chain compatibility is tested mainly on whether the sub-chain block data can meet the public chain accounting requirement, that is, whether the data can be generated according to the block data form of the public chain. Therefore, in the above test process, the preset block data template may be in a block data form based on public link transaction, so that the sub-chain can directly block data to the public link synchronization block after the compatibility test is passed.
It should be noted that, because the sub-chain may serve as a relatively independent blockchain system, in this embodiment, if the transaction occurs within the range of the sub-chain, the generated blockchain data may not be synchronized with the public chain, and thus, the compatibility test is not required; when a transaction occurs between the public link and the child link, the node must generate the chunk data of the child link specification and the chunk data of the public link specification, and then the newly created child link must be subjected to a compatibility test.
Further, as shown in fig. 4, the step of comparing the test block data with the predefined block data template further includes the following specific comparison processes:
s2041: the test network generates public link block data based on public link standards, and the public link block data is used as a block data template;
s2042: the sub-chain network generates sub-chain block data based on a sub-chain standard;
s2043: comparing the public link block data with the child link block data;
s2044: if the public link block data is consistent with the sub-link block data, the sub-link network passes a compatibility test.
In practical application, the public link block data can be generated based on the public link standard through the test network, and as the test network is a part of nodes of the public link network, the public link block data generated by the test network inevitably meets the public link block data specification, so the generated public link block data can be used as the block data template in the embodiment. And then generating sub-chain block data through the sub-chain network according to the standard defined by the sub-chain contract, and directly carrying out consistency comparison on the sub-chain block data and the public chain block data in the subsequent comparison process.
It should be noted that the compatibility test further includes the following contents: testing the effectiveness, reliability and safety of the sub-chain contract; the sub-chain inherits the public chain capability test (block, transaction, contract, inquiry, creation, verification and other functions of the account number); the method comprises the following steps of (1) testing the bidirectional transaction capacity of a sub-chain and a public chain (the public chain conducts transaction to the sub-chain, and the sub-chain conducts transaction to the public chain); the sub-chain safety sandbox test has no influence on the public chain; if the child chain is docked with a third party system or a traditional centralized network, concurrent and repeated testing is required.
S3: the sub-chain deployment voting transaction is initiated by the sub-chain network completing and passing the compatibility test, by the voting contract of the public chain standard, and is broadcast in the public chain network.
In practical applications, to facilitate management of a newly created child chain, for example: and a block data storage mode, new link function registration and the like are adopted, and the sub-link network which is completed and passes the compatibility test can not be directly put in for adaptation, but still needs nodes in the public link network to vote so as to be online to the public link network. Because the proposal provided by the application needs a plurality of nodes in the public link network to participate in voting, the block chain network provided by the application is still a decentralized network system and conforms to the basic specification of the block chain technology.
In particular, after the child chain passes the test, a voting contract may be executed collectively by any one or more nodes in the child chain, thereby initiating a voting transaction. The voting transaction is a special constraint form transaction, which also needs to execute a corresponding intelligent contract in practical application, and also needs to generate block data according to a transaction result during the transaction, and verify and store the transaction in a public link network in a distributed manner. However, on the basis of meeting the above transaction process, the voting transaction also needs to be fed back by the node participating in the voting, that is, whether to agree with the online request of the sub-chain network. Meanwhile, in order to promote the participating nodes in the public link to complete the voting transaction in time, a certain number of public link certificates can be paid by the project side of the sub-link as the voting cost, and a certain number of public link certificates are awarded for the public link nodes feeding back the result in the voting transaction.
That is, in some embodiments of the present application, as shown in fig. 5, the sub-chain network that completes and passes the compatibility test, and the initiating the sub-chain deployment voting transaction by the voting contract of the public chain standard includes:
s301: the sub-chain network initiates a voting transaction through a voting contract of a public chain standard; the voting transaction comprises a preset amount of public link certificate paid by the project party;
s302: the child chain network broadcasting the voting transaction to the public chain;
s303: the node receiving the voting transaction generates voting results for the voting transaction, wherein the voting results comprise support and objection;
s304: and transferring a preset number of public link certificates to the nodes supported by the voting result according to the voting contract.
From the above steps, when the related development work is completed and the test is completed, the child chain deployment voting can be initiated through the voting contract of the public chain standard. Firstly, the sub-chain project party initiatively initiates the vote, a corresponding public chain certificate needs to be paid to complete the vote, and the paid certificate can comprise two parts, wherein one part is the execution cost of the intelligent contract, and the other part is the initiative undertaking of the transaction cost of the node supported by the subsequent vote.
In the voting transaction, the voting fee of the node which feeds back the voting result as support is set to be paid by the project party, and the fee of the node which feeds back the voting result as objection is not paid by the project party, so that the nodes in the public chain are prompted to feed back the voting result for the voting transaction. In addition, since the later uplink process of the sub-chain needs the support of the node in the public chain, that is, after the sub-chain is uplink, the original public chain node needs to undertake the transaction verification and accounting functions in the sub-chain, whether the node in the public chain agrees to the uplink of the sub-chain does not depend on the subjective intention of the node administrator, and a certain requirement should be made on the hardware of the public chain node. Therefore, the public chain certificate paid by the project party can also be used as a public chain point to participate in the reward of chain linking on the sub chain.
S4: and feeding back a voting result by the nodes in the public link network according to the voting transaction, and generating a subchain node candidate list according to the voting result.
In the technical scheme provided by the application, after receiving the voting transaction, the node in the public chain can confirm whether the sub-chain is supported to be accessed in a transaction mode; that is, the public link node supporting the line on the sub-chain can feed back the voting result as support, and the public link node against the line on the sub-chain feeds back the voting result as objection. Because the public link network is a block link network, the feedback results can be obtained by the nodes in the public link, so that the voting results can be counted by any node in the public link, and the voting results fed back by all the nodes participating in voting can also be counted by the voting contract.
Further, in the step of generating the child chain node candidate list according to the voting result, the public link point which is fed back as the support of the voting result is added to the child chain node candidate list, that is, the support of the public link point is obtained in the subsequent process of online of the child chain. And, the method further comprises: configuring the child chain contract for a common link point in the child chain node candidate list.
The public link node in the sub-link node candidate list can be understood as an extension of the size of the node of the sub-link network, so that after the sub-link is linked to the public link network, the node in the sub-link node candidate list also needs to undertake transaction verification and accounting processes in the sub-link network, and therefore a sub-link contract developed before can be configured for the public link node in the sub-link node candidate list, so that the node can adapt to the transaction form of the sub-link network. Obviously, the configuration process of the sub-chain contract can be performed after the sub-chain completes the chaining, so as to avoid redundant configuration of the common link node when the sub-chain fails to pass the voting.
S5: and if the fed voting result meets the preset voting requirement, connecting the nodes in the sub-chain node candidate list with the common link point to finish the chain linking.
In the technical scheme provided by the application, all nodes in the public link network can receive the voting transaction and feed back the voting result in principle, but due to the large scale of the public link network, the waiting time for all the public link nodes to feed back the voting result is too long, so that the online process of the sub-chain can be completed when the voting result meets the preset requirement, and the waiting time is reduced. The specific voting requirement can be set according to the public link condition. For example, when the public link network is just in the input stage, in order to expand the service field range of the public link, the online threshold established by the voting requirement may be set lower, so as to quickly attract a large number of sub-link networks.
For example, the voting requirement may be that the number of public link nodes agreed to be on line is more than 51% of the total number of public link nodes. In addition, the voting result can be weighted according to the specific application state and management mode of the public link network, for example, the project side of the public link and the nodes related to the sub-link function can have a larger weight, so as to avoid that the transaction environment of the public link is maliciously damaged by the partially created sub-link.
Further, if the fed-back voting result meets the preset voting requirement, the nodes in the sub-chain node candidate list are in point-to-point connection with the common link, and the step of completing the uplink includes:
counting the fed voting results; if the statistical voting result is that the number of the supported nodes is greater than or equal to a first judgment threshold value, the fed-back voting result meets the preset voting requirement; or, within the preset voting deadline time for initiating the voting transaction, counting the voting result that the number of the supported nodes is greater than or equal to the second judgment threshold, wherein the fed-back voting result meets the preset voting requirement.
In practical application, the voting result can be counted in real time aiming at the voting transaction, and when the counted result reaches the preset voting requirement, the voting is ended. In order to improve the online efficiency of the sub-chains, two judgment thresholds can be set respectively to determine whether the voting result meets the voting requirement. I.e. the indication that the voting is complete, may be that the voting time has expired or that there are already enough nodes to support the access. In addition, after the voting is finished, the remainder of the certificate paid by the child chain is returned to the project side. But the spent credentials are not returned regardless of success or failure of the line to the public chain on the child chain.
In some embodiments of the present application, as shown in fig. 6, if the child link network has an independent authentication mechanism, before completing uplink, the method further includes:
s601: establishing an account corresponding to the sub-chain network in the public chain network;
s602: transferring a preset number of sub-chain certificate connections and public chain certificate connections to a public chain through the created account;
s603: generating an initial exchange rate according to the sub-chain permit quantity and all public chain permit quantities in the current public chain network;
s604: storing the initial redemption rates in the public link network node and the child link network nodes.
After voting is successful, if the sub-chain is certified through, an account corresponding to the sub-chain network needs to be established in the public chain network, the established account can be used for completing transfer and subsequent mortgage, a preset number of sub-chain certifications and public chain certifications are transferred to the public chain through the established account, namely certificating mortgage is carried out, the initial exchange rate of the sub-chain certifications and the public chain certifications is determined, and the certificating circulation and the exchange of the sub-chain in subsequent chain crossing and other application scenes are ensured. In this embodiment, initially, the nodes in the sub-chain provide a preset number of sub-chain certificates and a corresponding number of public chain certificates through the intelligent contract provided by the public chain to determine the corresponding exchange rate. For example, the child chain provides 1000 child chain credentials, while providing 10 public chain credentials, determining the corresponding redemption rate to be 100: 1, this portion of the initial sublink is to be used as a reserve certificate. In subsequent application, the intelligent contract can be called for many times, and the certificate exchange is completed once every time of calling, so that the corresponding exchange rate can be updated through continuous exchange.
After the certification mortgage is completed, the sub-chain project party confirms the deployed node list, namely the node list consisting of the common chain nodes which are fed back in the voting process and supported by the voting result, and the confirmation is completed in a contract execution mode. After the steps are completed, the sub-chain is successfully connected with the public chain, the chain winding is completed, and the selected node serves as a subsequent sub-chain node to provide corresponding service.
According to the technical scheme, the block chain sub-chain creation method provided by the application can be based on a software architecture of a public chain, reuse a data network of the public chain, share data storage, and quickly establish an own block chain network, namely create a sub-chain network. The subchain creating method can effectively save corresponding investment in implementation and deployment cost and time. In some cases, it can also be used as a way of scheme test and verification to quickly check system schemes, test system capabilities, and verify business requirements.
Based on the block chain sub-chain creation method, the application also provides a block chain sub-chain creation system based on a public chain, which comprises a public chain network with nodes mutually establishing P2P network connection, wherein the public chain network nodes are configured to develop and deploy sub-chain contracts, and part of nodes in the public chain network are configured to develop the sub-chain contracts to form a sub-chain network; the public link network comprises a test network;
the public link network is further configured to perform the following procedural steps: implementing compatibility test on the sub-chain network through a test network in the public chain network; nodes in the public link network feed back voting results according to the voting transactions and generate a sub-link node candidate list according to the voting results; if the fed back voting result meets the preset voting requirement, connecting the nodes in the sub-chain node candidate list with the common link point to finish the chain linking;
the sub-chain network is further configured to perform the following procedural steps: the sub-chain deployment voting transaction is initiated by the sub-chain network completing and passing the compatibility test, by the voting contract of the public chain standard, and is broadcast in the public chain network.
According to the technical scheme, the block chain sub-chain creating method and system based on the public chain are provided, the sub-chain contract can be developed through the public chain node to form the sub-chain network, the voting transaction is initiated in the public chain network after the compatibility test is completed, and then the sub-chain node is in online butt joint with the public chain node according to the voting result to complete the uplink. The method can create a block link sub-chain network with new functions by utilizing the existing public link network, and directly complete the butt joint of the sub-chain and the public link through voting transaction, and the creation speed of the sub-chain is high and the cost is low. The created sub-chain network has the functions of a public chain and a sub-chain at the same time, the functions are mutually independent, free cross-chain transaction can be realized, the expansibility of a new chain is improved, and various service requirements can be met.
The embodiments provided in the present application are only a few examples of the general concept of the present application, and do not limit the scope of the present application. Any other embodiments extended according to the scheme of the present application without inventive efforts will be within the scope of protection of the present application for a person skilled in the art.