Disclosure of Invention
The embodiment of the application aims to provide a blockchain crossing method, a blockchain crossing system, a blockchain crossing device, electronic equipment and a computer readable storage medium, which are used for realizing crossing of chains under the condition that a private key is not provided.
In one aspect, the present application provides a blockchain cross-link method, applied to a server, including:
Determining at least two sub-target blockchains related to a target service in response to a service request initiated to the target service;
For each sub-target blockchain, initiating a business transaction request to an agent intelligent contract on the sub-target blockchain; the service transaction request comprises a server private key signature, wherein the server private key signature is used for proving that the server is authorized by a user initiating the service request on the proxy intelligent contract;
And returning the service processing results returned by the proxy intelligent contracts on the at least two sub-target blockchains to the source of the service request.
In an embodiment, the initiating a business transaction request to a proxy intelligence contract on the sub-target blockchain includes:
determining agent intelligent contracts and service processing parameters corresponding to the sub-target block chain and the target service;
Encrypting the service processing parameters according to a server private key of the server in the sub-target blockchain to obtain a server private key signature corresponding to the sub-target blockchain;
and constructing the business transaction request according to the business processing parameters and the private key signature of the server, and initiating the business transaction request to the proxy intelligent contract on the sub-target blockchain.
In an embodiment, the target traffic indicates a processing order of the at least two sub-target blockchains;
The initiating a business transaction request to an agent intelligence contract on each sub-target blockchain for each sub-target blockchain includes:
and initiating the business transaction request to agent intelligent contracts on the at least two sub-target blockchains according to the processing sequence.
In an embodiment, the initiating the business transaction request to the proxy intelligence contract on the at least two sub-target blockchains according to the processing order includes:
Determining a front sub-target blockchain and a rear sub-target blockchain of the at least two sub-target blockchains according to the processing order;
initiating a first business transaction request to an agent intelligence contract on the front sub-target blockchain;
acquiring a service processing result returned by the proxy intelligent contract on the front sub-target block chain;
And constructing a second business transaction request based on the business processing result, and initiating the second business transaction request to an agent intelligent contract on the rear sub-target blockchain.
In an embodiment, before the determining at least two sub-target blockchains related to the target service in response to the service request initiated for the target service, the method further comprises:
Responsive to an authorization instruction at each sub-target blockchain, parsing an authorization transaction request from the authorization instruction; the authorization transaction request comprises an address of the server side on the sub-target blockchain, service processing parameters and a user private key signature of the authorization instruction initiator;
For each sub-target blockchain, sending an authorized transaction request corresponding to the sub-target blockchain to an agent intelligent contract on the sub-target blockchain, so that the agent intelligent contract authorizes based on the address of the server, the service processing parameters and the user private key signature;
And returning an authorization result returned by the agent intelligent contract on each sub-target blockchain to the source of the authorization instruction.
In one aspect, the present application provides a blockchain cross-chain system, comprising:
the client is used for responding to the initiating operation of the target service and sending a service request corresponding to the target service; receiving a service processing result corresponding to the service request;
The server is connected with the client and is used for responding to a service request initiated to a target service and determining at least two sub-target block chains related to the target service; for each sub-target blockchain, initiating a business transaction request to an agent intelligent contract on the sub-target blockchain; the service transaction request comprises a server private key signature, wherein the server private key signature is used for proving that the server is authorized by a user initiating the service request on the proxy intelligent contract; and returning the service processing results returned by the proxy intelligent contracts on the at least two sub-target block chains to the client.
In one embodiment of the present invention, in one embodiment,
The client is further used for constructing an authorized transaction request based on a user private key corresponding to each sub-target blockchain; initiating an authorization instruction comprising the authorization transaction request for each sub-target blockchain, and sending the authorization instruction; deleting a user private key corresponding to each sub-target blockchain; receiving an authorization result corresponding to each sub-target blockchain;
The server is used for responding to the authorization instruction of each sub-target blockchain and analyzing an authorization transaction request from the authorization instruction; the authorization transaction request comprises an address of the server side on the sub-target blockchain, service processing parameters and a user private key signature of the authorization instruction initiator; for each sub-target blockchain, sending an authorized transaction request corresponding to the sub-target blockchain to an agent intelligent contract on the sub-target blockchain, so that the agent intelligent contract authorizes based on the address of the server, the service processing parameters and the user private key signature; and returning an authorization result returned by the agent intelligent contract on each sub-target blockchain to the source of the authorization instruction.
On the other hand, the application also provides a block chain crossing device, which is applied to the server and comprises the following components:
A determining module, configured to determine at least two sub-target blockchains related to a target service in response to a service request initiated to the target service;
The system comprises an initiating module, a service transaction module and a service transaction module, wherein the initiating module is used for initiating a service transaction request to an agent intelligent contract on each sub-target blockchain aiming at each sub-target blockchain; the service transaction request comprises a server private key signature, wherein the server private key signature is used for proving that the server is authorized by a user initiating the request on the proxy intelligent contract;
and the return module is used for returning the service processing results returned by the proxy intelligent contracts on the at least two sub-target blockchains to the source of the service request.
Further, the application also provides an electronic device, which comprises:
A processor;
a memory for storing processor-executable instructions;
Wherein the processor is configured to perform the blockchain cross-chain method described above.
In addition, the application also provides a computer readable storage medium storing a computer program executable by a processor to perform the blockchain crossing method.
When determining that a target service in a service request is related to at least two sub-target blockchains, a service end of a cross-chain system can initiate a service transaction request to an agent intelligent contract on each sub-target blockchain according to each sub-target blockchain; the service transaction request comprises a server private key signature, wherein the server private key signature is used for proving that the server is authorized by a user on an agent intelligent contract; the server side can return service processing results corresponding to at least two sub-target block chains to the source of the service request;
when the service is processed in a cross-chain manner, the service end on each sub-target blockchain is authorized by a user, so that the proxy intelligent contract can be indicated to process the service transaction request through the private key signature of the service end; because the server does not need to use the user private key, the risk of revealing the user private key is avoided, and the safety of the cross-link service is improved.
Detailed Description
The technical solutions in the embodiments of the present application will be described below with reference to the accompanying drawings in the embodiments of the present application.
Like reference numerals and letters denote like items in the following figures, and thus once an item is defined in one figure, no further definition or explanation thereof is necessary in the following figures. Meanwhile, in the description of the present application, the terms "first", "second", and the like are used only to distinguish the description, and are not to be construed as indicating or implying relative importance.
Fig. 1 is an application scenario schematic diagram of a blockchain cross-chain method according to an embodiment of the present application. As shown in fig. 1, the application scenario includes a client 30, a server 40, a plurality of nodes 50 hosting a blockchain 1, and a plurality of nodes 60 hosting a blockchain 2; the client 30 may be a user terminal such as a host, a mobile phone, or a tablet computer, and is configured to send a service request related to cross-link processing to the server 40; nodes 50 and 60 may be servers or hosts; the server 40, which may be a server, a server cluster, or a cloud computing center, may interact with nodes 50, 60 to process service requests involving blockchain 1 and blockchain 2.
Referring to fig. 2, a schematic diagram of related art blockchain cross-chain interaction is shown in fig. 2, wherein the interaction includes a registration stage and a cross-chain stage.
In the registration phase: the client may perform step S201 to initiate user registration with the server according to the private key and the account address provided by the user. Here, the client may provide the server with the private key and account address of the user at blockchain 1, and the private key and account address of the user at blockchain 2. The server may perform step S202 to record the private key and the account address provided by the client. Further, the server may execute step S203, allocate a cross-chain account to the user, and return to the client.
In the cross-chain phase: the client may perform step S204 to initiate a service request to the server through the cross-chain account. The traffic indicated by the traffic request involves blockchain 1 and blockchain 2. The server may determine the private key and the account address of the service request initiator according to the cross-chain account number, and execute step S205 to invoke a contract to operate the user account with the user private key and the account address on the blockchain 1 according to the service requirement. The blockchain 1 may perform step S206 to return the service processing result to the server. The server may execute step S207 to invoke a contract to operate the user account with the user private key and the account address on the blockchain 2 according to the service requirement. The blockchain 2 may perform step S208 to return the service processing result to the server. After the server obtains the service processing results of the blockchain 1 and the blockchain 2, step S209 may be executed to return the service processing results to the client.
Therefore, in the related technology, the private key and the account address of the user in a plurality of blockchains are provided for the service end of the cross-chain system in the registration stage, so that the risk of exposing the private key of the user exists, and the security is low.
As shown in fig. 3, the present embodiment provides an electronic apparatus 1 including: at least one processor 11 and a memory 12, one processor 11 being exemplified in fig. 3. The processor 11 and the memory 12 are connected by a bus 10, and the memory 12 stores instructions executable by the processor 11, which instructions are executed by the processor 11, so that the electronic device 1 may perform all or part of the flow of the method in the embodiments described below. In an embodiment, the electronic device 1 may be the server 40 described above for performing the blockchain cross-chain method.
The Memory 12 may be implemented by any type of volatile or non-volatile Memory device or combination thereof, such as static random access Memory (Static Random Access Memory, SRAM), electrically erasable Programmable Read-Only Memory (ELECTRICALLY ERASABLE PROGRAMMABLE READ-Only Memory, EEPROM), erasable Programmable Read-Only Memory (Erasable Programmable Read Only Memory, EPROM), programmable Read-Only Memory (PROM), read-Only Memory (ROM), magnetic Memory, flash Memory, magnetic disk, or optical disk.
The present application also provides a computer readable storage medium storing a computer program executable by the processor 11 to perform the blockchain crossing method provided by the present application.
Referring to fig. 4, a flowchart of a blockchain cross-linking method according to an embodiment of the present application is shown in fig. 4, and the method may include the following steps 410 to 430.
Step 410: at least two sub-target blockchains associated with the target service are determined in response to a service request initiated for the target service.
Wherein the target service is a service that needs to be performed by intelligent contracts on at least two blockchains; a sub-target blockchain is a blockchain that contains intelligent contracts to perform target services.
The server may receive a service request corresponding to the target service from the client, and determine at least two sub-target blockchains related to the target service according to specific content of the target service. Illustratively, the target service is to write the user's personal data to blockchain 1 and blockchain 2, then blockchain 1 and blockchain 2 are both child target blockchains.
Step 420: for each sub-target blockchain, initiating a business transaction request to an agent intelligent contract on the sub-target blockchain; the service transaction request comprises a server private key signature, wherein the server private key signature is used for proving that the server is authorized by a user initiating the service request on the proxy intelligent contract.
Here, the proxy intelligence contract is used for the proxy server to invoke the service blockchain that performs the specific service on the blockchain. Each sub-target blockchain has a corresponding proxy intelligent contract, and the server is authorized in each proxy intelligent contract, so that the server can operate the user account on the sub-target blockchain.
For each sub-target blockchain, the server constructs a corresponding service transaction request according to the service content corresponding to the sub-target blockchain, wherein the service transaction request is expressed in a form of transaction on the blockchain. The service transaction request carries a server private key signature, which is used to prove that the service transaction request is sent by the server. The server has different addresses and private keys on different sub-target blockchains, and when constructing a service transaction request for any sub-target blockchain, the server can generate a server private key signature according to the private key corresponding to the sub-target blockchain.
Illustratively, the sub-target blockchain includes blockchain 1 and blockchain 2, and the server has addresses and private keys in both blockchain 1 and blockchain 2. When a service transaction request is generated for the blockchain 1, the server can generate a server private key signature according to the private key of the blockchain 1; when generating a service transaction request for the blockchain 2, the server can generate a server private key signature according to the private key of the blockchain 2.
After receiving the service transaction request, the proxy intelligent contract on each sub-target blockchain can decrypt the private key signature of the server according to the public key of the server on the sub-target blockchain, and judge whether the service transaction request is sent by the server according to the decryption result. On the other hand, if not, the business transaction request is falsified and can not be processed. On the other hand, if yes, the proxy intelligent contract can judge whether the server side is authorized by the user.
For example, after any user grants authorization to the server so that the server can operate the user account on the blockchain, the proxy intelligence contract can record the mapping between the address of the server and the user address on the blockchain. When the service transaction request is determined not to be forged, the proxy intelligent contract can search the address of the server in a plurality of recorded mapping relations, and determine that the server is authorized when the address of the server is searched. Since the same server may be authorized by multiple users, in this case, the service transaction request constructed by the server may include the address of the user that initiated the service request. The proxy intelligent contract can search whether the mapping relation between the user address and the server address exists, and if so, the proxy intelligent contract indicates that the user has authorized the server.
After determining that the server side is authorized by the user, the proxy intelligent contract can accept the operation of the server side on the user account on the sub-target blockchain, thereby executing the service indicated by the service transaction request and returning the service processing result to the server side.
Illustratively, user A initiates a service request for a target service, which is the account balance of user A on statistical blockchain 1 and the account balance of user A on blockchain 2. After receiving the service request, the server may send the service transaction request to the proxy intelligent contract of the blockchain 1 and the proxy intelligent contract of the blockchain 2, respectively. The agent intelligent contract of the block chain 1 determines that the service transaction request is not forged based on a private key signature of a service end in the service transaction request, further judges whether a mapping relation between the address of the service end and the address of the user A is recorded, and if so, allows the service end to operate a user account of the user A on the block chain 1, so as to obtain account balance of the user A on the block chain 1. The proxy intelligence contract for blockchain 1 may return the account balance to the server. Similarly, the proxy intelligent contract for blockchain 2 may return the account balance of user a on blockchain 2 to the server.
Step 430: and returning the service processing results returned by the proxy intelligent contracts on at least two sub-target blockchains to the source of the service request.
After obtaining the service processing results returned by the proxy intelligent contracts on all sub-target blockchains, the server side can send the service processing results to the source of the service request. The client side sending the service request can receive the service processing result and display the service processing result to the user.
Through the measures, when the cross-chain target service is involved, the service end authorized by the user can initiate a service transaction request to the proxy intelligent contract on each sub-target blockchain according to the private key signature of the service end, so that the target service is executed; the server does not need to store and use the private key of the user on the blockchain, so that the risk of disclosure of the private key of the user is avoided.
In an embodiment, referring to fig. 5, which is a detailed flowchart of step 420 in fig. 4 according to an embodiment of the present application, as shown in fig. 5, when a service transaction request is initiated to an agent intelligence contract on each sub-target blockchain, the following steps 510-530 may be performed.
Step 510: and determining the proxy intelligent contract and the service processing parameters corresponding to the sub-target block chain and the target service.
Here, the service processing parameters may include a contract address of a service intelligent contract for executing a specific service, and a function name, a function parameter, etc. of a function used when executing the service in the service intelligent contract.
After determining the sub-target blockchains related to the target service, the server may determine the proxy intelligent contract and the service processing parameter corresponding to the target service for each sub-target blockchain.
For example, the server may locally record the blockchains related to various services, the contract addresses of the proxy intelligent contracts on each blockchain, the contract addresses of the service intelligent contracts, the function names, and the function parameters in advance. After receiving the service request corresponding to the target service, the server can search a plurality of sub-target blockchains related to the target service, the contract address of the proxy intelligent contract on each sub-target blockchain, the contract address of the service intelligent contract, the function name and the function parameter locally.
By way of example, the service request may include a blockchain associated with the target service, a contract address of an agent intelligence contract on each blockchain, a contract address of the service intelligence contract, a function name, and a function parameter. After the service end analyzes the service request, the contract address, the function name and the function parameter of the proxy intelligent contract on each sub-target block chain can be obtained.
Step 520: and encrypting the service processing parameters according to the service terminal private key of the service terminal in the sub-target blockchain to obtain a service terminal private key signature corresponding to the sub-target blockchain.
Step 530: and constructing a business transaction request according to the business processing parameters and the private key signature of the server, and initiating the business transaction request to the proxy intelligent contract on the sub-target blockchain.
For each sub-target block chain, the server can encrypt the contract address, function name and function parameter of the business intelligent contract on the target block chain according to the private key of the server in the sub-target block chain, thereby obtaining the private key signature of the server corresponding to the sub-target block chain.
For each sub-target blockchain, the server may package the service processing parameters and the server private key signature corresponding to the service processing parameters, thereby generating a service transaction request. The server may initiate a business transaction request to the proxy intelligent contract on the sub-target blockchain according to the contract address of the proxy intelligent contract.
The proxy intelligent contract on the sub-target blockchain receives the business transaction request, and after verifying that the business transaction request is true based on the private key signature of the server side, the function indicated by the function name on the business intelligent contract can be called to execute the business based on the contract address, the function name and the function parameter of the business intelligent contract in the business transaction request.
In one embodiment, the target service indicates a processing order of at least two sub-target blockchains associated with the target service.
In this embodiment, when the service end initiates the service transaction request, the service transaction request may be initiated according to the processing sequence to the proxy intelligent contracts on the at least two sub-target blockchains.
Illustratively, user a initiates a service request for a target service that records a first portion of personal information of user a on blockchain 1 and a second portion of personal information of user a on blockchain 2, and the target service indicates that the first portion of personal information is recorded first and then the second portion of personal information is recorded. The server may first initiate a business transaction request to the proxy smart contract on blockchain 1, the business transaction request including a first portion of personal information for user a. If the proxy intelligent contract of blockchain 1 returns a business process result indicating that the process was successful, the server may continue to initiate a business transaction request to the proxy intelligent contract on blockchain 2, the business transaction request including a second portion of personal information for user a.
Through the measures, when the processing contents of different sub-target block chains to the target service have a sequence, the service end can initiate the service transaction request according to the processing sequence, so that the target service can be normally executed.
In one embodiment, referring to fig. 6, a detailed flowchart of step 420 in fig. 4 provided for another embodiment of the present application, as shown in fig. 6, when a service transaction request is initiated to an agent intelligence contract on each sub-target blockchain, the following steps 610-640 may be performed.
Step 610: the front sub-target blockchain and the rear sub-target blockchain of the at least two sub-target blockchains are determined according to the processing order.
Here, the former sub-target blockchain is a sub-target blockchain that is in the front of the processing order among the two sub-target blockchains; the latter sub-target blockchain is the sub-target blockchain whose processing order is the latter among the two sub-target blockchains.
The front sub-target blockchain and the rear sub-target blockchain are relative concepts. Illustratively, the target traffic is related to blockchain 1, blockchain 2, blockchain 3, with the processing order being blockchain 1, blockchain 2, and blockchain 3 in that order, where blockchain 1 is the forward sub-target blockchain of blockchain 2 and blockchain 2 is the backward sub-target blockchain of blockchain 1; block chain 2 is the front sub-target block chain of block chain 3, and block chain 3 is the rear sub-target block chain of block chain 2.
Step 620: a first business transaction request is initiated to an agent intelligence contract on a preceding sub-target blockchain.
Step 630: and acquiring a service processing result returned by the proxy intelligent contract on the front sub-target block chain.
Step 640: and constructing a second business transaction request based on the business processing result, and initiating the second business transaction request to the proxy intelligent contract on the rear sub-target blockchain.
Here, the first business transaction request is a business transaction request sent to the front sub-target blockchain. The second business transaction request is a business transaction request sent to the back sub-target blockchain.
In this embodiment, there is data transferred between the front sub-target blockchain and the rear sub-target blockchain. After the service end initiates the first service transaction request to the proxy intelligent contract on the front sub-target block chain and obtains the service processing result corresponding to the first service transaction request, the service end can analyze the data to be transmitted to the rear sub-target block chain from the service processing result. The server may construct a second business transaction request based on the data and initiate the second business transaction request to the proxy intelligence contract on the back sub-target blockchain.
The target service is related to the blockchain 1, the blockchain 2 and the blockchain 3, the processing sequence is the blockchain 1, the blockchain 2 and the blockchain 3 in sequence, and the service end initiates a service transaction request to the agent intelligent contract on the blockchain 1 to obtain a first service processing result. The server acquires data to be transmitted to the blockchain 2 from the first service processing result, constructs a service transaction request initiated by the agent intelligent contract on the blockchain 2 according to the data, and thus acquires a second service processing result. The server acquires the data to be transmitted to the blockchain 3 from the second service processing result, constructs a service transaction request initiated by the agent intelligent contract on the blockchain 3 according to the data, and thus acquires a third service processing result.
In an embodiment, referring to fig. 7, a flowchart of user authorization provided in an embodiment of the present application, as shown in fig. 7, the method may include the following steps 710-730.
Step 710: responsive to the authorization instructions at each sub-target blockchain, parsing an authorization transaction request from the authorization instructions; the authorization transaction request comprises an address of a server side on a sub-target blockchain, service processing parameters and a user private key signature of an authorization instruction initiator.
Here, the service processing parameters may include a contract address of a service intelligent contract for executing a specific service, and a function name, a function parameter, etc. of a function used when executing the service in the service intelligent contract.
The server may receive, from the client, an authorization instruction for the server from the user on each sub-target blockchain, the authorization instruction indicating that the server performs an authorization task. The server may parse the authorization transaction request therefrom in response to the authorization instructions.
Step 720: and aiming at each sub-target blockchain, sending an authorized transaction request corresponding to the sub-target blockchain to the proxy intelligent contract on the sub-target blockchain, so that the proxy intelligent contract performs authorization based on the address of the server, the service processing parameters and the user private key signature.
After resolving the authorized transaction request corresponding to each sub-target blockchain, the server may send the authorized transaction request to the proxy intelligent contract on the sub-target blockchain. Here, the server may parse the identifier of the sub-target blockchain and the contract address of the proxy intelligent contract from the authorization instruction, so as to send the authorization transaction request to the proxy intelligent contract on the sub-target blockchain corresponding to the identifier.
After the proxy intelligent contract receives the authorized transaction request, the private key signature of the user in the authorized transaction request can be decrypted according to the public key of the user in the sub-target blockchain, and whether the authorized transaction request is sent by the user or not is judged according to the decryption result. In one aspect, if not, the authorization transaction request is indicated as counterfeit and may not be processed. On the other hand, if so, the proxy intelligent contract can determine that the user authorizes the server, and the authorized server can operate data related to the service processing parameters on the user account. The proxy smart contract may return an authorization result to the server indicating that the authorization was successful.
Step 730: and returning the authorization result returned by the proxy intelligent contract on each sub-target blockchain to the source of the authorization instruction.
For any sub-target blockchain, after the server receives the authorization result returned by the proxy intelligent contract on the sub-target blockchain, the server can return the authorization result to the client sending the authorization instruction, so that the client can display the authorization result to the user. After the authorization results of all sub-target blockchains related to the target service are returned to the client, the subsequent server can execute the target service according to the private key signature of the server.
By the measures, before executing the service request, the authorized transaction request is initiated to the proxy intelligent contract on each sub-target blockchain, so that the proxy intelligent contract executes the authorization of the user to the server according to the authorized transaction request, the server does not need to use the private key of the user when executing the service, and the risk of revealing the private key is avoided.
The application also provides a block chain crossing system, which can comprise a client and a server, wherein the client and the server are connected in a wired or wireless mode.
The client may be a user terminal hosting a cross-chain system client application. The user can initiate an operation for the target service at the client, and the client can send a service request of the target service in response to the initiation operation. Here, the target traffic involves at least two sub-target blockchains.
For example, the client may invoke an interface on the server corresponding to the target service, thereby initiating a service request.
The server may be a server, a server cluster, or a cloud computing center hosting a cross-chain system for determining at least two sub-target blockchains associated with a target service in response to a service request initiated for the target service. For each sub-target blockchain, initiating a business transaction request to an agent intelligent contract on the sub-target blockchain; the service transaction request comprises a server private key signature, wherein the server private key signature is used for proving that the server is authorized by a user initiating the service request on the proxy intelligent contract. And returning the service processing results returned by the proxy intelligent contracts on at least two sub-target blockchains to the client.
The service side processes the service request in detail in the foregoing, and will not be described in detail herein. After the service end returns the service processing result, the client end can receive the service processing result corresponding to the service request, and the processing result can indicate whether the target service is successfully processed.
It can be seen that when a service request is initiated, the client and the server do not use the private key of the user, but perform the target service on a plurality of sub-target blockchains by proving that the server is signed by the authorized private key of the server.
In one embodiment, the client is further configured to construct an authorized transaction request based on the user private key corresponding to each sub-target blockchain prior to initiating the service request. An authorization instruction is initiated for each sub-target blockchain that includes an authorization transaction request, and the authorization instruction is sent. The user private key corresponding to each sub-target blockchain is deleted. And receiving an authorization result corresponding to each sub-target blockchain.
The client may obtain the blockchain identification, user private key, address of the server, proxy intelligent contract address, and service processing parameters for each sub-target blockchain. For each sub-target blockchain, the client can encrypt the address of the service end corresponding to the sub-target blockchain and the service processing parameters according to the user private key corresponding to the sub-target blockchain to obtain the user private key signature.
For each sub-target blockchain, the client may construct an authorized transaction request based on the private key signature of the user, the address of the server, and the service processing parameters corresponding to the sub-target blockchain, where the authorized transaction request is expressed in terms of transactions on the blockchain. The client may construct an authorization instruction based on the authorization transaction request, the proxy intelligent contract address on the sub-target blockchain, and the blockchain identification. The authorization instruction indicates that an authorization transaction request is sent to the proxy intelligent contract corresponding to the proxy intelligent contract address on the sub-target blockchain corresponding to the blockchain identifier.
The client can send the authorization instruction corresponding to each sub-target block chain to the server and can receive the authorization result subsequently. The authorization result may indicate whether the authorization was successful. In addition, after constructing the authorized transaction request corresponding to any sub-target blockchain, the client can delete the user private key corresponding to the sub-target blockchain, thereby avoiding the risk of leakage of the user private key at the client.
The server is used for responding to the authorization instruction of each sub-target blockchain and analyzing an authorization transaction request from the authorization instruction; the authorization transaction request comprises an address of a server side on a sub-target blockchain, service processing parameters and a user private key signature of an authorization instruction initiator. And aiming at each sub-target blockchain, sending an authorized transaction request corresponding to the sub-target blockchain to the proxy intelligent contract on the sub-target blockchain, so that the proxy intelligent contract performs authorization based on the address of the server, the service processing parameters and the user private key signature. And returning the authorization result returned by the proxy intelligent contract on each sub-target blockchain to the source of the authorization instruction.
The processing flow of the server for authorizing the transaction request is detailed in the foregoing, and will not be described herein.
Therefore, after the authorization process proves that the user authorizes the server through the user private key signature, the client can delete the user private key, and the user private key is not required to be used in the subsequent process, so that the safety is greatly improved.
Referring to fig. 8, a schematic diagram of interaction of blockchain cross-links according to an embodiment of the present application is shown in fig. 8, where the interaction includes an authorization phase and a cross-link phase.
In the authorization phase: the client may perform step S801 to send an authorization instruction at blockchain 1, which instructs the server to send an authorization transaction request to blockchain 1. The server may perform step S802 to send an authorization transaction request in an authorization instruction to the blockchain 1, the authorization transaction request indicating that authorization is performed to the server so that a subsequent server may operate the user account on the blockchain 1. The blockchain 1 may perform step S803, and return the authorization result to the server after authorization. The service degree may perform step S804, and return the authorization result corresponding to the blockchain 1 to the client.
The client may perform step S805 to send an authorization instruction at blockchain 2, which instructs the server to send an authorization transaction request to blockchain 2. The server may perform step S806, sending an authorization transaction request in an authorization instruction to the blockchain 2, where the authorization transaction request indicates that authorization is performed to the server, so that the subsequent server may operate the user account on the blockchain 2. The blockchain 2 may perform step S807, and return the authorization result to the server after authorization. The service degree may perform step S808, and return the authorization result corresponding to the blockchain 2 to the client.
In the cross-chain phase: the client may perform step S809 to send a service request to the server, the service request involving blockchain 1 and blockchain 2. The server may execute step S810 to sign and invoke the contract on blockchain 1 to operate the user account with the private key of the server according to the service requirement. The blockchain 1 may perform step S811, and after processing the service, return the service processing result to the server. The server may execute step S812 to sign and invoke the contract on blockchain 2 to operate the user account with the private key of the server according to the service requirement. The blockchain 2 may perform step S813, and after processing the service, return the service processing result to the server. The server may perform step S814, returning the service processing result corresponding to the service request to the client.
FIG. 9 is a block diagram of a blockchain cross-chain device in accordance with an embodiment of the invention, as shown in FIG. 9, that may include:
a determining module 910, configured to determine at least two sub-target blockchains related to a target service in response to a service request initiated for the target service;
An initiating module 920, configured to initiate, for each sub-target blockchain, a service transaction request to an agent intelligence contract on the sub-target blockchain; the service transaction request comprises a server private key signature, wherein the server private key signature is used for proving that the server is authorized by a user initiating the request on the proxy intelligent contract;
and a return module 930, configured to return, to the source of the service request, the service processing result returned by the proxy intelligent contract on the at least two sub-target blockchains.
The implementation process of the functions and roles of each module in the device is specifically shown in the implementation process of the corresponding steps in the blockchain crossing method, and is not repeated here.
In the several embodiments provided in the present application, the disclosed apparatus and method may be implemented in other manners. The apparatus embodiments described above are merely illustrative, for example, of the flowcharts and block diagrams in the figures that illustrate the architecture, functionality, and operation of possible implementations of apparatus, methods and computer program products according to various embodiments of the present application. 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). 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.
In addition, functional modules in the embodiments of the present application may be integrated together to form a single part, or each module may exist alone, or two or more modules may be integrated to form a single part.
The functions, if implemented in the form of software functional modules and sold or used as a stand-alone product, may be stored on a computer readable storage medium. Based on this understanding, the technical solution of the present application may be embodied essentially or in a part contributing to the prior art or in a part of the technical solution in the form of a software product stored in a storage medium, comprising several instructions for causing a computer device (which may be a personal computer, a server, a network device, etc.) to perform all or part of the steps of the method of the embodiments of the present application. And the aforementioned storage medium includes: a usb disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), a magnetic disk, or an optical disk, or other various media capable of storing program codes.