Service processing method and apparatus for blockchain network, and product, device and medium
By deploying local contracts and private key shard collaborative signatures in the target business nodes, the problem of excessive consensus network load in the blockchain network is solved, which improves business processing performance and ensures security.
Patent Information
- Application Number
- PCT/CN2023/131758
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-05-17
- Filing Date
- 2023-11-15
- Publication Date
- 2024-11-21
AI Technical Summary
In a blockchain network, when multiple clients initiate services at the same time, the load on the consensus network will be very high, resulting in processing blockage and reducing the service processing performance of the blockchain network.
Deploy local contracts in the target business node, extract the service information that the consensus network does not need to be used for pre-processing, generate transition services, and sign them in collaboration with the client to reduce the load on the consensus network.
Through the deployment of local contracts and the collaborative signature of private key shards, the load pressure of the consensus network is alleviated, the service processing performance of the blockchain network is improved, and the security and credibility of the business are ensured.
Smart Images

Figure CN2023131758_21112024_PF_FP_ABST
Abstract
Description
Business processing methods, devices, products, equipment and media for blockchain networks
[0001] This application claims priority to the Chinese patent application filed with the China Patent Office on May 17, 2023, with application number 202310563531.0 and application name “Transaction processing method, device, product, equipment and medium for blockchain network”, the entire contents of which are incorporated by reference into this application. Technical Field
[0002] The present application relates to the field of blockchain technology, and in particular to a business processing method for a blockchain network, a business processing device for a blockchain network, a computer program product, a computer device, and a computer-readable storage medium. Background Art
[0003] In a blockchain network, a business node can receive services initiated by a client (such as services for resource transfer based on a blockchain) and perform a simple check on the business information in the service (such as checking the information format or range). After the check is completed, the business initiated by the client can be sent to the consensus network for consensus. In this way, the processing of services initiated by the client is all executed in the consensus network. When several clients initiate a lot of services at the same time, the load on the consensus network for business processing will be very large, which may lead to processing congestion, thereby reducing the performance of the blockchain network in processing services.
[0004] Summary of the Invention
[0005] This application provides a blockchain network business processing method, device, product, equipment and medium, which can improve the performance of blockchain network business processing.
[0006] On one hand, the present application provides a business processing method for a blockchain network, wherein the blockchain network includes a business network and a consensus network, the business network includes a target business node, and a local contract is deployed in the target business node; the target business node has a node private key, and the target business node and the client each store a private key shard of the node private key, and the private key shard of the node private key is obtained through key interaction between the target business node and the client; the method is executed by the target business node, and the method includes:
[0007] Receive a first business sent by the client and extract business information of a target type from the first business. The business information of the target type refers to business information that is not needed by the consensus network during the consensus processing of the business, or business information that is not needed in the process of executing the business after the consensus network successfully reaches consensus on the business;
[0008] Calling the local contract to process the target type of business information, obtaining a processing result of the target type of business information, and generating a transition business based on the processing result and other business information in the first business except the target type of business information;
[0009] Send the transition service to the client, and collaborate with the client to sign the transition service based on the private key shards saved by each party to obtain the first service signature of the transition service;
[0010] A second service is generated based on the first service signature and the transition service, and the second service is sent to the consensus network, so that the consensus network performs consensus processing on the second service.
[0011] On one hand, the present application provides a business processing device for a blockchain network. The blockchain network includes a business network and a consensus network. The business network includes a target business node. A local contract is deployed in the target business node. The target business node has a node private key. The target business node and the client each store a private key shard of the node private key. The private key shard of the node private key is obtained through key interaction between the target business node and the client. The device is applied to the target business node and includes:
[0012] A receiving module, configured to receive a first business sent by a client and extract business information of a target type from the first business, where the business information of the target type refers to business information that is not required to be used by the consensus network during the process of consensus processing of the business, or business information that is not required to be used in the process of executing the business after the consensus network successfully reaches consensus on the business;
[0013] A calling module, configured to call a local contract to process the target type of business information, obtain a processing result of the target type of business information, and generate a transition business based on the processing result and other business information in the first business except the target type of business information;
[0014] The signature module is used to send the transition service to the client and collaborate with the client to sign the transition service based on the private key shards stored by each client to obtain the first service signature of the transition service;
[0015] The consensus module is used to generate a second service based on the first service signature and the transition service, and send the second service to the consensus network so that the consensus network can perform consensus processing on the second service.
[0016] On the one hand, the present application provides a computer device including a memory and a processor, wherein the memory stores a computer program. When the computer program is executed by the processor, the processor executes the business processing method of the blockchain network in the present application.
[0017] On one hand, the present application provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the processor causes the processor to execute the business processing method of the blockchain network in the present application.
[0018] According to one aspect of the present application, a computer program product is provided, comprising a computer program stored in a computer-readable storage medium. A processor of a computer device reads the computer program from the computer-readable storage medium and executes the computer program, causing the computer device to perform the business processing method of the blockchain network described in the present application.
[0019] In this application, a blockchain network may include a business network and a consensus network. The business network includes a target business node. A local contract is deployed in the target business node. The local contract is used to process business information of the target type in the business. The target type of business information refers to business information that the consensus network does not need to use during the consensus processing of the business, or business information that the consensus network does not need to use during the execution of the business after successfully reaching consensus on the business. By deploying a local contract in the target business node, the target business node has the ability to process business information of the target type. The target business node has a node private key. The target business node and the client each store a private key shard of the node private key. The private key shard of the node private key is obtained through key interaction between the target business node and the client. It can be seen that the target business node is able to perform key interaction with the client, so that the two can each obtain and store a private key shard of the node private key of the target business node. This allows the node private key to be distributedly managed on the target business node and the client, thereby improving the security of the node private key. The target business node can receive the first business sent by the client and extract the target type of business information from the first business; call the local contract to process the extracted target type of business information to obtain the processing result of the target type of business information. Since the deployment of the local contract enables the target business node to have the processing capability for the target type of business information, the target business node can pre-process the first business (i.e., pre-process the target type of business information in the first business) and then send the processing result of the target type of business information to the consensus network. This can alleviate the load pressure of the consensus network in processing business, allowing the target business node and the consensus network to collaboratively process business. Based on the processing result and the business information in the first business other than the target type of business information, the target business node generates a transition business; sends the transition business to the client, and collaborates with the client to sign the transition business based on the private key shards they each save, obtaining the first business signature of the transition business; generates a second business based on the first business signature and the transition business, and sends the second business to the consensus network, allowing the consensus network to perform consensus processing on the second business. Since the processing result obtained by the target business node for the pre-processing of the first business changes the first business originally initiated by the client and obtains a new business (i.e., a transitional business), the target business node needs to cooperate with the client to sign the new business based on the private key shards they each save, and obtain the signature of the new business (i.e., the first business signature). The second business can be generated through the new business and the signature of the new business and given to the consensus network for consensus processing. The joint signature of the new business by the target business node and the client solves the confirmation problem of the new business and improves the performance of the blockchain network in processing business. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] FIG1 is a schematic diagram of a network architecture for business processing provided by the present application;
[0021] FIG2 is a schematic diagram of a business processing scenario provided by this application;
[0022] FIG3 is a flow chart of a business processing method of a blockchain network provided by the present application;
[0023] FIG4 is a schematic diagram of a scenario of key interaction processing regarding private key sharding provided by the present application;
[0024] FIG5 is a schematic diagram of a scenario for generating a transition service provided by the present application;
[0025] FIG6 is a schematic diagram of a scenario for generating a second service provided by the present application;
[0026] FIG7 is a flow chart of a contract deployment method provided by the present application;
[0027] FIG8 is a schematic diagram of a process for deploying a local contract provided by this application;
[0028] FIG9 is a schematic diagram of the structure of a business processing device of a blockchain network provided by the present application;
[0029] FIG10 is a schematic structural diagram of a computer device provided in this application. DETAILED DESCRIPTION
[0030] The following is a description of the relevant technical concepts involved in this application:
[0031] 1. Blockchain
[0032] Blockchain is a new application model for computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanisms, and encryption algorithms. Blockchain is essentially a decentralized database, a series of data blocks generated using cryptographic methods. Each block contains information about a batch of network transactions (such as transactions), which is used to verify the validity of this information (to prevent counterfeiting) and generate the next block. A blockchain can include the underlying blockchain platform, the platform product and service layer, and the application service layer. A blockchain consists of a series of blocks that are connected in chronological order. Once a new block is added to the blockchain, it cannot be removed. The block records the data submitted by the nodes in the blockchain system.
[0033] 2. Smart Contracts
[0034] A smart contract is an automated computer program that runs on a blockchain and is used to perform predefined operations under the terms of the contract. These contracts are stored on the blockchain in the form of code and can be automatically executed by nodes on the blockchain. The smart contracts of this application include the following local contracts and business contracts. Among them, a local contract (also known as a local smart contract) is a smart contract whose execution process does not participate in consensus. A local contract is only executed on a single business node (i.e., a single blockchain node). A business node refers to a blockchain node that does not participate in consensus and can be used to store business data on the blockchain.
[0035] 3. ECDSA m-n multi-signature algorithm:
[0036] Both n and m are positive integers, where n is the number of participants and m is the minimum number of participants among the n participants required to sign the transaction. The n participants will engage in a key exchange process (also known as key negotiation, such as key negotiation regarding a node's private key). After the key exchange process is complete, each party involved in the key exchange process possesses a private key fragment (such as a private key fragment of a node's private key); all participants can hold the same global public key (such as the node public key corresponding to the node's private key). During the signing phase, any m of the n participants can sign the transaction. The resulting transaction signature is consistent with the signature obtained by signing the transaction using the complete node private key, and the transaction signature can be verified using the global public key (node public key).
[0037] 4. Cloud Technology
[0038] Cloud technology refers to a hosting technology that unifies hardware, software, and network resources within a wide area network (WAN) or local area network (LAN) to enable data computing, storage, processing, and sharing. Cloud technology is a general term for network technology, information technology, integration technology, management platform technology, and application technology based on the cloud computing business model. It can form a resource pool that can be used on demand, flexibly and conveniently. Cloud computing technology will become a key support. Backend services for technical network systems, such as video websites, image websites, and more portals, require a large amount of computing and storage resources. With the rapid development and application of the internet industry, every item in the future may have its own unique identification mark, which will need to be transmitted to the backend system for logical processing. Data of different levels will be processed separately, and all types of industry data require strong system support, which can only be achieved through cloud computing. The application of cloud technology in this application includes: data exchange between clients and business nodes, and between business nodes and consensus nodes, can all be carried out through the "cloud."
[0039] It should be noted that all business data collected in this application (such as business information, node private keys, private key shards, public key shards, node public keys and other related data) are collected with the consent and authorization of the object to which the business data belongs (such as users, institutions or enterprises), and the collection, use and processing of relevant data must comply with relevant laws, regulations and standards.
[0040] Please refer to Figure 1, which is a structural diagram of a network architecture for business processing provided by this application. As shown in Figure 1, the network architecture may include several clients (which can be understood as a client set) and a blockchain network. The client may be the client used by the user, and the user can initiate business to the blockchain network based on the client used. The blockchain network may include a business network and a consensus network. The business network may include multiple business nodes. The number of business nodes in the business network can be determined according to the actual application scenario and is not limited to this. Similarly, the consensus network may include multiple consensus nodes. The number of consensus nodes in the consensus network can also be determined according to the actual application scenario and is not limited to this.
[0041] The business nodes in the business network can be connected to the user's client. In an optional implementation method, different business nodes can be connected to different clients, that is, several clients can be assigned to different business nodes for connection; the so-called connection can be understood as an exclusive connection, that is, the client's business is responded to and processed by the business node connected to it. In addition, in subsequent embodiments, the business node and the client it connects to can perform key interaction processing on the private key shard of the node private key of the business node, so that the business node and the client each obtain the private key shard of the node private key of the business node. In the embodiment of the present application, key interaction processing refers to key negotiation, that is, the process of interactive negotiation between two parties (or multiple parties) to obtain a common key (this application specifically refers to the private key shard of the node private key). This implementation not only improves client service processing efficiency but also increases the node resource utilization of each service node. For example, if a service network includes service nodes 1, 2, 3, and 4, and the client set includes clients 1 through 12, then the clients connected to service node 1 may include clients 1 through 3, the clients connected to service node 2 may include clients 4 through 6, the clients connected to service node 3 may include clients 7 through 9, and the clients connected to service node 4 may include clients 10 through 12. In another optional implementation, different service nodes may connect to the same client. This can be determined based on the actual application scenario and is not a limitation.
[0042] The business nodes in the business network and the consensus nodes in the consensus network are all blockchain nodes in the blockchain network. The blockchain node can be composed of a server, which can be an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN (content distribution network), and big data and artificial intelligence platforms.
[0043] It should be noted that since the principle of each business node processing the business of each client it is connected to is the same and independent, the following is an example of a process in which a business node (hereinafter referred to as a business node) processes the business of a connected client (hereinafter referred to as a client).
[0044] In this application, a client can initiate a service to a service node. The service node can perform corresponding pre-processing on the service initiated by the client and then submit the new service generated after the pre-processing to the consensus node for consensus processing, as described below. The pre-processing here refers to the processing process performed before consensus processing. In this application, it specifically refers to the information processing process performed by the service node on the service information of the target type before the service is processed by consensus. Please refer to Figure 2, which is a schematic diagram of a service processing scenario provided by this application. As shown in Figure 2, here, the client can initiate a first service to the service node. The first service can include service information of the target type and other service information in addition to the service information of the target type. The service information of the target type can refer to service information that the consensus network does not need to witness. The so-called "no need for witness" means: service information that the consensus network does not need to use during the process of consensus processing of the service; or service information that the consensus network does not need to use during the process of executing the service after the service consensus is successfully reached. In other words, the presence or absence of the target type service information has no effect on the subsequent consensus processing process of the consensus network for the service or the process of executing the service after the service consensus is successfully reached.
[0045] The service node is deployed with a local contract (i.e., a local smart contract) for pre-processing services. Specifically, the service node can call the local contract deployed therein to process the service information of the target type in the first service and obtain the processing result of the service information of the target type. The service node can generate a transition service based on the processing result of the service information of the target type and other service information in the first service other than the service information of the target type to generate a transition service. The transition service is the new service obtained after the service node pre-processes the first service. The service node and the client connected to it can each save the private key shard of the node private key of the service node. The private key shard is obtained through key exchange between the service node and the client connected to it. Therefore, the service node can send the transition service to the client and cooperate with the client to sign the transition service based on the private key shards they each save, thereby generating a service signature for the transition service (which can be called a first service signature). The service node can combine the first service signature with the transition service to generate a second service, which is the service that needs to be submitted to the consensus network for consensus processing. The business node can send the second business to the consensus network, so that the consensus network can perform consensus processing on the second business. After the second business is successfully reached in the consensus network, the consensus network can execute the second business and process the second business on the chain.
[0046] From the above, it can be seen that part of the business logic that originally needs to be implemented in the consensus node (that is, the logic for processing the target type of business information) can be implemented in the local contract of the business node, thereby reducing the load of the consensus node for business processing, and the target type of business information is processed in the local contract of the business node. The local contract only exists in the business node to which it belongs. The processing logic of the local contract for the target type of business information is public (that is, the processing logic of the local contract can be made public on the blockchain), but the local contract's processing process for the target type of business information is confidential (that is, the processing process only exists in the business node to which the local contract belongs). This makes the target type of business information only exist in the business node to which the local contract belongs and will not be leaked to other blockchain nodes, ensuring the privacy and security of the target type of business information.
[0047] Please refer to Figure 3, which is a flow chart of a business processing method of a blockchain network provided by the present application. The blockchain network may include a business network and a consensus network. The business network may include multiple business nodes, and the consensus network may include multiple consensus nodes. The business nodes and consensus nodes are both blockchain nodes. Any blockchain node may be composed of one or more computer devices, and the computer device may be a terminal device, a server, or other devices, without limitation. Any business node in the business network may be referred to as a target business node. The target business node may be a business node that has completed key interaction processing with the client regarding private key sharding. The first business may be any business initiated by the client to a business node (i.e., a target business node) with which it has completed key interaction processing regarding private key sharding. The client may be a client of any user, used for the user to initiate a business. The method of this embodiment may be executed by the target business node; as shown in Figure 3, the method may include:
[0048] Step S101: Receive the first business sent by the client and extract business information of the target type from the first business. The business information of the target type is business information that the consensus network does not need to witness, that is, the business information of the target type is business information that the consensus network does not need to use in the process of consensus processing of the business, or business information that the consensus network does not need to use in the process of executing the business after successfully reaching consensus on the business.
[0049] The target business node may have a node private key (also referred to as a node key), which may be used to sign and encrypt the business of the target business node. The client in this application (i.e., the client that the target business node needs to connect to for business processing) may be one or more. This application may obtain a private key shard of the node private key by performing a key interaction process with the target business node through the one or more clients. It can be understood that the node private key may be obtained by the target business node and all the clients connected to it through a key interaction process (such as a key interaction process obtained through the ECDSA m-n multi-signature algorithm). After the key interaction process is completed, any party participating in the key interaction process (such as the target business node or any client connected to the target business node) can save a private key shard of the node private key. Schematically, in the ECDSA m-n multi-signature algorithm involved here, n can be equal to the number of parties participating in the key interaction process, i.e., the sum of the number of all clients connected to the target business node and the number of target business nodes; m can be equal to 2. It is understandable that the parties involved in the key interaction process only store private key fragments, and none of them store complete node private keys to ensure the security of the node private keys. Moreover, by setting m to 2, any two of the n parties involved in the key interaction process can realize the joint signature of the business (equivalent to the effect of signing the business with the complete node private key), that is, any client can interact with the target business node for data to realize the signature processing of the business (such as the transition business described below). Wherein, m is equal to 2, which can also be understood as the node private key can be recovered by the two private key fragments (i.e., any two private key fragments) of any two parties involved in the key interaction process (such as the node private key obtained by adding the two private key fragments), and the private key fragments stored by each party are kept confidential from each other.
[0050] Please refer to Figure 4, which is a schematic diagram of a scenario of key interaction processing for private key sharding provided by the present application. As shown in Figure 4, the above n can be equal to 4, that is, n is equal to the sum of the number of the three clients (including client k1, client k2 and client k3) and the target business node. The three clients and the target business node can perform multiple rounds of key interaction processing on the private key shards of the node private key of the target business node. After the key interaction processing is completed, each party can obtain a private key shard of the node private key of the target business node, such as client k1 can obtain private key shard 1, client k2 can obtain private key shard 2, client k3 can obtain private key shard 3, and the target business node can obtain private key shard 4.
[0051] It should be noted that, since the principles of data interaction between each client and the target business node to realize the processing of the business are the same and independent of each other, this application is explained by taking the process of data interaction between a client and the target business node to realize the processing of the client's business as an example (hereinafter collectively referred to as the client), but there can be multiple clients in the key interaction processing process of the private key sharding of the node private key. Depending on the application scenario, the type of the first business in this application may also be different. For example, in the application scenario of data notarization, the first business may be a data notarization business; in the application scenario of resource transfer, the first business may be a resource transfer business; in the application scenario of resource issuance, the first business may be a resource issuance business, and so on. The specific business type of the first business can be determined according to the actual application scenario, and there is no limitation on this. This application can be applied to all relevant application scenarios in which the business can be collaboratively processed by business nodes and consensus nodes.
[0052] Furthermore, a local contract (i.e., a local smart contract) can be deployed in the target business node, and this local contract can only run on the target business node. This local contract can be used to process the business information of the target type in the business. For different application scenarios, the business information of this target type can also be different, and the processing logic configured in the local contract for the business of this target type can also be different, which can be determined according to the actual application scenario. The business information of this target type can be business information of the type that the consensus network does not need to witness. It can be understood that the business information of this target type can refer to business information that the consensus network does not need to use during the process of reaching consensus on the business or executing the business after consensus. That is, the presence or absence of the business information of this target type has no effect on the subsequent consensus network's consensus processing of the business or the process of executing the business after the business consensus is successful. For example, the first business can be a data storage business initiated by a client, and the business information of the target type can be the identity information of the client in the first business, which can be used to authenticate the identity of the client.
[0053] The target service node may receive the first service initiated by the client and extract service information of the target type from the first service. Optionally, the target service node may also have a prerequisite for extracting the service information of the target type from the first service (i.e., there may be a prerequisite for starting service processing of the first service), for example, requiring successful verification of the first service before allowing the extraction of service information of the target type from the first service.
[0054] The first service may include a service signature, which may be referred to as the second service signature. The second service signature may be obtained by the client signing the service information in the first service other than the second service signature (e.g., encrypting the hash value of the service information in the first service other than the second service signature) based on the client's stored private key shard. It can be understood that the second service signature is the signature of the first service. The private key shard stored by the client and the public key shard corresponding to the private key shard may constitute a key pair. Data encrypted using the private key shard stored by the client may be decrypted using the public key shard corresponding to the private key shard stored by the client. The public key shard corresponding to the private key shard stored by the client may be public, i.e., the target service node may know the public key shard corresponding to the private key shard stored by the client. Therefore, the target service node can use the public key shard corresponding to the private key shard stored by the client to verify the second service signature in the first service (i.e., verify the signature) and obtain the verification result of the second service signature. If the verification result indicates that the verification of the second service signature fails, it indicates that the first service is an illegal and untrustworthy service. Then, the target service node can start processing the first service, such as extracting the target type of service information from the first service. If the verification result indicates that the verification of the second service signature succeeds, it indicates that the first service is a legal and trustworthy service.
[0055] Among them, the process in which the target business node verifies the second business signature to obtain the verification result of the second business signature may include: the target business node may use the public key fragment corresponding to the private key fragment stored by the client to decrypt the second business signature to obtain a decrypted hash value. The target business node may also perform hash calculation on the business information other than the second business signature in the first business to obtain a calculated hash value. If the decrypted hash value is the same as (i.e., consistent with) the calculated hash value, the verification result of the second business signature may indicate that the verification of the second business signature is successful; conversely, if the decrypted hash value is different from (i.e., inconsistent with) the calculated hash value, the verification result of the second business signature may indicate that the verification of the second business signature has failed.
[0056] Step S102: calling the local contract to process the target type of business information, obtaining the processing result of the target type of business information, and generating a transition business based on the processing result and other business information in the first business except the target type of business information.
[0057] The target business node can call a local contract to process the target type of business information extracted from the first business to obtain a processing result of the target type of business information. For example, if the target type of business information in the first business is the identity information of the client, the information processing can be an identity authentication process for the client, and the processing result can refer to the identity authentication result of the client. Specifically, the target business node can call a local contract to perform identity authentication processing on the client based on the identity information of the client extracted from the first business, and can obtain the identity authentication result of the client. The identity authentication result can indicate that the identity of the client is legal, or the identity authentication result can indicate that the identity of the client is illegal (i.e., illegal).
[0058] It is understood that the local contract is configured with processing logic for processing the target type of business information, and the processing logic can be a pre-processing logic for the business. Optionally, the operation of extracting the target type of business information from the first business in the above step S101 can also be executed by calling the local contract, and the local contract can also be configured with processing logic for extracting the target type of business information from the business. If the target type of business information is the identity information of the client, the client's identity information can include the identity number information of the object to which the client belongs (such as a user), and the identity number information is the unique number information registered by the object in a certain institution. Therefore, the target business node can call the local contract to query the institution for the authenticity of the client's identity number information. If the queried identity number information is the actual number information of the object in the institution, it can be determined that the client's identity information in the first business is legal. Conversely, if the queried identity number information is not the actual number information of the object in the institution, it can be determined that the client's identity information in the first business is illegal. The above-mentioned identity authentication result can be the processing result of the identity information (that is, the processing result obtained after calling the local contract to process the target type of business information in the first business).
[0059] The target business node can generate a new business based on the above-obtained processing results and other business information in the first business except for the business information of the target type. The new business can be called a transitional business. The transitional business can include the processing results of the local contract for the business information of the target type. The processing results are used as the output of the local contract. The output of the local contract can be used as the input of the business contract in the subsequent consensus node. Specifically, the first business can include the contract address called by the first business. The contract address called by the first business can be the contract address of the local contract of the above-mentioned target business node. The contract address can be the unique address assigned to the local contract by the consensus network when the local contract is deployed in the target business node (also called the calling address of the local contract). In addition, a business contract can also be deployed in the consensus network, that is, each consensus node in the consensus network can be deployed with the business contract. The business contract can be a contract for the consensus network to perform business processing (such as consensus processing of the business and execution of the business after the business consensus is successful). The consensus network performs business processing by calling the business contract.
[0060] The process of generating the transition service based on the processing result of the service information of the target type in the first service and other service information in the first service except the service information of the target type may include:
[0061] The target business node can replace the business information of the target type in the first business with the processing result of the business information of the target type, and can remove the second business signature in the first business (which can be understood as deleting the second business signature from the first business) to obtain the initial transition business; that is, the business information of the target type in the first business can be replaced with the processing result of the business information of the target type, and the business obtained after removing the second business signature is called the initial transition business. The initial transition business does not contain the business information of the target type, but contains the processing result of the business information of the target type, and the initial transition business does not contain the second business signature. The contract address called in the initial transition business is still the contract address of the local contract. The target business node can modify the contract address called in the initial transition business from the contract address of the local contract to the contract address of the business contract to generate a transition business; that is, the business obtained after modifying the contract address called by the first business in the initial transition business to the contract address of the business contract can be called a transition business, and the contract address called in the transition business is the contract address of the business contract.
[0062] Since the business after the local contract processing needs to be given to the consensus network for consensus processing, the present application can also establish a binding relationship between the local contract and the contract that processes the business (such as the above-mentioned business contract). The binding relationship can be established through the contract address of the local contract and the contract address of the business contract, such as the binding relationship between the contract address of the local contract and the contract address of the business contract. Therefore, a binding relationship can be established between the contract address of the above-mentioned local contract and the contract address of the business contract. The binding relationship can be established during the process of deploying the local contract in the target business node, or after the local contract is deployed in the target business node, and there is no restriction on this.
[0063] The target business node modifies the contract address of the first business call in the initial transition business from the contract address of the local contract to the contract address of the business contract to generate the transition business, which may include:
[0064] The target business node can obtain the contract address that has a binding relationship with the contract address of the local contract (that is, the contract address of the business contract). The target business node can modify the contract address of the first business call in the initial transition business (that is, the contract address of the local contract) to the contract address that has a binding relationship with the contract address of the call (that is, the contract address of the business contract), and thus obtain the transition business.
[0065] Optionally, the process of establishing a binding relationship between the contract address of the local contract and the contract address of the business contract may include:
[0066] The target business node can generate a contract binding service, which can include the contract address of the local contract and the contract address of the business contract. The contract binding service refers to a service for requesting the binding of the contract address of the local contract with the contract address of the business contract (i.e., establishing a binding relationship). The target business node can send the contract binding service to the consensus network so that each consensus node in the consensus network can reach a consensus on the contract binding service and execute the contract binding service after reaching a consensus on the contract binding service.
[0067] Among them, executing the contract binding service can be to establish a binding relationship between the contract address of the local contract and the contract address of the business contract. After successfully establishing the binding relationship between the contract address of the local contract and the contract address of the business contract (that is, after successfully executing the contract binding service), the consensus network can return the status information of the contract binding service to the target business node. The status information of the contract binding service can be information indicating that the binding relationship between the contract address of the local contract and the contract address of the business contract has been successfully established. The status information of the contract binding service can include the contract address that has successfully established a binding relationship with the contract address of the local contract. The target business node can store the contract address that has a binding relationship with the contract address of the local contract in the status information. It is understandable that the consensus network will also store the executed business (such as the contract binding business) and the execution result of the contract binding business (such as the contract address that has established a binding relationship with the contract address of the local contract).
[0068] It is understandable that the target business node itself can usually store a contract address that has a binding relationship with the contract address of the local contract. If the target business node stores a contract address that has a binding relationship with the contract address of the local contract, the target business node can directly obtain the contract address that has a binding relationship with the contract address of the local contract from the local database; or, in some special scenarios (such as the scenario where the local database of the target business node fails), if the target business node does not store a contract address that has a binding relationship with the contract address of the local contract, the target business node can pull the contract address that has a binding relationship with the contract address of the local contract from the consensus network (such as from any consensus node).
[0069] Please refer to Figure 5, which is a schematic diagram of a scenario for generating a transition business provided by this application. As shown in Figure 5, a business can contain multiple fields. For example, the multiple fields in the first business here may include: Nonce (random number, here the random number is x1, filled in by the business initiator (such as the client)), gasprice (which can be understood as the unit price of each operation of business processing in the blockchain, here x2), gas (which can be understood as the number of each operation of business processing in the blockchain, here x3), to (representing the contract address of the business call, here Addr_L, the Addr_L can represent the contract address of the local contract), value (if the business is a resource transfer business, then value is the resource transfer amount, here x4), input (input parameter, that is, the parameter for calling the smart contract, which can include parameter A, parameter B, parameter C and parameter D), RSV (i.e. R, S, V) all represent the signature field of the business signature (here the business signature is Sig(TX), the Sig(TX) can represent the above-mentioned second business signature).
[0070] It should be noted that the target type of business information in this application may be part of the input parameters of the business. For example, the target type of business information in the first business here may include parameters C and D in the input parameters of the first business. The specific meaning of each parameter in the input parameters of the first business can be determined according to the actual application scenario and is not limited to this. For example, parameters C and D here may be parameters representing the identity information of the client, and parameters A and B may be relevant remarks when performing resource transfer or relevant information of the resource transferor and resource recipient, etc.
[0071] The target business node can call the local contract to process parameter C and obtain result E (which can be called parameter E). It can also call the local contract to process parameter D and obtain result F (which can be called parameter F). Result E and result F together constitute the processing result of the target type of business information in the first business. Keeping parameters A and B unchanged in the input parameters of the first business, the input parameters of the business contract can be parameters A, B, result E, and result F. These input parameters are also the input parameters of the transition business that needs to be generated later.
[0072] As shown in Figure 5, the input parameters of the generated transition service can include parameter A, parameter B, result E, and result F, and the "to" field in the transition service (i.e., the field of the called contract address) can be Addr_C, which can represent the contract address of the business contract. In the transition service, except for the called contract address and the results E and F in the input parameters, which are different from the corresponding business information in the first business, the other business information can be the corresponding business information in the first business, and the signature field RSV in the transition service is empty. Since the above-mentioned transition service is obtained by repackaging the first service by the target service node, the transition service can also be understood as the service of the target service node. However, in essence, the transition service is still the first service of the client.
[0073] Step S103: Send the transition service to the client, and collaborate with the client to sign the transition service based on the private key fragments stored by each party to obtain a first service signature of the transition service.
[0074] The target service node can send the above-generated transition service to the client, and then collaborate with the client to sign the transition service based on the private key shards they each save, to obtain the service signature of the transition service. This service signature can be referred to as the first service signature of the transition service. It is understandable that the first service signature is consistent with the signature obtained by directly using the node private key to sign the transition service (such as encrypting the hash value of the transition service). However, the first service signature is obtained by the target service node collaborating with the client to encrypt the hash value of the transition service based on the private key shards they each save.
[0075] Optionally, for security reasons, the target business node may also use its own private key shard to sign the transition business (such as encrypting the hash value of the transition business) to obtain the business signature of the transition business. This business signature can be called the third business signature, and then the third business signature and the transition business are sent to the client for collaborative signature processing.
[0076] The private key fragment stored by the target service node and the public key fragment corresponding to the private key fragment can constitute a key pair. That is, data encrypted using the private key fragment stored by the target service node can be decrypted using the public key fragment corresponding to the private key fragment stored by the target service node. The public key fragment corresponding to the private key fragment stored by the target service node can be public, so the client can know (or store) the public key fragment corresponding to the private key fragment stored by the target service node. After receiving the third service signature and the transition service, the client can verify the received third service signature (i.e., verify the signature) using the public key fragment corresponding to the private key fragment stored by the target service node to obtain a verification result for the third service signature. The principle of verifying the third service signature using the public key fragment corresponding to the private key fragment stored by the target service node to obtain the verification result for the third service signature is the same as the principle of verifying the second service signature using the public key fragment corresponding to the private key fragment stored by the client to obtain the verification result for the second service signature, and will not be further described here.
[0077] If the verification result of the third service signature indicates that the third service signature verification is successful, the client can cooperate with the target service node to perform signature processing on the transition service, so that the target service node can obtain the first service signature of the transition service.
[0078] Optionally, the process of the target business node cooperating with the client to sign the transition business may include: since the target business node is the node that submits the business to the consensus network, the target business node can mainly sign the transition business. After obtaining the transition business, the client can verify the business information in the transition business (such as whether the format of the verification information is correct or whether the verification information is complete, etc.). After the client successfully verifies the business information in the transition business (that is, after confirming that the business information in the transition business is correct), it can send an encrypted private key shard to the target business node. The encrypted private key shard can be obtained by homomorphically encrypting the private key shard saved by the client. Among them, homomorphic encryption is an encryption algorithm, which has a characteristic, that is, it can make the processing result of the homomorphically encrypted data consistent with the processing result of the original data (such as the private key shard saved by the client). After receiving the encrypted private key fragment sent by the client, the target business node can sign the transition business using the encrypted private key fragment and the private key fragment saved by the target business node itself (the signature effect achieved is the same as the effect of directly using the node private key to sign the transition business), and obtain the first business signature of the transition business.
[0079] It can be understood that the embodiments of the present application also support the client to sign the transition service; similarly, the target service node can also perform homomorphic encryption on the private key shards it saves to obtain the corresponding encrypted private key shards, and can give the encrypted private key shards to the client. The client can also sign the transition service by combining the encrypted private key shards with the private key shards it saves to obtain the service signature of the transition service (the same as the first service signature).
[0080] Step S104: Generate a second service based on the first service signature and the transition service, and send the second service to the consensus network so that the consensus network performs consensus processing on the second service.
[0081] The target service node can combine the first service signature and the transition service to generate a second service, and the second service includes the transition service and the first service signature of the transition service. In one implementation, the transition service may include a signature field, and the field information at the signature field in the transition service is empty, that is, there is no field information at the signature field in the transition service (that is, there is no service signature). Therefore, the first service signature can be encapsulated into the signature field in the transition service, that is, the first service signature is used as the field information at the signature field in the transition service, and the second service can be obtained. In other words, the second service refers to the service obtained after encapsulating the first service signature into the transition service. The second service is the service that calls the service contract. The so-called calling the service contract here can also be understood as calling the consensus network where the service contract is deployed.
[0082] Please refer to Figure 6, which is a schematic diagram of a scenario for generating a second business provided by this application. As shown in Figure 6, after the target business node collaborates with the client to sign the transition business and obtains the first business signature of the transition business (i.e., Sig(new_TX) here), it can add the first business signature to the signature field RSV in the transition business to obtain the second business. The transition business here can be generated based on the process described in the embodiment corresponding to Figure 5 above. The contract address called by the second business is the contract address of the business contract. The target business node can send the second business to the consensus network so that the consensus network can perform consensus processing on the second business based on the deployed business contract.
[0083] In one embodiment, the consensus network may include multiple consensus nodes, and the process of the target business node sending the second business to the consensus network may include: the target business node may send the second business to the target consensus node among the multiple consensus nodes, so that the target consensus node can re-broadcast the received second business to other consensus nodes in the consensus network, and finally each consensus node in the consensus network can receive the second business. In this way, each consensus node in the consensus network can jointly perform consensus processing on the second business based on the deployed business contract. Schematically, the target consensus node can be any consensus node among the multiple consensus nodes of the consensus network, or the target consensus node can also be the consensus node among the multiple consensus nodes that is closest to the target business node (it can be geographically closest, which can make the data transmission line shorter, the data transmission overhead smaller, and the data transmission speed faster).
[0084] Since the second business may contain the processing result of the business information of the target type, the consensus node in the consensus network can check the processing result in the second business after receiving the second business. If it is determined that the processing result is a legal result (that is, the consensus node can confirm the processing result), the second business can be processed by consensus. For example, if the business information of the target type in the first business is the identity information of the client, the processing result can be the identity authentication result of the client. Therefore, if the consensus node determines that the identity authentication result is the result of successful authentication of the client's identity (such as the result of authenticating that the client's identity is legal), the consensus node can perform consensus processing on the received second business.
[0085] Optionally, as can be seen from the above, the first business signature is consistent with the signature obtained by directly encrypting the hash value of the transition business using the node private key. Therefore, any consensus node (any consensus node in the blockchain network, which may be the target consensus node or not) can call the business contract to perform consensus processing on the second business. It should be noted that each consensus node can save the node public key of the target business node (also called the global public key), and the node public key and the node private key of the target business node (also called the global private key) form a key pair. Based on the characteristics of the ECDSA m-n multi-signature algorithm itself, the node public key can be equal to the sum of the public key shards corresponding to the private key shards saved by all parties participating in the key interaction process (all clients connected to the target business node and the target business node), and the node public key can be public.
[0086] The process of any consensus node calling a business contract to perform consensus processing on the second business may include: the any consensus node may call the business contract to use the node public key of the target business node to verify the first business signature in the second business (i.e., signature verification processing), including: the any consensus node may use the node public key to decrypt the first business signature in the second business, and the hash value obtained by decryption may be referred to as the decrypted hash value. The any consensus node may also call the business contract to perform hash calculation on the business information other than the first business signature in the second business, and the calculated hash value may be referred to as the calculated hash value. Therefore, if the calculated hash value is consistent with the decrypted hash value (i.e., the same), it can be determined that the consensus of the second business by any consensus node is successful (in fact, the consensus process for the second business may also include other consensus operations related to the second business itself. For example, when the second business is a resource transfer business, it is also necessary to verify whether the resources owned by the resource transfer party are sufficient to perform the corresponding number of resource transfer operations, etc. The specific operations can be determined based on the actual application scenario).
[0087] Optionally, when more than a specified number of consensus nodes in the consensus network (such as more than 2f+1, where f is a positive integer and f is the maximum number of malicious nodes that can be accommodated in the consensus network) have successfully reached consensus on the second business, it indicates that the second business has successfully reached consensus in the consensus network, and the consensus network (i.e., the consensus node in the consensus network) can also call the business contract to execute the second business, obtain the execution result of the second business, and can process the second business and the execution result of the second business on the chain (i.e., store them in the blockchain network). The consensus network (such as the target consensus node in the consensus network) can return the execution result of the second business to the target business node, and the target business node can also store the execution result of the second business. For example, if the second business is a business that records the target data, the execution result of the second business can be the result of successfully recording the target data; for example, if the second business is a resource transfer business that transfers the target resources of the first account to the second account, the execution result of the second business can be the result of transferring the target resources of the first account to the second account, and so on.
[0088] Optionally, the target service node may further associate and store the execution result of the second service, the first service (which may be the original first service sent from the client without modification), and the second service.
[0089] In this application, the local contract's information processing logic can be public, but the local contract's information processing process (i.e., the execution process) is not public. Therefore, through the above process, the target type of business information can only exist in the target business node (such as only in the local contract of the target business node), and will not be exposed to other blockchain nodes in the blockchain network (such as consensus nodes). This prevents the target type of business information from being disclosed, thereby improving the security and privacy of the target type of business information in the business. Moreover, since the business node in this application can process the target type of business information in the business through the local contract, the subsequent consensus node does not need to process the target type of business information. Therefore, the target business node shares part of the workload of the consensus node for business processing, thereby reducing the load of the consensus node for business processing. In addition, since this application adopts a multi-signature algorithm, the client and the target business node respectively store the private key shards of the node private key. It is impossible to sign the business through the private key shard stored by a client itself. This makes it impossible for the client to bypass the target business node and directly send the business that has not been processed by the target business node (that is, the business that has not been verified by the target business node) to the consensus node, thereby improving the security of business processing. In addition, the method provided by this application allows the local contract in the target business node to execute more complex business logic, and the execution result (such as the processing result of the target type of business information) can be appended to the business (such as the first business initiated by the client), and the appended business (such as the transition business) can be confirmed by both the target business node and the client (that is, the two parties jointly sign the transition business based on their own private key shards to achieve confirmation). It can be understood that both the signature of the target business node on the transition business and the signature of the client on the transition business are retained. Therefore, it complies with the business rules of submitting the business to the consensus node, ensuring the security and credibility of the business.
[0090] In this application, a blockchain network may include a business network and a consensus network. The business network includes a target business node. A local contract is deployed in the target business node. The local contract is used to process business information of the target type in the business. The target type of business information refers to business information that the consensus network does not need to use during the consensus processing of the business, or business information that the consensus network does not need to use during the execution of the business after successfully reaching consensus on the business. By deploying a local contract in the target business node, the target business node has the ability to process business information of the target type. The target business node has a node private key. The target business node and the client each store a private key shard of the node private key. The private key shard of the node private key is obtained through key interaction between the target business node and the client. It can be seen that the target business node is able to perform key interaction with the client, so that the two can each obtain and store a private key shard of the node private key of the target business node. This allows the node private key to be distributedly managed on the target business node and the client, thereby improving the security of the node private key. The target business node can receive the first business sent by the client and extract the target type of business information from the first business; call the local contract to process the extracted target type of business information to obtain the processing result of the target type of business information. Since the deployment of the local contract enables the target business node to have the processing capability for the target type of business information, the target business node can pre-process the first business (i.e., pre-process the target type of business information in the first business) and then send the processing result of the target type of business information to the consensus network. This can alleviate the load pressure of the consensus network in processing business, allowing the target business node and the consensus network to collaboratively process business. Based on the processing result and the business information in the first business other than the target type of business information, the target business node generates a transition business; sends the transition business to the client, and collaborates with the client to sign the transition business based on the private key shards they each save, obtaining the first business signature of the transition business; generates a second business based on the first business signature and the transition business, and sends the second business to the consensus network, allowing the consensus network to perform consensus processing on the second business. Since the processing result obtained by the target business node for the pre-processing of the first business changes the first business originally initiated by the client and obtains a new business (i.e., a transitional business), the target business node needs to cooperate with the client to sign the new business based on the private key shards they each save, and obtain the signature of the new business (i.e., the first business signature). The second business can be generated through the new business and the signature of the new business and given to the consensus network for consensus processing. The joint signature of the new business by the target business node and the client solves the confirmation problem of the new business and improves the performance of the blockchain network in processing business.
[0091] Please refer to Figure 7, which is a flow chart of a contract deployment method provided by this application. The execution subject in the embodiment of this application can also be the above-mentioned target business node. As shown in Figure 7, the method may include:
[0092] Step S201: Generate a contract deployment service. The contract deployment service includes a local contract, and the contract deployment service is used to request deployment of the local contract in a target service node.
[0093] The target service node may generate a contract deployment service, which may include the local contract to be deployed (e.g., the contract code of the local contract). The local contract may be imported into the target service node, or the local contract may be written directly in the target service node, without limitation. The contract deployment service is a service for requesting the deployment of the local contract in the target service node.
[0094] Step S202: Submit the contract deployment business to the consensus network so that the consensus network can perform consensus processing on the contract deployment business.
[0095] The target business node can send the above-generated contract deployment business to the consensus network (which can be the same as the principle of sending the second business to the consensus network), so that each consensus node in the consensus network can perform consensus processing on the contract deployment business. If the contract deployment business is successfully agreed upon in the consensus network, the consensus network (i.e., the consensus node in the consensus network) can execute the contract deployment business. Executing the contract deployment business can mean: confirming the successful deployment of the local contract in the target business node. After executing the contract deployment business, the execution result of the contract deployment business can be obtained. The execution result can include status information of the contract deployment business (such as executed status information). The status information can include the local contract, and the status information can be used to indicate that the local contract is successfully deployed in the target business node.
[0096] Optionally, the target business node in this application may have two private keys, one of which is the node private key mentioned above. The node private key is used for key exchange processing between the target business node and the client to obtain the corresponding private key shard, so that the target business node can subsequently collaborate with the client to sign the repackaged client business (such as transition business). The other private key can be called the business private key of the target business node. The business private key can also have a corresponding public key (can be called a business public key). The business public key can be public. The business private key and the business public key can form a key pair. The business private key can be used to sign the target business node's own proprietary business (the business is usually unrelated to the client, such as the business can include the above-mentioned contract deployment business and the above-mentioned contract binding business, etc.). Optionally, after the target business node and the client perform key exchange processing on the node private key, the private key shard saved by the target business node can be used as the above-mentioned business private key. Alternatively, the business private key may not be the private key shard saved by the target business node for the node private key. The business private key can also be regenerated using the private key generation algorithm.
[0097] The consensus node in the consensus network can save the business public key of the target business node. The above-mentioned contract deployment business in this application can carry the business signature of the contract deployment business. The business signature can be obtained by the target business node using the business private key to sign other business information in the contract deployment business except the business signature. After obtaining the contract deployment business, the consensus node in the consensus network can use the above-mentioned business public key to verify the business signature in the contract deployment business (i.e., signature verification). If the verification is successful and it is confirmed that the contract deployment business has been successfully agreed upon in the consensus network, the contract deployment business can be executed to obtain the execution result of the contract deployment business.
[0098] Step S203, receiving the execution result of the contract deployment service sent by the consensus network; the execution result is the result of the contract deployment service being executed by the consensus network after the contract deployment service consensus is successfully reached.
[0099] The consensus network (i.e., the consensus node in the consensus network) can return the execution result of the contract deployment business to the target business node. The target business node can obtain the successfully deployed local contract (i.e., the local contract deployed by synchronizing from the consensus network) through the execution result of the contract deployment business, and confirm that the local contract is successfully deployed at the target business node.
[0100] By adopting the above method described in this application, the successful deployment of the local contract in the target business node can be achieved through business means.
[0101] Please refer to Figure 8, which is a schematic diagram of a process for deploying a local contract provided by this application. As shown in Figure 8, the process may include:
[0102] S1: The target business node can request the consensus node to deploy a local smart contract (i.e., a local contract, such as a business request through the above contract deployment), and the code of the local smart contract can be included in the request.
[0103] S2: After receiving the request from the target business node, the consensus node (which can be any consensus node in the consensus network) can perform a deployment operation. The principle of performing the deployment operation can be to reach consensus in the consensus network and perform the contract deployment business. By performing the deployment operation, the local contract can be successfully deployed in the target business node.
[0104] S3: The consensus node can return the deployment result of the local contract (which can be the execution result of the contract deployment business) to the target business node, so that the target business node can synchronously deploy the successful local contract from the consensus node, so that the subsequent target business node can call the local contract.
[0105] S4: After learning that the local contract has been successfully deployed, the target business node can also request the consensus node to set the access address of the local contract. The access address can be the public key shard corresponding to the private key shard saved by each client connected to the target business node. The access address can be used for subsequent verification of the business initiated by the client (such as the first business), so that only the client whose public key shard corresponding to the saved private key shard is set as the access address of the local contract can initiate the corresponding business (such as the first business) to the target business node, that is, only the client whose public key shard corresponding to the saved private key shard is set as the access address of the local contract can initiate the business of calling the local contract to the target business node. The business can be successfully verified by the target business node and then perform information processing (such as pre-processing of the first business).
[0106] S5: After receiving the request from the target business node to set the local contract's access address, the consensus node sets the access address for the local contract. This means setting the public key shard corresponding to the private key shard stored by each client connected to the target business node as the local contract's access address. Optionally, the request may also include the public key shard corresponding to the private key shard stored by each client connected to the target business node.
[0107] Optionally, the process in which the target business node requests the consensus node to set the access address of the local contract can also be achieved by the target business node initiating a service for setting the access address of the local contract to the consensus node (which can be called an access address setting service). After receiving the access address setting service, the consensus node can perform consensus processing on the access address setting service. After the access address setting service is successfully consensused in the consensus network, the consensus node can execute the access address setting service. Executing the access address setting service is to set the access address of the local contract.
[0108] S6: The consensus node can return the setting result (such as the execution result of the access address setting business) to the target business node, and the target business node will know that the access address of the local contract has been set successfully. Subsequently, only the clients that participate in the key interaction processing of the private key shard of the node private key of the target business node (that is, the clients connected to the target business node) can call the local contract deployed in the target business node.
[0109] Subsequently, the client can query the local contract from the target business node or the consensus node to ensure that the local contract deployed in the target business node is consistent with the local contract that has been agreed upon by each consensus node in the consensus network.
[0110] Please refer to Figure 9, which is a schematic diagram of the structure of a business processing device for a blockchain network provided in this application. The blockchain network comprises a business network and a consensus network. The business network comprises a target business node, which is deployed with a local contract. The local contract is used to process target-type business information within the business. The target-type business information is business information that the consensus network does not need to witness, i.e., business information that the consensus network does not need to use during the consensus processing of the business, or business information that the consensus network does not need to use during the execution of the business after successfully reaching consensus on the business. The target business node has a node private key. The target business node and the client each store a private key shard of the node private key obtained through key exchange. The business processing device for this blockchain network can be applied to the target business node. As shown in Figure 9, the business processing device 901 of this blockchain network may include: a receiving module 9011, a calling module 9012, a signing module 9013, and a consensus module 9014.
[0111] The receiving module 9011 is used to receive the first business sent by the client and extract business information of the target type from the first business. The business information of the target type is business information that the consensus network does not need to witness. The so-called no need for witness means: business information that the consensus network does not need to use in the process of consensus processing of the business, or business information that the consensus network does not need to use in the process of executing the business after successfully reaching consensus on the business.
[0112] A calling module 9012 is configured to call a local contract to process the target type of business information, obtain a processing result of the target type of business information, and generate a transition business based on the processing result and other business information in the first business except the target type of business information;
[0113] The signature module 9013 is used to send the transition service to the client and collaborate with the client to sign the transition service based on the private key shards stored by each client to obtain a first service signature for the transition service.
[0114] The consensus module 9014 is used to generate a second service based on the first service signature and the transition service, and send the second service to the consensus network so that the consensus network performs consensus processing on the second service.
[0115] Optionally, the first business includes a called contract address, which is the contract address of a local contract. A business contract is deployed in the consensus network, and the consensus network performs business processing by calling the business contract. The first business includes a second business signature, which is obtained by the client signing other business information in the first business except the second business signature based on the stored private key sharding.
[0116] The calling module 9012 generates a transition service mode based on the processing result and service information of the first service except the service information of the target type, including:
[0117] Replacing the service information of the target type contained in the first service with the processing result, and removing the second service signature in the first service to obtain an initial transition service;
[0118] Change the contract address of the first business call in the initial transition business from the contract address of the local contract to the contract address of the business contract to generate a transition business.
[0119] Optionally, there is a binding relationship between the contract address of the local contract and the contract address of the business contract;
[0120] The calling module 9012 modifies the contract address of the first business call in the initial transition business from the contract address of the local contract to the contract address of the business contract, and generates a transition business method, including:
[0121] Get the contract address that is bound to the local contract address;
[0122] The contract address of the first business call in the initial transition business is modified from the contract address of the local contract to the contract address of the business contract that has a binding relationship with the contract address of the local contract to generate a transition business.
[0123] Optionally, the signature module 9013 collaborates with the client to sign the transition service based on the private key shards stored by each of the clients to obtain the first service signature of the transition service, including:
[0124] Obtain the encrypted private key shard sent by the client; the encrypted private key shard is sent by the client after successfully verifying the transition service. The encrypted private key shard is obtained by homomorphically encrypting the private key shard stored by the client.
[0125] Based on the encrypted private key shard and the private key shard stored in the target service node, the transition service is signed to obtain a first service signature of the transition service.
[0126] Optionally, the first service includes a second service signature, and the second service signature is obtained by the client signing service information in the first service except the second service signature based on the private key shard stored by the client.
[0127] The receiving module 9011 extracts the target type of service information from the first service, including:
[0128] Using the public key shard corresponding to the private key shard stored by the client, verifying the second service signature in the first service to obtain a verification result of the second service signature;
[0129] If the verification result of the second service signature is used to indicate that the verification of the second service signature is successful, service information of the target type is extracted from the first service.
[0130] Optionally, the signature module 9013 sends the transition service to the client in the following manner:
[0131] The transition service is signed using the private key shard stored in the target service node to obtain the third service signature of the transition service;
[0132] Send the third service signature and transition service to the client;
[0133] Among them, the client is used to verify the received third business signature based on the public key shard corresponding to the private key shard saved by the target business node, and after the third business signature is successfully verified, it is used to cooperate with the target business node to sign the transition business.
[0134] Optionally, the transition service includes a signature field, and the field information of the signature field in the transition service is empty;
[0135] The consensus module 9014 generates the second service based on the first service signature and the transition service, including:
[0136] The first service signature is encapsulated into the signature field in the transition service to generate a second service.
[0137] Optionally, the target type of service information included in the first service is identity information of the client; and the processing result is an identity authentication result of the client;
[0138] The calling module 9012 calls the local contract to process the extracted target type of business information to obtain the processing result of the target type of business information, including:
[0139] Call the local contract to perform identity authentication on the client based on the extracted client identity information and obtain the client's identity authentication result.
[0140] Optionally, after receiving the second service, the consensus network is configured to extract an identity authentication result from the second service;
[0141] The consensus network is used to perform consensus processing on the second service after determining that the identity of the client initiating the second service is legitimate based on the identity authentication result.
[0142] Optionally, the consensus network includes multiple consensus nodes; the way in which the consensus module sends the second business to the consensus network includes:
[0143] Sending the second service to a target consensus node among the multiple consensus nodes, so that the target consensus node broadcasts the second service to other consensus nodes among the multiple consensus nodes;
[0144] The target consensus node is any consensus node in the consensus network, and multiple consensus nodes in the consensus network are used to perform consensus processing on the received second business.
[0145] Optionally, the first service signature is consistent with a service signature obtained by encrypting a hash value of the transition service using a node private key;
[0146] The process of consensus processing of the second service by any consensus node in the consensus network includes:
[0147] Decrypting the first service signature in the second service using the node public key corresponding to the node private key to obtain a decrypted hash value;
[0148] Performing hash calculation on other service information in the second service except the first service signature to obtain a calculated hash value;
[0149] If the calculated hash value is consistent with the decrypted hash value, it is determined that any consensus node has successfully reached consensus on the second service.
[0150] Optionally, the device 901 is further used for:
[0151] Generate a contract deployment service; the contract deployment service includes a local contract, and the contract deployment service is used to request the deployment of the local contract in the target business node;
[0152] Send the contract deployment business to the consensus network, so that the consensus network can reach a consensus on the contract deployment business;
[0153] Receive the execution result of the contract deployment business sent by the consensus network; the execution result is the result of the contract deployment business executed by the consensus network after the contract deployment business consensus is successfully reached;
[0154] The execution result of the contract deployment service includes the status information of the contract deployment service, the status information includes the local contract, and the status information is used to indicate that the local contract deployment is successful.
[0155] Optionally, the device 901 is further used for:
[0156] Receive the execution result of the second business sent by the consensus network; the execution result is the result of executing the second business after the consensus network successfully reaches consensus on the second business;
[0157] The execution result of the second service, the first service, and the second service are stored in association.
[0158] According to one embodiment of the present application, the steps involved in the business processing method of the blockchain network shown in Figure 3 can be performed by various modules in the business processing device 901 of the blockchain network shown in Figure 9. For example, step S101 shown in Figure 3 can be performed by the receiving module 9011 in Figure 9, and step S102 shown in Figure 3 can be performed by the calling module 9012 in Figure 9; step S103 shown in Figure 3 can be performed by the signature module 9013 in Figure 9, and step S104 shown in Figure 3 can be performed by the consensus module 9014 in Figure 9.
[0159] In this application, a blockchain network may include a business network and a consensus network. The business network includes a target business node. A local contract is deployed in the target business node. The local contract is used to process business information of the target type in the business. The target type of business information refers to business information that the consensus network does not need to use during the consensus processing of the business, or business information that the consensus network does not need to use during the execution of the business after successfully reaching consensus on the business. By deploying a local contract in the target business node, the target business node has the ability to process business information of the target type. The target business node has a node private key. The target business node and the client each store a private key shard of the node private key. The private key shard of the node private key is obtained through key interaction between the target business node and the client. It can be seen that the target business node is able to perform key interaction with the client, so that the two can each obtain and store a private key shard of the node private key of the target business node. This allows the node private key to be distributedly managed on the target business node and the client, thereby improving the security of the node private key. The target business node can receive the first business sent by the client and extract the target type of business information from the first business; call the local contract to process the extracted target type of business information to obtain the processing result of the target type of business information. Since the deployment of the local contract enables the target business node to have the processing capability for the target type of business information, the target business node can pre-process the first business (i.e., pre-process the target type of business information in the first business) and then send the processing result of the target type of business information to the consensus network. This can alleviate the load pressure of the consensus network in processing business, allowing the target business node and the consensus network to collaboratively process business. Based on the processing result and the business information in the first business other than the target type of business information, the target business node generates a transition business; sends the transition business to the client, and collaborates with the client to sign the transition business based on the private key shards they each save, obtaining the first business signature of the transition business; generates a second business based on the first business signature and the transition business, and sends the second business to the consensus network, allowing the consensus network to perform consensus processing on the second business. Since the processing result obtained by the target business node for the pre-processing of the first business changes the first business originally initiated by the client and obtains a new business (i.e., a transitional business), the target business node needs to cooperate with the client to sign the new business based on the private key shards they each save, and obtain the signature of the new business (i.e., the first business signature). The second business can be generated through the new business and the signature of the new business and given to the consensus network for consensus processing. The joint signature of the new business by the target business node and the client solves the confirmation problem of the new business and improves the performance of the blockchain network in processing business.
[0160] According to one embodiment of the present application, the various modules in the business processing device 901 of the blockchain network shown in Figure 9 can be separately or completely combined into one or several units to constitute, or one (some) of the units can be further divided into multiple functionally smaller sub-units to achieve the same operation without affecting the realization of the technical effects of the embodiments of the present application. The above modules are divided based on logical functions. In actual applications, the functions of a module can also be implemented by multiple units, or the functions of multiple modules can be implemented by one unit. In other embodiments of the present application, the business processing device 901 of the blockchain network can also include other units. In actual applications, these functions can also be implemented with the assistance of other units and can be implemented by collaboration of multiple units.
[0161] According to one embodiment of the present application, a business processing device 901 of a blockchain network as shown in FIG9 can be constructed, and the business processing method of the blockchain network of the embodiment of the present application can be implemented by running a computer program capable of executing each step involved in the corresponding method as shown in FIG3 on a general-purpose computer device such as a computer including processing elements and storage elements such as a central processing unit (CPU), a random access memory (RAM), and a read-only memory (ROM). The computer program can be recorded on a computer-readable recording medium, for example, and loaded into the computing device via the computer-readable recording medium and executed therein.
[0162] Please refer to Figure 10, which is a schematic diagram of the structure of a computer device provided in this application. As shown in Figure 10, the computer device 1000 may include: a processor 1001, a network interface 1004 and a memory 1005. In addition, in some embodiments, the computer device 1000 may also include: a user interface 1003 and at least one communication bus 1002. The communication bus 1002 is used to implement connection and communication between these components. The user interface 1003 may include a display screen (Display) and a keyboard (Keyboard). Optionally, the user interface 1003 may also include a standard wired interface and a wireless interface. The network interface 1004 may optionally include a standard wired interface and a wireless interface (such as a Wi-Fi interface). The memory 1005 may be a high-speed RAM memory or a non-volatile memory (non-volatile memory), such as at least one disk storage. The memory 1005 may also optionally be at least one storage device located away from the aforementioned processor 1001. As shown in Figure 10, the memory 1005, which is a computer storage medium, may include an operating system, a network communication module, a user interface module and a computer program.
[0163] In the computer device 1000 shown in Figure 10, the network interface 1004 can provide a network communication function; the user interface 1003 is mainly used to provide an input interface for the user; and the processor 1001 can be used to call the computer program stored in the memory 1005 to implement the implementation methods provided by the steps shown in Figures 3 and 8 above. For details, please refer to the implementation methods provided by the above steps, which will not be repeated here. It should be understood that the computer device 1000 described in the embodiment of the present application can execute the description of the business processing method of the above-mentioned blockchain network in the corresponding embodiments of Figures 3 to 8 above, and can also execute the description of the business processing device 901 of the above-mentioned blockchain network in the corresponding embodiment of Figure 9 above, which will not be repeated here. In addition, the description of the beneficial effects of using the same method will not be repeated.
[0164] In addition, it should be noted that the present application also provides a computer-readable storage medium, and the computer-readable storage medium stores a computer program. When the processor executes the computer program, it can perform the description of the business processing method of the blockchain network in the embodiment corresponding to Figure 3 above. Therefore, it will not be repeated here. In addition, the description of the beneficial effects of using the same method will not be repeated. For technical details not disclosed in the computer storage medium embodiment involved in this application, please refer to the description of the method embodiment of this application.
[0165] As an example, the above-mentioned computer program can be deployed and executed on one computer device, or deployed and executed on multiple computer devices located in one location, or executed on multiple computer devices distributed in multiple locations and interconnected by a communication network. Multiple computer devices distributed in multiple locations and interconnected by a communication network can constitute a blockchain network.
[0166] The computer-readable storage medium may be an internal storage unit of the computer device, such as a hard disk or memory of the computer device. The computer-readable storage medium may also be an external storage device of the computer device, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped with the computer device. Furthermore, the computer-readable storage medium may include both an internal storage unit of the computer device and an external storage device. The computer-readable storage medium is used to store the computer program and other programs and data required by the computer device. The computer-readable storage medium may also be used to temporarily store data that has been output or is about to be output.
[0167] This application provides a computer program product, which includes a computer program stored in a computer-readable storage medium. The processor of a computer device reads the computer program from the computer-readable storage medium and executes the computer program, causing the computer device to perform the description of the business processing method of the blockchain network in the embodiment corresponding to Figure 3 above. Therefore, it will not be repeated here. In addition, the description of the beneficial effects of using the same method will not be repeated. For technical details not disclosed in the computer-readable storage medium embodiment involved in this application, please refer to the description of the method embodiment of this application.
[0168] The terms "first", "second", etc. in the description, claims, and drawings of the embodiments of the present application are used to distinguish different objects, rather than to describe a specific order. In addition, the terms "comprising" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, apparatus, product, or device comprising a series of steps or units is not limited to the listed steps or modules, but may optionally include steps or modules not listed, or may optionally include other step units inherent to these processes, methods, apparatuses, products, or devices.
[0169] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in terms of function in the above description. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0170] The above disclosure is only a preferred embodiment of the present application, and certainly cannot be used to limit the scope of rights of the present application. Therefore, equivalent changes made according to the claims of the present application are still within the scope covered by the present application.
Claims
1. A business processing method of a blockchain network, characterized in that: The blockchain network includes a business network and a consensus network, the business network includes a target business node, and a local contract is deployed in the target business node; the target business node has a node private key, and the target business node and the client each store a private key shard of the node private key, and the private key shard of the node private key is obtained by key interaction processing between the target business node and the client; The method is performed by the target service node, and the method includes: Receive a first service sent by the client, and extract service information of a target type from the first service, where the service information of the target type refers to service information that is not required to be used by the consensus network in the process of consensus processing of the service, or service information that is not required to be used in the process of executing the service after the consensus network successfully reaches consensus on the service; Calling the local contract to process the business information of the target type, and obtaining a processing result of the business information of the target type; generating a transition service based on the processing result and other service information in the first service except the service information of the target type; Sending the transition service to the client, and cooperating with the client to sign the transition service based on the private key fragments stored by each party, to obtain a first service signature of the transition service; A second service is generated based on the first service signature and the transition service, and the second service is sent to the consensus network so that the consensus network performs consensus processing on the second service.
2. The method according to claim 1, characterized in that The first service includes a contract address called by the first service, and the contract address called by the first service is the contract address of the local contract; a service contract is deployed in the consensus network, and the consensus network performs service processing by calling the service contract; the first service includes a second service signature, and the second service signature is obtained by the client after signing other service information in the first service except the second service signature based on the private key sharding saved by the client; The generating a transition service based on the processing result and other service information in the first service except the service information of the target type includes: Replacing the service information of the target type contained in the first service with the processing result, and removing the second service signature in the first service to obtain an initial transition service; The contract address called by the first business in the initial transition business is modified from the contract address of the local contract to the contract address of the business contract to generate the transition business.
3. The method according to claim 2, characterized in that There is a binding relationship between the contract address of the local contract and the contract address of the business contract; The step of modifying the contract address called by the first service in the initial transition service from the contract address of the local contract to the contract address of the service contract to generate the transition service includes: Obtain the contract address of the business contract that has a binding relationship with the contract address of the local contract; The contract address called by the first business in the initial transition business is modified from the contract address of the local contract to the contract address of the business contract to generate the transition business.
4. The method according to any one of claims 1 to 3, characterized in that: The step of coordinating with the client to perform signature processing on the transition service based on the private key fragments stored by each client to obtain a first service signature of the transition service includes: Obtaining the encrypted private key fragment sent by the client; the encrypted private key fragment is sent by the client after successfully verifying the transition service, and the encrypted private key fragment is obtained by the client performing homomorphic encryption processing on the private key fragment stored by itself; Based on the encrypted private key fragment and the private key fragment stored in the target service node, the transition service is signed to obtain the The first service signature of the transition service.
5. The method according to any one of claims 1 to 4, characterized in that: The first service includes the second service signature, and the second service signature is obtained by the client after signing other service information in the first service except the second service signature based on the private key fragment stored by the client itself; The extracting the service information of the target type from the first service includes: Using the public key fragment corresponding to the private key fragment stored by the client, verifying the second service signature in the first service to obtain a verification result of the second service signature; If the verification result of the second service signature indicates that the verification of the second service signature is successful, service information of the target type is extracted from the first service.
6. The method according to any one of claims 1 to 5, characterized in that: The sending the transition service to the client comprises: The transition service is signed by using the private key fragment stored in the target service node to obtain a third service signature of the transition service; The third service signature and the transition service are sent to the client, so that the client verifies the received third service signature based on the public key fragment corresponding to the private key fragment saved by the target service node, and cooperates with the target service node to sign the transition service after the third service signature is successfully verified.
7. The method according to any one of claims 1 to 6, characterized in that: The transition service includes a signature field, and field information at the signature field in the transition service is empty; The generating the second service based on the first service signature and the transition service comprises: The first service signature is encapsulated into the signature field in the transition service to generate the second service.
8. The method according to any one of claims 1 to 7, characterized in that: The service information of the target type included in the first service is the identity information of the client; the processing result is the identity authentication result of the client; The calling of the local contract to process the business information of the target type to obtain a processing result of the business information of the target type includes: The local contract is called to perform identity authentication processing on the client based on the extracted identity information of the client, and an identity authentication result of the client is obtained.
9. The method according to claim 8, characterized in that The consensus network performs consensus processing on the second service, including: After receiving the second service, the consensus network extracts the identity authentication result from the second service; After determining that the identity of the client initiating the second service is legitimate based on the identity authentication result, the consensus network performs consensus processing on the second service.
10. The method according to any one of claims 1 to 9, characterized in that: The consensus network includes a plurality of consensus nodes; and sending the second service to the consensus network includes: Sending the second service to a target consensus node among the multiple consensus nodes, so that the target consensus node broadcasts the second service to other consensus nodes among the multiple consensus nodes; Among them, the target consensus node is any consensus node in the consensus network, and multiple consensus nodes in the consensus network are used to perform consensus processing on the received second business.
11. The method according to any one of claims 1 to 10, characterized in that: The first service signature is consistent with a service signature obtained by encrypting the hash value of the transition service using the node private key; The process of any consensus node in the consensus network performing consensus processing on the second service includes: Using the node public key corresponding to the node private key, decrypting the first service signature contained in the second service to obtain a decrypted hash value; Performing hash calculation on other service information in the second service except the first service signature to obtain a calculated hash value; If the calculated hash value is consistent with the decrypted hash value, it is determined that any one of the consensus nodes has successfully reached consensus on the second service.
12. The method according to any one of claims 1 to 11, characterized in that: The method further comprises: Generate a contract deployment service; the contract deployment service includes the local contract, and the contract deployment service is used to request deployment of the local contract in the target service node; Sending the contract deployment service to the consensus network so that the consensus network performs consensus processing on the contract deployment service; Receiving the execution result of the contract deployment service sent by the consensus network; the execution result is the result of the contract deployment service being executed by the consensus network after the consensus network successfully reaches a consensus on the contract deployment service; The execution result of the contract deployment service includes status information of the contract deployment service, the status information includes the local contract, and the status information is used to indicate that the local contract is deployed successfully.
13. The method according to any one of claims 1 to 12, characterized in that: The method further comprises: Receiving the execution result of the second service sent by the consensus network; the execution result is the result of executing the second service after the consensus network successfully reaches a consensus on the second service; The execution result of the second service, the first service and the second service are stored in association.
14. A business processing device for a blockchain network, characterized in that: The blockchain network includes a business network and a consensus network, the business network includes a target business node, and a local contract is deployed in the target business node; the target business node has a node private key, and the target business node and the client each store a private key shard of the node private key, and the private key shard of the node private key is obtained by key interaction processing between the target business node and the client; The device is applied to the target service node, and the device includes: A receiving module, used to receive the first service sent by the client, and extract service information of a target type from the first service, wherein the service information of the target type refers to service information that is not needed to be used by the consensus network in the process of consensus processing of the service, or service information that is not needed to be used in the process of executing the service after the consensus network successfully reaches consensus on the service; A calling module, configured to call the local contract to process the business information of the target type, obtain a processing result of the business information of the target type, and generate a transition business based on the processing result and other business information in the first business except the business information of the target type; A signature module, used to send the transition service to the client, and cooperate with the client to sign the transition service based on the private key fragments saved by each client to obtain a first service signature of the transition service; A consensus module is used to generate a second service based on the first service signature and the transition service, and send the second service to the consensus network so that the consensus network performs consensus processing on the second service.
15. A computer program product, comprising a computer program, which, when executed by a processor, implements the steps of the business processing method of the blockchain network described in any one of claims 1 to 13.
16. A computer device, characterized in that: It includes a memory and a processor, the memory stores a computer program, and when the computer program is executed by the processor, the processor executes the steps of the business processing method of the blockchain network according to any one of claims 1 to 13.
17. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and the computer program is suitable for being loaded by a processor and executing the business processing method of the blockchain network described in any one of claims 1 to 13.
Citation Information
Patent Citations
Blockchain-based data processing system, method and apparatus
CN111461723A
Data processing method and device based on smart contract and readable storage medium
CN113379422A
Permission verification method and device, processor and electronic equipment
CN115065542A
Blockchain-based data processing method and apparatus, and device and readable storage medium
EP4050542A1
