A method, device, equipment and storage medium for off-chain computing power trading
By establishing a trading channel controller and identity verification mechanism in off-chain transactions, the problem of lack of credibility and transaction security of off-chain transaction data is solved, and the high credibility and transaction security of off-chain transaction data is achieved.
Patent Information
- Application Number
- CN202410864756.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-28
- Publication Date
- 2025-04-29
- Estimated Expiration
- 2044-06-28
AI Technical Summary
Off-chain transaction payment channel technology cannot guarantee the identity security of both parties and the security of transaction data. Off-chain transaction data lacks credibility, and the integrity and authenticity of the intermediate transaction status between on-chain transaction settlement cannot be guaranteed.
By establishing an off-chain transaction channel between the trading channel controller and both parties to the transaction, perform identity verification, and initiate an off-chain transaction settlement operation after the identity verification is passed. Receive the transaction settlement to be issued to verify digital vouchers, check whether a digital signature is attached, verify the signature, and issue a transaction settlement to verify digital vouchers and send it to both parties to the transaction.
It improves the credibility and verifiability of off-chain transaction data, ensures transaction security, and ensures the integrity and authenticity of the intermediate transaction status between on-chain and off-chain transaction settlements.
Smart Images

Figure CN118396624B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computing power trading, and in particular to an off-chain computing power trading method, device, equipment and storage medium. Background Art
[0002] Typical transaction applications or systems based on blockchain use cryptocurrency to transfer or trade digital assets. These applications use the characteristics of blockchain such as decentralization, distributed storage, data tamper-proofing, traceability, and cryptographic trust endorsement to provide strong technical support for distributed trading platforms. In order to improve the transaction efficiency of blockchain, the industry has proposed a transaction method that combines on-chain and off-chain. By establishing off-chain payment channels, fast off-chain transactions between transaction parties are achieved, which improves transaction speed and throughput, thereby achieving efficient and low-cost transactions.
[0003] However, the off-chain transaction payment channel technology cannot guarantee the identity security of both parties to the transaction and the security of transaction data, the off-chain transaction data lacks credibility, and the integrity and authenticity of the intermediate transaction status between on-chain transaction settlements cannot be guaranteed. Summary of the invention
[0004] In view of this, the present invention provides an off-chain computing power transaction method, device, equipment and storage medium to improve the credibility and verifiability of off-chain transaction data, thereby ensuring transaction security.
[0005] In a first aspect, the present invention provides an off-chain computing power trading method, which is applied to a trading channel controller, and the method includes:
[0006] Establishing an off-chain transaction channel between the transaction channel controller and the transaction parties, and using the transaction channel to verify the identities of the transaction parties;
[0007] In the case where the identity authentication of the two parties to the transaction is qualified, the off-chain transaction settlement operation is initiated by using the transaction channel, and based on the off-chain settlement operation of the two parties to the transaction, a verifiable digital certificate for transaction settlement to be issued from one of the parties is received; and the verifiable digital certificate for transaction settlement to be issued is checked to see whether the digital signatures of the two parties to the transaction are attached;
[0008] If yes, verify the digital signatures attached by both parties to the transaction;
[0009] If the verification is passed, the transaction settlement verifiable digital certificate is issued, and the issued transaction settlement verifiable digital certificate is sent to the transaction parties.
[0010] In combination with the first aspect, in a possible implementation, the transaction channel includes a first transaction channel and a second transaction channel, and the transaction parties include a computing power consumption end and a computing power supply end;
[0011] The step of establishing an off-chain transaction channel between the transaction channel controller and both parties to the transaction, and using the transaction channel to verify the identities of both parties to the transaction, includes:
[0012] Establish a first transaction channel of a decentralized application of a first computing power trading platform associated with the transaction channel controller and the computing power consumption end, and use the first transaction channel to verify the identity of the computing power consumption end; and establish a second transaction channel of a decentralized application of a second computing power trading platform associated with the transaction channel controller and the computing power supply end, and use the second transaction channel to verify the identity of the computing power supply end.
[0013] In combination with the first aspect, in another possible implementation, establishing a first transaction channel of a decentralized application of a first computing power trading platform associated with the transaction channel controller and the computing power consumer, and using the first transaction channel to verify the identity of the computing power consumer, includes:
[0014] Receiving an application message for creating a transaction channel initiated by the computing power consumer, wherein the application message includes declaration data of a transaction initiation verifiable digital certificate to be issued;
[0015] In response to the application message, verifying the identity of the computing power consumer;
[0016] If the identity verification is successful, the first transaction channel is created, and the first transaction channel information is generated and returned to the first computing power trading platform decentralized application.
[0017] In combination with the first aspect, in another possible implementation manner, verifying the identity of the computing power consumer includes:
[0018] Encrypting first preset data according to the public key of the computing power consumption end to obtain first encrypted data;
[0019] Sending the first encrypted data to the computing power consumer, and instructing the computing power consumer to decrypt the first encrypted data using the private key of the computing power consumer after receiving the first encrypted data;
[0020] Receiving second preset data from the computing power consumption end;
[0021] If the first preset data matches the second preset data, it is determined that the computing power consumer identity authorization authentication is passed.
[0022] In combination with the first aspect, in another possible implementation, establishing a second transaction channel of a decentralized application of a second computing power trading platform associated with the transaction channel controller and the computing power supplier, and using the second transaction channel to verify the identity of the computing power supplier includes:
[0023] Receive an application message for connecting to a designated transaction channel initiated by the computing power supply end, wherein the application message is triggered when the computing power supply end receives a transaction start message from the computing power consumption end;
[0024] In response to the application message for connecting to the designated transaction channel, verifying the identity of the computing power supplier;
[0025] If the identity verification is successful, the second transaction channel is created, and the second transaction channel information is generated and returned to the second computing power trading platform decentralized application.
[0026] In combination with the first aspect, in another possible implementation, the verification of the digital signatures attached by the two parties to the transaction includes: obtaining the distributed digital identity identifier DID documents of the two parties to the transaction from the digital identity chain, and reading the public key information of the transaction user from each of the DID documents; and using the read public key information to verify the digital signatures attached by the two parties to the transaction.
[0027] In combination with the first aspect, in another possible implementation, the issuance of the verifiable digital certificate for transaction settlement includes: writing the DID of the issuer, the issuance time and the digital signature in the verifiable digital certificate for transaction settlement, generating the issued verifiable digital certificate for transaction settlement, and the DID of the issuer is the DID of the transaction channel controller.
[0028] In combination with the first aspect, in another possible implementation, the method further includes: if the digital signatures attached to the transaction parties fail to be verified, replying an error prompt message to the transaction parties.
[0029] In combination with the first aspect, in another possible implementation, the method further includes: obtaining verifiable digital credential data of the most recent off-chain transaction settlement after N off-chain settlement cycles have passed between the two parties to the transaction;
[0030] According to the verifiable digital certificate data of the most recent off-chain transaction settlement, the supporting data of the verifiable digital certificate of the most recent off-chain transaction settlement is generated through a hash algorithm and a digital signature algorithm, wherein the supporting data includes the hash of the verifiable digital certificate of the most recent off-chain transaction settlement, the signature information of the transaction channel controller on the hash, and the DID of the transaction channel controller;
[0031] The supporting data of the verifiable digital certificate of the most recent off-chain transaction settlement is stored on the blockchain.
[0032] In combination with the first aspect, in another possible implementation, before establishing an off-chain transaction channel between the transaction channel controller and the transaction parties, it also includes: obtaining access information of a transaction chain node associated with the transaction channel controller, the access information including: the IP address, port number and connection method of the transaction chain node; connecting the transaction chain node through a pre-designed smart contract interface or SDK access interface, and writing the association information between the transaction channel controller and the transaction chain node into the blockchain, the data structure of the association information including a key-value pair consisting of the DID of the transaction channel controller and the ID of the transaction chain node.
[0033] In combination with the first aspect, in another possible implementation, the method further includes: counting its own load; when receiving a load query request sent by either party to the transaction, packaging the number of currently started transaction channels and system resource usage and sending them to the requesting party.
[0034] In combination with the first aspect, in yet another possible implementation, the transaction channel controller includes:
[0035] A transaction channel control module is used to dynamically start or stop a transaction channel, wherein the transaction channel provides a transmission channel for interactive data transmission between transaction parties;
[0036] A module for interacting with digital identity chain nodes, which is used to interact with the data of nodes on the digital identity chain, wherein the digital identity chain nodes are used to store DID documents, computing power service capability certificate templates, and computing power service capability verifiable digital certificates;
[0037] A data interaction module with a transaction chain node, used for data interaction with a transaction chain node, registering association information with the transaction chain node on the transaction chain, and uploading supporting data of a verifiable digital certificate for transaction settlement to the chain. The transaction chain node is used to store association information between the transaction channel controller and the transaction chain node, a transaction initiation template, a transaction settlement template, a verifiable digital certificate for transaction initiation, and supporting data of a verifiable digital certificate for transaction settlement;
[0038] The settlement certificate issuance and verification module is used for the issuance and verification of verifiable digital certificates for off-chain transaction settlement;
[0039] The load situation statistics and query module is used to count the load situation of the transaction channel controller and process load query requests.
[0040] In a second aspect, the present invention further provides an off-chain computing power trading method, which is applied to a decentralized application of a computing power trading platform, and the method comprises:
[0041] Establishing an off-chain transaction channel between a transaction channel controller and both parties to the transaction, and using the transaction channel to verify the identities of both parties to the transaction;
[0042] When the identity authentication of both parties to the transaction is qualified, the off-chain transaction settlement operation is initiated using the transaction channel, and the corresponding transaction settlement template is obtained from the transaction chain;
[0043] Create a transaction settlement verifiable digital certificate to be issued according to the transaction settlement template, and fill in the declaration data of the transaction settlement verifiable digital certificate according to the actual transaction data;
[0044] Adding the digital signature of the computing power consumer to the end of the declaration data of the transaction settlement verifiable digital certificate to be issued, and sending it to the other party of the transaction, so that the other party can check the declaration data of the transaction settlement verifiable digital certificate and add the corresponding digital signature;
[0045] Receiving the transaction settlement verifiable digital certificate issued by the transaction channel controller after verifying the transaction settlement verifiable digital certificate with digital signatures attached to both parties of the transaction;
[0046] According to the preset storage strategy of the computing power trading platform, the issued transaction settlement verifiable digital certificate is saved.
[0047] In conjunction with the second aspect, in a possible implementation manner, establishing a transaction channel between a transaction channel controller and transaction parties includes:
[0048] Acquire transaction channel controller list information from the transaction chain node, wherein the transaction channel controller list information includes at least one transaction channel controller;
[0049] Selecting a transaction channel controller from the at least one transaction channel controller according to the screening strategy, and establishing a transaction channel between the two transaction parties associated with the computing power trading platform decentralized application associated with the two transaction parties;
[0050] Wherein, the screening strategy includes any of the following:
[0051] According to the load of each available transaction channel controller, select a transaction channel controller with the smallest load;
[0052] According to the loop time delay between the decentralized application of the computing power trading platform and each trading channel controller, selecting a trading channel controller with the minimum delay;
[0053] According to the transaction chain nodes connected to the decentralized application access transaction chain of the computing power trading platform associated with the transaction parties, a transaction channel controller associated with any transaction chain node is selected.
[0054] In combination with the second aspect, in another possible implementation, before selecting a transaction channel controller from the at least one transaction channel controller according to the screening strategy, the method further includes:
[0055] Obtain transaction quotation information from the transaction chain node;
[0056] Acquire the transaction decision of the computing power consumer according to the transaction quotation information, and enable the transaction initiation template according to the transaction decision;
[0057] Fill in the verifiable digital certificate declaration data according to the transaction initiation template and the actual quotation data to generate a transaction initiation verifiable digital certificate;
[0058] After selecting a transaction channel controller from the at least one transaction channel controller according to the screening strategy, the method further includes:
[0059] Generate a transaction initiation message, wherein the transaction initiation message includes: the transaction initiation verifiable digital certificate to be issued and transaction channel information;
[0060] The transaction initiation message is sent to the computing power supplier so that the computing power supplier reviews and issues a verifiable digital certificate for the transaction initiation.
[0061] In combination with the second aspect, in another possible implementation manner, after sending the transaction initiation message to the computing power supplier, the process further includes:
[0062] receiving the transaction initiation message;
[0063] Reviewing the declaration data of the transaction initiation verifiable digital certificate to be issued in the transaction initiation message;
[0064] If the review is passed, the current transaction is approved and a verifiable digital certificate for initiating the transaction is issued;
[0065] If the review fails, the computing power consumer will be notified to exit the current transaction and close the transaction channel.
[0066] In combination with the second aspect, in another possible implementation, after saving the issued transaction settlement verifiable digital certificate, the method further includes:
[0067] Verifying off-chain transaction settlement data, wherein the off-chain transaction settlement data includes the issued transaction settlement verifiable digital certificate;
[0068] If the off-chain transaction settlement data is verified, the validity of the declaration data in the issued transaction settlement verifiable digital certificate is verified. The declaration data includes: the DID of the computing power supply end, the DID of the computing power consumption end, the specific transaction data, and the joint signature of the transaction parties on the declaration data;
[0069] If the content in the declaration data is verified, the declaration data is determined to be authentic and valid; otherwise, the declaration data is determined to be invalid data.
[0070] In combination with the second aspect, in yet another possible implementation, the method further includes:
[0071] Obtaining the attestation data of a verifiable digital certificate for off-chain transaction settlement from the transaction chain node, wherein the attestation data includes a hash of a verifiable digital certificate for off-chain transaction settlement, signature information of the transaction channel controller on the hash, and the DID of the transaction channel controller;
[0072] Obtain the corresponding off-chain transaction settlement verifiable digital certificate from either party of the transaction;
[0073] Obtain the corresponding DID document from the digital identity chain, and read the public key of the transaction channel controller from the DID document;
[0074] Using the public key verification, the transaction channel controller verifies the signature information of the hash, and verifies whether the most recent off-chain transaction settlement verifiable digital certificate is valid;
[0075] If the signature information is verified, and the off-chain transaction settlement verifiable digital certificate is authentic and valid, the off-chain transaction settlement verifiable digital certificate is converted into a second hash value using a hash function;
[0076] If the second hash value is consistent with the hash of the off-chain transaction settlement verifiable digital certificate, the verification is successful; otherwise, the verification fails.
[0077] In conjunction with the second aspect, in another possible implementation, the computing power trading platform decentralized application includes:
[0078] DID service module, used to complete DID identity registration, identity authentication, and identity query and update on the digital identity chain;
[0079] The verifiable digital certificate service module is used to complete the certificate creation, complete the registration of the transaction initiation template and the transaction settlement template, issue the transaction initiation verifiable digital certificate and create the transaction settlement verifiable digital certificate;
[0080] The transaction service module is used to obtain the transaction channel controller list information from the transaction chain node.
[0081] In a third aspect, the present invention provides a transaction channel controller, the transaction channel controller comprising:
[0082] A transaction channel control module is used to establish an off-chain transaction channel between the transaction channel controller and both parties to the transaction, and to verify the identities of both parties to the transaction using the transaction channel;
[0083] A settlement certificate issuance and verification module, used to initiate an off-chain transaction settlement operation using the transaction channel when the identity authentication of the transaction parties is qualified, and receive a transaction settlement verifiable digital certificate to be issued from one of the transaction parties based on the off-chain settlement operation of the transaction parties;
[0084] The settlement voucher issuance and verification module is further used to check whether the transaction settlement verifiable digital voucher is attached with the respective digital signatures of the transaction parties; and if it is checked that the respective digital signatures of the transaction parties are attached, verify the digital signatures attached by the transaction parties; if the verification by the verification module passes, issue the transaction settlement verifiable digital voucher;
[0085] The first sending module is used to send the issued transaction settlement verifiable digital certificate to the transaction parties.
[0086] In a fourth aspect, the present invention provides an off-chain computing power trading device, the device comprising:
[0087] The transaction service module is used to establish an off-chain transaction channel between a transaction channel controller and both parties to the transaction, and use the transaction channel to verify the identities of both parties to the transaction. When the identities of both parties to the transaction are qualified, the transaction channel is used to initiate an off-chain transaction settlement operation, and obtain a corresponding transaction settlement template from the transaction chain;
[0088] The transaction service module is further used to create a transaction settlement verifiable digital certificate to be issued according to the transaction settlement template, fill in the declaration data of the transaction settlement verifiable digital certificate according to the actual transaction data, and append the digital signature of the computing power consumer end to the end of the declaration data of the transaction settlement verifiable digital certificate;
[0089] A sending module, used to send the transaction settlement verifiable digital certificate attached with the digital signature of the computing power consumer to the other party of the transaction, so that the other party can check the declaration data of the transaction settlement verifiable digital certificate and attach the corresponding digital signature;
[0090] The receiving module is used to receive the transaction settlement verifiable digital certificate issued by the transaction channel controller after verifying the transaction settlement verifiable digital certificate with digital signatures attached to both parties of the transaction.
[0091] In a fifth aspect, the present invention provides a computer device, comprising: a memory and a processor, the memory and the processor being communicatively connected to each other, the memory storing computer instructions, and the processor executing the off-chain computing power trading method described in any one of the embodiments of the first aspect or the second aspect by executing the computer instructions.
[0092] In addition, the present invention provides a computer-readable storage medium, on which computer instructions are stored, and the computer instructions are used to enable a computer to execute the off-chain computing power trading method described in any embodiment of the first aspect or the second aspect above.
[0093] In a sixth aspect, the present invention also provides a computer program product, comprising computer instructions, which, when executed on a computer, enables the computer to execute the off-chain computing power trading method as described in any one of the embodiments of the first or second aspect above.
[0094] The off-chain computing power trading method provided in this embodiment adds the function of issuing verifiable digital certificates for transaction settlement to the transaction channel controller, avoiding the issuance of verifiable digital certificates for transaction settlement by both parties to the transaction, so that the credibility of the certificate data is verified by the transaction channel controller TCC and the verifiable digital certificates for off-chain transaction settlement can be verified through the transaction chain, thereby improving the credibility and verifiability of off-chain transaction data.
[0095] In addition, before issuing a verifiable digital certificate for transaction settlement, it is also necessary to verify whether the digital signatures of both parties to the transaction are attached to the certificate to be issued. The issuance operation is performed only after the verification is passed, further ensuring the security of off-chain transaction data and the identities of both parties, thereby ensuring the integrity and authenticity of the intermediate transaction status between on-chain and off-chain transaction settlements. BRIEF DESCRIPTION OF THE DRAWINGS
[0096] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0097] Figure 1 This is a diagram of the architecture of a computing power trading system provided by an embodiment of the present invention;
[0098] Figure 2It is a schematic diagram of data interaction inside and with the outside of a transaction channel controller provided by an embodiment of the present invention;
[0099] Figure 3 It is a flowchart of an off-chain computing power trading method provided by an embodiment of the present invention;
[0100] Figure 4 It is a flowchart of another off-chain computing power trading method provided by an embodiment of the present invention;
[0101] Figure 5 It is a signaling flow chart of an off-chain computing power trading method provided by an embodiment of the present invention;
[0102] Figure 6 It is a flowchart of another off-chain computing power trading method provided by an embodiment of the present invention;
[0103] Figure 7 It is a flowchart of another off-chain computing power trading method provided by an embodiment of the present invention;
[0104] Figure 8 It is a signaling flow chart of another off-chain computing power trading method provided by an embodiment of the present invention;
[0105] Fig. 9 is a structural block diagram of a transaction channel controller provided by an embodiment of the present invention;
[0106] Fig.10 It is a structural block diagram of an off-chain computing power trading device provided by an embodiment of the present invention;
[0107] Fig.11 It is a schematic diagram of the hardware structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0108] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.
[0109] The technical solution of this application is applied to the field of blockchain network and computing power transaction. Specifically, the embodiment of the present invention discloses a method and device for off-chain computing power transaction. Furthermore, it involves a computing power transaction method combining blockchain, DID, VC and on-chain and off-chain. On the basis of this solution, as long as the transaction data model is expanded and customized in small amounts, it can support more types of transactions and is suitable for a wider range of digital transaction scenarios in the digital economy.
[0110] First, the technical scenario and related technical terms of the present invention are explained.
[0111] (1) Computing network
[0112] Computing Power Network (CPN) is a backbone network that supports various computing applications and provides the necessary computing resources for tasks such as simulation, data mining, model training and reasoning. A typical CPN usually has a two-layer structure: the bottom layer consists of basic hardware infrastructure such as computing nodes and network devices, and the upper layer module uses software-defined network technology to organize and manage computing nodes in the computing network, so that they can act as a cohesive entity to provide users with unified and comprehensive computing services.
[0113] (2) Blockchain transaction efficiency
[0114] Blockchain technology has the characteristics of decentralization, distributed storage, data tamper-proof, traceability and encrypted trust endorsement, providing strong technical support for distributed trading platforms. Blockchain systems can be mainly divided into two types: permissionless chains and permissioned chains.
[0115] Among them, the permissionless chain is also called the "public chain", and the permissioned chain is also called the "alliance chain". Transactions on the public chain are usually conducted using cryptocurrencies.
[0116] In addition, the accounting rules of blockchain networks (such as consensus, verification, etc.) significantly limit transaction speed, making it unsuitable for scenarios involving small-value, high-frequency transactions. Although consortium blockchains (referred to as consortium chains) have greatly improved transaction efficiency, they still cannot meet the instant settlement needs of high-frequency transactions. In order to meet these challenges, the industry has proposed a transaction processing technology that combines on-chain and off-chain.
[0117] (3) Blockchain transaction security:
[0118] Although transaction efficiency has been improved, issues of identity and transaction security have also arisen. Especially in a distributed system based on blockchain, ensuring transaction and identity security is crucial.
[0119] During blockchain transactions, the lack of reliable user authentication or trusted transaction mechanisms may lead to identity fraud. For example, an artist's work was auctioned on an NFT market platform without his knowledge. In order to solve the problems of identity security and trusted transactions, the industry has proposed some methods, including identity authentication, data access control or authorization, and cryptography. In order to meet these challenges, decentralized identifiers (DID) and verifiable credentials (VC) technologies are used to solve identity and transaction security issues.
[0120] At present, there are five main technical specifications, including DID, DID Documents, DID Resolvers, DID Specification Registries, and Verifiable Credentials (VC). These technical specifications are widely used in the construction of distributed digital identity and credential systems to ensure the trusted flow of identities and credentials on different networks and platforms.
[0121] The off-chain transaction payment channel technology cannot guarantee the identity security of both parties to the transaction and the security of transaction data. The off-chain transaction data lacks credibility. At the same time, the integrity and authenticity of the intermediate transaction status between on-chain transaction settlements cannot be guaranteed.
[0122] In order to improve the processing efficiency and security of off-chain computing power transactions, an embodiment of the present invention proposes a computing power transaction method based on blockchain, DID, VC and the combination of on-chain and off-chain.
[0123] It should be noted that the steps shown in the flowcharts of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and that, although a logical order is shown in the flowcharts, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0124] See also Figure 1 , is an implementation example of a computing power trading system based on the embodiment method of the present invention, including two parts, namely a blockchain and an off-chain processing unit.
[0125] The blockchain includes: a digital identity chain and a transaction chain. Specifically, the digital identity chain stores the DID documents of computing power supply users and computing power consumption users, the DID documents of the transaction channel controller, the VC certificate of the computing power supply user's ability to provide computing power service capabilities, and the computing power service capability certificate declaration data template (Claim Protocol Type, CPT) template, referred to as CPT template, etc.
[0126] Before registering a DID identity with the digital identity chain, any entity, such as a computing power user and a transaction channel controller, will create an asymmetric key pair and write the corresponding public key into the DID document. The DID document will be written into the digital identity chain (i.e., stored on the chain), while the corresponding private key will be kept by the entity itself, such as by the computing power user. After any entity completes the DID identity registration, the registered entity will obtain a distributed digital identity identifier (DID), which is a string of characters that uniquely identifies the entity's identity.
[0127] In addition, the digital identity chain contains a special user, namely the authoritative institution user (a user designated by all participating institutions through election or internal deliberation), who is responsible for the review and authentication of user identity registration. At the same time, the authoritative institution user will create a computing power service capability certificate CPT template and provide computing power service capability certificate issuance services for computing power supply users.
[0128] The transaction chain includes all transaction chain nodes, and each transaction chain node of the transaction chain can be connected to a transaction channel controller (TCC). A target transaction chain node is determined in the transaction chain. After the target transaction chain node is determined, a call instruction can be sent to the target TCC corresponding to the target transaction chain node.
[0129] The transaction channel controller TCC can be a control program of a transaction channel, which can dynamically start or stop a transaction channel. Each transaction channel is used for data exchange between transaction parties. The transaction channel can be a data transmission pipeline and a transaction service program. Any transaction channel controller TCC is connected to a transaction chain node. It can be deployed on the transaction chain node as an extension program of the transaction chain node, or it can be deployed on a host outside the transaction chain node and connected to the node through the network. The transaction chain node can call the associated TCC to create or close a transaction channel by remotely calling the Application Programming Interface (API).
[0130] like Figure 1 As shown in the figure, the off-chain processing unit mainly includes: Decentralized Application (DAPP) of computing power trading platform and Transaction Channel Controller (TCC).
[0131] Optionally, in a specific implementation of the solution, the open source alliance chain project FISCO BCOS v3.4.0 is used to build and deploy a blockchain node network. In addition, open source components are used to build DID and VC related functional components.
[0132] Furthermore, if Figure 2 As shown, it is a schematic diagram of the internal module of a transaction channel controller and the data interaction with the outside provided in this embodiment, which includes the data interaction between the transaction channel controller TCC and the computing power trading platform DAPP.
[0133] Specifically, the transaction channel controller (TCC) is a control program for a transaction channel, such as Figure 2 As shown, it mainly includes: a transaction channel control module, a digital identity chain node data interaction module, a transaction chain node data interaction module, a settlement voucher issuance and verification module, and a load situation statistics and query module.
[0134] Among them, the transaction channel control module is responsible for dynamically starting or stopping a transaction channel. Each transaction channel is used for the transaction parties to exchange data. A transaction channel can be regarded as a data transmission pipeline. The transaction channel is used for the transaction parties to conduct off-chain settlement processing and transactions.
[0135] The module for interacting with digital identity chain nodes is responsible for data interaction with the digital identity chain, including registering identity DID and obtaining a DID document from the digital identity chain. For example, TCC obtains a DID document of a transaction user from the digital identity chain, reads the public key information of the transaction user from it, and uses the public key to verify the digital signature of the user.
[0136] The module for interacting with transaction chain nodes is responsible for data interaction with the transaction chain, including registering information associated with transaction chain nodes to the transaction chain, and settling verifiable digital certificates to support data on the chain.
[0137] The settlement certificate issuance and verification module is responsible for the issuance and verification of VC certificates for off-chain transaction settlement.
[0138] Optionally, the transaction settlement verifiable digital certificate is a transaction settlement VC certificate.
[0139] The load statistics and query module is responsible for counting the load of TCC and processing load query requests (this module is responsible for counting the number of transaction channels started on this TCC and the usage of system resources (including CPU, memory usage, etc.).
[0140] The transaction channel controller TCC is connected to a transaction chain node. It can be deployed on the transaction chain node as an extension program of the node, or it can be deployed on a host outside the node and connected to the node through the network.
[0141] The computing power trading platform decentralized application is a distributed application program, which is connected to a node of the digital identity chain and the transaction chain respectively, and the terminal user can access the data on the digital identity chain and the transaction chain through it. The transaction chain receives a request instruction from the computing power trading platform DAPP, and the request instruction is used to instruct to obtain the target transaction service channel according to the target transaction parameters. The target transaction parameters are the relevant parameters used to build the target transaction service channel after the computing power consumer makes a transaction request to the computing power supplier and obtains feedback from the computing power supplier, and the two parties reach a transaction consensus. The target transaction parameters at least include the distributed identity identifier of the computing power consumer, the distributed identity identifier of the computing power supplier, the verifiable credential data for issuing the transaction start, and the digital credential template for the initial transaction settlement. The distributed identity identifier of the computing power consumer and the distributed identity identifier of the computing power supplier are used to characterize the digital identity of the terminal. The distributed identity identifier (Decentralized Identifier, DID) is a globally unique digital identity identifier with distributed, resolvable and verifiable properties.
[0142] The computing power trading platform DAPP (DAPP for short) is a distributed application that is connected to a node of the digital identity chain and the transaction chain respectively, and end users can access the data on the digital identity chain and the transaction chain through it. DAPP mainly includes: transaction service module, DID service module and verifiable digital certificate service module.
[0143] Among them, the functions of the DID service module include: transaction users can complete DID identity registration, identity authentication, and identity query and update on the digital identity chain through the DID service module of DAPP. When transaction users connect to TCC through DAPP, they can obtain TCC's DID document from the digital identity chain through the DID service module of DAPP, read the interface information of the channel connection from it, and then use the interface to connect to TCC to obtain a new transaction channel or access an existing transaction channel.
[0144] The functions of the verifiable digital certificate service module include: computing power consumption users can complete certificate creation through the VC service module of DAPP, and computing power supply users can complete the registration of transaction initiation CPT template and transaction settlement CPT template, the issuance of transaction initiation VC certificate and the creation of transaction settlement VC certificate through the VC service module of DAPP.
[0145] The functions of the transaction service module include: the transaction user obtains the available TCC list information from the transaction chain node through the transaction service module of DAPP (smart contracts can be defined and the contract interface can be used to obtain the association information between the registered TCC and the transaction chain node), and DAPP uses the load balancing strategy to select the best TCC (i.e. its DID) from the available TCC list and return it to the transaction user. The DAPP load balancing strategy connected by the computing power consumption user can query the load of each available TCC separately and select the one with the smallest load; it can also select the one with the smallest delay based on the loop time delay between DAPP and TCC; it can also select a TCC associated with a certain transaction chain node, such as the TCC associated with a certain transaction chain node connected by the DAPPs of the two parties to the transaction.
[0146] The following is a description of an off-chain computing power trading method provided in this embodiment.
[0147] See also Figure 3 , is a flow chart of an off-chain computing power transaction method provided in this embodiment, which is applied to the aforementioned Figure 1 or Figure 2 As shown in the system architecture, the method mainly includes three stages.
[0148] Phase 1: Create an off-chain transaction channel and initiate a computing power transaction.
[0149] First, the computing power consumer obtains transaction quotation information from the transaction chain node through DAPP, makes a transaction decision, and uses a transaction initiation template (such as CPT template) to create a transaction initiation VC certificate (unissued). Secondly, the computing power consumer obtains a TCC from the transaction chain node through DAPP, connects to TCC to create a transaction channel, and obtains the transaction channel number. Then the computing power consumer sends the transaction initiation message (including the unissued transaction initiation VC certificate declaration data and transaction channel number information) to the computing power supply user through DAPP. Finally, the computing power supply user connects to the designated transaction channel of TCC through DAPP, reviews the declaration data of the transaction initiation VC certificate sent by the computing power consumer user, and issues the transaction initiation VC certificate when deciding to agree to the transaction, and saves the issued VC certificate to the transaction chain (optional step). When deciding to reject the transaction, the computing power consumer is notified through the transaction channel, and both parties to the transaction will exit the transaction channel and close the channel.
[0150] It should be noted that in this embodiment, the computing power consumption user is the computing power consumption end, the computing power supply user is the computing power supply end, and the transaction parties are the computing power consumption end and the computing power supply end. In addition, the computing power consumption end is associated with DAPP-1, and the computing power supply end is associated with DAPP-2. The transaction parties establish a transaction channel with TCC through DAPP-1 and DAPP-2, and the transaction channel is used to transmit data credentials and related data.
[0151] Phase 2: Off-chain transaction settlement processing flow.
[0152] The two parties to the transaction use the transaction channel to conduct scheduled off-chain transaction settlement. The transaction settlement data is saved by both parties in the form of VC certificates, and the transaction settlement VC certificate is issued by the TCC representative associated with the transaction chain node. Therefore, it can be verified on the transaction chain to ensure the credibility of the certificate.
[0153] The third stage: transaction settlement data vouchers are processed on the chain.
[0154] After N off-chain settlement cycles in the second stage, TCC's transaction channel initiates a transaction settlement evidence data chain processing. The transaction settlement evidence data includes the hash of the most recent off-chain settlement VC certificate and the signature information of TCC (representing its associated transaction chain node), which may include multiple TCC signatures.
[0155] From the above three-stage processing flow, it can be seen that the security of the transaction can be guaranteed. First, the access authentication process of the service channel can ensure that only designated transaction users can join, and identity security is effectively guaranteed; secondly, the data of each off-chain transaction settlement is interacted in the form of VC credentials, and the chain stores the supporting data of the most recent off-chain transaction settlement certificate, which can ensure that the transaction data is verifiable, credible and traceable.
[0156] The specific process of each of the above three stages is introduced in detail below.
[0157] See also Figure 4 , is a flow chart of an off-chain computing power trading method provided by an embodiment of the present invention. The method can be applied to a transaction channel controller TCC. The method includes:
[0158] Step S101, establish an off-chain transaction channel between the transaction channel controller and both parties to the transaction, and use the transaction channel to verify the identities of the two parties to the transaction.
[0159] This step corresponds to the "first stage" and is a preparatory step before the off-chain transaction settlement. Among them, the computing power consumption end and computing power supply end of the transaction parties are each associated with a computing power trading platform decentralized application DAPP, and TCC is the TCC associated with a transaction chain node on the transaction chain.
[0160] The transaction channel includes a first transaction channel and a second transaction channel; then this step S101: establishes an off-chain transaction channel between the transaction channel controller and the transaction parties, and uses the first transaction channel to verify the identity of the computing power consumer, including: establishing a first transaction channel between the transaction channel controller TCC and the first computing power trading platform (DAPP-1) associated with the computing power consumer, and establishing a second transaction channel between the transaction channel controller TCC and the second computing power trading platform (DAPP-2) associated with the computing power supply, and using the second transaction channel to verify the identity of the computing power supply. In other words, this step establishes a first transaction channel between TCC and DAPP-1, and establishes a second transaction channel between TCC and DAPP-2, where DAPP-1 and DAPP-2 are different.
[0161] Furthermore, a first transaction channel of the first computing power trading platform DAPP-1 associated with the transaction channel controller and the computing power consumer end is established, including: receiving an application message for creating a transaction channel initiated by the computing power consumer end, the application message including declaration data of a verifiable digital certificate for transaction initiation to be issued; in response to the application message, verifying the identity of the computing power consumer end; if the identity verification is successful, creating the first transaction channel, generating and returning the first transaction channel information to the first computing power trading platform DAPP-1.
[0162] It should be noted that the transaction initiation verifiable digital certificate to be issued is a transaction initiation VC certificate to be issued.
[0163] The transaction initiation VC voucher is created by a computing power consumer. The voucher declaration data is filled in according to the corresponding transaction initiation CPT template and the actual quotation data, and a transaction initiation message containing the voucher declaration data is sent to the designated computing power supply user through DAPP. The computing power supply end then completes the voucher review and issuance. The issued transaction initiation VC voucher data is stored on the chain (depending on the actual system requirements, it can be stored off-chain, and the two parties to the transaction can choose the off-chain storage method independently, and can be checked through the voucher or data verification interface defined in the DID documents of the two parties to the transaction).
[0164] A transaction initiation VC credential may include the following information: protocol version information, credential DID, transaction initiation CPT template ID (cptId), issuer DID, issuance time, expiration time, statement content, issuer signature data, and credential type.
[0165] In step S101, a second transaction channel of the second computing power trading platform DAPP-2 associated with the transaction channel controller and the computing power supply end is established. The specific process includes: receiving an application message initiated by the computing power supply end to connect to the designated transaction channel, and the application message is triggered when the computing power supply end receives a transaction start message from the computing power consumption end; in response to the application message for connecting to the designated transaction channel, the identity of the computing power supply end is verified; if the identity verification is successful, a second transaction channel is created, and the second transaction channel information is generated and returned to the second computing power trading platform DAPP-2.
[0166] After the transaction channel is established and the transaction computing power is started, the off-chain transaction settlement operations of the computing power consumption end and the computing power supply end (both parties to the transaction) begin.
[0167] Step S102, when the identity authentication of both parties to the transaction is qualified, the off-chain transaction settlement operation is initiated using the transaction channel, and based on the off-chain settlement operation of both parties to the transaction, a verifiable digital certificate for transaction settlement to be issued by one of the parties is received.
[0168] Among them, the transaction parties include the computing power consumption end and the computing power supply end. According to the off-chain settlement cycle specified in the transaction startup VC certificate, each off-chain settlement cycle will trigger an off-chain transaction settlement operation. When an off-chain transaction settlement is triggered, either party of the transaction can settle the transaction according to the transaction settlement specified in the transaction startup VC certificate. Specifically, the off-chain settlement operation of the transaction parties is described in detail in the following embodiments.
[0169] After the transaction parties perform off-chain settlement operations, such as appending the digital signatures of both parties to the end of the declaration data of the verifiable digital certificate for transaction settlement to be issued, it is sent to the transaction channel controller TCC through the first transaction channel or the second transaction channel.
[0170] Step S103, checking whether the transaction settlement verifiable digital certificate to be issued is attached with the digital signatures of both parties to the transaction.
[0171] After receiving the transaction settlement verifiable digital certificate to be issued from either party of the transaction, the transaction channel controller TCC checks whether the digital signatures of both parties of the transaction are attached to the end of the declaration data of the transaction settlement VC certificate to be issued.
[0172] If the transaction settlement VC certificate to be issued is sent by the computing power consumption end, the first computing power trading platform (DAPP-1) will send the transaction settlement VC certificate to TCC through the first trading channel; if the transaction settlement VC certificate to be issued is sent by the computing power supply end, the second computing power trading platform (DAPP-2) will send the transaction settlement VC certificate to TCC through the second trading channel.
[0173] Specifically, step S103 includes: parsing the verifiable digital certificate for transaction settlement to be issued, and checking whether it contains the digital signature of the computing power consumer and the digital signature of the computing power supplier. The digital signatures of the two parties to the transaction are pre-stored in the DID document on the transaction chain, so the TCC can obtain the digital signatures of the two parties to the transaction through the DID document. Alternatively, another implementation method is to check whether there is a digital signature field of the two parties to the transaction in the transaction settlement VC certificate to be issued. Such as "proof": {...}, #Signature data of the issuer", if so, it is determined that the digital signature exists; otherwise, it does not exist.
[0174] In this step, if the query lacks one or does not have the digital signature of both parties to the transaction, the verification fails and the transaction initiation process is stopped.
[0175] Step S104: if yes, verify the digital signatures attached by both parties to the transaction.
[0176] If the transaction settlement VC voucher to be issued verified in the previous step contains the digital signatures of both parties to the transaction, the additional digital signatures of both parties to the transaction are verified.
[0177] One verification method is to obtain the distributed digital identity identifier DID documents of both parties to the transaction from the digital identity chain, and read the public key information of the transaction user from each of the DID documents; and use the read public key information to verify the digital signatures attached by the two parties to the transaction.
[0178] Specifically, TCC obtains the computing power consumer DID document from the digital identity chain, reads the corresponding public key, creates a random data, encrypts it with the public key, and then returns an identity authentication request containing the ciphertext. After receiving the identity authentication request, the computing power consumer reads the ciphertext and decrypts it with the private key, and then replies the plaintext or the answer to the plaintext request to TCC to complete the access identity authentication.
[0179] Step S105: If the verification is passed, the transaction settlement verifiable digital certificate is issued, and the issued transaction settlement verifiable digital certificate is sent to both parties of the transaction.
[0180] Specifically, the issuance of the verifiable digital certificate for transaction settlement includes: writing the DID of the issuer, the issuance time and the digital signature in the verifiable digital certificate for transaction settlement, generating the issued verifiable digital certificate for transaction settlement, and the DID of the issuer is the DID of the transaction channel controller.
[0181] In this embodiment, the issuer of the certificate is the transaction channel controller TCC.
[0182] The issued transaction settlement VC certificate is sent to DAPP-1 through the first transaction channel, so that the computing power consumption end obtains the issued transaction settlement VC certificate through DAPP-1; and sent to DAPP-2 through the second transaction channel, so that the computing power supply end obtains the issued transaction settlement VC certificate through DAPP-2. After receiving, DAPP-1 and DAPP-2 save the issued transaction settlement VC certificate at their respective computing power ends.
[0183] If the digital signature verification of both parties fails, an error message will be sent to both parties.
[0184] Steps S102 to S105 of this embodiment correspond to the off-chain transaction settlement processing process of the aforementioned “second stage”.
[0185] The off-chain computing power trading method provided in this embodiment adds the function of issuing verifiable digital certificates for transaction settlement to the transaction channel controller, avoiding the issuance of verifiable digital certificates for transaction settlement by both parties to the transaction, so that the credibility of the certificate data is verified by the transaction channel controller TCC and the verifiable digital certificates for off-chain transaction settlement can be verified through the transaction chain, thereby improving the credibility and verifiability of off-chain transaction data.
[0186] In addition, before issuing a verifiable digital certificate for transaction settlement, it is also necessary to verify whether the digital signatures of both parties to the transaction are attached to the certificate to be issued. The issuance operation is performed only after the verification is passed, further ensuring the security of off-chain transaction data and the identities of both parties, thereby ensuring the integrity and authenticity of the intermediate transaction status between on-chain and off-chain transaction settlements.
[0187] In a possible implementation of this embodiment, in the above step S101, in the process of establishing a transaction channel between the two parties, it also includes: a process of verifying the identities of the computing power consumer and the computing power supplier.
[0188] Specifically, the identity of the computing power consumer is verified, including: encrypting first preset data according to the public key of the computing power consumer to obtain first encrypted data; sending the first encrypted data to the computing power consumer, and instructing the computing power consumer to decrypt the first encrypted data using the private key of the computing power consumer after receiving the first encrypted data; receiving second preset data from the computing power consumer; if the first preset data matches the second preset data, it is determined that the identity authorization authentication of the computing power consumer is passed.
[0189] The matching includes that the first preset data and the second preset data are the same, or the first preset data and the second preset data meet the relationship of "question" and "answer", which also belongs to matching.
[0190] Similarly, the identity of the computing power supplier is verified, including: encrypting the third preset data according to the public key of the computing power supplier to obtain the third encrypted data; sending the third encrypted data to the computing power supplier, and instructing the computing power supplier to decrypt the third encrypted data using the private key of the computing power consumer after receiving the third encrypted data; receiving the fourth preset data from the computing power consumer; if the fourth preset data matches the third preset data, it is determined that the identity authorization authentication of the computing power supplier is passed.
[0191] Specifically, the transaction starts the security process as follows: Figure 5 As shown in the figure, in the "first phase", after the computing power consumer obtains a TCC from the transaction chain node through DAPP-1, it will connect to the TCC and apply to create a transaction channel. The TCC application message contains the declaration data of the unissued transaction start VC certificate.
[0192] After TCC receives an application from a computing power consumer to create a transaction channel, it can require the computing power consumer to perform identity verification. After the verification is passed, a transaction channel is created as required, and the transaction channel information (transaction channel number) is returned to the computing power consumer. The implementation method of an identity authentication is as follows: TCC obtains the computing power consumer user's DID identity document from the digital identity chain, reads the corresponding public key, creates a random data, encrypts it with the public key, and then returns an identity authentication request containing ciphertext to DAPP-1, and DAPP-1 sends the identity authentication request to the computing power consumer.
[0193] After receiving the identity authentication request, the computing power consumer reads the ciphertext and decrypts it with the private key, and then replies the plaintext or the answer to the plaintext request to TCC, such as feeding back the identity authentication reply message to TCC through DAPP-1, so that TCC can complete the access identity authentication and return the transaction channel information to the computing power consumer.
[0194] The computing power consumption user generates and sends a transaction initiation message to the computing power supply user based on the transaction channel information returned by TCC. Specifically, the transaction initiation message is first transmitted to DAPP-2 through DAPP-1, and then DAPP-2 sends the transaction initiation message to the computing power supply user. Among them, the transaction initiation message contains the declaration data and transaction channel information of the unissued transaction initiation VC certificate. The computing power supply user connects to the designated transaction channel and completes similar identity authentication.
[0195] Specifically, the computing power supply user sends a request to connect to the designated transaction channel to TCC through DAPP-2. After receiving the request, TCC sends an identity authentication request to the computing power supply user.
[0196] After receiving the identity authentication request, the computing power supply user reads the ciphertext and decrypts it with the private key, and then replies the plaintext or the answer to the plaintext request to TCC, such as feeding back the identity authentication reply message to TCC through DAPP-2, so that TCC completes the access identity authentication and returns the transaction channel information to the computing power supply user.
[0197] After the above operations are executed, the two parties can use the transaction channel to complete the subsequent data interaction, such as the transaction start VC certificate issued by the interaction, the scheduled off-chain transaction settlement VC certificate, etc. Figure 3 The method flow of "Phase 2" and "Phase 3" is shown. From the above flow, it can be seen that the security verification of channel access depends on the security of asymmetric keys. As long as the key is not leaked or cracked, the security of the access identity is guaranteed.
[0198] In some other implementations of this embodiment, Figure 6 As shown, after step S105, the method further includes:
[0199] Step S106, after N off-chain settlement cycles, the transaction parties obtain the verifiable digital certificate data of the most recent off-chain transaction settlement. The verifiable digital certificate data of the most recent off-chain transaction settlement is the VC certificate data of the most recent off-chain transaction settlement.
[0200] Step S107, based on the verifiable digital certificate data of the most recent off-chain transaction settlement, generate the supporting data of the verifiable digital certificate of the most recent off-chain transaction settlement through the hash algorithm and the digital signature algorithm.
[0201] The supporting data includes: the hash of the most recent off-chain transaction settlement verifiable digital certificate, the signature information of the transaction channel controller on the hash, and the DID of the transaction channel controller. The supporting data of the transaction settlement VC certificate consists of the hash of the most recent off-chain settlement VC certificate and the digital signature and DID of the TCC entity (possibly one or more) on the hash.
[0202] In the "second phase" of off-chain transaction settlement, after N off-chain settlement cycles, TCC's transaction channel initiates a transaction settlement supporting data chain processing. The transaction settlement supporting data includes the hash of the most recent off-chain settlement VC certificate and the signature information of the TCC on behalf of its associated transaction chain node. The signature information can contain multiple TCC signatures.
[0203] The transaction settlement VC certificate is used for off-chain settlement (so the transaction settlement VC certificate is not on-chain). It is created by both parties through the transaction channel and issued by the TCC on behalf of the associated transaction node. A transaction settlement VC certificate sample includes the following content: protocol version information, certificate DID, transaction settlement CPT template ID, issuer DID, issuance time, expiration time, statement content, issuer signature data, and certificate type.
[0204] Step S108, save the supporting data of the verifiable digital certificate of the most recent off-chain transaction settlement on the blockchain.
[0205] In this embodiment, the issued transaction start VC certificate does not need to be put on the chain before issuance. Only the issued transaction start VC certificate is saved on the transaction chain, and the transaction start VC certificate can even be saved off the chain as needed. And because the supporting data of the off-chain transaction settlement VC certificate is much smaller than the VC certificate data, the on-chain storage of supporting data in the present invention has lower overhead and higher efficiency in on-chain processing.
[0206] In addition, in another implementation of the present embodiment, before establishing the off-chain transaction channel between the transaction channel controller and the transaction parties in step S101, it also includes: obtaining access information of the transaction chain node associated with the transaction channel controller, the access information including: the IP address, port number and connection method of the transaction chain node; connecting the transaction chain node through a pre-designed smart contract interface or SDK access interface, and writing the association information between the transaction channel controller and the transaction chain node into the blockchain, wherein the data structure of the association information includes a key-value pair consisting of the DID of the transaction channel controller and the ID of the transaction chain node.
[0207] Specifically, when creating a transaction channel controller TCC, you need to complete the following two steps:
[0208] Step 1: Register the DID identity on the digital identity chain, and write the transaction channel connection service interface information, certificate issuance and verification interface information, load status query interface information and public key into the DID document, and save the DID document on the digital identity chain.
[0209] Step 2: Get an access address of a transaction chain node associated with the transaction channel controller TCC, such as an IP address, port number, and connection method such as UDP, TCP, HTTP, HTTPS, etc. Connect the transaction chain node through a pre-designed API, for example, the API interface can be a smart contract interface, or an access interface developed based on SDK, which is not limited in this embodiment. And write the association information between TCC and the transaction chain node into the blockchain.
[0210] Among them, the data structure of the association information between TCC and transaction chain nodes is composed of a key-value pair consisting of a TCC DID and a transaction chain node ID. A TCC can only be associated with one transaction chain node, and a transaction chain node can be associated with multiple TCCs. When starting a TCC, it will first obtain the access address of a specified transaction chain node (including IP, port number, protocol mode, etc.), connect to the corresponding node through the API provided by the system, and complete the association with the transaction chain node, that is, register the association information between the two on the transaction chain.
[0211] In this embodiment, by designing a TCC management smart contract, defining the TCC access registration, update and cancellation interface, and pre-deploying the smart contract to the transaction chain, access management services can be provided for TCC.
[0212] Optionally, the above method also includes: TCC statistics on its own load; when receiving a load query request sent by either party to the transaction, the number of currently started transaction channels and system resource usage are packaged and sent to the requesting party, so that the requesting party, such as a computing power consumer or a computing power supplier, can select a target TCC on the transaction chain according to the load of TCC.
[0213] The transaction chain and digital identity chain contain multiple blockchain nodes, and the transaction chain nodes are used to store the association information between TCC and transaction chain nodes, transaction initiation templates, transaction settlement templates, transaction initiation verifiable digital certificates, and transaction settlement verifiable digital certificates. The digital identity chain nodes are used to store DID documents, computing power service capability certificate templates, and computing power service capability verifiable digital certificates.
[0214] In another embodiment, another off-chain computing power transaction method is provided, see Figure 7 The method is applied to the computing power trading platform DAPP, for example, it can be applied to the aforementioned DAPP-1 or DAPP-2. The method is the method flow of establishing the transaction channel between the two parties of the transaction and selecting the TCC in the aforementioned step S101. Specifically, the method includes:
[0215] Step S201, establish a transaction channel between a transaction channel controller and both parties of the transaction. Wherein, either party of the transaction is associated with the computing power transaction platform DAPP, and the two parties of the transaction include a computing power consumption end and a computing power supply end.
[0216] This step corresponds to the aforementioned step S101 and the method flow of the “first stage”.
[0217] Step S202: When the identity authentication of both parties to the transaction is qualified, the off-chain transaction settlement operation is initiated using the transaction channel, and the corresponding transaction settlement template is obtained from the transaction chain.
[0218] Among them, the transaction settlement template is a transaction settlement CPT template, which is customized and registered by the computing power supply user according to the computing power transaction characteristics. Optionally, an example of a transaction settlement CPT template includes the following content:
[0219] Template name, template description, supply user DID, consumer user DID, settlement fee (in RMB), settlement cycle start time, settlement cycle end time, digital signatures of both parties to the transaction, encryption method, such as plain text, CP-ABE, etc.
[0220] Step S203, creating a transaction settlement verifiable digital certificate to be issued according to the transaction settlement template, and filling in the declaration data of the transaction settlement verifiable digital certificate according to the actual transaction data.
[0221] Specifically, the computing power consumer fills in the transaction settlement CPT template to create a transaction settlement VC voucher.
[0222] Step S204, attaching the digital signature of the computing power consumer to the end of the declaration data of the transaction settlement verifiable digital certificate, and sending it to the other party of the transaction, such as the computing power supplier, so that the computing power supplier checks the transaction settlement verifiable digital certificate and attaches the corresponding digital signature.
[0223] Among them, the computing power consumption end adds a digital statement to the created transaction settlement VC certificate through its associated first computing power trading platform DAPP-1, that is, attaches the digital signature of the computing power consumption end, and the transaction settlement VC certificate is not issued. In this embodiment, DAPP-1 sends the transaction settlement VC certificate to be issued to DAPP-2, which is forwarded by DAPP-2 to the computing power supply user or computing power supply end.
[0224] The computing power supplier receives the transaction settlement VC certificate to be issued and verifies it. After the verification is passed, it adds the digital signature of the computing power supplier to the end of the declaration data of the transaction settlement VC certificate, and sends the transaction settlement VC certificate with the attached digital signature to the transaction channel controller TCC through DAPP-2.
[0225] Step S205, receiving the verifiable digital certificate for transaction settlement issued by the transaction channel controller after verifying the verifiable digital certificate for transaction settlement with digital signatures attached by both parties to the transaction.
[0226] The specific process refers to steps S102 to S105 of the aforementioned embodiment, which will not be described again here.
[0227] In addition, the above method also includes: saving the issued transaction settlement verifiable digital certificate according to the preset storage strategy of the decentralized application of the computing power trading platform.
[0228] One implementation method is that DAPP-1 receives the issued transaction settlement VC certificate sent by TCC, and then saves the issued transaction settlement VC certificate according to its own preset storage strategy.
[0229] Optionally, before step S201: establishing a transaction channel between a transaction channel controller and both transaction parties, it also includes: obtaining transaction channel controller list information, such as TCC list information, from the transaction chain node, and the transaction channel controller list information (TCC list information) includes at least one transaction channel controller.
[0230] The DAPP selects a transaction channel controller from the at least one transaction channel controller according to the screening strategy, and establishes a transaction channel of the decentralized application of the computing power trading platform associated with the transaction parties. The screening strategy includes any of the following:
[0231] According to the load of each available transaction channel controller, select a transaction channel controller with the smallest load;
[0232] According to the loop time delay between the decentralized application of the computing power trading platform and each trading channel controller, selecting a trading channel controller with the minimum delay;
[0233] According to the transaction chain connected to the decentralized application access transaction chain of the computing power trading platform associated with the transaction parties, a transaction channel controller associated with any transaction chain node is selected.
[0234] This process can be implemented through the "transaction service module" of DAPP. The transaction user obtains the available TCC list information from the transaction chain node through the transaction service module of DAPP (the smart contract can be defined and the contract interface can be used to obtain the association information between the registered TCC and the transaction chain node), and DAPP uses the load balancing strategy to select the best TCC (that is, its DID) from the available TCC list and return it to the transaction user.
[0235] The load balancing strategy of the DAPP connected to the computing power consuming user can query the load status of each available TCC separately and select a TCC with the smallest load; it can also select a TCC with the smallest delay based on the loop time delay between DAPP and TCC; it can also select a TCC associated with a certain transaction chain node (for example, a transaction chain node connected by the DAPPs of both parties to the transaction).
[0236] When a computing power consumption user initiates a computing power transaction, he can send a transaction start message to the specified computing power supply user through the transaction service module of DAPP. The specific implementation method is as follows: a mapping table containing "transaction user DID" and "connected DAPP end address" can be maintained in this module. By querying this table, the address of the DAPP end to which the specified computing power supply user is connected can be found, and the message can be sent to the computing power supply user through the DAPP. In addition, the DID document of the specified computing power supply user can be obtained through the digital identity chain, the corresponding message receiving interface can be read, and the transaction start message can be sent to the computing power supply user using this interface.
[0237] Through the DID service module and VC service module provided by the trading platform DAPP, the third-party system can not only check the user's identity information, but also verify the transaction data of this platform. The transaction data is interacted in the form of VC credentials, so each transaction data can be trusted to flow between third-party platforms.
[0238] Optionally, in a possible implementation manner, before the DAPP selects a transaction channel controller from the at least one transaction channel controller according to the screening strategy, it further includes:
[0239] DAPP obtains transaction quotation information from the transaction chain node; obtains the transaction decision of the computing power consumer according to the transaction quotation information, and activates the transaction initiation template according to the transaction decision, such as the transaction initiation CPT template. The transaction initiation CPT template is customized and registered by the computing power supply user or computing power consumption user according to the transaction characteristics. A sample content of the transaction initiation CPT template includes the following:
[0240] Template name, template description, supply user DID, consumer user DID, TCC entity DID, computing power specifications, price per unit time (such as per minute), unit yuan, minimum cost (i.e. starting price), unit yuan, off-chain settlement cycle, settlement template ID, computing power consumer's digital signature, encryption method, such as plain text, CP-ABE and other information.
[0241] Optionally, the transaction initiation template defines the data fields required to initiate the transaction, usually including the supplier's DID, the consumer's DID, the specifications of the computing power, the unit price of the computing power, the settlement method, the starting price, the data encryption method, the transaction settlement template ID, etc. The transaction initiation template can be defined according to the supplier's needs and supports some complex transaction modes, such as using different computing power quotations in different time periods.
[0242] Optionally, the transaction settlement template defines the data fields included in a transaction settlement, typically including the supplier's DID, the consumer's DID, fees, start and end time, data encryption method, transaction amount type, etc.
[0243] The DAPP fills in the verifiable digital certificate declaration data according to the transaction initiation template and the actual quotation data, generates a transaction initiation verifiable digital certificate, i.e., a transaction initiation VC certificate, and after selecting a transaction channel controller from the at least one transaction channel controller according to the screening strategy, further includes:
[0244] DAPP generates a transaction initiation message based on the declaration data of the transaction initiation VC certificate, which includes: the transaction initiation verifiable digital certificate to be issued and the transaction channel information; the transaction initiation message is sent to the computing power trading platform corresponding to the computing power supply user, such as DAPP-2, so that the computing power supply user can review and issue the transaction initiation verifiable digital certificate. After receiving the transaction, the computing power supply user completes the review and issuance of the transaction initiation VC certificate.
[0245] The computing power supply user connects to the designated transaction channel of TCC through DAPP-2, and reviews the declaration data of the transaction start VC certificate sent by the computing power consumption user; when deciding to agree to the transaction, the transaction start VC certificate is issued, and the issued VC certificate is saved on the transaction chain (optional step). When deciding to reject the transaction, the computing power consumption user is notified through the transaction channel, and both parties to the transaction will exit the transaction channel and close the channel.
[0246] Specifically, after sending the transaction initiation message to the computing power supply user, it also includes: receiving the transaction initiation message; reviewing the declaration data of the transaction initiation verifiable digital certificate to be issued in the transaction initiation message; if the review passes, agreeing to the current transaction and issuing the transaction initiation verifiable digital certificate; if the review fails, notifying the computing power consumption user, exiting the current transaction and closing the transaction channel.
[0247] In another specific embodiment, Figure 8 As shown in the figure, in the second phase, the process of off-chain transaction settlement specifically includes:
[0248] The transaction parties use the transaction channel to conduct scheduled off-chain transaction settlement based on the transaction channel established in step S101 above.
[0249] Step S3.1: DAPP-1 associated with the computing power consumption end triggers an off-chain transaction settlement operation in each off-chain settlement cycle according to the off-chain settlement cycle specified in the transaction initiation VC certificate. At this point, the transaction initiation VC certificate has been initiated and verified.
[0250] Step S3.2: When an off-chain transaction settlement is triggered, any party to the transaction, such as DAPP-1 associated with the computing power consumption end, can obtain the corresponding transaction settlement CPT template from the transaction chain according to the transaction settlement CPT template ID specified in the transaction settlement VC voucher, create a transaction settlement VC voucher according to the transaction settlement CPT template, and fill in the declaration content of the transaction settlement VC voucher according to the actual transaction data.
[0251] Step S3.3: DAPP-1 appends the digital signature of the computing power consumer to the end of the declaration data, that is, the declaration content (including the digital signature of the attached user) is encrypted using the user's private key to generate a transaction settlement VC certificate to be issued.
[0252] Step S3.4: After completing the above operations, DAPP-1 will send the transaction settlement VC certificate to be issued to the other party. In this embodiment, it is transmitted to the second computing power trading platform DAPP-2 associated with the computing power supply end.
[0253] Step S3.5: The second computing power trading platform DAPP-2 receives the transaction settlement VC certificate to be issued sent by the other party DAPP-1, and verifies the authenticity and integrity of the transaction settlement VC certificate to be issued.
[0254] Step S3.6: When the data verification is OK, the digital signature of the transaction party (for the declaration content) will be added to the end of the declaration data of the transaction settlement VC certificate to be issued, that is, DAPP-2 will add declaration data 2 to the transaction settlement VC certificate to be issued (including adding the digital signature of the computing power provider to the end of the declaration data 2 of the certificate), and generate a second transaction settlement VC certificate to be issued.
[0255] Step S3.7: Send the second transaction settlement VC voucher to TCC through the transaction channel.
[0256] If the data verification fails in step S3.6, for example, there is a problem with the data, an error message is sent back to the other party.
[0257] Correspondingly, the transaction channel controller TCC receives the second transaction settlement VC certificate sent by DAPP-2, and checks whether the second transaction settlement VC certificate data is authentic and complete, such as whether the digital signatures of both parties to the transaction are attached, whether the digital signature verification of both parties to the transaction is passed, etc.
[0258] When the check is passed, the second transaction settlement VC certificate is issued, that is, the issuer DID, issuance time and digital signature are written into the certificate, and finally the issued second transaction settlement VC certificate is sent to both parties of the transaction.
[0259] The specific process refers to steps S102 to S104 of the previous embodiment, which will not be described in detail in this embodiment.
[0260] If the check fails, an error message will be sent to both parties of the transaction.
[0261] After receiving the issued second transaction settlement VC certificate, both parties to the transaction save the settlement certificate according to the autonomous storage strategy.
[0262] From the above process, it can be seen that the transaction settlement data is saved by both parties to the transaction in the form of VC vouchers, and the transaction settlement VC vouchers are issued by TCC (representing the associated transaction chain node), so they can be verified on the transaction chain to ensure the privacy, security and credibility of the voucher data content.
[0263] In addition, in order to ensure the security of transactions, this method firstly ensures that only designated transaction users can join the access authentication process of the service channel, and identity security is effectively guaranteed; secondly, the data of each off-chain transaction settlement is exchanged in the form of VC credentials, thereby ensuring that the transaction data is authentic, verifiable, credible and traceable.
[0264] In some possible implementations, after the transaction parties save the transaction settlement verifiable digital certificate issued by the TCC, they also include a verification operation of the off-chain transaction settlement data. The verification operation of the off-chain transaction settlement data specifically includes:
[0265] Verify the off-chain transaction settlement data, which includes the issued verifiable digital certificate for transaction settlement; if the off-chain transaction settlement data is verified, verify the validity of the declaration data in the issued verifiable digital certificate for transaction settlement, which includes: the DID of the computing power supply end, the DID of the computing power consumption end, the specific transaction data, and the joint signature of the transaction parties on the declaration data; if the content in the declaration data is verified, it is determined that the declaration data is authentic and valid; otherwise, it is determined that the declaration data is invalid data.
[0266] The first step is to verify the off-chain transaction settlement data. The transaction settlement VC voucher contains the transaction settlement CPT template number V cptid , Voucher declaration data V claim , the DID of the certificate issuer (ie TCC), namely Vidid, and the digital signature Vproof of the TCC (representing the associated transaction chain node) on the above data. The authenticity and validity of the certificate can be verified through the following verification process.
[0267] It can be expressed as: Verify(V cptid , V claim , V idid , Vproof ) → Valid / Invalid
[0268] The first step of verification is to verify the DID document, public key and other information of the issuer TCC. When the first step of verification is passed, the second step of verification is performed to verify the content of the declaration.
[0269] The second step is verification: data verification of the declaration content, which is used to verify the authenticity and validity of the credential declaration data. claim Contains the user DID, namely C pdid 、Consumer user DID is C cdid , Specific transaction data C data And the joint signature of this statement data by both parties to the transaction C proof . As follows: in the statement content.
[0270] It can be expressed as: Verify(C pdid , C cdid , C data , C proof )→Valid / Invalid
[0271] If all verifications meet the preset conditions or all verifications pass, the authenticity and validity of the data can be proven; otherwise, the data is invalid.
[0272] It should be noted that the executor of the above-mentioned verification operation of the off-chain transaction settlement data can be any party to the transaction, such as DAPP-1 or DAPP-2 corresponding to the two parties to the transaction; or it can also be a third-party user, or a DAPP connected through a third-party user, such as DAPP-3.
[0273] In some other possible implementations, the transaction method provided in this embodiment further includes: verifying the authenticity of the verifiable digital voucher data of the most recent off-chain transaction settlement. Specifically, it includes:
[0274] Obtain the verifiable digital certificate data of the most recent off-chain transaction settlement in N off-chain settlement cycles from the transaction chain node, the supporting data including the hash of the verifiable digital certificate of the most recent off-chain transaction settlement and the signature information of the transaction channel controller on the hash; obtain the corresponding DID document from the digital identity chain, and read the public key of the transaction channel controller from the DID document; verify the signature information of the hash by the transaction channel controller using public key verification, and verify whether the verifiable digital certificate of the most recent off-chain transaction settlement is valid; if the signature information verification is passed and the certificate is authentic and valid, use the hash function to convert the verifiable digital certificate of the most recent off-chain transaction settlement into a second hash value; if the second hash value is consistent with the hash of the verifiable digital certificate of the most recent off-chain transaction settlement, the verification is passed; otherwise, the verification fails.
[0275] Specifically, any party of the transaction or a third party obtains the transaction settlement supporting data (including the Hash of the transaction settlement VC certificate and the signature of TCC) from the transaction chain, and obtains the corresponding off-chain transaction settlement VC certificate at the same time. According to the DID of TCC in the supporting data, the corresponding DID document identity can be obtained from the digital identity chain, and the public key of TCC can be read, and the signature of TCC can be verified with the public key. At the same time, after ensuring the authenticity and validity of the transaction settlement VC certificate, the specific verification process of the third-party user is similar or the same as the above-mentioned "first step verification" and "second step verification". The transaction settlement VC certificate is converted into a Hash value using the Hash function, and finally matched with the Hash in the supporting data. If the two are consistent, the verification is passed, and if they are inconsistent, the verification fails.
[0276] In this embodiment, the transaction settlement VC voucher data is independently stored and controlled by both parties to the transaction, that is, the control of the data is given to the user, and the transaction user independently chooses the storage method; and the data interaction is centered on the transaction user, and can be verified through the transaction chain according to the transaction user's own wishes, which effectively ensures the credibility and security of the data.
[0277] After N off-chain settlement cycles, the hash of the most recent off-chain transaction settlement VC certificate and the signature data of TCC will be written into the blockchain as settlement supporting data, thereby effectively combining the off-chain transaction settlement VC certificate with the on-chain supporting data, making the transaction settlement certificate more credible and traceable.
[0278] The technical solution provided by the above embodiment of the present invention includes the following beneficial effects:
[0279] Cross-platform trust: This method uses DID and VC mechanisms to implement computing power transaction initiation and settlement processing, and encapsulates computing power transaction data in VC credential mode, thereby supporting cross-platform verification of transaction data and making transaction data more credible.
[0280] Security: When both parties of the computing power transaction access the transaction channel, they need to use DID identity data for access authentication, thus ensuring the identity security of both parties. At the same time, the transaction data uses a combination of off-chain settlement data and on-chain supporting data based on the VC model to ensure that the data is authentic, verifiable, trustworthy, and traceable.
[0281] Flexible trading mode: The transaction data interaction method based on the VC model can support flexible computing power trading mode. According to the characteristics of computing power trading, computing power supply users can customize and register transaction start CPT templates and transaction settlement CPT templates, supporting rich and diverse computing power trading scenarios, such as time-based billing, increased incentive strategies, special settlement strategies, etc.
[0282] Processing efficiency: It adopts a combination of on-chain and off-chain methods to achieve high-throughput transaction processing based on off-chain transaction channels. It can also solve the bottleneck problem of on-chain processing performance caused by high-frequency small transactions by adjusting the time span of on-chain settlement (such as increasing the number of off-chain scheduled settlement cycles between two adjacent on-chain settlements). It can also solve the problem of system congestion caused by the sudden number of transaction settlement on-chain requests.
[0283] This method also improves the common shortcomings of the off-chain transaction channel method, including the authenticity and integrity (Data Integrity) of the intermediate transaction status and the lack of liquidity (Lack of Liquidity) of the locked payment tokens. The details are as follows:
[0284] Data Integrity: The integrity and authenticity of the intermediate transaction status between on-chain transaction settlements lacks assurance. This method, based on the VC mechanism, can support the verifiability of the intermediate status and ensure the authenticity of the data, thus overcoming this defect.
[0285] Lack of Liquidity of locked payment tokens: During the life cycle of the off-chain transaction channel, the payment tokens will be locked by the smart contract responsible for maintaining the transaction channel, resulting in reduced liquidity of the payment tokens. The flexible cycle transaction settlement on-chain strategy adopted in this method can reduce the amount of locked payment tokens to a minimum value, which is enough to pay for the cost of one on-chain settlement, thereby reducing the impact on the liquidity of payment tokens.
[0286] In addition, it should be noted that the embodiment of the present invention proposes a computing power trading method based on blockchain, DID, VC and the combination of on-chain and off-chain. On the basis of this solution, as long as the transaction data model is expanded and customized in small amounts, it can support more types of transactions and is suitable for a wider range of digital transaction scenarios in the digital economy.
[0287] In this embodiment, a device for off-chain computing power trading is also provided, which is used to implement the above embodiments and preferred implementations, and will not be repeated here. As used below, the term "module" can implement a combination of software and / or hardware for a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.
[0288] This embodiment provides a transaction channel controller, which can be used to implement all or part of the functions of the transaction channel controller TCC in the above-mentioned embodiment, such as Fig. 9 As shown, the device includes: a transaction channel control module 910, a transaction chain node data interaction module 920, a settlement voucher issuance and verification module 930 and a sending module 940. In addition, the device may also include other more or fewer units or modules, which is not limited in this embodiment.
[0289] Among them, the transaction channel control module 910 is used to establish an off-chain transaction channel between the transaction channel controller and the transaction parties, and use the transaction channel to verify the identities of the transaction parties.
[0290] The settlement certificate issuance and verification module 930 is used to initiate an off-chain transaction settlement operation using the transaction channel when the identity authentication of the two transaction parties is qualified, and receive a verifiable digital certificate for transaction settlement to be issued from one of the two transaction parties based on the off-chain settlement operation of the two transaction parties.
[0291] The settlement certificate issuance and verification module 930 is used to check whether the transaction settlement verifiable digital certificate is attached with the respective digital signatures of the transaction parties; and when it is checked that the digital signatures of the transaction parties are attached, the digital signatures attached by the transaction parties are verified. When the verification module 930 passes the verification, the transaction settlement verifiable digital certificate is issued.
[0292] The sending module 940 is used to send the issued transaction settlement verifiable digital certificate to the transaction parties.
[0293] The module 920 for interacting with transaction chain node data is used for interacting with transaction chain data, including registering information associated with the transaction chain node to the transaction chain, and uploading settlement VC voucher supporting data to the chain.
[0294] Optionally, the above-mentioned transaction channel controller also includes: a load statistics and query module, which is used to count the load of TCC and process load query requests, and is responsible for counting the number of transaction channels started on the transaction channel controller and system resource usage, such as CPU, memory occupancy, etc.
[0295] Each transaction chain node of the transaction chain is connected to a transaction channel controller TCC.
[0296] The off-chain computing power trading device described in this embodiment can be used to execute the embodiment of the above-mentioned off-chain computing power trading method. Its principles and technical effects are similar and will not be repeated here.
[0297] The off-chain computing power trading device provided in this embodiment adds the function of issuing verifiable digital certificates for transaction settlement to the transaction channel controller, thereby avoiding the issuance of verifiable digital certificates for transaction settlement by both parties to the transaction. The credibility of the certificate data is verified by the transaction channel controller TCC and the verifiable digital certificates for off-chain transaction settlement can be verified through the transaction chain, thereby improving the credibility and verifiability of off-chain transaction data.
[0298] In addition, before issuing a verifiable digital certificate for transaction settlement, it is also necessary to verify whether the digital signatures of both parties to the transaction are attached to the certificate to be issued. The issuance operation is performed only after the verification is passed, further ensuring the security of off-chain transaction data and the identities of both parties, thereby ensuring the integrity and authenticity of the intermediate transaction status between on-chain and off-chain transaction settlements.
[0299] Optionally, an off-chain computing power trading device is also provided in an embodiment of the present invention, which can be used to implement all or part of the functions of the computing power trading platform DAPP in the above embodiment, such as Fig.10 As shown, the device includes: a transaction service module 110, a verifiable digital certificate service module 120, a sending module 130, and a receiving module 140. In addition, the device may also include other more or fewer units or modules, which is not limited in this embodiment.
[0300] Among them, the transaction service module 110 is used to establish an off-chain transaction channel between a transaction channel controller and the two parties to the transaction, and use the transaction channel to verify the identities of the two parties to the transaction, and when the identity authentication of the two parties to the transaction is qualified, use the transaction channel to initiate an off-chain transaction settlement operation and obtain the corresponding transaction settlement template from the transaction chain.
[0301] The transaction service module 110 is also used to create a transaction settlement verifiable digital certificate to be issued according to the transaction settlement template, fill in the declaration data of the transaction settlement verifiable digital certificate according to the actual transaction data, and attach the digital signature of the computing power consumer to the end of the declaration data of the transaction settlement verifiable digital certificate.
[0302] The sending module 130 is used to send the transaction settlement verifiable digital certificate attached with the digital signature of the computing power consumer to the other party of the transaction, so that the other party can check the declaration data of the transaction settlement verifiable digital certificate and attach the corresponding digital signature.
[0303] The receiving module 140 is used to receive the transaction settlement verifiable digital certificate issued by the transaction channel controller after verifying the transaction settlement verifiable digital certificate with digital signatures attached to both parties of the transaction.
[0304] In addition, it also includes: a storage module used to save the issued transaction settlement verifiable digital certificate according to the preset storage strategy of the computing power trading platform.
[0305] Optionally, it also includes: a DID service module, which allows transaction users to complete DID identity registration, identity authentication, and identity query and update on the digital identity chain through the DID service module of DAPP. When a transaction user connects to TCC through DAPP, he can obtain the DID document of TCC from the digital identity chain through the DID service module of DAPP, and read the interface information of the channel connection from it, and use the interface to connect to TCC to obtain a new transaction channel or access an existing transaction channel.
[0306] The verifiable digital certificate service module 120 is used to complete the certificate creation through the DAPP settlement certificate issuance and verification module 930. Similarly, the DAPP-2 and digital identity chain node data interaction module is used to complete the registration of the transaction start CPT template and the transaction settlement CPT template, the issuance of the transaction start VC certificate and the creation of the transaction settlement VC certificate.
[0307] The off-chain computing power trading device described in this embodiment can be used to execute the embodiment of the above-mentioned off-chain computing power trading method. Its principles and technical effects are similar and will not be repeated here.
[0308] It should be noted that the above-mentioned off-chain computing power trading device is presented in the form of functional modules, where the modules refer to ASIC circuits, processors and memories that execute one or more software or fixed programs, and / or other devices that can provide the above-mentioned functions. In addition, the further functional description of each of the above-mentioned modules and units is the same as that of the above-mentioned corresponding embodiments, and will not be repeated here.
[0309] Fig.11 Schematic diagram of the structure of an electronic device provided by the present invention. Fig.11 As shown, the electronic device may include: a processor 10, a memory 20, a communication interface 30 and a communication bus. The processor 10, the memory 20 and the communication interface 30 communicate with each other through the communication bus.
[0310] The processor 10 can call the logic instructions in the memory 20 to execute the off-chain computing power transaction method provided by the above methods, which includes: establishing an off-chain transaction channel between the transaction channel controller and the two parties to the transaction, and when an off-chain transaction settlement is triggered, receiving a verifiable digital certificate for transaction settlement to be issued from one of the parties based on the off-chain settlement operation of the two parties to the transaction; checking whether the verifiable digital certificate for transaction settlement to be issued is attached with the respective digital signatures of the two parties to the transaction; if so, verifying the digital signatures attached by the two parties to the transaction; if the verification passes, issuing a verifiable digital certificate for transaction settlement, and sending the issued verifiable digital certificate for transaction settlement to the computing power consumer and the computing power supplier.
[0311] In addition, the logic instructions in the above-mentioned memory 20 can be implemented in the form of software functional units and can be stored in a computer-readable storage medium when sold or used as an independent product. Based on such an understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art or the part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention.
[0312] The aforementioned storage media include but are not limited to: USB flash drives, mobile hard disks, read-only memories (ROM), random access memories (RAM), magnetic disks or optical disks, and other media that can store program codes.
[0313] In addition, in some possible implementations, when the processor 10 calls the computer instructions in the memory 20, it is also used to execute the following method steps: establish a transaction channel between a transaction channel controller and both parties to the transaction, and use the transaction channel to verify the identities of the two parties to the transaction. When the identity authentication of the two parties to the transaction is qualified, use the transaction channel to initiate an off-chain transaction settlement operation, and obtain the corresponding transaction settlement template from the transaction chain; create a verifiable digital certificate for transaction settlement to be issued according to the transaction settlement template; attach the digital signature of the computing power consumer to the end of the declaration data of the verifiable digital certificate for transaction settlement to be issued; send the verifiable digital certificate for transaction settlement attached with the digital signature of the computing power consumer to the computing power supply end, so that the computing power supply end checks the verifiable digital certificate for transaction settlement and attaches the corresponding digital signature; receive the verifiable digital certificate for transaction settlement issued after the transaction channel controller verifies the verifiable digital certificate for transaction settlement attached with the digital signatures of both parties to the transaction; save the issued verifiable digital certificate for transaction settlement according to the preset storage policy of the computing power trading platform.
[0314] On the other hand, the present invention also provides a computer program product, which includes a computer program. The computer program can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the off-chain computing power trading method provided by the methods in the above embodiments.
[0315] The method includes: establishing an off-chain transaction channel between a transaction channel controller and both parties to the transaction, and when an off-chain transaction settlement is triggered, receiving a verifiable digital certificate for transaction settlement to be issued from one of the parties based on the off-chain settlement operation of the two parties to the transaction; checking whether the declaration data in the verifiable digital certificate for transaction settlement to be issued is attached with the respective digital signatures of the two parties to the transaction at the end; if so, verifying the digital signatures attached by the two parties to the transaction; if the verification passes, issuing a verifiable digital certificate for transaction settlement, and sending the issued verifiable digital certificate for transaction settlement to the computing power consumer and the computing power supplier.
[0316] On the other hand, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, is implemented to execute the computing power trading method provided by the above-mentioned methods, the method comprising: establishing an off-chain transaction channel between a transaction channel controller and both parties to the transaction, initiating an off-chain transaction settlement operation using the transaction channel when the identity authentication of both parties to the transaction is qualified, receiving a verifiable digital certificate for transaction settlement to be issued from one of the parties based on the off-chain settlement operation of both parties to the transaction; checking whether the verifiable digital certificate for transaction settlement to be issued is attached with the respective digital signatures of both parties to the transaction; if so, verifying the digital signatures attached by both parties to the transaction; if the verification passes, issuing a verifiable digital certificate for transaction settlement, and sending the issued verifiable digital certificate for transaction settlement to both parties to the transaction.
[0317] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.
[0318] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0319] The above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for off-chain computing power trading, characterized in that: Applied to a transaction channel controller, the method comprises: After the computing power consumer obtains a transaction channel controller from the transaction chain node through the decentralized application of the first computing power trading platform, he connects to the transaction channel controller and applies to create a transaction channel; When the transaction channel controller receives the transaction channel creation application from the computing power consuming user, it requires the computing power consuming user to perform identity verification. After the verification is passed, it creates a transaction channel as required and returns the transaction channel information to the computing power consuming user; After receiving the identity authentication request, the computing power consumer reads the ciphertext and decrypts it with a private key, and replies the plaintext or the answer to the plaintext request to the transaction channel controller, specifically including: feeding back the identity authentication reply message to the transaction channel controller through the first computing power trading platform decentralized application, so that the transaction channel controller completes the access identity authentication; The computing power consuming user generates and sends a transaction initiation message to the computing power supplying user based on the transaction channel information returned by the transaction channel controller, wherein the transaction initiation message includes declaration data of an unissued transaction initiation verifiable credential and transaction channel information; The computing power supply user sends a request to connect to a designated transaction channel to the transaction channel controller through the decentralized application of the second computing power transaction platform, and the transaction channel controller sends an identity authentication request to the computing power supply user after receiving the request; After receiving the identity authentication request, the computing power supply user reads the ciphertext and decrypts it with a private key, and replies the plaintext or the answer to the plaintext request to the transaction channel controller, specifically including: feeding back the identity authentication reply message to the transaction channel controller through the second computing power trading platform decentralized application, so that the transaction channel controller completes the access identity authentication and returns the transaction channel information to the computing power supply user; In the case where the identity authentication of the transaction parties is qualified, the off-chain transaction settlement operation is initiated by using the transaction channel, and based on the off-chain settlement operation of the transaction parties, a verifiable digital certificate for transaction settlement to be issued by one of the transaction parties is received; Checking whether the transaction settlement verification digital certificate to be issued has the digital signatures of both parties to the transaction attached; If yes, verify the digital signatures attached by both parties to the transaction; If the verification is passed, the transaction settlement verifiable digital certificate is issued, and the issued transaction settlement verifiable digital certificate is sent to the transaction parties.
2. The method according to claim 1, characterized in that The verifying of the digital signatures attached by both parties to the transaction includes: Obtain the distributed digital identity identifier DID documents of both parties to the transaction from the digital identity chain, and read the public key information of the transaction user from each of the DID documents; The digital signatures attached by the transaction parties are verified using the read public key information.
3. The method according to claim 2, characterized in that The issuing of the transaction settlement verifiable digital certificate comprises: The DID of the issuer, the issuance time and the digital signature are written into the transaction settlement verifiable digital certificate to generate the issued transaction settlement verifiable digital certificate, and the DID of the issuer is the DID of the transaction channel controller.
4. The method according to claim 1, characterized in that: The method further comprises: If the digital signatures attached by both parties to the transaction fail to be verified, an error prompt message will be sent to both parties to the transaction.
5. The method according to claim 1, characterized in that Before establishing the off-chain transaction channel between the transaction channel controller and the transaction parties, it also includes: Acquire access information of a transaction chain node associated with the transaction channel controller, the access information including: an IP address, a port number, and a connection method of the transaction chain node; The transaction chain node is connected through a pre-designed smart contract interface or SDK access interface, and the association information between the transaction channel controller and the transaction chain node is written into the blockchain, wherein the data structure of the association information includes a key-value pair consisting of the DID of the transaction channel controller and the ID of the transaction chain node.
6. The method according to claim 1, characterized in that The method further comprises: Statistics of its own load; When a load query request is received from either party of the transaction, the number of currently started transaction channels and system resource usage are packaged and sent to the requesting party.
7. The method according to claim 1, characterized in that The transaction channel controller comprises: A transaction channel control module is used to dynamically start or stop a transaction channel, wherein the transaction channel provides a transmission channel for interactive data transmission between transaction parties; A module for interacting with digital identity chain nodes, which is used to interact with digital identity chain nodes, wherein the digital identity chain nodes are used to store DID documents, computing power service capability certificate templates, and computing power service capability verifiable digital certificates; A data interaction module with a transaction chain node, used for data interaction with a transaction chain node, registering association information with the transaction chain node on the transaction chain, and uploading supporting data of a verifiable digital certificate for transaction settlement to the chain. The transaction chain node is used to store association information between the transaction channel controller and the transaction chain node, a transaction initiation template, a transaction settlement template, a verifiable digital certificate for transaction initiation, and supporting data of a verifiable digital certificate for transaction settlement; The settlement certificate issuance and verification module is used for the issuance and verification of verifiable digital certificates for off-chain transaction settlement; The load situation statistics and query module is used to count the load situation of the transaction channel controller and process load query requests.
8. An electronic device, characterized in that: comprising a memory and a processor, wherein the memory and the processor are connected; The memory stores computer instructions; The processor executes the off-chain computing power trading method described in any one of claims 1 to 7 by executing the computer instructions.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the off-chain computing power transaction method as described in any one of claims 1 to 7 is implemented.
10. A computer program product, characterized in that It includes computer instructions, which, when executed on a computer, enable the computer to execute the off-chain computing power transaction method as described in any one of claims 1 to 7.
Citation Information
Patent Citations
Computing power transaction method, device and system, electronic equipment and storage medium
CN117057921A