parallel chain management method, equipment and storage medium
Technical Field
The present invention relates to the field of block chain technologies, and in particular, to a parallel chain management method, device, and storage medium.
Background
A parallel Chain solution of a block Chain represented by Chain33, based on a main Chain, can build a plurality of parallel sub-chains for different business development, such as: parallel subchains dedicated to gaming, parallel subchains dedicated to traceability, and the like. The processing mode can greatly facilitate the development of block chain services and reduce the technical and application thresholds of the block chain. As long as the main chain is stable, safety guarantee can be provided for the parallel chain, the parallel chain can obtain the consensus safety and authority of the main chain, and the trust of a main chain user can be directly obtained.
The existing parallel subchain is generally developed and managed by a specific service party, parallel subchain nodes are deployed and interact with a main chain, and transaction data of the parallel subchain is stored in the main chain. The existing scheme has the following defects:
1) The parallel sub chains can be set up at will only by connecting the main chain, and the main chain is difficult to count and manage the number of the parallel sub chains.
2) Information such as names of parallel sub-chains is freely applied, who takes the account of who uses the information first, and management is lacked.
3) The node management of the parallel sub-chains is lack of some constraints, and nodes can be randomly built and added into a certain parallel sub-chain unless the parallel sub-chain project side carries out customized development on the common identification of the parallel sub-chains. This may cause some hidden troubles to the stable operation of the parallel subchains. Such as: people build more parallel sub-chain nodes to capture the control right of the parallel sub-chains.
Chinese patent application, publication No.: CN108200210A, publication date: 24/22/2018, a method, apparatus, and computer-readable medium are disclosed for blockchain-based chain management, the method comprising: a first node in a block chain determines that a sub-chain can be created based on a corresponding sub-chain management account book, first transaction information used for creating the sub-chain is broadcasted to at least another node and the first node in the block chain, and when the broadcasted first transaction information is received, the at least another node and the first node determine that the sub-chain can be created based on the corresponding sub-chain management account book; and the first node is configured to be a node of the child chain and to broadcast second transaction information corresponding to the first transaction information to the at least one further node and the first node. In the patent, one node can be added into a plurality of sub-chains simultaneously, and in a main chain, the data isolation boundary is not obvious; the management address of the sub-chain is a first node address, the invention refers to a method for applying for adding the sub-chain by the node, and does not refer to a method for removing a certain node from the sub-chain; the invention does not disclose how to do malicious treatment and node management.
Chinese patent application, publication No.: CN109379429A, publication date: 2019, 2 month and 22 days, a block chain-based multi-chain management method is disclosed, wherein the block chain comprises a main chain and a plurality of sub chains, and the method comprises the following steps: the subchain judges whether a new subchain can be added into a block chain or not; and if the number of the sub chains reaches or exceeds the preset number, the main chain judges that the new sub chain can be added into the block chain, and the new sub chain is added into the block chain to form the sub chain. The invention does not relate to a more refined management of sub-chains.
Disclosure of Invention
1. Technical problem to be solved by the invention
To overcome the above technical problems, the present invention provides a method and system, an apparatus, and a storage medium. The number of parallel chains registered on the main chain can be counted, and parallel chain nodes can be further managed.
2. Technical scheme
In order to solve the problems, the technical scheme provided by the invention is as follows:
In a first aspect, the present invention provides a parallel chain management method, which is applicable to a blockchain node on a main chain, and includes: receiving a transaction sent by a first account address and containing first parallel chain registration application information, wherein the first parallel chain registration application information comprises a first parallel chain name and a first parallel chain registration mortgage amount; judging whether the first parallel chain name is applied or not, if so, failing to register the first parallel chain; if not, judging whether the balance of the first parallel link address in the contract account is enough for the first parallel link registration mortgage amount, and if not, failing to register the first parallel link; if yes, the first parallel chain is successfully registered, and the first account address is set as the first parallel chain management address.
Optionally, comprising: the first parallel chain management address has management authority over a first parallel chain, the management authority comprising: and authorizing and recording the accessed first parallel link node and the access forbidden node.
Optionally, the first parallel chain registration fails, further comprising: the contract records the transaction execution failure containing the first parallel chain registration application information and the failure reason thereof; the first parallel chain registration is successful, further comprising: the contract records the successful execution of the transaction containing the first parallel chain registration application information.
Optionally, a request for querying the transaction execution result containing the first parallel chain registration application information is received, and the transaction execution result containing the first parallel chain registration application information is returned to the querier.
Optionally, the first parallel chain registration is successful, further comprising: saving the first parallel chain name in the contract, saving the first parallel chain management address, and freezing the first parallel chain registration mortgage amount of the first parallel chain address in the contract account.
Optionally, the first parallel chain registration fails, further comprising: freezing the first parallel chain registration mortgage amount of the first parallel chain address in the contract account until the appointed time, and unfreezing, wherein if the transaction sent by the first account address and containing the request of returning the first parallel chain registration mortgage amount is received in the appointed time, the transaction execution fails; if the transaction sent by the first account address and containing the request for returning the first parallel chain registration mortgage amount is received outside the appointed time, the transaction is successfully executed, and the first parallel chain registration mortgage amount is returned to the first account address.
Optionally, receiving a transaction sent by at least one second account address and containing application information registered as a first parallel link node, where the application information registered as the first parallel link node includes a first parallel link node mortgage amount; the contract marks the transaction containing the application information registered as the first parallel link node as a to-be-audited state; the contract or the first parallel chain management address verifies whether the second account address meets the requirement and whether the balance of the second account address in the contract account is enough for the mortgage amount of the first parallel chain node, if one of the second account address and the first parallel chain management address does not meet the requirement, the second account address is applied for registering as the first parallel chain node and fails; if yes, the second account address is applied to register as the first parallel link node successfully.
Optionally, the method further comprises: and counting the name and the total number of the first parallel chain.
optionally, the applying for the registration of the second account address as the first parallel link node fails further includes: the first parallel chain management address initiates a transaction that the second account address cannot be audited to the contract, the transaction is successfully executed, and the contract marks the transaction containing the application information registered as the first parallel chain node as an audit failure state; recording the address of the second account as a non-first parallel link node; the first parallel chain management address initiates a transaction that the second account address is approved to the contract, the transaction is successfully executed, and the contract marks the transaction containing the application information registered as the first parallel chain node as an approved state; and recording the second account address as the first parallel link node.
Optionally, a request for querying the transaction execution result registered as the application information of the first parallel link node is received, and the transaction execution result registered as the application information of the first parallel link node is returned to the querier.
Optionally, comprising: the second account address application is successfully registered as the first parallel link node, and further comprising: saving the second account address, the IP address and freezing the first parallel link node mortgage amount of the second account address in the contract account; and counting the names and the total number of the first parallel link nodes.
optionally, the applying for the registration of the second account address as the first parallel link node fails further includes: freezing the first parallel link node mortgage amount of the second account address in the contract account until the second account address is thawed after the appointed time, and if the transaction which is sent by the second account address and contains the request for returning the first parallel link node mortgage amount is received within the appointed time, the transaction execution fails; if the transaction sent by the second account address and containing the request for returning the first parallel link node mortgage amount is received outside the appointed time, the transaction is successfully executed, and the first parallel link node mortgage amount is returned to the second account address.
Optionally, comprising: receiving information of first parallel chain transaction data on a main chain, checking whether an information sender requesting to acquire the first parallel chain transaction data on the main chain is a first parallel chain management node or a first parallel chain node, and if so, returning the first parallel chain transaction data to the information sender requesting to acquire the first parallel chain transaction data on the main chain; if not, rejecting the test result.
optionally, comprising: if the first parallel link management address is bad, voting whether to change the first parallel link management address or not after evidence confirmation is carried out, and if the voting is passed, the first parallel link registration mortgage amount is penalized and not awarded to the first parallel link node; the first parallel chain management address is then reassigned by voting.
In a second aspect, the present invention provides a parallel chain management method, which is applicable to a blockchain node on a parallel chain, and includes: receiving a transaction which is sent by at least one second account address and contains application information registered as a first parallel link node, wherein the transaction is sent to the main chain to be executed; the contract marks the transaction containing the application information registered as the first parallel link node as a to-be-audited state; the contract or the first parallel chain management address verifies whether the second account address meets the requirement and whether the balance of the second account address in the contract account is enough for the mortgage amount of the first parallel chain node, if one of the second account address and the first parallel chain management address does not meet the requirement, the second account address is applied for registering as the first parallel chain node and fails; if yes, the second account address is applied to register as the first parallel link node successfully.
Optionally, the applying for the registration of the second account address as the first parallel link node fails further includes: the first parallel chain management address initiates a transaction that the second account address cannot be audited to the contract, the transaction is successfully executed, and the contract marks the transaction containing the application information registered as the first parallel chain node as an audit failure state; recording the address of the second account as a non-first parallel link node; the first parallel chain management address initiates a transaction that the second account address is approved to the contract, the transaction is successfully executed, and the contract marks the transaction containing the application information registered as the first parallel chain node as an approved state; and recording the second account address as the first parallel link node.
Optionally, a request for querying the transaction execution result containing the first parallel link node application information is received, and the transaction execution result containing the first parallel link node application information is returned to the querier.
Optionally, comprising: the second account address application is successfully registered as the first parallel link node, and further comprising: saving the second account address, the IP address and freezing the first parallel link node mortgage amount of the second account address in the contract account; and counting the names and the total number of the first parallel link nodes.
Optionally, the applying for the registration of the second account address as the first parallel link node fails further includes: freezing the first parallel link node mortgage amount of the second account address in the contract account until the second account address is thawed after the appointed time, and if the transaction which is sent by the second account address and contains the request for returning the first parallel link node mortgage amount is received within the appointed time, the transaction execution fails; if the transaction sent by the second account address and containing the request for returning the first parallel link node mortgage amount is received outside the appointed time, the transaction is successfully executed, and the first parallel link node mortgage amount is returned to the second account address.
optionally, comprising: if the first parallel link management address is bad, voting whether to change the first parallel link management address or not after evidence confirmation is carried out, and if the voting is passed, the first parallel link registration mortgage amount is penalized and not awarded to the first parallel link node; the first parallel chain management address is then reassigned by voting.
In a third aspect, the present invention provides an apparatus comprising: one or more processors; memory for storing one or more programs that, when executed by the one or more processors, cause the one or more processors to perform a method as described above.
In a fourth aspect, the invention provides a storage medium storing a computer program which, when executed by a processor, performs a method as claimed in any one of the preceding claims.
3. advantageous effects
Compared with the prior art, the technical scheme provided by the invention has the following beneficial effects:
the parallel chain management method has the advantages that a fair, efficient, convenient and safe parallel chain management mode can be provided, application, node registration and management of the parallel chain and parallel chain data acquisition are more convenient and safer, punishment guarantee fairness and safety can be carried out on malicious nodes, and the main chain is enabled to acquire parallel chain information more conveniently.
drawings
Fig. 1 is a flowchart of a parallel chain management method provided in embodiment 1.
fig. 2 is a diagram illustrating contents stored after the first parallel chain registration is successful in embodiment 1.
fig. 3 is a flowchart of a first parallel link node registration method in embodiment 1.
Fig. 4 is a flowchart of a method further performed after the first parallel link node fails to register in embodiment 1.
fig. 5 is a flowchart of a method performed after the first parallel link node is successfully registered in embodiment 1.
Fig. 6 is a diagram illustrating contents stored after the first parallel link node is successfully registered in embodiment 1.
Fig. 7 is a flowchart of a parallel chain management method applied to nodes on a parallel chain in embodiment 2.
FIG. 8 is a schematic diagram of an apparatus according to the present invention.
Detailed Description
For a further understanding of the present invention, reference will now be made in detail to the embodiments illustrated in the drawings.
The present application will be described in further detail with reference to the following drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the relevant invention and not restrictive of the invention. It should be noted that, for convenience of description, only the portions related to the present invention are shown in the drawings.
The terms first, second, and the like in the present invention are provided for convenience of describing the technical solution of the present invention, and have no specific limiting effect, but are all generic terms, and do not limit the technical solution of the present invention.
It should be noted that the embodiments and features of the embodiments in the present application may be combined with each other without conflict. The present application will be described in detail below with reference to the embodiments with reference to the attached drawings.
The first parallel chain registration application information, the exit request of the first parallel chain node, the voting of the first parallel chain management address, the request for acquiring data from the main chain and the like are triggered to be executed through transactions. The data information of the execution result is stored in the block chain account data, such as the registered node information, the name information of the applied parallel chain, and the like.
Example 1
the embodiment provides a parallel chain management method, which is applicable to a block chain node on a main chain, as shown in fig. 1, and includes:
S101, receiving a transaction which is sent by a first account address and contains first parallel chain registration application information, wherein the first parallel chain registration application information comprises a first parallel chain name and a first parallel chain registration mortgage amount;
S102, judging whether the name of the first parallel chain is applied or not, if so, failing to register the first parallel chain;
if not, S103, judging whether the balance of the first parallel link address in the contract account is enough for the first parallel link registration mortgage, if not, the first parallel link registration fails; if yes, the first parallel chain is successfully registered, and the first account address is set as the first parallel chain management address.
When the first account address sends a transaction containing first parallel chain registration application information to a contract address on the main chain, a certain number of tokens are sent to offset the first parallel chain registration mortgage amount; if the number of tokens sent is greater than the first parallel chain registration mortgage amount, the first parallel chain may be successfully registered on the premise that the first parallel chain name is not applied.
Further, the first parallel chain management address has management authority over the first parallel chain, the management authority including: and authorizing and recording the accessed first parallel link node and the access forbidden node.
The first parallel chain registration failure further comprises: the contract records the transaction execution failure containing the first parallel chain registration application information and the failure reason thereof;
the first parallel chain registration is successful, further comprising: the contract records the successful execution of the transaction containing the first parallel chain registration application information.
further, receiving a request for inquiring the transaction execution result containing the first parallel chain registration application information, and returning the transaction execution result containing the first parallel chain registration application information to the inquirer. Whether the first account address successfully applies for registering to the state of the first parallel chain is obtained through inquiry.
Further, the successful registration of the first parallel chain, as shown in fig. 2, further includes: saving the first parallel chain name in the contract, saving the first parallel chain management address, and freezing the first parallel chain registration mortgage amount of the first parallel chain address in the contract account. Further comprising: and counting the names and the total number of the first parallel chains, so that the latest parallel chain list can be counted conveniently.
Further, the failure of the first parallel chain registration further includes: freezing the first parallel chain registration mortgage amount of the first parallel chain address in the contract account until the appointed time, and unfreezing, wherein if the transaction sent by the first account address and containing the request of returning the first parallel chain registration mortgage amount is received in the appointed time, the transaction execution fails; if the transaction sent by the first account address and containing the request for returning the first parallel chain registration mortgage amount is received outside the appointed time, the transaction is successfully executed, and the first parallel chain registration mortgage amount is returned to the first account address. The agreed time is a defined time range, such as a number of defined block times. At the beginning of the contract setting, a certain value is set.
As shown in fig. 3, the method for applying for registration of a first parallel link node includes:
S401, receiving a transaction which is sent by at least one second account address and contains application information registered as a first parallel chain node, wherein the application information registered as the first parallel chain node comprises a first parallel chain node mortgage amount; the contract marks the transaction containing the application information registered as the first parallel link node as a to-be-audited state;
S402, the contract or the first parallel chain management address verifies whether the second account address meets the requirement and whether the balance of the second account address in the contract account is enough for the mortgage amount of the first parallel chain node, if one of the second account address and the first parallel chain management address does not meet the requirement, the second account address is applied for registering as the first parallel chain node failure; if yes, the second account address is applied to register as the first parallel link node successfully.
And if the audit is passed, recording the second account address application state as pass of the check in the contract. And when the first parallel link management address confirms that the relevant information of the second account address is correct, the first parallel link management address initiates a transaction which is approved by the second account address to the contract, the transaction is successfully executed, and the first parallel link management address records the second account address as a legal first parallel link node in the contract.
If the first parallel chain management address considers that the information is not correct, or the second account address is not allowed to be the first parallel chain node, a transaction that the second account address is not approved is initiated to the contract, the transaction is executed successfully, the second account address is recorded in the contract as a non-first parallel chain node, and the token of the mortgage amount of the second account address is returned to the second account.
The content of the contract or the first parallel chain management address audit further includes auditing whether the IP address where the second account address is located meets the requirement, whether the number of the second parallel chain nodes exceeds the limit, the hardware device condition of the node where the second account address is located, and the like, including but not limited to the condition that the first parallel chain management address is manually set after the first parallel chain management authority is obtained.
The contract auditing content can be whether the number of the second parallel link nodes exceeds the limit, whether the balance of the second account address in the contract account is enough for the first parallel link node mortgage amount, and the like. Except the content of contract auditing, the rest of the contract auditing method is auditing by the first parallel chain management address, and online auditing and offline auditing can be realized. Specifically, the content of the contract audit and the content of the first parallel chain management address audit are set differently according to different application scenarios, and are not limited by the application.
Wherein the second account address application fails to register as the first parallel link node, as shown in fig. 4, further comprising: the first parallel chain management address initiates a transaction that the second account address is not approved to the contract, the transaction also comprises the reason of the non-approval, and when the state of the non-approval is inquired, the transaction is used for feeding back to the corresponding account address; the transaction execution is successful, and the contract marks the transaction containing the application information registered as the first parallel link node as an auditing failure state; recording the address of the second account as a non-first parallel link node;
Freezing the first parallel link node mortgage amount of the second account address in the contract account until the second account address is thawed after the appointed time, and if the transaction which is sent by the second account address and contains the request for returning the first parallel link node mortgage amount is received within the appointed time, the transaction execution fails; if the transaction sent by the second account address and containing the request for returning the first parallel link node mortgage amount is received outside the appointed time, the transaction is successfully executed, and the first parallel link node mortgage amount is returned to the second account address.
The second account address application is successfully registered as the first parallel link node, as shown in fig. 5, the registering of the second account address application as the first parallel link node is successful further includes: the first parallel chain management address initiates a transaction that the second account address is approved to the contract, the transaction is successfully executed, and the contract marks the transaction containing the application information registered as the first parallel chain node as an approved state; and recording the second account address as the first parallel link node.
The second account address application is successfully registered as the first parallel link node, as shown in fig. 6, further includes: saving the second account address, the IP address and freezing the first parallel link node mortgage amount of the second account address in the contract account; and counting the names and the total number of the first parallel link nodes.
Further, receiving a request for inquiring the transaction execution result registered as the application information of the first parallel link node, and returning the transaction execution result registered as the application information of the first parallel link node to the inquirer.
as can be seen from the above, after the second account address application fails to register as the first parallel-link node, the first parallel-link node mortgage amount is frozen within a predetermined time (a freezing period, the beginning of the setting of the method, a set response time, which may be a time of several block heights, or a specific time such as minutes or hours, or in short, a certain time), and then can be thawed. Therefore, when the second account address sends the transaction containing the request for returning the first parallel link node mortgage amount to the block chain node on the main chain, if the first parallel link node mortgage amount passes the freezing period, the transaction for returning the first parallel link node mortgage amount is sent to the second account address.
for another situation that requires to refund the mortgage of the first parallel link node, although the second account address has successfully become the first parallel link node, the second account address is due to some reason, such as a consideration of self load pressure (it should be noted that the reason is not a limiting condition of the present invention), and requests to quit as the first parallel link node, and after the operator of the second account address decides, the following steps are performed:
the second account address sends a transaction containing application information for quitting as the first parallel link node to the main chain node; after the main chain node receives the information, the first parallel chain management address checks the state of the second account address, for example, whether malicious behaviors exist or not, whether illegal transaction behaviors exist or not and the like, and if not, the check is passed; the first parallel chain management address sends the approved transaction to the main chain, records that the second account address is no longer the first parallel chain node, and freezes the corresponding first parallel chain node mortgage amount within the appointed time range (freezing period); after the above process is completed, the second account address sends a transaction including a request for returning the first parallel link node mortgage amount to the main chain node, the first parallel link management address audits the transaction, for example, the audit already records that the second account address is no longer the first parallel link node, if the audit passes, the first parallel link node mortgage amount is unfrozen in another appointed time (the initial setting of the method, the set response time may be several block height time, or specific time such as how many minutes or hours, or the like, in short, in a certain time), and the node on the main chain sends the transaction including returning the first parallel link node mortgage amount to the second account address through the contract account address.
Further, receiving information requesting to acquire first parallel chain transaction data on a main chain, checking whether an information sending party requesting to acquire the first parallel chain transaction data on the main chain is a first parallel chain management node or a first parallel chain node, and if so, returning the first parallel chain transaction data to the information sending party requesting to acquire the first parallel chain transaction data on the main chain; if not, rejecting the test result.
therefore, the transaction data among the parallel chains can not be shared in a cross mode, the relative isolation and the safety of the transaction data of the parallel chains are ensured, the relative confidentiality among the transaction data of the parallel chains is formed, and the situation that the transaction data of the parallel chain is sent to nodes which are not the parallel chain nodes can not occur. The method can be applied to the conditions of supply chain relation and the like between enterprises.
Further, if the first parallel chain management address is bad, whether the first parallel chain management address is replaced is voted after evidence confirmation is carried out, and if the vote is passed, the first parallel chain registration mortgage amount is punished and not awarded to the first parallel chain node; the first parallel chain management address is then reassigned by voting.
The method is used for the first parallel chain management address to make a penalty condition after the penalty condition is done so as to ensure that the first parallel chain runs fairly and fairly.
Taking an example that a certain node a on the public Chain33 applies for a parallel Chain a, the technical solution of the embodiment is explained.
If the account address A sends the registration application information of the parallel Chain A to the public Chain Chan 33 in the form of a transaction, the registration application information of the parallel Chain A comprises the name of the parallel Chain A: play forever, registration mortgage amount of parallel chain A: 5000 digital currency, or points, etc.
After a plurality of nodes on the public Chain33 receive the registration application information of the parallel Chain A, judging the name of the parallel Chain A: if the registration mortgage amount of the parallel Chain A meets the requirement, if the mortgage amount of the parallel Chain A required to be registered on the public Chain Chain33 is equal to or lower than 5000, the parallel Chain A successfully applies for registration, if the mortgage amount of the parallel Chain required to be registered on the Chain Chain33 is larger than 5000, the parallel Chain A fails to register, meanwhile, the parallel Chain A fails to register, and the reason of the failure, namely the insufficient registration mortgage amount of the parallel Chain A, is sent to the account address A, and a prompt of re-registering the application after the registration mortgage amount of the parallel Chain A is increased is sent.
if the name of parallel chain A: play forever has been registered as a parallel Chain on Chain33, then parallel Chain A registration fails, and at the same time, the account address A is sent that parallel Chain A registration fails and the reason for the failure, namely the name of parallel Chain A is registered, and a prompt is sent to re-register the application after modifying the name of parallel Chain A.
if the parallel chain A is successfully registered, the name, the registration mortgage amount and the account address A of the parallel chain A are saved, and the account address A is used as a management address of the parallel chain A for managing the parallel chain A, wherein the management authority includes but is not limited to: and authorizing and recording the management authority of the accessed first parallel link node, the access forbidden node and the like. After the storage, the number and the name of the registered parallel Chain on the public Chain33 can be counted, the parallel Chain with the same name is prevented from being repeatedly registered, and the registration of the parallel Chain is convenient to manage.
If the management address of the parallel chain A, namely the account address A, is bad, evidence confirmation and voting are carried out, and if the voting passes, the registration mortgage amount of the parallel chain A is punished and not distributed to other parallel chain A nodes; the management address of the parallel chain a is reassigned by voting.
When a node B on a parallel Chain A requests to acquire data from a public Chain Chan 33, a node on the public Chain Chan 33 receives information of the main Chain data requested to be acquired, which is sent by the node B on the parallel Chain A; meanwhile, account address information containing the node B is sent to a first parallel chain management address, namely an account address A, for auditing; the account address A checks whether the node B is legal or not, namely whether the node B is a node on the parallel chain A or not, and if the node B is a node on the parallel chain A, corresponding data are sent to the first parallel chain node. When the parallel chain A is a private chain in a certain unit, the data is ensured not to be transmitted outwards through the limitation.
example 2
The embodiment further provides a parallel chain management method, which is applicable to nodes on a parallel chain, as shown in fig. 7, and includes:
S601, receiving a transaction which is sent by at least one second account address and contains application information registered as a first parallel chain node, and sending the transaction to a main chain for execution; the contract marks the transaction containing the application information registered as the first parallel link node as a to-be-audited state;
S602, the contract or the first parallel chain management address verifies whether the second account address meets the requirement and whether the balance of the second account address in the contract account is enough for the mortgage amount of the first parallel chain node, if one of the second account address and the first parallel chain management address does not meet the requirement, the second account address is applied for registering as the first parallel chain node failure; if yes, the second account address is applied to register as the first parallel link node successfully.
The second account address application for registering as a failure of the first parallel link node further comprises: the first parallel chain management address initiates a transaction that the second account address is not approved to the contract, the transaction also comprises the reason of not approved, the transaction is successfully executed, and the contract marks the transaction containing the application information registered as the first parallel chain node as an approval failure state; recording the address of the second account as a non-first parallel link node; and when later inquiry is facilitated, the audit state, the registration failure state and the failure reason thereof are provided.
The second account address application is successfully registered as the first parallel link node, and further comprising: the first parallel chain management address initiates a transaction that the second account address is approved to the contract, the transaction is successfully executed, and the contract marks the transaction containing the application information registered as the first parallel chain node as an approved state; and recording the second account address as the first parallel link node.
And receiving a request for inquiring the transaction execution result containing the first parallel link node application information, and returning the transaction execution result containing the first parallel link node application information to an inquirer.
And the transaction execution result comprises successful transaction execution, namely the second account address application is successfully registered as the first parallel link node, and the second account address is approved.
And the transaction execution fails, namely the second account address is applied for registering as the first parallel link node fails, the second account address is not checked, and the failure reason is returned to the second account address, so that the second account address can be adjusted according to the failure reason and is applied again.
Freezing the first parallel link node mortgage amount of the second account address in the contract account until the second account address is thawed after the appointed time, and if the transaction which is sent by the second account address and contains the request for returning the first parallel link node mortgage amount is received within the appointed time, the transaction execution fails; if the transaction sent by the second account address and containing the request for returning the first parallel link node mortgage amount is received outside the appointed time, the transaction is successfully executed, and the first parallel link node mortgage amount is returned to the second account address.
The second account address application is successfully registered as the first parallel link node, and further comprising: saving the second account address, the IP address, and the first parallel link node mortgage amount of the frozen second account address in the contract account; and counting the names and the total number of the first parallel link nodes.
If the first parallel link management address is bad, voting whether to change the first parallel link management address or not after evidence confirmation is carried out, and if the voting is passed, the first parallel link registration mortgage amount is penalized and not awarded to the first parallel link node; the first parallel chain management address is then reassigned by voting.
a plurality of parallel chains are distributed on the public Chain33, the management address of the parallel Chain A is an account address A, a node B is to be added into the parallel Chain A to become a node on the parallel Chain A, and a transaction is sent to include a collateral amount of the node of the parallel Chain A, which is recorded as virtual assets such as 5000 digital currency or points and the like; whether the account address, the IP address and the mortgage amount of the node B of the parallel Chain A meet the requirements or not is checked, for example, the set mortgage amount of the node B of the parallel Chain A is 4000, the mortgage amount of the node A of the parallel Chain meets the requirements, and the checking requirements on the account address and the IP address of the node B can be not nodes on other parallel chains and not nodes on a main Chain33, and the checking requirements have the premise that a management address, namely the account address A, of the parallel Chain A can be obtained or a node list on other parallel chains or a node list on the main Chain33 is saved, so that checking and judgment are facilitated.
If the audit is not passed, the node B cannot become a node of the parallel chain a, and a message including a failure cause is sent to the account address of the node B.
After the verification is passed, the node B becomes a node of the parallel chain A, and simultaneously, the account address and the mortgage amount of the node B are recorded in a node list of the parallel chain A, so that the number of the nodes on the parallel chain A can be counted.
If node B is bad, evidence confirmation and voting are carried out, and if the voting is passed, the corresponding node B mortgage amount is penalized.
when the node B wants to acquire data from the main Chain Chan 33, the node B sends a transaction to the parallel Chain A and receives a message which is sent by the node B and requests to acquire the main Chain Chan 33 data; and checking whether the node B is legal, and if so, sending a message that the corresponding node B is legal to a main Chain33 node. Meanwhile, the node on the main Chain33 sends corresponding data to the node B of the parallel Chain a.
In some cases, node B may quit as a node of parallel chain a, and then node B sends a transaction to parallel chain a, and parallel chain a receives the application information sent by node B as the first parallel chain node, and the application information of quit as parallel chain a includes a request to refund the parallel chain a mortgage amount; and checking whether the account address of the node B is legal or not, if so, deleting the account address of the node B from the node list of the parallel chain A, and returning the mortgage amount of the node B to the account address of the node B.
Example 3
Intelligent contracts X are laid out on the public Chain33, providing logical implementation and interface for parallel Chain registration and management. The public Chain33 is used as a main Chain, and can register a plurality of parallel chains through the intelligent contract X to acquire the names and management rights of the parallel chains, and a registrant is required to mortgage the tokens. The main chain can know the data information such as the number of parallel subchains, nodes and the like in the current system through the intelligent contract X, and the parallel chain number statistics is convenient to carry out.
The parallel chain adopts a mode of registering to the intelligent contract X, who registers a certain parallel sub-chain name firstly and has g the management right of the parallel chain, and the account address of a registration party is used as the management address of the parallel chain. When registering parallel chains, the parallel chain management address needs to collate certain tokens, such as: 10000 tokens in the main chain are mortared to avoid the behavior of robbing the name resource of the sub-chain without cost.
When registering a parallel chain name S, if the name is applied for, the registration fails, otherwise, the registration succeeds, and the registered account address has a management authority for the parallel chain, including but not limited to: the administrative authority of the authorized access node, the forbidden access node and the like can be set according to the specific application requirements.
The node address B, when registered as a node of the parallel chain S, also needs to be secured with certain tokens, such as: the main chain tokens are mortgaged for 5000 tokens to avoid the behavior of capturing the control right of the parallel chain S without cost.
When the node address B registers to the management address A, the node address B comprises necessary information such as a public key and an ip address of the node address B; the management address A confirms that the node has no problem, authorization is passed, and the node address B is added into a parallel chain managed by the management address A. If node B needs to exit the parallel chain child for some reason, a may remove node B from the legitimate node list by an intelligent contract.
When the main chain issues data to the parallel chain nodes, the validity of the public key and the address of the node B is checked, and the node authorized by a certain parallel chain management address can obtain the data corresponding to the parallel chain.
The parallel chain can pull data to the main chain, the main chain judges whether the transaction data is the transaction data of the parallel chain, if yes, the transaction data is allowed, and if not, the transaction data is filtered. The parallel chain only concerns its own transaction data and not the data of other chains or the main chain data.
The public key and the IP address of the parallel chain node passing the authorization are recorded in the intelligent contract, and if the public key and the IP of a certain node are not recorded and authorized in the intelligent contract, the main chain node refuses the node to obtain the transaction data of the parallel chain.
A neutral multi-party management arbitration committee can be established to enhance the intelligent contract X, and when some parallel chain nodes are malignant, tokens which are not mortgage for the malignant nodes can be penalized after arbitration voting. This way, the occurrence of malicious behavior by the node can be further reduced.
The main chain can know the number of parallel sub-chains, nodes and other data information in the current system through the intelligent contract X.
Parallel link point deletion: the parallel chain management address deletes a certain parallel chain node address from the parallel chain legal node. Multiparty signature penalty is not done as a malicious node mortgage: if a certain parallel subchain node is reported as dislike, setting addresses of a plurality of neutral arbitration mechanisms in the intelligent contract, confirming evidence and voting, if most votes pass, the mortgage money of the dislike node is penalized and not rewarded to other parallel subchain nodes, and the dislike node is deleted from a specific parallel subchain; if the parallel chain manager does bad, the addresses of a plurality of neutral arbitration mechanisms in the intelligent contract are set, evidence confirmation and voting are carried out, and if the majority of votes pass, the mortgage money of the management node is not rewarded to other parallel chain nodes.
Example 4
An apparatus, the apparatus comprising: one or more processors; memory for storing one or more programs that, when executed by the one or more processors, cause the one or more processors to perform a method as described above.
a storage medium storing a computer program which, when executed by a processor, implements the method as described in the above embodiments.
Fig. 8 is a schematic structural diagram of an apparatus according to an embodiment of the present invention.
As shown in fig. 8, as another aspect, the present application also provides an apparatus 500 including one or more Central Processing Units (CPUs) 501 that can perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM)502 or a program loaded from a storage section 508 into a Random Access Memory (RAM) 503. In the RAM503, various programs and data necessary for the operation of the apparatus 500 are also stored. The CPU501, ROM502, and RAM503 are connected to each other via a bus 504. An input/output (I/O) interface 505 is also connected to bus 504.
The following components are connected to the I/O interface 505: an input portion 506 including a keyboard, a mouse, and the like; an output portion 507 including a display such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, and a speaker; a storage portion 508 including a hard disk and the like; and a communication section 509 including a network interface card such as a LAN card, a modem, or the like. The communication section 509 performs communication processing via a network such as the internet. The driver 510 is also connected to the I/O interface 505 as necessary. A removable medium 511 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 510 as necessary, so that a computer program read out therefrom is mounted into the storage section 508 as necessary.
In particular, according to embodiments disclosed herein, the method described in any of the above embodiments may be implemented as a computer software program. For example, embodiments disclosed herein include a computer program product comprising a computer program tangibly embodied on a machine-readable medium, the computer program comprising program code for performing the method described in any of the embodiments above. In such an embodiment, the computer program may be downloaded and installed from a network through the communication section 509, and/or installed from the removable medium 511.
as yet another aspect, the present application also provides a computer-readable storage medium, which may be the computer-readable storage medium included in the apparatus of the above-described embodiment; or it may be a separate computer readable storage medium not incorporated into the device. The computer readable storage medium stores one or more programs for use by one or more processors in performing the methods described herein.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units or modules described in the embodiments of the present application may be implemented by software or hardware. The described units or modules may also be provided in a processor, for example, each of the described units may be a software program provided in a computer or a mobile intelligent device, or may be a separately configured hardware device. Wherein the designation of a unit or module does not in some way constitute a limitation of the unit or module itself.
The above description is only a preferred embodiment of the application and is illustrative of the principles of the technology employed. It will be appreciated by those skilled in the art that the scope of the invention herein disclosed is not limited to the particular combination of features described above, but also encompasses other arrangements formed by any combination of the above features or their equivalents without departing from the spirit of the present application. For example, the above features may be replaced with (but not limited to) features having similar functions disclosed in the present application.