A governance method and device for cross-chain service contracts and a medium
By using the application chain administrator voting mechanism to review cross-chain business contract registration applications, the network congestion and security risks caused by the relay chain managing a large number of contracts are resolved, thus achieving efficient governance of the cross-chain system.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-07-20
- Publication Date
- 2026-04-10
AI Technical Summary
The relay chain needs to manage a large number of cross-chain business contracts, which leads to congestion and inefficiency in cross-chain network governance, and the relay chain's complete trust in the application chain may cause security risks.
After receiving a registration application for a cross-chain business contract, the application chain determines the registration result through administrator voting, and sends the registration information to the relay chain after successful registration, thereby realizing multi-party supervision and management of cross-chain business contracts.
It reduces the governance burden of the relay chain, reduces the risks of cross-chain contract services, improves the efficiency of the cross-chain system, and avoids governance congestion.
Smart Images

Figure CN115310973B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application belongs to the technical field of blockchains, and particularly relates to a governance method and device for cross-chain business contracts and a medium. BACKGROUND
[0002] A relay chain can provide cross-chain services for application chains registered to the relay chain. In order to meet different cross-chain requirements, an application chain needs to deploy multiple cross-chain business contracts. Cross-chain transactions need to call between contract services of cross-chain application chains, and therefore, the relay chain needs to manage cross-chain business contracts when providing cross-chain services for the application chains.
[0003] Since each application chain includes multiple cross-chain business contracts and multiple application chains can be registered to the relay chain, the relay chain needs to manage a large number of cross-chain business contracts. When governing a large number of cross-chain business contracts, the relay chain needs to undertake a large amount of tasks, which can easily cause governance congestion of the cross-chain network and low efficiency of the cross-chain network in providing cross-chain services.
[0004] In addition, after an application chain is successfully registered on the relay chain, the application chain can obtain cross-chain permissions. After the application chain obtains the cross-chain permissions, cross-chain business contracts on the application chain can also obtain the cross-chain permissions. The full trust of the relay chain in the cross-chain business contracts on the application chain can easily cause security risks. SUMMARY
[0005] Therefore, the embodiments of the application provide a governance method, device and medium for cross-chain business contracts to reduce the governance burden of the relay chain on the cross-chain business contracts.
[0006] A first aspect of the embodiments of the application provides a governance method for cross-chain business contracts, applied to an application chain, and the method comprises the following steps.
[0007] Receiving a registration application initiated by a first cross-chain business contract, the registration application being used for the first cross-chain business contract to initiate registration to a first relay chain where the application chain is located;
[0008] Sending the registration application to an administrator on the application chain to obtain a voting result of the administrator for the registration application;
[0009] Determining an application result of the registration application according to the voting result;
[0010] If the application result is registration success, sending registration information of the first cross-chain business contract to the first relay chain to register the first cross-chain business contract to the first relay chain.
[0011] A second aspect of the embodiment of the application provides a governance device of a cross-chain service contract, applied to an application chain, and the device comprises:
[0012] The receiving module is configured to receive a registration application initiated by a first cross-chain service contract, the registration application being used for the first cross-chain service contract to initiate registration to a first relay chain where the application chain is located;
[0013] The first sending module is configured to send the registration application to an administrator on the application chain to obtain a voting result of the administrator for the registration application;
[0014] The determining module is configured to determine an application result of the registration application according to the voting result;
[0015] The second sending module is configured to, if the application result is registration success, send registration information of the first cross-chain service contract to the first relay chain to register the first cross-chain service contract to the first relay chain.
[0016] A third aspect of the embodiment of the application provides a computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, and the processor implements the method of the first aspect when executing the computer program.
[0017] A fourth aspect of the embodiment of the application provides a computer readable storage medium, which stores a computer program, and the computer program is executed by a processor to implement the method of the first aspect.
[0018] A fifth aspect of the embodiment of the application provides a computer program product, which, when executed on a computer device, causes the computer device to execute the method of the first aspect.
[0019] Compared with the prior art, the embodiment of the application has the following advantages:
[0020] In the embodiment of the present application, when the cross-chain service contract needs to be registered in the relay chain, the cross-chain service contract first needs to send a registration application to the application chain. After receiving the registration application of the cross-chain service contract, the application chain can send the registration application to each administrator on the application chain, and then determine the registration result of the registration application submitted by the cross-chain service contract according to the voting results of each administrator. If the registration result determined according to the voting result is registration success, the application chain can submit the registration information of the cross-chain service contract to the relay chain to register the cross-chain service contract on the relay chain. In this embodiment, the cross-chain service contract needs to be audited by the application chain before being registered in the relay chain. After the application chain audit is passed, the cross-chain service contract can be registered on the relay chain. Based on the audit of the application chain, the cross-chain service contract registered on the relay chain can be supervised and managed by multiple parties, thereby reducing the risk of cross-chain contract service running on the relay chain. In addition, the cross-chain service contract can be audited and managed by the application chain, which can significantly reduce the workload of the relay chain administrator in directly governing and auditing the cross-chain service contract, thereby improving the efficiency of the cross-chain system and avoiding the problem of governance congestion. BRIEF DESCRIPTION OF DRAWINGS
[0021] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following will briefly introduce the drawings needed to be used in the embodiments or prior art description. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can also be obtained by those skilled in the art without creative labor.
[0022] Figure 1 is a step flow diagram of a cross-chain service contract management method provided by an embodiment of the present application;
[0023] Figure 2 is a schematic diagram of a cross-chain system provided by an embodiment of the present application;
[0024] Figure 3 is a step flow diagram of another cross-chain service contract management method provided by an embodiment of the present application;
[0025] Figure 4 is a flow diagram of a cross-chain service contract call provided by an embodiment of the present application;
[0026] Figure 5 is a schematic diagram of a cross-chain service contract management device provided by an embodiment of the present application;
[0027] Figure 6 is a schematic diagram of a computer device provided by an embodiment of the present application. DETAILED DESCRIPTION
[0028] In the following description, for purposes of explanation and not limitation, specific details are set forth such as particular architectures, technologies, techniques, etc. in order to provide a thorough understanding of the embodiments of the present application. However, it will be apparent to those skilled in the art that the present application can be practiced in other embodiments that depart from these specific details. In other instances, detailed descriptions of well-known systems, devices, circuits, and methods are omitted so as not to obscure the description of the present application with unnecessary detail.
[0029] It is to be understood that the terminology "includes", "has", "holds", "contains" and / or "comprising", "including", "having" and their conjugates, as used herein, means "including but not limited to", and not to the exclusion of any other term or aspect.
[0030] It is also to be understood that the terminology "and / or" as used herein refers to and encompasses any and all possible combinations of one or more of the associated listed items, as well as the lack of any associated listed items.
[0031] As used in the description of the application and the appended claims, the term "if" can be interpreted to mean "when" or "upon" or "in response to determining" or "in response to detecting" depending on the context. Similarly, the phrase "if it is determined" or "if [a described condition or event] is detected" can be interpreted to mean "upon determining" or "in response to determining" or "upon [the described condition or event] being detected" or "in response to [the described condition or event] being detected", depending on the context.
[0032] In addition, the description in the specification of the application and the appended claims, the terms "first", "second", "third", etc. are merely used for distinguishing between similar underlying features, and do not constitute any relative importance.
[0033] The description in the specification of the application uses "one embodiment", "an embodiment", or "some embodiments" to mean that a particular feature, structure, or characteristic described in connection with the embodiment is included in at least one embodiment of the application. The appearance of the phrases "in one embodiment", "in an embodiment", "in some embodiments" or "in other embodiments" in various places in the specification are not necessarily all referring to the same embodiment, although it can be. Furthermore, the terms "comprises", "comprising", "has", "having", "includes", "including", "contains", "containing" or variations thereof are intended to mean "including but not limited to", unless expressly specified otherwise.
[0034] The technical solutions of the present application are described below through specific embodiments.
[0035] Reference is made to Figure 1, a schematic diagram of a step flow of a governance method of a cross-chain service contract provided in an embodiment of the present application is shown, which can specifically include the following steps:
[0036] In S101, a registration application initiated by a first cross-chain service contract is received, and the registration application is used for the first cross-chain service contract to initiate registration to a first relay chain where the application chain is located.
[0037] The execution subject of the embodiment is an application chain. The application chain can be in a cross-chain network, and the application chain can be registered in a relay chain to obtain cross-chain permission in the cross-chain network. In a possible implementation manner, the application chain can be registered in different relay chains to obtain cross-chain permission in multiple different cross-chain networks. Multiple cross-chain service contracts can be deployed on the application chain to process different cross-chain services. For example, to process cross-chain data exchange services, the application chain can deploy a cross-chain data exchange contract; to process cross-chain transfer services, the application chain can deploy a cross-chain transfer contract.
[0038] Figure 2 A schematic diagram of a cross-chain system to which the method in the present application is applied is shown. As shown in Figure 2 The first relay chain and the second relay chain can provide cross-chain services for different cross-chain networks, respectively. In the present application, an application chain can be registered in a relay chain, for example, the second application chain can be registered in the first relay chain, and the fourth application chain can be registered in the second relay chain. The application chain can also be registered in multiple relay chains, for example, the first application chain can be registered in the first relay chain and the second relay chain at the same time; the third application chain can be registered in the first relay chain and the second relay chain at the same time. The application chain can deploy a cross-chain service contract, for example, the first cross-chain service contract and the second cross-chain service contract can be deployed in the first application chain; the third cross-chain service contract can be deployed in the second application chain; the fourth cross-chain service contract can be deployed in the third application chain; and the fifth cross-chain service contract can be deployed in the fourth application chain.
[0039] The cross-chain service contract can process cross-chain services by initiating a cross-chain transaction; the cross-chain transaction needs to be executed by a cross-chain service contract on another application chain. Cross-chain service contracts registered in the same relay chain can cooperatively process cross-chain transactions. Therefore, the cross-chain service contract needs to be registered in the relay chain.
[0040] The first cross-chain service contract described above can be a cross-chain service contract deployed on an application chain. The first relay chain described above can be a relay chain where the application chain is registered. The process of registering the first cross-chain service contract in the first relay chain is used to describe the governance method of the cross-chain service contract in the present application.
[0041] The first cross-chain service contract can submit a registration application to the application chain, and the registration application can include information of the first cross-chain service contract, for example, initiator of the first cross-chain service contract, verification signature of the first cross-chain service contract, and service information processed by the first cross-chain service contract, etc. After receiving the registration application, the application chain can perform audit governance.
[0042] In a possible implementation, a cross-chain management contract broker can be deployed on the application chain, and the cross-chain management contract can be used to govern the cross-chain service contract. The governance of the cross-chain management contract can include registration, freezing, and cross-chain permission change of the cross-chain management contract. When the cross-chain management contract freezes the cross-chain service contract, the cross-chain service contract cannot provide contract services on the relay chain. The cross-chain management contract can manage the cross-chain service contract based on voting behaviors of multiple administrators on the application chain.
[0043] S102, send the registration application to the administrator on the application chain to obtain the voting result of the administrator for the registration application.
[0044] The application chain can include multiple administrators, and each administrator can have a corresponding node address, id, or role. The administrators can manage transactions on the application chain through voting. The application chain can include an address list of the administrators, and when a new administrator is added, the application chain can fill the address of the new administrator into the address list; when an administrator is logged out, the application chain can delete the address of the logged-out administrator from the address list.
[0045] When the application chain receives the registration application sent by the first cross-chain service contract, the application chain can obtain the address list corresponding to the multiple administrators; according to the address list, the application chain can send the registration application to each administrator respectively; each administrator can vote on the registration application after receiving the registration application, and return the voting result to the application chain; then the application chain can receive the voting result returned by each administrator for the registration application.
[0046] The above address list can be changed according to the added administrators and the logged-out administrators. When it is necessary to change the administrators, an administrator change application can be sent to the application chain; when the application chain receives the administrator change application, the application chain can obtain the current address list; then the application chain can send the administrator change application to each administrator according to the current address list; each administrator can vote on the administrator change application according to the application content after receiving the administrator change application, and then obtain the administrator change voting result, and return the administrator voting result to the application chain. The application chain receives the administrator change voting result returned by each administrator for the administrator change application; then the application chain can update the address list according to the administrator change application and the administrator change voting result. The administrator change application includes address information of the administrator to be changed.
[0047] In a possible implementation, the address list of the administrators in the application chain can be managed by the cross-chain management contract, and the addresses of the administrators can be added or modified.
[0048] S103, determining an application result of the registration application according to the voting result.
[0049] The voting rule can be preset in the application chain, for example, the voting rule can specify that the number of votes needs to exceed four-fifths of the total number of administrators in order to be valid, and the number of votes in favor of registration needs to exceed two-thirds of the number of administrators in order to pass the registration application.
[0050] The application chain can obtain the number of administrators participating in the voting, and if the number of administrators participating in the voting is less than a first preset value, it is determined that the application result is registration failure, if the number of administrators participating in the voting is greater than or equal to the first preset value, the ratio of the number of votes in favor of registration to the number of administrators participating in the voting is calculated, and if the ratio is greater than a second preset value, it is determined that the application result is registration success.
[0051] S104, if the application result is registration success, sending the registration information of the first cross-chain business contract to the first relay chain to register the first cross-chain business contract in the first relay chain.
[0052] When the application result is registration success, it means that the registration application of the first cross-chain business contract has been supported by multiple administrators, and at this time, the first cross-chain business contract can be registered on the first relay chain.
[0053] In a possible implementation, the application chain includes multiple nodes, each node can correspond to an administrator, and the registration application of the cross-chain business contract can be submitted to one of the nodes; the node can synchronize the registration application to each node of the application chain, and receive the vote of each node on the registration application, so as to determine whether to register the cross-chain contract on the relay chain.
[0054] In one possible implementation, after a cross-chain business contract is registered with a relay chain, it can provide cross-chain services to the cross-chain network where the relay chain resides. The application chain can receive a first cross-chain transaction submitted by a first cross-chain business contract. If the first cross-chain business contract is already registered in the first relay chain, the application chain sends the first cross-chain transaction to the first relay chain. This first cross-chain transaction requests the invocation of other cross-chain business contracts registered in the first relay chain. When the application chain receives a second cross-chain transaction sent by a second relay chain, it determines the second cross-chain business contract invoked by the second cross-chain transaction. If the second cross-chain business contract is already registered in the second relay chain, the application chain executes the second cross-chain transaction through the second cross-chain business contract, obtaining the execution result. The execution result is then returned to the second relay chain.
[0055] In this embodiment, each cross-chain business contract can be registered on the relay chain through a cross-chain management contract. The cross-chain management contract can govern the cross-chain business contracts. Cross-chain business contracts registered on the relay chain can provide contract services within the cross-chain network where the relay chain resides.
[0056] by Figure 2 The cross-chain system described herein explains the process of cross-chain business contracts providing contract services. A first cross-chain business contract registers with a first relay chain and can send a first cross-chain transaction to the first relay chain via a first application chain. This first cross-chain transaction is used to invoke the contract service provided by a third cross-chain business contract. Upon receiving this first cross-chain transaction, the first relay chain determines that the third cross-chain business contract needs to be invoked based on the transaction information, and then searches for the registration information of the third cross-chain business contract. Based on the registration information, it determines that the application chain where the third cross-chain business contract resides is the second application chain, and then sends the first cross-chain transaction to the second application chain. The second application chain then sends the first cross-chain transaction to the third cross-chain business contract to invoke it. If the first relay chain cannot find the registration information of the third cross-chain business contract, it returns a transaction failure message to the first application chain.
[0057] When the fifth cross-chain business contract needs to call the contract service provided by the second cross-chain business contract, the fifth cross-chain business contract needs to be registered on the second relay chain; if the fifth cross-chain business contract has been registered on the second relay chain, the fifth cross-chain business contract sends a second cross-chain transaction to the second relay chain through the fourth application chain, and the second cross-chain transaction is used to call the contract service provided by the second cross-chain business contract. After the second relay chain receives the second cross-chain transaction, it can determine that the fifth cross-chain business contract needs to be called according to the transaction information, and then find the registration information of the fifth cross-chain business contract; then according to the registration information, it is determined that the application chain where the second cross-chain business contract is located is the first application chain, and then the second cross-chain transaction is sent to the first application chain; after the first application chain receives the second cross-chain transaction, it can determine that the cross-chain business contract corresponding to the second cross-chain transaction is the second cross-chain business contract; then the second cross-chain transaction is sent to the second cross-chain business contract to call the second cross-chain business contract. If the second cross-chain business contract is not registered in the second relay chain, the second relay chain can return transaction failure information to the second application chain.
[0058] In this embodiment, a cross-chain management contract can be deployed on each application chain in each access relay chain. Each cross-chain business contract service on each application chain needs to be registered on the cross-chain management contract to obtain the permission of cross-chain service calling, and the cross-chain management contract can also change the cross-chain permission of the specified cross-chain business contract service. In this way, the cross-chain permission governance operation of the multiple cross-chain business contract services on an application chain can be flexibly controlled.
[0059] Referring to Figure 3 , another step flow diagram of the governance method of the cross-chain business contract provided by the embodiment of the application is shown, as Figure 3 shown, the method can specifically include the following steps:
[0060] S301, prepare and start the application chain.
[0061] The method in the application is applied to an application chain. Before the method in the application is executed, the application chain needs to be prepared and started first.
[0062] S302, deploy the cross-chain management contract broker.
[0063] The cross-chain management contract can be used to govern the cross-chain business contract on the application chain, so the deployment of the cross-chain management contract generally needs to be deployed before the cross-chain contract. The cross-chain management contract can include the rules of the governance of the cross-chain business contract, such as specifying the list of administrator addresses on the current application chain when deploying the cross-chain management contract, and specifying the conditions for passing the audit vote. For example, there are 4 administrator addresses on the application chain, and the condition is that at least 3 administrators vote to pass to be counted as passing the audit. Because the addresses of the application chain administrators are recorded and retained in the cross-chain management contract, the application chain administrator information can also be updated as needed in the future, and the possibility of linking the same application chain to multiple different cross-chain networks is also reserved.
[0064] S303, deploying a cross-chain business contract.
[0065] When different cross-chain businesses need to be processed, a cross-chain business contract can be deployed on the application chain, and the business processing rules can be included in the cross-chain business contract.
[0066] S304, the cross-chain business contract initiates registration to the cross-chain management contract.
[0067] The cross-chain business contract can initiate a registration application to the cross-chain management contract to register on the relay chain, and the registration application can include the registration information of the cross-chain business contract. After the cross-chain business contract initiates registration to the cross-chain management contract, a proposal will be generated in the contract.
[0068] S305, the application chain management contract votes for audit.
[0069] After receiving the registration application initiated by the cross-chain business contract, the application chain can obtain the address list of the application chain administrators; according to the address list, the registration application can be sent to multiple administrators; then the multiple administrators of the application chain can vote on the registration application; the cross-chain management contract can determine whether the registration application passes the vote based on the above-mentioned specified conditions for passing the audit vote.
[0070] S306, the cross-chain business contract obtains cross-chain permission.
[0071] The application chain administrators can vote on the proposal in turn, and when the pass or fail condition is reached, the cross-chain business contract correspondingly obtains or does not obtain the cross-chain service call permission. For the proposal whose vote fails, the business contract can initiate a registration application again, and the previous failure does not affect the re-registration.
[0072] After the cross-chain business contract is registered and voted through by the application chain administrator, it obtains the cross-chain service calling permission on the application chain where it is located, and then needs to be registered on the relay chain by any application chain administrator for voting. For the cross-chain business contract service authorized by the application chain, the relay chain administrator generally only confirms whether the information content and format are standard and meet the conditions, and votes to agree.
[0073] The cross-chain system adopting the relay mode has a governance function for the application chain accessed, and also has a certain governance function for the cross-chain business contract service registered on the relay chain. In the prior art, the governance of the cross-chain business contract is performed on the relay chain, that is, the governance participants (voting decision makers) are all administrators on the relay chain. Many cross-chain business contract services can be deployed on an application chain, and the governance task workload of the cross-chain business contract in the cross-chain network can be several orders of magnitude higher than that of the application chain level. If the relay chain directly manages the cross-chain business contract, it may cause governance congestion of the cross-chain network and low efficiency. In the embodiments of the present application, the application chain administrator audits the contract service in advance before the cross-chain business contract service is registered on the relay chain. Only the contract service authorized by the application chain administrator can be submitted to the relay chain for registration and voting governance. By using the method in the embodiments of the present application, the cross-chain contract service needs to be audited and governed by the administrator of the application chain before being registered on the relay chain, and only the cross-chain contract service authorized can complete the cross-chain transaction on the relay chain. Under the mechanism of multi-party supervision and management, the risk of the cross-chain contract service running on the relay chain can be significantly reduced. The cross-chain business contract service in the cross-chain network is preliminarily audited on the respective application chain, and then registered on the relay chain for service, which can significantly reduce the workload of direct governance and audit by the relay chain administrator, improve the efficiency of the cross-chain system, and avoid the problem of governance congestion.
[0074] It should be noted that the size of the serial number of each step in the above embodiments does not mean the order of execution, and the execution order of each process should be determined according to its function and inherent logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.
[0075] The cross-chain business contract can perform cross-chain transactions after being registered on the relay chain, so as to call the cross-chain business contract. Figure 4 is a flowchart of a cross-chain business contract calling process provided by an embodiment of the present application. As shown in Figure 4The first cross-chain service contract is a cross-chain service contract deployed on the first application chain, and the first application chain includes a cross-chain management contract deployed in advance. The third cross-chain service contract is a cross-chain service contract deployed on the second application chain, and the second application chain includes a cross-chain management contract deployed in advance. If the first cross-chain service contract needs to use the service of the third cross-chain service contract, the first cross-chain service contract and the third cross-chain service contract need to be registered in the relay chain first.
[0076] The first cross-chain service contract can initiate a registration application to the cross-chain management contract on the first application chain. The cross-chain management contract on the first application chain sends the registration application to each administrator on the first application chain. Then, the voting results of each administrator on the registration application are received, and the registration result of the registration application is determined according to the voting results. If the first cross-chain service contract is successfully registered with the cross-chain management contract on the first application chain, the cross-chain management contract on the first application chain can send the registration information of the first cross-chain service contract to the relay chain. Then, the relay chain can register the first cross-chain service contract on the relay chain according to the registration information. The third cross-chain service contract can initiate a registration application to the cross-chain management contract on the second application chain. The cross-chain management contract on the second application chain sends the registration application to each administrator on the second application chain. Then, the voting results of each administrator on the registration application are received, and the registration result of the registration application is determined according to the voting results. If the third cross-chain service contract is successfully registered with the cross-chain management contract on the second application chain, the cross-chain management contract on the second application chain can send the registration information of the third cross-chain service contract to the relay chain. Then, the relay chain can register the third cross-chain service contract on the relay chain according to the registration information.
[0077] When the first cross-chain service contract needs to call the third cross-chain service contract, a first cross-chain transaction can be initiated; then the first cross-chain transaction can be sent to the cross-chain management contract on the first application chain; then the cross-chain management contract on the first application chain can find from the registration information that the first cross-chain service contract has been registered on the relay chain, and therefore the cross-chain management contract on the first application chain can send the first cross-chain transaction to the relay chain; after receiving the first cross-chain transaction, the relay chain can detect whether the third cross-chain service contract is registered on the relay chain; since the third cross-chain service contract has been registered on the relay chain, the relay chain can send the first cross-chain transaction to the cross-chain management contract on the second application chain, and the cross-chain management contract on the second application chain can send the first cross-chain transaction to the third cross-chain service contract. After receiving the first cross-chain transaction, the third cross-chain service contract can execute the first cross-chain transaction to obtain a first execution result. Then, the third cross-chain service contract can send the first execution result to the cross-chain management contract on the second application chain; the cross-chain management contract on the second application chain sends the first execution result to the relay chain; the relay chain sends the first execution result to the cross-chain management contract on the first application chain; the cross-chain management contract on the first application chain returns the first execution result to the first cross-chain service contract, thereby completing the first cross-chain transaction.
[0078] With reference to Figure 5 , a schematic diagram of a governance device of a cross-chain service contract provided by an embodiment of the present application is shown, which can be applied to an application chain and specifically can include a receiving module 51, a first sending module 52, a determining module 53 and a second sending module 54, wherein:
[0079] The receiving module 51 is configured to receive a registration application initiated by a first cross-chain service contract, and the registration application is used for the first cross-chain service contract to initiate registration to a first relay chain where the application chain is located.
[0080] The first sending module 52 is configured to send the registration application to an administrator on the application chain to obtain a voting result of the administrator for the registration application.
[0081] The determining module 53 is configured to determine an application result of the registration application according to the voting result.
[0082] The second sending module 54 is configured to, if the application result is registration success, send registration information of the first cross-chain service contract to the first relay chain to register the first cross-chain service contract in the first relay chain.
[0083] In a possible implementation manner, the above-mentioned governance device further includes:
[0084] A registration module is configured to register the application chain in the first relay chain to obtain cross-chain authority of the first relay chain.
[0085] A deployment module is configured to deploy a cross-chain management contract on the application chain, where the cross-chain management contract is configured to receive the registration application and send the registration information to the first relay chain based on the cross-chain authority.
[0086] In a possible implementation, the above-mentioned governance device further includes:
[0087] A first cross-chain transaction receiving module is configured to receive a first cross-chain transaction submitted by the first cross-chain service contract.
[0088] A first cross-chain transaction sending module is configured to send the first cross-chain transaction to the first relay chain if the first cross-chain service contract has been registered in the first relay chain, where the first cross-chain transaction is configured to request to invoke other cross-chain service contracts registered in the first relay chain through the first relay chain.
[0089] In a possible implementation, the above-mentioned governance device further includes:
[0090] A second cross-chain transaction receiving module is configured to determine a second cross-chain service contract invoked by a second cross-chain transaction when the second cross-chain transaction sent by the second relay chain is received.
[0091] A second cross-chain transaction executing module is configured to execute the second cross-chain transaction through the second cross-chain service contract to obtain an execution result if the second cross-chain service contract has been registered in the second relay chain.
[0092] An execution result returning module is configured to return the execution result to the second relay chain.
[0093] In a possible implementation, the above-mentioned first sending module 52 includes:
[0094] An address list obtaining submodule is configured to obtain an address list corresponding to each of the administrators.
[0095] A registration application sending submodule is configured to send the registration application to each of the administrators according to the address list.
[0096] A voting result receiving submodule is configured to receive a voting result returned by each of the administrators for the registration application.
[0097] In a possible implementation, the above-mentioned governance device further includes:
[0098] The aforementioned address list acquisition submodule is also used to acquire the address list of the application chain when an administrator change request is received;
[0099] The administrator change request sending module is used to send the administrator change request to each of the administrators according to the address list;
[0100] The administrator change voting result receiving module is used to receive the administrator change voting results returned by each of the administrators in response to the administrator change application;
[0101] The address list update module is used to update the address list based on the administrator change application and the administrator change voting results; the administrator change application includes the address information of the administrator to be changed.
[0102] In one possible implementation, the determining module 53 includes:
[0103] The administrator count acquisition submodule is used to obtain the number of administrators who participated in the vote;
[0104] The first judgment submodule is used to determine that the application result is a registration failure if the number of administrators participating in the vote is less than a first preset value.
[0105] The second judgment submodule is used to calculate the ratio of the number of votes in the voting results agreeing to registration to the number of administrators participating in the voting if the number of administrators participating in the voting is greater than or equal to a first preset value; if the ratio is greater than a second preset value, the application result is determined to be a successful registration.
[0106] As the apparatus embodiments are basically similar to the method embodiments, they are described in a relatively simple manner. For relevant details, please refer to the description in the method embodiment section.
[0107] Figure 6 This is a schematic diagram of the structure of a computer device provided in an embodiment of this application. Figure 6 As shown, the computer device 6 of this embodiment includes: at least one processor 60 ( Figure 6 (Only one is shown) a processor, a memory 61, and a computer program 62 stored in the memory 61 and executable on the at least one processor 60, wherein the processor 60 executes the computer program 62 to implement the steps in any of the above method embodiments.
[0108] The computer device may include, but is not limited to, a processor 60 and a memory 61. Those skilled in the art will understand that... Figure 6The computer device 6 is merely an example and does not limit the computer device 6, which can include more or less components, or combine some components, or include different components, for example, can also include input / output devices, network access devices, etc.
[0109] The processor 60 can be a central processing unit (CPU), and can also be other general-purpose processors, a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic device, discrete gate or transistor logic, discrete hardware components, etc. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor.
[0110] The memory 61 can be an internal storage unit of the computer device 6 in some embodiments, for example, a hard disk or a memory of the computer device 6. The memory 61 can also be an external storage device of the computer device 6 in other embodiments, for example, a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. Further, the memory 61 can include both the internal storage unit and the external storage device of the computer device 6. The memory 61 is used to store an operating system, application programs, a boot loader, data and other programs, for example, program codes of the computer program, etc. The memory 61 can also be used to temporarily store data that has been output or will be output.
[0111] The embodiments of the present application further provide a computer readable storage medium, which stores a computer program. The computer program is executed by a processor to implement the steps in each method embodiment.
[0112] The embodiments of the present application provide a computer program product. When the computer program product is run on a computer device, the computer device is enabled to implement the steps in each method embodiment.
[0113] The cross-chain business contract governance method in the present application can be stored in a computer-readable storage medium if it is implemented in the form of a software functional unit and sold or used as an independent product. Based on such understanding, all or part of the processes in the above-mentioned embodiment methods can be completed by a computer program instructing related hardware, and the computer program can be stored in a computer-readable storage medium. When the processor executes the computer program, the steps of the above-mentioned various method embodiments can be implemented. The computer program includes computer program code, which can be in the form of source code, object code, an executable file, or some intermediate form. The computer-readable medium at least includes any entity or device capable of carrying the computer program code to the computer device, a recording medium, a computer memory, a read-only memory (ROM), a random access memory (RAM), an electrical carrier signal, a telecommunications signal, and a software distribution medium. For example, a U disk, a mobile hard disk, a magnetic disk or an optical disk, etc. In some jurisdictions, according to legislation and patent practice, the computer-readable medium cannot be an electrical carrier signal and a telecommunications signal.
[0114] In the above embodiments, the description of each embodiment has its own focus, and the parts not described or recorded in detail in a certain embodiment can be referred to the related description of other embodiments.
[0115] Those skilled in the art can appreciate that the units and algorithm steps of the examples described in combination with the embodiments disclosed herein can be realized by electronic hardware or a combination of computer software and electronic hardware. Whether the functions are realized in hardware or software depends on the specific application and design constraints of the technical solution. Professional technicians can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the present application.
[0116] In the embodiments provided in the present application, it should be understood that the disclosed apparatus / computer device and method can be implemented in other ways. For example, the above-described apparatus / computer device embodiments are only schematic, for example, the division of the modules or units is only a logical function division, and actual implementation can have another division manner, for example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between the shown or discussed mutual elements can be indirect coupling or communication connection through some interfaces, devices or units, and can be electrical, mechanical or other forms.
[0117] The units described as separate components may or may not be physically separate, and the components displayed as units may or may not be physical units, that is, may be located in one place, or may also be distributed to multiple network units. Part or all of the units can be selected to achieve the purpose of the embodiment scheme according to actual needs.
[0118] The above embodiments are only used to illustrate the technical solutions of the present application, but not limit them. Although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those skilled in the art that the technical solutions recorded in the foregoing embodiments can be modified, or some technical features can be replaced by equivalents; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application, and should be included in the protection scope of the present application.
Claims
1. A method for governance of cross-chain business contracts, characterized in that, The method applied to an application chain comprises: receiving a registration application initiated by a first cross-chain service contract, the registration application being used for the first cross-chain service contract to initiate registration to a first relay chain where the application chain is located, the first cross-chain service contract being a cross-chain service contract deployed on the application chain, and the application chain being registered in the first relay chain; sending the registration application to an administrator on the application chain to obtain a voting result of the administrator for the registration application; determining an application result of the registration application according to the voting result; if the application result is registration success, sending registration information of the first cross-chain service contract to the first relay chain to register the first cross-chain service contract to the first relay chain.
2. The method of claim 1, wherein, Before the receiving of the registration application initiated by the first cross-chain service contract, the method further comprises: registering the application chain to the first relay chain to obtain cross-chain authority of the first relay chain; deploying a cross-chain management contract on the application chain, the cross-chain management contract being used for receiving the registration application and sending the registration information to the first relay chain based on the cross-chain authority.
3. The method of claim 1 or 2, wherein, The method further comprises: receiving a first cross-chain transaction submitted by the first cross-chain service contract; if the first cross-chain service contract has been registered in the first relay chain, sending the first cross-chain transaction to the first relay chain, the first cross-chain transaction being used for requesting to call other cross-chain service contracts registered in the first relay chain through the first relay chain.
4. The method of claim 1 or 2, wherein, The method further comprises: when receiving a second cross-chain transaction sent by a second relay chain, determining a second cross-chain service contract called by the second cross-chain transaction; if the second cross-chain service contract has been registered in the second relay chain, executing the second cross-chain transaction through the second cross-chain service contract to obtain an execution result; returning the execution result to the second relay chain.
5. The method of claim 1, wherein, The sending of the registration application to the administrator on the application chain to obtain the voting result of the administrator for the registration application comprises: obtaining an address list corresponding to a plurality of administrators; sending the registration application to each of the administrators according to the address list; receiving a voting result returned by each of the administrators for the registration application.
6. The method of claim 5, wherein, The method further comprises: when receiving an administrator change application, obtaining the address list of the application chain; sending the administrator change application to each of the administrators according to the address list; receiving an administrator change voting result returned by each of the administrators for the administrator change application; updating the address list according to the administrator change application and the administrator change voting result, the address information of an administrator to be changed being included in the administrator change application.
7. The method of claim 1 or 2 or 5 or 6, wherein, The determination of the application result of the registration application according to the voting result comprises: obtaining a number of the administrators participating in voting; if the number of the administrators participating in voting is less than a first preset value, determining that the application result is registration failure. If the number of the administrators participating in the voting is greater than or equal to a first preset value, a ratio of the number of votes agreeing to register in the voting result to the number of the administrators participating in the voting is counted; if the ratio is greater than a second preset value, the application result is determined as a registration success.
8. A governance apparatus for cross-chain business contracts, characterized in that, The device is applied to an application chain and includes: A receiving module is configured to receive a registration application initiated by a first cross-chain service contract, the registration application being used for the first cross-chain service contract to initiate registration to a first relay chain where the application chain is located, the first cross-chain service contract being a cross-chain service contract deployed on the application chain, and the application chain being registered in the first relay chain; A first sending module is configured to send the registration application to an administrator on the application chain to obtain a voting result of the administrator for the registration application; A determining module is configured to determine an application result of the registration application according to the voting result; A second sending module is configured to send registration information of the first cross-chain service contract to the first relay chain to register the first cross-chain service contract to the first relay chain if the application result is a registration success.
9. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, The processor executes the computer program to implement the method in any one of claims 1-7.
10. A computer-readable storage medium storing a computer program, the computer program comprising instructions that, when executed by a computer, cause the computer to perform the method of any one of claims 1 to 9. The computer program is executed by the processor to implement the method in any one of claims 1-7.
Citation Information
Patent Citations
Blockchain network access method and system
CN110868308A
Cross-chain contract analysis method of block chain, relay chain and cross-chain system
CN112488679A