Resource transfer and account creation method and device, computer equipment and storage medium
By using the key management service of the cloud platform to sign resource transfers in the blockchain network, the security risk of users' private keys being kept on their own is solved, and the security and cost-effectiveness of resource transfers are improved.
Patent Information
- Application Number
- CN202410891833.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-02
- Publication Date
- 2024-08-27
AI Technical Summary
Self-keeping of users' private keys in the blockchain network involves the risk of leakage and theft, which affects transaction security.
By sending resource transfer information to multiple cloud platforms, using the private key of the cloud account to sign, and aggregating the signatures and sending them to the blockchain network, resource transfer is realized, preventing users from keeping their own private keys, and reducing the risk of key leakage.
It improves the security of resource transfer, reduces the cost for users to keep their own private keys, and further enhances security through multi-signature services.
Smart Images

Figure CN118552197A
Abstract
Description
Technical Field
[0001] The present application relates to the field of blockchain technology, and in particular to a resource transfer method, apparatus, computer equipment, storage medium and computer program product, as well as an account creation method, apparatus, computer equipment, storage medium and computer program product. Background Art
[0002] With the development of computer technology, blockchain has emerged. Blockchain is a new application model of computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanism, encryption algorithm, etc. It is essentially a decentralized database. To interact with the blockchain network, users can create accounts on the blockchain network in advance and initiate transactions through the accounts.
[0003] In the process of initiating a transaction through an account, in order to ensure the security of the transaction, the transaction is usually signed by the user's private key. The blockchain network will execute the transaction only after verifying the signature. However, the user's private key is usually kept by themselves, and the storage methods are different. There is a risk of leakage and theft, which poses a security risk. Summary of the invention
[0004] Based on this, it is necessary to provide a resource transfer and account creation method, apparatus, computer equipment, computer-readable storage medium and computer program product that can improve resource security in response to the above technical problems.
[0005] On the one hand, the present application provides a resource transfer method, comprising:
[0006] Obtaining resource transfer information related to a target account; the target account is an account from which resources are transferred;
[0007] Sending the resource transfer information to multiple cloud platforms to instruct the cloud platforms to sign the resource transfer information using a private key of a cloud account; the cloud account has a binding relationship with the target account;
[0008] Receive signatures fed back by each of the cloud platforms, and aggregate multiple received signatures to obtain an aggregated signature;
[0009] The resource transfer information and the aggregate signature are sent to the blockchain network to instruct the blockchain network to perform an on-chain transaction based on the resource transfer information and the aggregate signature to achieve resource transfer.
[0010] On the other hand, the present application also provides a resource transfer device, including:
[0011] An acquisition module, used to acquire resource transfer information related to a target account; the target account is an account of a resource transferor;
[0012] A sending module, used to send the resource transfer information to multiple cloud platforms to instruct the cloud platforms to sign the resource transfer information using a private key of a cloud account; the cloud account has a binding relationship with the target account;
[0013] An aggregation module, used to receive signatures fed back by each of the cloud platforms, and aggregate multiple received signatures to obtain an aggregated signature;
[0014] An operation module is used to send the resource transfer information and the aggregate signature to the blockchain network to instruct the blockchain network to perform an on-chain transaction based on the resource transfer information and the aggregate signature to achieve resource transfer.
[0015] On the other hand, the present application also provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the above-mentioned resource transfer method when executing the computer program.
[0016] On the other hand, the present application also provides a computer-readable storage medium having a computer program stored thereon, and the computer program implements the steps of the above-mentioned resource transfer method when executed by a processor.
[0017] On the other hand, the present application also provides a computer program product, including a computer program, which implements the steps of the above-mentioned resource transfer method when executed by a processor.
[0018] The above-mentioned resource transfer method, device, computer equipment, storage medium and computer program product can send the resource transfer information related to the target account to multiple cloud platforms when resource transfer is required, and each cloud platform signs the resource transfer information through the private key of the cloud account bound to the target account created in advance. The signatures fed back by each cloud platform are aggregated to obtain an aggregate signature, so that the resource transfer information and the aggregate signature are sent to the blockchain network in the form of a transaction, so that the blockchain network verifies the aggregate signature. Once the verification is passed, the on-chain transaction can be executed to realize resource transfer. In this application, there is no need for users to keep account keys by themselves. With the key storage capability of the cloud platform, the risk of key leakage is greatly reduced, which improves the security of resources in the account. At the same time, it also avoids users from keeping secret keys by themselves, and also saves storage costs. In addition, this application uses a multi-signature service when transferring resources, which can further improve the security of resource transfer.
[0019] On the other hand, the present application provides an account creation method, comprising:
[0020] For any of the N cloud accounts that have logged in, a key pair is generated by calling the key management service of the cloud platform to which the cloud account belongs according to the cloud account targeted; N is a positive integer greater than 1;
[0021] Get the public key in the key pair of each cloud account, aggregate the public keys of N cloud accounts to get the aggregated public key;
[0022] constructing a target object according to the aggregated public key;
[0023] The target object is published to the blockchain network, and a target account is obtained after the publication is successful; the target account has a binding relationship with the N logged-in cloud accounts.
[0024] On the other hand, the present application also provides an account creation device, including:
[0025] A control module, for generating a key pair for any one of the N logged-in cloud accounts by calling a key management service of the cloud platform to which the cloud account belongs according to the cloud account targeted; wherein N is a positive integer greater than 1;
[0026] An aggregation module is used to obtain the public key in the key pair of each cloud account, and aggregate the public keys of N cloud accounts to obtain an aggregated public key;
[0027] A construction module, used to construct a target object according to the aggregated public key;
[0028] The publishing module is used to publish the target object to the blockchain network and obtain the target account after the publishing is successful; the target account has a binding relationship with the N logged-in cloud accounts.
[0029] On the other hand, the present application also provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the above-mentioned account creation method when executing the computer program.
[0030] On the other hand, the present application also provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the steps of the above-mentioned account creation method are implemented.
[0031] On the other hand, the present application also provides a computer program product, including a computer program, which implements the steps of the above-mentioned account creation method when executed by a processor.
[0032] The above-mentioned account creation method, device, computer equipment, storage medium and computer program product, for any of the N cloud accounts that have been logged in, calls the key management service of the cloud platform to which it belongs according to the cloud account to generate a key pair, and then obtains and aggregates the public keys of the N cloud accounts to obtain the aggregated public key. Construct a target object according to the aggregated public key, publish the target object to the blockchain network, and obtain the target account after the successful publication. There is a binding relationship between the target account and the N cloud accounts that have been logged in. This application connects with multiple cloud platforms, creates a key pair using the key management service of the cloud platform, relies on the security of the cloud platform, stores the private key in the key management service, can only take out the public key, and creates an account based on the public key, so that the key storage capability of the cloud platform can be used, and the risk of leakage of the private key is greatly reduced, which improves the security of the resources in the account. At the same time, it avoids the user from keeping the secret key by himself, and also saves the corresponding storage cost. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the related technologies, the drawings required for use in the embodiments or the related technical descriptions are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0034] Figure 1 A diagram of an application environment of a resource transfer and / or account creation method in one embodiment;
[0035] Figure 2 A flowchart of an account creation method in one embodiment;
[0036] Figure 3 A schematic diagram of a MAST structure in one embodiment;
[0037] Figure 4 A schematic diagram of a method for unlocking a target script in one embodiment;
[0038] Figure 5 Schematic diagram of the principle of a target script in one embodiment;
[0039] Figure 6 A schematic diagram of the composition of a smart contract in an embodiment;
[0040] Figure 7 A flowchart of an account creation method in another embodiment;
[0041] Figure 8 A schematic diagram of a resource transfer method in one embodiment;
[0042] Fig. 9A schematic diagram of aggregating multiple signatures into an aggregate signature in one embodiment;
[0043] Fig.10 A schematic diagram of a flow chart of a resource transfer method in another embodiment;
[0044] Fig.11 A schematic diagram of a transaction execution process in one embodiment;
[0045] Fig.12 A schematic diagram of a flow chart of transaction execution in another embodiment;
[0046] Fig.13 is an application architecture diagram of an account service system in one embodiment;
[0047] Fig.14 is a structural block diagram of a resource transfer device in an embodiment;
[0048] Fig.15 It is a structural block diagram of an account creation device in one embodiment;
[0049] Fig.16 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0050] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0051] The resource transfer and / or account creation method provided in the embodiments of the present application can be applied to Figure 1 In the application environment shown. Among them, the blockchain network 102 is connected to the account service system 104, and the account service system 104 is connected to multiple cloud platforms 102. The account service system 104 can provide account services by the server, and the terminal provides an interactive interface to interact with the user. The cloud platform can specifically be a cloud server that provides cloud services. Among them, the connection can be directly or indirectly connected through wired or wireless communication, and this application does not limit it here.
[0052] The server may be an independent physical server, a server cluster or a distributed system composed of multiple physical servers, or a cloud server providing cloud computing services. The terminal may be a smart phone, a tablet computer, a laptop computer, a desktop computer, a smart speaker, a smart watch, a car terminal, a smart TV, etc., but is not limited thereto.
[0053] The blockchain network is a network composed of multiple blockchain nodes. Blockchain is a new application model of computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanism, encryption algorithm, etc. Blockchain is essentially a decentralized database, a string of data blocks generated by cryptographic methods. Each data block contains a batch of network transaction information, which is used to verify the validity of its information (anti-counterfeiting) and generate the next block. Blockchain can include the blockchain underlying platform, platform product service layer and application service layer.
[0054] The underlying blockchain platform can include processing modules such as user management, basic services, smart contracts, and operation monitoring. Among them, the user management module is responsible for the identity information management of all blockchain participants, including maintaining the generation of public and private keys (account management), key management, and the maintenance of the correspondence between the user's real identity and the blockchain address (authority management), etc., and, under authorization, supervises and audits the transactions of certain real identities and provides risk control rule configuration (risk control audit); the basic service module is deployed on all blockchain node devices to verify the validity of business requests, and records valid requests to storage after consensus is reached. For a new business request, the basic service first adapts the interface for parsing and authentication (interface adaptation), and then encrypts the business information through the consensus algorithm (consensus management). The smart contract module is responsible for the registration and issuance of contracts, as well as contract triggering and contract execution. Developers can define the contract logic in a programming language and publish it to the blockchain (contract registration). According to the logic of the contract terms, the key or other events are called to trigger the execution and complete the contract logic. It also provides the function of contract upgrade and cancellation. The operation monitoring module is mainly responsible for the deployment, configuration modification, contract setting, cloud adaptation and real-time status visualization output of the product during the product release process, such as alarm, network status monitoring, node equipment health status monitoring, etc.
[0055] The platform product service layer provides the basic capabilities and implementation framework of typical applications. Developers can superimpose business features based on these basic capabilities to complete the blockchain implementation of business logic. The application service layer provides application services based on blockchain solutions for business participants to use.
[0056] The present application can provide a wallet function through a blockchain network. The wallet is used to provide the function of conducting transactions of electronic resources, including initiating transactions (i.e., sending the transaction record of the current transaction to other nodes in the blockchain system. After the other nodes successfully verify, as a response to acknowledge the validity of the transaction, the transaction record data is stored in a temporary block of the blockchain; of course, the wallet also supports querying the remaining electronic resources in the electronic resource address.
[0057] The present application also relates to smart contracts, which are computer protocols designed to disseminate, verify or execute contracts in an information-based manner. Smart contracts allow for trusted transactions without a third party, which are traceable and irreversible. Smart contracts can execute the terms of a contract through code deployed on a shared ledger that is executed when certain conditions are met. The code is used to complete automated transactions based on actual business needs, such as querying the logistics status of the goods purchased by the buyer, and transferring the buyer's electronic currency to the merchant's address after the buyer signs for the goods; of course, smart contracts are not limited to executing contracts for transactions, but can also execute contracts for processing received information.
[0058] In an exemplary embodiment, Figure 2 As shown, a method for creating an account is provided, which is applied to Figure 1 The computer device in the account service system in the example (the computer device may be a server or a terminal) is used as an example to illustrate the method, including the following steps 202 to 208. Among them:
[0059] Step 202: for any cloud account among the N logged-in cloud accounts, a key pair is generated by calling a key management service of the cloud platform to which the cloud account belongs according to the cloud account; N is a positive integer greater than 1.
[0060] Among them, the cloud platform is the cloud server that provides cloud services, and the cloud account is an account registered in the cloud platform, which has the ability to call the cloud services provided by the cloud platform. Key management service, also known as Key Management Service, abbreviated as KMS, provides the function of creating and securely managing keys, and is a service among the cloud services provided by the cloud platform.
[0061] In some embodiments, the account service system may provide a front-end interactive interface, that is, display the interactive interface on the terminal. In this way, after logging into the account service system, the user can interact through the interactive interface to log into the cloud accounts of different cloud platforms through the interactive interface. In this way, the server as the back-end processing of the account service system can determine the currently logged-in cloud account.
[0062] Specifically, before creating an account, the computer device can determine the N cloud accounts currently logged in, and for each cloud account, the computer device can use the login status of the cloud account to initiate a key creation request to the cloud platform to which the cloud account belongs, and call the key management service to create a key pair according to the key creation request. Among them, the key pair includes a public key and a private key with a corresponding relationship.
[0063] Step 204, obtain the public key in the key pair of each cloud account, and aggregate the public keys of N cloud accounts to obtain an aggregated public key.
[0064] Specifically, for each cloud platform, the computer device can log in to the cloud account of the cloud platform, call the key management service, and send a public key acquisition request to the key management service to obtain the public key in the key pair kept by the key management service. It can be understood that the public key is the public key of the cloud account.
[0065] Then, the computer device may combine the N public keys obtained to obtain an aggregated public key. In some embodiments, the computer device may aggregate the N public keys using a preset aggregation method to obtain an aggregated public key. The preset aggregation method may be, for example, the Schnorr signature algorithm (a digital signature algorithm based on elliptic curve cryptography), the BLS signature algorithm (a cryptographic signature algorithm), or the ECDSA signature algorithm (elliptic curve digital signature algorithm).
[0066] In some embodiments, the computer device may send a public key acquisition request to each cloud platform in sequence, or send a public key acquisition request to each cloud platform simultaneously and in parallel, which is not limited in this embodiment of the present application.
[0067] Step 206: construct a target object according to the aggregated public key.
[0068] Among them, the target object is a data object that can be published in the blockchain network, and specifically can be a data object constructed based on the aggregated public key, such as a public key address constructed based on the aggregated public key, or a target script constructed based on the aggregated public key, or a hash value of the target script, or a smart contract constructed based on the aggregated public key, etc.
[0069] In some embodiments, the computer device may perform calculations or processing based on the aggregated public key, and according to the calculation results or processing results, perform processing according to the construction standard of the target object to obtain the target object.
[0070] Exemplarily, the computer device may perform a calculation on the aggregated public key to obtain a string of numbers and / or letters, etc., which can be considered as the public key address. Exemplarily, the computer device may perform a hash calculation on the aggregated public key to obtain the public key address, and use the public key address as the target object.
[0071] For example, the computer device may construct a script unlocking condition according to the aggregated public key, and write the script unlocking condition into the script to obtain a target script, and then use the target script as the target object. Alternatively, after the computer device constructs the target script, it may perform a hash operation on the target script to obtain a hash value of the target script, and use the hash value of the target script as the target object.
[0072] Exemplarily, a computer device can construct a smart contract based on an aggregated public key, such as setting the contract execution condition to be based on the verification of the aggregated public key, and the contract execution logic to be the resource operation logic, so that the target object can be obtained.
[0073] It can be understood that the target account is obtained after the target object is successfully published, and the target object is constructed by the aggregated public key. Therefore, if you want to unlock the target account, you need the private key corresponding to the public key of each cloud account.
[0074] In some embodiments, the aggregated public key is obtained by aggregating the public keys of N cloud accounts; when performing a resource transfer operation, the resource transferor needs to provide an aggregated signature obtained by aggregating the signatures of the private keys of these N cloud accounts in order to pass the verification of the aggregated public key.
[0075] In some other embodiments, through the threshold mechanism, the resource transferor only needs to provide an aggregate signature obtained by aggregating the signatures of the private keys of M cloud accounts to pass the verification of the aggregate public key, where M is a value greater than the threshold and less than or equal to N.
[0076] Step 208, publish the target object to the blockchain network, and obtain the target account after the publication is successful; the target account has a binding relationship with the N logged-in cloud accounts.
[0077] Specifically, the computer device can publish the target object to the blockchain network by constructing a transaction, and obtain the target account after the publication is successful. The account can be specifically a wallet account. It can be understood that since the target object is related to the aggregated public key, and the aggregated public key is obtained by aggregating the public keys of the N cloud accounts logged in by the above user, the target account has a binding relationship with the logged-in N cloud accounts.
[0078] In some embodiments, the computer device may sign the target object, construct a transaction request based on the signatures of the target object and the computer device, and send the signatures of the target object and the computer device to the blockchain node in the blockchain network through the transaction request. After receiving the transaction request, the blockchain node verifies the signature of the transaction request, and if the verification passes, a consensus is reached. If the consensus passes, the content in the transaction request is stored on the disk to realize the release of the target object.
[0079] In some embodiments, if the target object is a target script, the hash value of the target script can be used as the target account; if the target object is a smart contract, the contract address of the smart contract can be used as the target account, wherein the contract address can be obtained based on the transaction context generated by the smart contract on the chain. The transaction context refers to all the information and status involved in the entire execution process of a transaction from initiation to completion in the blockchain network, including but not limited to: transaction initiator, transaction recipient, transaction content, transaction signature, transaction status, and transaction results.
[0080] It should be noted that when transferring resources out of the target account, the target account is used as the resource transferor account; when transferring resources into the target account, the target account is used as the resource receiver account. Among them, resources are digital assets with certain value, such as electronic receipts, vouchers, virtual items, or virtual currency.
[0081] The above account creation method, for any of the N cloud accounts that have been logged in, calls the key management service of the cloud platform to which it belongs according to the cloud account to generate a key pair, and then obtains and aggregates the public keys of the N cloud accounts to obtain the aggregated public key. Construct a target object based on the aggregated public key, publish the target object to the blockchain network, and obtain the target account after the successful publication. The target account has a binding relationship with the N logged-in cloud accounts. This application connects with multiple cloud platforms, creates a key pair using the key management service of the cloud platform, relies on the security of the cloud platform, saves the private key in the key management service, can only take out the public key, and creates an account based on the public key. In this way, the key storage capability of the cloud platform can be used to greatly reduce the risk of leakage of the private key, thereby improving the security of the resources in the account. At the same time, it avoids the user's own custody of the secret key, and also saves the corresponding custody cost.
[0082] In some embodiments, constructing a target object based on an aggregated public key includes: obtaining a target key; the target key includes at least one of a preset key or a public key of a third-party organization; and constructing a target object based on the aggregated public key and the target key.
[0083] In some embodiments, constructing a target object by aggregating public keys can be considered to provide an unlocking condition for unlocking the target account. It can be understood that this unlocking method can be considered as a regular unlocking method for daily operations of the target account.
[0084] In other embodiments, unconventional unlocking methods can be provided to facilitate unlocking capabilities when the user's cloud account is invalid. That is, when constructing the target object, the target key is set as another unlocking condition, that is, if the resource transferor can provide information that can be verified by the target key, the target account can be unlocked and the resource can be transferred out.
[0085] The target key can be the user's own preset key, or the public key of a third-party organization, so that the resource transferor can unlock the target account under unconventional circumstances, thereby realizing the transfer of resources in the target account.
[0086] In some embodiments, during the account creation process, the computer device may require the user to provide identity authentication information, and then send the identity authentication information to a third-party organization to instruct the third-party organization to verify the validity of the identity authentication information. If the identity authentication information is verified to be valid, the third-party organization can feed back its own public key to the computer device. Among them, the identity authentication information is information that uniquely identifies an identity, such as an ID number or biometrics. Among them, biometrics include facial features, fingerprints, or voiceprints.
[0087] In some embodiments, during the process of creating an account, the computer device may provide an interactive interface and collect a preset key input by the user through the interactive interface. The preset key may be kept by the user.
[0088] In some embodiments, after the computer device obtains the target account, it can associate the user's identity authentication information with the target account and then feed it back to a third-party organization, which saves the association between the identity authentication information and the target account.
[0089] In the above embodiment, the target object is constructed based on the aggregated public key and the target key, and multiple unlocking methods can be provided for the target account, which is convenient for providing a resource transfer method in the event of cloud account loss or abnormality, and provides a multi-security account service.
[0090] In some embodiments, the target object includes a target script, and constructing the target object according to the aggregated public key and the target key includes: determining a first unlocking condition according to the aggregated public key, determining a second unlocking condition according to the target key; and constructing the target script according to the first unlocking condition and the second unlocking condition.
[0091] The unlocking condition is the unlocking condition of the target account, that is, the condition under which the locked resources in the target account can be operated. When the unlocking condition is met, the resources in the target account can be released for use.
[0092] The first unlocking condition is an unlocking condition determined according to the aggregated public key, and specifically can be verified by the aggregated public key. The second unlocking condition is an unlocking condition determined according to the target key, and specifically can be verified by the target key.
[0093] Specifically, the computer device can determine the first unlocking condition according to the aggregated public key, that is, set the verification through the aggregated public key, and if the verification is successful, the target account is determined to be unlocked, and then the on-chain transaction can be executed. In addition, the computer device can also determine the second unlocking condition according to the target key, that is, set the verification through the target key, and if the verification is successful, the target account is determined to be unlocked, and then the on-chain transaction can be executed.
[0094] In some embodiments, the computer device may determine the second unlocking condition according to the target key and the time lock, that is, verification may be performed by the target key only after the preset time requirement is met, and if the verification is passed, it is determined that the second unlocking condition is met.
[0095] In some embodiments, the second unlocking condition may be a Merkle path unlocking condition, that is, providing a Merkle tree path to achieve unlocking. The Merkle tree path may be constructed by a target key. In some embodiments, one target key may construct a Merkle tree path, and multiple target keys may construct multiple Merkle tree paths, thereby providing multiple unlocking paths.
[0096] Furthermore, the computer device may determine the unlocking logic according to the first unlocking condition and the second unlocking condition, and write the unlocking logic according to a preset script format to obtain a target script. In some embodiments, the target script may be a taproot script, and the target account may be a taproot account.
[0097] In the above embodiment, the first unlocking condition is determined according to the aggregated public key, the second unlocking condition is determined according to the target key, and then the target script is constructed according to the first unlocking condition and the second unlocking condition. At least two unlocking methods can be provided, one is to unlock through the aggregated signature corresponding to the aggregated public key; the other is to unlock through the method corresponding to the target key. This is convenient for releasing and using locked resources when the aggregated signature of the cloud account fails, preventing resources from being locked, and ensuring the security of the target account.
[0098] In some embodiments, the target key includes a preset key and a public key of a third-party organization, and determining the second unlocking condition based on the target key includes: constructing a first script command based on the public key of the third-party organization and the first time lock, and obtaining a hash value of the first leaf node based on the first script command; constructing a second script command based on the preset key and the second time lock, and obtaining a hash value of the second leaf node based on the second script command; determining the hash value of the root node based on the hash value of the first leaf node and the hash value of the second leaf node; determining the second unlocking condition based on the hash values of each leaf node and the hash value of the root node.
[0099] It should be noted that, for the second unlocking condition, the computer device can be set with a time lock, that is, a certain preset time requirement must be met before it can be unlocked by the target key; if the preset time requirement is not met, the unlocking will fail.
[0100] The second unlocking condition may be an unlocking condition constructed according to a MAST (Merkle Abstract Syntax Tree) structure, that is, an unlocking condition obtained through a Merkle tree.
[0101] For example, please refer to Figure 3 , Figure 3 Schematic diagram of a MAST structure in one embodiment. Figure 3 As shown in the figure, the MAST structure includes three leaf nodes and one root node. By performing a hash operation on script command 1 (Script1), the hash value of leaf node 1 (i.e. Figure 3 32-bit Hash1 shown in the figure); Perform a hash operation on script command 2 (Script2) to obtain the hash value of leaf node 2 (i.e. Figure 3 32-bit Hash2 shown in the figure); Perform a hash operation on script command 3 (Script3) to obtain the hash value of leaf node 3 (i.e. Figure 3 32-bit Hash3 shown in the figure). Hash1 and Hash2 are merged to obtain the hash values of the parent nodes of leaf nodes 1 and 2 (i.e. Figure 3 Then Hash3 and Hash(1&2) are merged to get the hash value of the root node (that is, Figure 3 Hash (1, 2 & 3) shown in the figure). In this way, a Merkle tree is constructed.
[0102] Among them, script command 1 in the above example is "Alice's signature and time lock meet the requirements"; script command 2 is "Bob's signature and time lock meet the requirements"; script command 3 is "provide an aggregated signature obtained by aggregating 2 signatures". It can be understood that when any requirement is met, the path corresponding to the requirement is unlocked, and the Merkle tree is also unlocked. In this way, the script can be unlocked by exposing one branch and the corresponding Merkle path, without exposing other branches, and there is a certain degree of privacy protection.
[0103] Next, please look at the construction process of the Merkle tree in this application:
[0104] The computer device can construct a first script command according to the public key of the third-party organization and the first time lock, perform a hash operation on the first script command to obtain the hash value of the first leaf node; construct a second script command according to the preset key and the second time lock, and perform a hash operation on the second script command to obtain the hash value of the second leaf node. Then, according to the hash value of the first leaf node and the hash value of the second leaf node, the hash value of the root node is determined; according to the hash values of each leaf node and the hash value of the root node, a Merkle tree is constructed to obtain the second unlocking condition.
[0105] In some embodiments, the computer device may concatenate the hash value of the first leaf node and the hash value of the second leaf node to obtain the hash value of the root node; or, the computer device may perform a hash operation on the hash value of the first leaf node and the hash value of the second leaf node again to obtain the hash value of the root node.
[0106] In some embodiments, the duration requirement of the first time lock may be longer, shorter or equal to the duration requirement of the second time lock, which is not limited in the embodiments of the present application. In one embodiment, the duration requirement of the first time lock is less than the duration requirement of the second time lock.
[0107] It is understandable that the Merkle tree in the present application may also include more than 2 branches, such as 3 or 4. For each target key, a corresponding script command may be constructed according to the target key and the time lock. For any script command, a hash operation may be performed on it to obtain a hash value of a leaf node. The computer device may determine the hash value of the root node according to the hash value of each leaf node, and then determine the second unlocking condition according to the hash value of each leaf node and the hash value of the root node.
[0108] In the above embodiment, the second unlocking condition is determined by constructing a Merkle tree through the target key, so that script unlocking can be achieved when any path is met, and other branches will not be exposed, which can provide secure and diverse unlocking conditions and protect user privacy.
[0109] In some embodiments, please refer to Figure 4 , Figure 4 Figure 1 is a schematic diagram of how to unlock the target script. Figure 4As shown, normal multi-signature unlocking and MAST unlocking methods can exist in parallel. The left side is the conventional unlocking method, that is, the unlocking method verified by the aggregated public key when the resource transfer is normal, which can take effect immediately once the verification is passed; the right side is the unlocking method through the Merkle tree, which can be verified without exposing the existence of the complete Merkle tree. Two paths are provided in this application, one is to unlock through a preset key and time lock; the other is to unlock through the public key and time lock of a third-party organization. In theory, when the user cannot use the normal signing process, the merkle tree path needs to be used to unlock and use.
[0110] In some embodiments, please refer to Figure 5 , Figure 5 This is a schematic diagram of the principle of the target script. Figure 5 As shown in the figure, the user-created multi-cloud aggregate signature is used as a condition for independent use of locked resources (and takes effect immediately). At the same time, the unlocking condition is parallel to a merkle script tree. If the aggregate signature on the cloud cannot be used (such as multiple cloud services losing data, or the cloud platform crashes, etc.), the locked resources can be released by revealing any of the two branches in the merkle script tree. The two branches of the merkle script tree include:
[0111] (1) Unlocked by a preset key and requiring a relatively long delay condition to be met;
[0112] (2) Unlocking is performed by a third-party institution, and a relatively short delay condition needs to be met. The third-party institution can be a bank, an account issuing institution, a government department, or an insurance institution. In addition, more than one third-party institution can be set up, so that the merkle tree will have more branches.
[0113] In this application, the security of the account is guaranteed through the two branches of the merkle script tree, which can prevent assets from being locked.
[0114] In some embodiments, the target object includes a smart contract, and the target object is constructed based on the aggregated public key and the target key, including: constructing script verification logic and resource operation logic based on the aggregated public key and the target key; and constructing a smart contract based on the script verification logic and the resource operation logic.
[0115] Specifically, for blockchain networks that cannot support script execution, computer devices can construct smart contracts and write script verification logic and resource operation logic into smart contracts to achieve resource transfer through automatic execution of smart contracts.
[0116] In some embodiments, the computer device may construct a target script based on the aggregated public key and the target key, and construct a script verification logic based on the target script, and determine the contract execution condition based on the script verification logic, such as determining that the contract execution condition is satisfied when the script unlocking condition is satisfied. The computer device may construct a resource operation logic, and set the resource operation logic as the contract execution logic. Then, a smart contract is obtained based on the contract execution condition and the contract execution logic.
[0117] It should be noted that the resource operation logic may specifically be logic for performing resource transfer.
[0118] In some embodiments, if the unlocking condition of the target script includes a first unlocking condition and a second unlocking condition, the smart contract may also provide a management function of the aggregated public key and the Merkle tree path.
[0119] In some embodiments, if the blockchain network is a second blockchain network that does not support taproot technology but supports smart contract technology, the computer device can create a target account by building a smart contract. The computer device can deploy and call the smart contract in the virtual machine of the second blockchain network.
[0120] For example, please refer to Figure 6 , Figure 6 It is a schematic diagram of the composition of a smart contract in an embodiment. The smart contract is composed of script verification logic, multi-signature address and unlock merkle path management, and resource operation logic. Among them, the script verification logic can be specifically taproot script verification logic, which is used to implement the smart contract deployed in the virtual machine to verify the taproot target script equally like the first blockchain network, so that the calculation logic of the target account is common to the first blockchain and the second blockchain. Multi-signature address and unlock merkle path management are used to provide multi-signature permissions and taproot multi-unlock path design solution storage in the smart contract. The resource operation logic can specifically include resource operation codes and operation logic engines. This part refers to the transfer in and out of the target script, and designs resource operation codes for operating resources in the target account.
[0121] In the above embodiment, the script verification logic is constructed according to the aggregated public key and the target key, the resource operation logic is constructed, and the smart contract is constructed according to the script verification logic and the resource operation logic. For blockchain networks that do not support script accounts, accounts that can be used for resource storage and transfer can be created through smart contracts, which provides the applicability of accounts.
[0122] refer to Figure 7 In a specific embodiment, the account creation method includes the following steps:
[0123] Step 701, create cloud accounts in N cloud platforms, and log in to the cloud account of each cloud platform, where N is a positive integer greater than 1.
[0124] Step 702: For any cloud account among the N logged-in cloud accounts, a key management service of the cloud platform to which the cloud account belongs is called to generate a key pair.
[0125] Step 703: Obtain the public key in the key pair of each cloud account, and aggregate the public keys of N cloud accounts to obtain an aggregated public key.
[0126] Step 704, obtain the target key; the target key includes a preset key and a public key of a third-party organization.
[0127] Step 7051, determining a first unlocking condition according to the aggregated public key.
[0128] Step 7052, construct a first script command based on the public key of the third-party organization and the first time lock, obtain the hash value of the first leaf node based on the first script command, construct a second script command based on the preset key and the second time lock, obtain the hash value of the second leaf node based on the second script command, determine the hash value of the root node based on the hash value of the first leaf node and the hash value of the second leaf node, and determine the second unlocking condition based on the hash values of each leaf node and the hash value of the root node.
[0129] Step 7053: construct a target script according to the first unlocking condition and the second unlocking condition.
[0130] Step 7054, publish the target script to the first blockchain network, and obtain the target account after successful publishing; the target account has a binding relationship with the N logged-in cloud accounts.
[0131] Step 7061, construct script verification logic and resource operation logic based on the aggregated public key and the target key; construct a smart contract based on the script verification logic and resource operation logic.
[0132] Step 7062, publish the smart contract to the second blockchain network, and obtain the target account after the publication is successful; the target account has a binding relationship with the N logged-in cloud accounts.
[0133] The above account creation method, for any of the N cloud accounts that have been logged in, calls the key management service of the cloud platform to which it belongs according to the cloud account to generate a key pair, and then obtains and aggregates the public keys of the N cloud accounts to obtain the aggregated public key. Construct a target object based on the aggregated public key, publish the target object to the blockchain network, and obtain the target account after the successful publication. The target account has a binding relationship with the N logged-in cloud accounts. This application connects with multiple cloud platforms, creates a key pair using the key management service of the cloud platform, relies on the security of the cloud platform, stores the private key in the key management service, can only take out the public key, and creates an account based on the public key. In this way, the key storage capability of the cloud platform can be used to greatly reduce the risk of private key leakage, thereby improving the security of resource transfer. At the same time, it avoids the user's own custody of the secret key, and also saves the corresponding custody cost.
[0134] In addition, the first unlocking condition is determined according to the aggregated public key, the second unlocking condition is determined according to the target key, and then the target script is constructed according to the first unlocking condition and the second unlocking condition. At least two unlocking methods can be provided, one is to unlock through the aggregated signature corresponding to the aggregated public key; the other is to unlock through the method corresponding to the target key. This is convenient for releasing and using locked resources when the aggregated signature of the cloud account fails, preventing resources from being locked, and ensuring the security of the target account.
[0135] In some embodiments, Figure 8 As shown, a resource transfer method is provided, which is applied to Figure 1 The computer device in the account service system in FIG. 8 (the computer device may be a server or a terminal) is used as an example to illustrate the method, which includes the following steps 802 to 808. Among them:
[0136] Step 802, obtaining resource transfer information related to a target account; the target account is the resource transferor account.
[0137] The account is an account used to store and manage resources, which can be an electronic wallet. The target account is the account of the resource transferor. Resources are digital assets with a certain value, such as electronic tickets, vouchers, virtual items, or virtual coins. Resource transfer information is information used to transfer resources, which can specifically include the resource transferor account, resource recipient account, and resource transfer amount.
[0138] Specifically, the front-end web interface can display an interactive interface. After logging into the account service system, the user can interact through the interactive interface to log into the cloud accounts of different cloud platforms through the interactive interface. In addition, a resource transfer instruction can be triggered in the interactive interface, and the resource transfer instruction includes resource transfer information. The front-end interactive interface can send the resource transfer information to the computer device.
[0139] Step 804, sending the resource transfer information to multiple cloud platforms to instruct the cloud platforms to sign the resource transfer information using the private key of the cloud account; the cloud account has a binding relationship with the target account.
[0140] Specifically, the computer device can construct a transaction request that can communicate with the blockchain network according to the blockchain network to which the target account belongs, and the transaction request includes resource transfer information. Then the computer device can send the transaction request to the cloud platform to which the logged-in cloud account belongs through the currently logged-in cloud account, such as to M cloud platforms. Each cloud platform uses the key management service to sign the resource transfer information with the private key of the cloud account that sends the transaction request, and feeds back the generated signature to the computer device.
[0141] In some embodiments, the computer device can determine multiple cloud accounts that are currently logged in. For each cloud account, the computer device can send resource transfer information to the corresponding cloud platform through the cloud account according to the login status of the cloud account, and call the key management service through the cloud account, thereby instructing the key management service to use the private key of the cloud account to sign the resource transfer information.
[0142] Step 806: Receive signatures fed back by each cloud platform, and aggregate the received multiple signatures to obtain an aggregate signature.
[0143] Specifically, the computer device receives signatures fed back by each cloud platform, and aggregates the received multiple signatures through a preset aggregation method to obtain an aggregate signature. The preset aggregation method may be, for example, the Schnorr signature algorithm (a digital signature algorithm based on elliptic curve cryptography), the BLS signature algorithm (a cryptographic signature algorithm), or the ECDSA signature algorithm (elliptic curve digital signature algorithm).
[0144] For example, please refer to Fig. 9 , Fig. 9 FIG. 1 is a schematic diagram of aggregating multiple signatures into an aggregate signature in one embodiment. Fig. 9 As shown, the computer device can aggregate N signatures into an aggregate signature by exchanging at least two rounds of communication.
[0145] Instead of publishing each public key and each signature separately on the blockchain, multiple signatures are combined to generate an aggregate signature, and then signed with an aggregate signature. This obviously has better scalability and privacy enhancement, and can also significantly save space and save verification time, and as the number of signatories of traditional multi-signature transactions increases, the relative advantages will become greater.
[0146] Step 808, sending the resource transfer information and the aggregate signature to the blockchain network to instruct the blockchain network to execute on-chain transactions based on the resource transfer information and the aggregate signature to achieve resource transfer.
[0147] Specifically, the computer device can add the aggregate signature to the transaction request to obtain a valid transaction, and then send the transaction to the blockchain network. That is, the resource transfer information and the aggregate signature are sent to the blockchain node in the blockchain network. After receiving the transaction request, the blockchain node calls the target object related to the target account through the target account in the request, verifies the aggregate signature through the target object, and executes the transaction according to the resource transfer information after the verification. After the transaction is executed, if the consensus is passed, the transaction result will be placed on the disk to realize the resource transfer. Among them, the target object is an object pre-deployed in the blockchain network, which can be a data object constructed according to the aggregate public key, such as a public key address constructed according to the aggregate public key, or a target script constructed according to the aggregate public key, or a hash value of the target script, or a smart contract constructed according to the aggregate public key, etc.
[0148] In some embodiments, the blockchain network calls a pre-deployed target object related to the target account, verifies the aggregate signature through the aggregate public key in the target object, and performs resource transfer based on the resource transfer information after the verification is passed; wherein the aggregate public key is obtained by aggregating the public keys of multiple cloud accounts that have a binding relationship with the target account.
[0149] Specifically, the computer device can verify the aggregated private key through the aggregated public key in the target object. If the verification is successful, it means that the user has the right to use the target account. In this way, the blockchain network can transfer resources based on the resource transfer information. Specifically, the resources in the resource transferor's account can be transferred to the resource receiver's account, and the amount of resources transferred is the amount specified in the resource transfer information. In this way, the target account can be unlocked through the aggregate signature, thereby achieving secure resource transfer.
[0150] The above-mentioned resource transfer method, when resource transfer is required, can send the resource transfer information related to the target account to multiple cloud platforms, and each cloud platform signs the resource transfer information through the private key of the pre-created cloud account bound to the target account. The signatures fed back by each cloud platform are then aggregated to obtain an aggregate signature, so that the resource transfer information and the aggregate signature are sent to the blockchain network in the form of a transaction, so that the blockchain network verifies the aggregate signature. Once the verification is passed, the on-chain transaction can be executed to realize resource transfer. In this application, there is no need for users to keep account keys by themselves. With the key storage capability of the cloud platform, the risk of private key leakage is greatly reduced, which improves the security of resource transfer. At the same time, it avoids users from keeping secret keys by themselves, and also saves the corresponding storage costs. In addition, this application uses a multi-signature service when transferring resources, which can further improve the security of resource transfer.
[0151] In some embodiments, sending resource transfer information to multiple cloud platforms includes: determining M cloud accounts that are logged in among N cloud accounts that have a binding relationship with the target account; N is a positive integer greater than 1, and M is a positive integer greater than 1 and less than or equal to N; sending the resource transfer information to the cloud platforms to which each of the M cloud accounts belongs.
[0152] Specifically, when transferring resources through the target account, the user can first log in to M cloud accounts among the N cloud accounts previously bound to the target account. M can be the same as N, or M is greater than the threshold and less than N. Then the resource transfer information is sent to the cloud platform to which each of the M cloud accounts belongs.
[0153] It can be understood that when a computer device creates a target account, it needs to aggregate the public keys of N cloud accounts to obtain an aggregated public key. If the signature algorithm used in the public key aggregation process does not support the threshold mechanism, then when using the target account for resource transfer, the private keys of N cloud accounts need to be signed separately and then aggregated; if the signature algorithm used in the public key aggregation process supports the threshold mechanism, then when using the target account for resource transfer, the private keys of M cloud accounts exceeding the threshold can be used to sign separately and then aggregated, and the aggregated signature obtained can be verified by the aggregated public key.
[0154] In the above embodiment, by signing with the private keys of less than or equal to N cloud accounts, the authorization scope of resource transfer can be provided without using the private keys of all cloud accounts. In the event of a small number of cloud platform outages or cloud account loss, users can still transfer resources.
[0155] In some embodiments, resource transfer information is sent to the cloud platforms to which each of the M cloud accounts belongs, including: for any cloud account among the M cloud accounts that are in a logged-in state, the resource transfer information is sent to the cloud platform to which the targeted cloud account belongs, and the key management service of the corresponding cloud platform is called to instruct the key management service to sign the resource transfer information using the private key of the targeted cloud account.
[0156] Specifically, for any cloud account among the M cloud accounts that are in a logged-in state, the computer device can send resource transfer information to the cloud platform to which the targeted cloud account belongs, and call the key management service of the corresponding cloud platform to instruct the key management service to sign the resource transfer information using the private key of the targeted cloud account.
[0157] In some embodiments, the computer device may send resource transfer information to each cloud platform in sequence, or send resource transfer information to each cloud platform simultaneously and in parallel, which is not limited in this embodiment of the present application.
[0158] In some embodiments, the cloud platform can specifically be a public cloud. The present application can be connected to the key management services of cloud accounts of multiple public clouds. By maintaining the login status on multiple clouds and calling the API of the key management service, users can create multi-signature keys (i.e., aggregated signatures) on different cloud platforms. The private keys rely on the security of the cloud service and are stored in the KMS system of the cloud service. Only the public key can be retrieved and calculated into a multi-signature address (i.e., aggregated public key), which greatly reduces the risk of private key leakage. At the same time, it avoids the need for wallets or users to keep the keys themselves, and also saves the corresponding storage costs.
[0159] In the above embodiment, the private key of the target account is distributed in multiple cloud platforms and is kept by the key management service of the cloud platform, which can avoid the loss or theft of the key and improve the security of resource transfer.
[0160] In some embodiments, the method also includes a resource transfer step, which specifically includes: obtaining first transfer information related to the target account; obtaining identity authentication information, and sending the identity authentication information and the first transfer information to a third-party agency to instruct the third-party agency to sign the first transfer information when the identity authentication information is verified; sending the first transfer information and the signature of the third-party agency to the blockchain network to instruct the blockchain network to execute an on-chain transaction based on the first transfer information and the signature of the third-party agency to realize resource transfer.
[0161] The transfer information is information used to transfer resources, which may include the account of the resource transferor, the account of the resource recipient, and the amount of resource transfer. The resource recipient account can usually be a designated account, and the amount of resource transfer can be a value less than the account balance, or the entire value of the account balance, or it can be empty. If it is empty, all transfers are made to the resource recipient account by default.
[0162] As mentioned above, during the process of creating the target account, one of the branches of the Merkle tree can be constructed through the public key of a third-party organization. Therefore, in the event of a cloud service outage or cloud service data loss, a third-party organization can be used to assist in resource transfer.
[0163] Specifically, the computer device can obtain the identity authentication information input by the user, and send the identity authentication information and the first transfer information to the third party institution. The third institution signs the first transfer information when verifying that the identity authentication information is valid and the identity authentication information is associated with the target account.
[0164] The computer device receives the signature fed back by the third-party organization, and sends the first transfer information and the signature of the third-party organization to the blockchain network in the form of a constructed transaction, instructing the blockchain network to verify the signature according to the public key of the third-party organization in the target object. If the verification is successful, the on-chain transaction is executed based on the first transfer information. After the transaction is completed, if consensus is passed, the transaction result will be stored on the disk to realize the transfer of resources.
[0165] In some embodiments, the third party institution may also send the first transfer-out information and the signature of the third party institution to the blockchain network in the form of constructing a transaction. This embodiment of the present application does not limit this.
[0166] In some embodiments, the condition for unlocking the target object through the signature of a third-party organization also includes a time lock. That is, before the blockchain network verifies the signature through the public key of the third-party organization, it will first verify whether the preset time requirement in the time lock is reached. If it is reached, the verification operation will be performed. If not, the transaction failure result will be directly returned.
[0167] In the above embodiment, a solution for transferring out resources is provided, and the transfer out of resources in the target account can also be achieved through a third-party organization, thereby avoiding the problem of the target account being locked in unexpected circumstances and improving the security of the target account.
[0168] In some embodiments, the method also includes a resource transfer step, which specifically includes: obtaining second transfer information related to the target account; obtaining a preset key; sending the preset key and the second transfer information to the blockchain network to instruct the blockchain network to perform an on-chain transaction based on the second transfer information and the preset key to achieve resource transfer.
[0169] As mentioned above, during the creation of the target account, one of the branches of the Merkle tree can be constructed through the preset key. Therefore, in the event of a cloud service outage or cloud service data loss, the preset key can be used to assist in resource transfer.
[0170] Specifically, the computer device can obtain the preset key input by the user, and send the second transfer information and the preset key method to the blockchain network to instruct the blockchain network to verify the transaction according to the preset key in the target object. If the verification is passed, the on-chain transaction is executed based on the second transfer information. After the transaction is completed, if consensus is passed, the transaction result will be stored on the disk to realize the transfer of resources.
[0171] In some embodiments, the condition for unlocking the target object through a preset key also includes a time lock, that is, before verifying through the preset key, the blockchain network will first verify whether the preset time requirement in the time lock is reached. If it is reached, the verification operation will be performed. If not, the transaction failure result will be directly returned.
[0172] In the above embodiment, a solution for transferring out resources is provided, and the transfer out of resources in the target account can also be achieved through a preset key, thereby avoiding the problem of the target account being locked in unexpected situations and improving the security of the target account.
[0173] Please refer to Fig.10 In a specific embodiment, the resource transfer method includes the following steps:
[0174] Step 1001, for any cloud account among the N logged-in cloud accounts, call the key management service of the cloud platform to which the targeted cloud account belongs to generate a key pair; N is a positive integer greater than 1.
[0175] Step 1002, obtain the public key in the key pair of each cloud account, and aggregate the public keys of N cloud accounts to obtain an aggregated public key.
[0176] Step 1003, obtain the target key; the target key includes a preset key and a public key of a third-party organization.
[0177] Step 1004, construct a target object according to the aggregated public key and the target key, where the target object is a target script or smart contract.
[0178] Step 1005, publish the target object to the blockchain network, and obtain the target account after the publication is successful; the target account has a binding relationship with the N logged-in cloud accounts.
[0179] Step 1006, obtaining resource transfer information related to the target account; the target account is the resource transferor account.
[0180] Step 1007 , determining M cloud accounts in a logged-in state among N cloud accounts that have a binding relationship with the target account; M is a positive integer greater than 1 and less than or equal to N.
[0181] Step 1008, for any cloud account among the M cloud accounts in the logged-in state, the resource transfer information is sent to the cloud platform to which the targeted cloud account belongs, and the key management service of the corresponding cloud platform is called to instruct the key management service to sign the resource transfer information with the private key of the targeted cloud account.
[0182] Step 1009: Receive signatures fed back by each cloud platform, and aggregate the received multiple signatures to obtain an aggregate signature.
[0183] Step 1010, sending the resource transfer information and the aggregate signature to the blockchain network to instruct the blockchain network to call the pre-deployed target object related to the target account, verifying the aggregate signature through the aggregate public key in the target object, and transferring resources based on the resource transfer information after the verification is passed.
[0184] Step 1011, obtain the first transfer information related to the target account, obtain the identity authentication information, send the identity authentication information and the first transfer information to a third-party organization to instruct the third-party organization to sign the first transfer information when the identity authentication information is verified; send the first transfer information and the signature of the third-party organization to the blockchain network to instruct the blockchain network to execute an on-chain transaction based on the first transfer information and the signature of the third-party organization to realize resource transfer.
[0185] Step 1012, obtain the second transfer-out information related to the target account; obtain the preset key; send the preset key and the second transfer-out information to the blockchain network to instruct the blockchain network to perform an on-chain transaction based on the second transfer-out information and the preset key to realize the resource transfer.
[0186] The above-mentioned resource transfer method, when resource transfer is required, can send the resource transfer information related to the target account to multiple cloud platforms, and each cloud platform signs the resource transfer information through the private key of the pre-created cloud account bound to the target account. The signatures fed back by each cloud platform are then aggregated to obtain an aggregate signature, so that the resource transfer information and the aggregate signature are sent to the blockchain network in the form of a transaction, so that the blockchain network verifies the aggregate signature. Once the verification is passed, the on-chain transaction can be executed to realize resource transfer. In this application, there is no need for users to keep account keys by themselves. With the key storage capability of the cloud platform, the risk of private key leakage is greatly reduced, which improves the security of resource transfer. At the same time, it avoids users from keeping secret keys by themselves, and also saves the corresponding storage costs. In addition, this application uses a multi-signature service when transferring resources, which can further improve the security of resource transfer.
[0187] In one scenario embodiment, please refer to Fig.11 , taking the target object as a smart contract as an example: the account service system aggregates multiple signatures into an aggregate signature, and then constructs a transaction based on the aggregate signature and sends it to the blockchain network. After the blockchain nodes in the blockchain network verify that the transaction is reasonable, they will execute the smart contract to realize resource transfer.
[0188] In some embodiments, Fig.12 As shown in Figure 1, smart contracts provide the logic of verification and transaction, that is, verification steps and resource transfer operations can be automatically executed by smart contracts. The account service system can send a user operation object to the blockchain network, which includes the user's intention, signature, and other data. User operations have a separate transaction memory pool, and nodes connected to this transaction memory pool will perform specific verification. The packager collects these user operations in batches, packages them into a single bundled transaction, and includes them in the block.
[0189] In the scenario where the target object is a smart contract, the computer device may also set up other additional contract execution logic, for example, provide an emergency freeze function in the event of a stolen account, which can prohibit resource transfer operations or prohibit dangerous devices from accessing the account; provide daily transaction limits, which can set transaction amount limits to reduce losses caused by user operational errors and help prevent attackers from emptying the wallet in a single transaction; multi-factor authentication, which can provide an additional layer of security through authenticator applications and / or local wallet solutions; set up a whitelist, and users can specify transfers only to known addresses; Trust Guard: Users can approve certain operations by appointing "guardians", such as: approval operations when the transaction amount exceeds the daily limit, approval operations for transfers to addresses not included in the whitelist, approval operations for account recovery, etc.
[0190] It is understandable that the present application can also be applied to other types of blockchain networks, such as blockchain networks that support taproot technology, and accordingly, the target object can be a target script. The resources transferred between different accounts can be virtual currency on the chain, or electronic notes bound to the account, such as electronic invoices, or virtual items bound to the account, such as game equipment, etc., and the present application embodiment does not limit this.
[0191] Next, combine Fig.13 The scheme of this application is described in detail:
[0192] like Fig.13 FIG. 1 is an application architecture diagram of an account service system in one embodiment. Fig.13 The left side of the figure is the public chain environment, the middle is the account service system and the specific modules it contains, and the right side is the multi-cloud environment for storing the user's key. In the specific application scenario, the account service system can also be called a secure wallet system, and the account can be called a wallet account.
[0193] Exemplarily, a user logs in to the secure wallet system, interacts with the front-end interaction module, and creates cloud accounts of multiple cloud platforms under the guidance of the system.
[0194] After creation, if the user needs to create a wallet account, he / she should first jump to the cloud account of the different cloud platforms according to the system's integration guidance, create multiple secret keys for this wallet account based on the KMS (key management system) of different cloud platforms, and synthesize the public keys of multiple secret keys into an aggregated public key, write the aggregated public key into the wallet account code, and use it for subsequent verification when initiating transactions through aggregate signatures.
[0195] After the multi-signature is created, the public key of the third-party institution (also known as a third-party notary) and the user's preset key are set into the wallet account code as a backup mechanism to create an account. After the wallet account is created, the wallet service begins to follow up on the created account and record the flow of funds.
[0196] When users need to use their wallet accounts later, they log in to the secure wallet system and rely on the integration of the secure wallet system to jump to the multi-cloud service to complete the signature, and then retrieve multiple signatures back to the secure wallet system for combination to obtain the aggregate signature. Initiate a transaction to the blockchain network based on the aggregate signature and resource transfer information. The blockchain network verifies the aggregate signature through the aggregate public key. Once the verification is passed, the wallet account can be unlocked to transfer resources.
[0197] If more than the threshold of secret keys in a multi-cloud account are lost, users can trigger the fund escape logic through the interactive interface, unlock the taproot script through a third-party notary or their own preset key, and retrieve their funds.
[0198] It should be understood that, although the steps in the flowcharts involved in the above embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps is not strictly limited in order, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above embodiments may include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0199] Based on the same inventive concept, the embodiment of the present application also provides a resource transfer device for implementing the resource transfer method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in one or more resource transfer device embodiments provided below can refer to the limitations on the resource transfer method above, and will not be repeated here.
[0200] In an exemplary embodiment, Fig.14 As shown, a resource transfer device 1400 is provided, comprising: an acquisition module 1401, a sending module 1402, an aggregation module 1403 and an operation module 1404, wherein:
[0201] The acquisition module is used to obtain resource transfer information related to the target account; the target account is the resource transferor account.
[0202] The sending module is used to send resource transfer information to multiple cloud platforms to instruct the cloud platforms to sign the resource transfer information using the private key of the cloud account; the cloud account has a binding relationship with the target account.
[0203] The aggregation module is used to receive signatures fed back by each cloud platform and aggregate the received multiple signatures to obtain an aggregate signature.
[0204] The operation module is used to send the resource transfer information and the aggregate signature to the blockchain network to instruct the blockchain network to execute on-chain transactions based on the resource transfer information and the aggregate signature to realize resource transfer.
[0205] In some embodiments, the sending module is specifically used to determine M cloud accounts that are in a logged-in state among N cloud accounts that have a binding relationship with the target account; N is a positive integer greater than 1, and M is a positive integer greater than 1 and less than or equal to N; and the resource transfer information is sent to the cloud platform to which each of the M cloud accounts belongs.
[0206] In some embodiments, the sending module is specifically used to send resource transfer information to the cloud platform to which the targeted cloud account belongs for any cloud account among the M cloud accounts in the logged-in state, and call the key management service of the corresponding cloud platform to instruct the key management service to sign the resource transfer information through the private key of the targeted cloud account.
[0207] In some embodiments, the blockchain network calls a pre-deployed target object related to the target account, verifies the aggregate signature through the aggregate public key in the target object, and performs resource transfer based on the resource transfer information after the verification is passed; wherein the aggregate public key is obtained by aggregating the public keys of multiple cloud accounts that have a binding relationship with the target account.
[0208] In some embodiments, the acquisition module is further used to obtain first transfer information related to the target account and obtain identity authentication information; the sending module is further used to send the identity authentication information and the first transfer information to a third-party agency to instruct the third-party agency to sign the first transfer information when the identity authentication information is verified; the operation module is further used to send the first transfer information and the signature of the third-party agency to the blockchain network to instruct the blockchain network to execute on-chain transactions based on the first transfer information and the signature of the third-party agency to realize resource transfer.
[0209] In some embodiments, the acquisition module is further used to obtain second transfer-out information related to the target account; obtain a preset key; and the operation module is further used to send the preset key and the second transfer-out information to the blockchain network to instruct the blockchain network to execute an on-chain transaction based on the second transfer-out information and the preset key to realize resource transfer.
[0210] In some embodiments, the device also includes a creation module, which is used to: for any cloud account among the N cloud accounts that have been logged in, call the key management service of the cloud platform to which the cloud account belongs to generate a key pair; N is a positive integer greater than 1; obtain the public key in the key pair of each cloud account, aggregate the public keys of the N cloud accounts to obtain the aggregated public key; construct a target object according to the aggregated public key; publish the target object to the blockchain network, and obtain the target account after successful publication; there is a binding relationship between the target account and the N logged in cloud accounts.
[0211] In some embodiments, the creation module is further used to: obtain a target key; the target key includes at least one of a preset key or a public key of a third-party organization; and construct a target object based on the aggregated public key and the target key.
[0212] In some embodiments, the creation module is further used to: determine a first unlocking condition according to the aggregated public key, determine a second unlocking condition according to the target key; and construct a target script according to the first unlocking condition and the second unlocking condition.
[0213] In some embodiments, the target key includes a preset key and a public key of a third-party organization, and the creation module is also used to: construct a first script command based on the public key of the third-party organization and the first time lock, and obtain the hash value of the first leaf node based on the first script command; construct a second script command based on the preset key and the second time lock, and obtain the hash value of the second leaf node based on the second script command; determine the hash value of the root node based on the hash value of the first leaf node and the hash value of the second leaf node; determine the second unlocking condition based on the hash value of each leaf node and the hash value of the root node.
[0214] In some embodiments, the target object includes a smart contract, and the creation module is also used to: construct script verification logic and resource operation logic based on the aggregated public key and the target key; and construct a smart contract based on the script verification logic and resource operation logic.
[0215] Based on the same inventive concept, the embodiment of the present application also provides an account creation device for implementing the account creation method involved above. The implementation solution provided by the device to solve the problem is similar to the implementation solution recorded in the above method, so the specific limitations in one or more account creation device embodiments provided below can refer to the limitations on the account creation method above, and will not be repeated here.
[0216] In an exemplary embodiment, Fig.15 As shown, an account creation device 1500 is provided, including: a control module 1501, an aggregation module 1502, a construction module 1503 and a publishing module 1504, wherein:
[0217] The control module is used to generate a key pair for any cloud account among the N logged-in cloud accounts by calling the key management service of the cloud platform to which the cloud account belongs according to the cloud account targeted; N is a positive integer greater than 1.
[0218] The aggregation module is used to obtain the public key in the key pair of each cloud account, and aggregate the public keys of N cloud accounts to obtain an aggregated public key.
[0219] A construction module that builds a target object based on an aggregate public key.
[0220] The publishing module is used to publish the target object to the blockchain network and obtain the target account after successful publishing; the target account is bound to the N logged-in cloud accounts.
[0221] In some embodiments, the construction module is further used to: obtain a target key; the target key includes at least one of a preset key or a public key of a third-party organization; and construct a target object based on the aggregated public key and the target key.
[0222] In some embodiments, the target object includes a target script, and the construction module is also used to: determine a first unlocking condition based on the aggregated public key, determine a second unlocking condition based on the target key; and construct the target script based on the first unlocking condition and the second unlocking condition.
[0223] In some embodiments, the target key includes a preset key and a public key of a third-party organization, and the construction module is also used to: construct a first script command based on the public key of the third-party organization and a first time lock, and obtain a hash value of the first leaf node based on the first script command; construct a second script command based on the preset key and the second time lock, and obtain a hash value of the second leaf node based on the second script command; determine the hash value of the root node based on the hash value of the first leaf node and the hash value of the second leaf node; determine the second unlocking condition based on the hash value of each leaf node and the hash value of the root node.
[0224] In some embodiments, the target object includes a smart contract, a building module, and is also used to: build script verification logic and resource operation logic based on the aggregated public key and the target key; and build a smart contract based on the script verification logic and resource operation logic.
[0225] Each module in the resource transfer device and / or account creation device can be implemented in whole or in part by software, hardware, or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute operations corresponding to each module.
[0226] In an exemplary embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as shown in FIG. Fig.16 As shown. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. Among them, the processor, the memory and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store transaction data. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a resource transfer and / or account creation method is implemented.
[0227] Those skilled in the art will understand that Fig.16 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0228] In one embodiment, a computer device is further provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in the above method embodiments when executing the computer program.
[0229] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.
[0230] In one embodiment, a computer program product is provided, including a computer program, which implements the steps in the above method embodiments when executed by a processor.
[0231] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant regulations.
[0232] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited to this.
[0233] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0234] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A resource transfer method, characterized in that: The method comprises: Obtaining resource transfer information related to a target account; the target account is an account from which resources are transferred; Sending the resource transfer information to multiple cloud platforms to instruct the cloud platforms to sign the resource transfer information using a private key of a cloud account; the cloud account has a binding relationship with the target account; Receive signatures fed back by each of the cloud platforms, and aggregate multiple received signatures to obtain an aggregated signature; The resource transfer information and the aggregate signature are sent to the blockchain network to instruct the blockchain network to perform an on-chain transaction based on the resource transfer information and the aggregate signature to achieve resource transfer.
2. The method according to claim 1, characterized in that The sending the resource transfer information to multiple cloud platforms includes: Determine M cloud accounts in a logged-in state among N cloud accounts that have a binding relationship with the target account; N is a positive integer greater than 1, and M is a positive integer greater than 1 and less than or equal to N; The resource transfer information is sent to the cloud platform to which each of the M cloud accounts belongs.
3. The method according to claim 2, characterized in that The sending the resource transfer information to the cloud platforms to which the M cloud accounts respectively belong includes: For any cloud account among the M cloud accounts that are in the logged-in state, the resource transfer information is sent to the cloud platform to which the targeted cloud account belongs, and the key management service of the corresponding cloud platform is called to instruct the key management service to sign the resource transfer information using the private key of the targeted cloud account.
4. The method according to claim 1, characterized in that: The blockchain network calls a pre-deployed target object related to the target account, verifies the aggregate signature through the aggregate public key in the target object, and transfers resources based on the resource transfer information after the verification; wherein the aggregate public key is obtained by aggregating the public keys of multiple cloud accounts that have a binding relationship with the target account.
5. The method according to claim 1, characterized in that The method further comprises: Acquire first transfer-out information related to the target account; Obtaining identity authentication information, and sending the identity authentication information and the first transfer information to a third-party organization, so as to instruct the third-party organization to sign the first transfer information when verifying that the identity authentication information is passed; The first transfer-out information and the signature of the third-party institution are sent to the blockchain network to instruct the blockchain network to execute an on-chain transaction based on the first transfer-out information and the signature of the third-party institution to realize the resource transfer.
6. The method according to claim 1, characterized in that The method further comprises: Acquire second transfer-out information related to the target account; Get the preset key; The preset key and the second transfer-out information are sent to the blockchain network to instruct the blockchain network to perform an on-chain transaction based on the second transfer-out information and the preset key to realize resource transfer.
7. The method according to any one of claims 1 to 6, characterized in that: The method further comprises: For any of the N cloud accounts that have logged in, a key pair is generated by calling the key management service of the cloud platform to which the cloud account belongs according to the cloud account targeted; N is a positive integer greater than 1; Get the public key in the key pair of each cloud account, aggregate the public keys of N cloud accounts to get the aggregated public key; constructing a target object according to the aggregated public key; The target object is published to the blockchain network, and a target account is obtained after the publication is successful; the target account has a binding relationship with the N logged-in cloud accounts.
8. The method according to claim 7, characterized in that The constructing a target object according to the aggregated public key includes: Obtaining a target key; the target key includes at least one of a preset key or a public key of a third-party organization; A target object is constructed according to the aggregate public key and the target key.
9. The method according to claim 8, characterized in that The target object includes a target script, and constructing the target object according to the aggregated public key and the target key includes: Determine a first unlocking condition according to the aggregated public key, and determine a second unlocking condition according to the target key; A target script is constructed according to the first unlocking condition and the second unlocking condition.
10. The method according to claim 9, characterized in that The target key includes a preset key and a public key of a third-party organization, and determining the second unlocking condition according to the target key includes: Constructing a first script command according to the public key of the third-party organization and the first time lock, and obtaining a hash value of the first leaf node according to the first script command; Constructing a second script command according to the preset key and the second time lock, and obtaining a hash value of the second leaf node according to the second script command; Determine a hash value of a root node according to the hash value of the first leaf node and the hash value of the second leaf node; A second unlocking condition is determined according to the hash value of each leaf node and the hash value of the root node.
11. The method according to claim 8, characterized in that The target object includes a smart contract, and constructing the target object according to the aggregated public key and the target key includes: Constructing script verification logic and resource operation logic according to the aggregated public key and the target key; A smart contract is constructed according to the script verification logic and the resource operation logic.
12. A method for creating an account, characterized in that: The method comprises: For any of the N cloud accounts that have logged in, a key pair is generated by calling the key management service of the cloud platform to which the cloud account belongs according to the cloud account targeted; N is a positive integer greater than 1; Get the public key in the key pair of each cloud account, aggregate the public keys of N cloud accounts to get the aggregated public key; constructing a target object according to the aggregated public key; The target object is published to the blockchain network, and a target account is obtained after the publication is successful; the target account has a binding relationship with the N logged-in cloud accounts.
13. A resource transfer device, characterized in that: The device comprises: An acquisition module, used to acquire resource transfer information related to a target account; the target account is an account of a resource transferor; A sending module, used to send the resource transfer information to multiple cloud platforms to instruct the cloud platforms to sign the resource transfer information using a private key of a cloud account; the cloud account has a binding relationship with the target account; An aggregation module, used to receive signatures fed back by each of the cloud platforms, and aggregate multiple received signatures to obtain an aggregated signature; An operation module is used to send the resource transfer information and the aggregate signature to the blockchain network to instruct the blockchain network to perform an on-chain transaction based on the resource transfer information and the aggregate signature to achieve resource transfer.
14. An account creation device, characterized in that: The device comprises: A control module, for generating a key pair for any one of the N logged-in cloud accounts by calling a key management service of the cloud platform to which the cloud account belongs according to the cloud account targeted; wherein N is a positive integer greater than 1; An aggregation module is used to obtain the public key in the key pair of each cloud account, and aggregate the public keys of N cloud accounts to obtain an aggregated public key; A construction module, used to construct a target object according to the aggregated public key; The publishing module is used to publish the target object to the blockchain network and obtain the target account after the publishing is successful; the target account has a binding relationship with the N logged-in cloud accounts.
15. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 12 are implemented.
16. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 12 are implemented.
17. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 12 are implemented.
