Blockchain smart account management method and device, computer device and storage medium

By directly decoding and calling smart contracts in the blockchain to create smart accounts, the problems of low execution performance and high consumption in traditional blockchain account management are solved, and efficient large-scale applications are achieved.

CN118709173BActive Publication Date: 2025-10-17HANGZHOU HIGH-TECH ZONE (BINJIANG) INSTITUTE OF BLOCKCHAIN & DATA SECURITY
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410642799.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-05-22
Publication Date
2025-10-17
Estimated Expiration
2044-05-22

AI Technical Summary

Technical Problem

Traditional blockchain account management suffers from low execution performance, high consumption, and difficulty in large-scale application.

Method used

By obtaining the user's management request, setting the initialization parameters in the parameter information, directly decoding and calling the smart contract in the blockchain, and creating the user's smart account, the virtual machine is avoided.

Benefits of technology

Improved execution performance, reduced consumption, and suitable for large-scale applications.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118709173B_ABST
    Figure CN118709173B_ABST
Patent Text Reader

Abstract

The application relates to a blockchain smart account management method and device, computer equipment and a storage medium, wherein the method comprises the following steps: obtaining a user management request; when the management request is a creation request, setting initialization parameters in parameter information based on the creation request; the creation request comprises a contract address, an owner address and parameter values; receiving and decoding the parameter information in the blockchain to obtain a first decoding result; calling a corresponding smart contract according to the contract address in the first decoding result; and creating a smart account of the user according to the owner address and the parameter values in the first decoding result under the smart contract. Through the application, the problems of low execution performance, high consumption and difficulty in large-scale application in the related art are solved, the creation of the smart account can be completed without the intervention of a virtual machine, the execution performance is improved, the consumption is reduced, and the application is suitable for large-scale application.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of blockchains, and in particular to a management method and device for a blockchain smart account, a computer device, and a storage medium. BACKGROUND

[0002] Traditional management of a blockchain account is controlled by an externally owned account (EQA); for example, creating an account, sending a transaction, and the like. Later, an abstract account technology was proposed, which involves writing an account contract through a solidity smart contract, thereby realizing rich functions. The current implementation scheme for creating a blockchain account is as follows: a solidity smart contract is written; in actual execution, the solidity smart contract is converted into bytecode, and the bytecode is executed through a virtual machine, thereby realizing the creation of an account. However, this scheme has the following problem: because the virtual machine needs to be involved to read and execute the bytecode, the execution performance is low, the consumption is high, and it is difficult to apply on a large scale.

[0003] Currently, there is no effective solution to the problem of low execution performance, high consumption, and difficulty in large-scale application in the related art. SUMMARY

[0004] A management method and device for a blockchain smart account, a computer device, and a storage medium are provided in this embodiment to solve the problem of low execution performance, high consumption, and difficulty in large-scale application in the related art.

[0005] In a first aspect, a management method for a blockchain smart account is provided in this embodiment, which includes the following steps.

[0006] Obtaining a management request of a user;

[0007] When the management request is a creation request, setting an initialization parameter in parameter information based on the creation request; the creation request includes a contract address, an owner address, and a parameter value;

[0008] Receiving and decoding the parameter information in a blockchain to obtain a first decoding result; calling a corresponding smart contract according to the contract address in the first decoding result; and creating a smart account of the user according to the owner address and the parameter value in the first decoding result under the smart contract.

[0009] In some embodiments, creating a smart account of the user according to the owner address and the parameter value in the first decoding result under the smart contract includes the following steps.

[0010] Under the smart contract, a smart account address of the smart account is generated according to the owner address and the parameter value, so as to complete the creation of the smart account of the user;

[0011] The calling method parameter in the parameter information is set as null.

[0012] In some embodiments, the method further comprises:

[0013] After obtaining the first decoding result, it is judged whether the initialization parameter is null;

[0014] If the initialization parameter is null, the corresponding bytecode is read based on the calling contract address in the creation request through the virtual machine; and the smart account of the user is created based on the bytecode.

[0015] In some embodiments, the method further comprises:

[0016] After creating the smart account of the user, the smart account address of the smart account and the owner address are stored in the blockchain; and the smart account address remains unchanged.

[0017] In some embodiments, the method further comprises:

[0018] When the management request is a use request, the calling method parameter and the signature parameter in the parameter information are set according to the use request and the key corresponding to the user;

[0019] The parameter information is received and decoded in the blockchain, and a second decoding result is obtained;

[0020] The use request is signed and authenticated according to the signature parameter in the second decoding result;

[0021] After the signature authentication passes, the corresponding smart contract is called according to the calling method parameter in the second decoding result; and the smart account of the user is used under the smart contract.

[0022] In some embodiments, the method further comprises:

[0023] When the management request is an upgrade request, the calling method parameter and the signature parameter in the parameter information are set according to the upgrade request and the key corresponding to the user;

[0024] The parameter information is received and decoded in the blockchain, and a third decoding result is obtained;

[0025] The upgrade request is signed and authenticated according to the signature parameter in the third decoding result;

[0026] After the signature authentication passes, a corresponding smart contract is invoked according to the calling method parameter in the third decoding result; and under the smart contract, the smart account of the user is upgraded.

[0027] In some embodiments, the management request is a composite request; and the composite request includes at least a creation request, and at least one or more of a use request and an upgrade request.

[0028] In a second aspect, a management apparatus of a blockchain smart account is provided in the embodiments, and the management apparatus comprises:

[0029] The management apparatus further comprises an obtaining module configured to obtain a management request of a user.

[0030] The management apparatus further comprises a setting module configured to, when the management request is a creation request, set an initialization parameter in parameter information based on the creation request; and the creation request comprises a calling contract address, an owner address, and a parameter value.

[0031] The management apparatus further comprises a management module configured to receive and decode the parameter information in a blockchain to obtain a first decoding result; invoke a corresponding smart contract according to the calling contract address in the first decoding result; and create a smart account of the user under the smart contract according to the owner address and the parameter value in the first decoding result.

[0032] In a third aspect, a computer device is provided in the embodiments, and the computer device comprises a memory, a processor, and a computer program stored in the memory and executable on the processor; and the processor implements the management method of the blockchain smart account according to the first aspect when executing the computer program.

[0033] In a fourth aspect, a storage medium is provided in the embodiments, and the storage medium stores a computer program executable by a processor; and the processor implements the management method of the blockchain smart account according to the first aspect when executing the computer program.

[0034] Compared with the related art, the management method, the apparatus, the computer device, and the storage medium of the blockchain smart account provided in the embodiments obtain a management request of a user; when the management request is a creation request, set an initialization parameter in parameter information based on the creation request; the creation request comprises a calling contract address, an owner address, and a parameter value; receive and decode the parameter information in a blockchain to obtain a first decoding result; invoke a corresponding smart contract according to the calling contract address in the first decoding result; and create a smart account of the user under the smart contract according to the owner address and the parameter value in the first decoding result, thereby solving the problem of low execution performance, high consumption, and difficulty in large-scale application in the related art, and completing the creation of the smart account without the intervention of a virtual machine, improving the execution performance, reducing the consumption, and thereby being applicable to large-scale application.

[0035] The details of one or more embodiments of the application are set forth in the accompanying drawings and the description below. Other features, objects, and advantages of the application will be apparent from the description and drawings, and from the claims. BRIEF DESCRIPTION OF DRAWINGS

[0036] The drawings used herein for the purpose of providing further understanding of the present application constitute a part of the present application, and the illustrative embodiments of the present application and their descriptions serve to explain the present application and do not constitute an improper limitation on the present application. In the drawings:

[0037] Figure 1 is a hardware structure block diagram of a terminal device of a management method of a blockchain smart account provided by an embodiment of the present application;

[0038] Figure 2 is a flowchart of a management method of a blockchain smart account provided by an embodiment of the present application;

[0039] Figure 3 is a flowchart of a smart account provided by an embodiment of the present application;

[0040] Figure 4 is a flowchart of a smart account upgrade provided by an embodiment of the present application;

[0041] Figure 5 is a flowchart of a smart account upgrade provided by an embodiment of the present application;

[0042] Figure 6 is a structure block diagram of a management device of a blockchain smart account provided by an embodiment of the present application.

[0043] In the figure: 102, processor; 104, memory; 106, transmission device; 108, input and output device; 210, acquisition module; 220, setting module; 230, management module. DETAILED DESCRIPTION

[0044] In order to more clearly understand the purpose, technical scheme and advantages of the present application, the present application is described and explained below in combination with the drawings and embodiments.

[0045] Unless otherwise defined, technical terms or scientific terms used in the present application shall have the same meaning as those commonly understood by a person of ordinary skill in the art to which the present application belongs. In the present application, "one", "a", "an", "the", "these", and similar words do not indicate quantity, and they can be singular or plural. In the present application, the terms "comprise", "contain", "have" and any variants thereof are intended to cover non-exclusive inclusion; for example, a process, method and system, product or device containing a series of steps or modules (units) are not limited to the listed steps or modules (units), but can include steps or modules (units) not listed, or can include other steps or modules (units) inherent to the process, method, product or device. In the present application, the terms "connected", "connected", "coupled" and the like do not limit to physical or mechanical connection, but can include electrical connection, whether direct or indirect. In the present application, "multiple" means two or more. "And / or" describes the association between the associated objects, which means that there can be three relationships, for example, "A and / or B" can mean that A exists alone, A and B exist together, and B exists alone. Generally, the character " / " represents the relationship between the objects before and after it is "or". In the present application, the terms "first", "second", "third" and the like are only used to distinguish similar objects, and do not represent a specific order of the objects.

[0046] The method embodiments provided in the present embodiment can be executed in a terminal, a computer or a similar computing device. For example, the method embodiments are executed on a terminal, Figure 1 is a hardware structure block diagram of a terminal of the management method of the blockchain smart account of the present embodiment. As shown in Figure 1 , the terminal can include one or more (only one in Figure 1 ) processors 102 and memories 104 for storing data, wherein the processor 102 can include but not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA. The above terminal can also include a transmission device 106 for communication function and an input and output device 108. Those skilled in the art can understand that Figure 1 The structure shown is only schematic, which does not limit the structure of the above terminal. For example, the terminal can include more or less components than those shown in Figure 1 , or have a different configuration from that shown in Figure 1 .

[0047] The memory 104 can be configured to store computer programs, for example, software programs of application software and modules, such as the computer program corresponding to the management method of the blockchain smart account in the embodiment. The processor 102 can execute various functional applications and data processing, i.e., implement the method described above, by running the computer programs stored in the memory 104. The memory 104 can include a high-speed random access memory, and can further include a non-volatile memory, such as one or more magnetic storage devices, flash memories, or other non-volatile solid-state memories. In some examples, the memory 104 can further include a memory remotely arranged with respect to the processor 102, which can be connected to the terminal through a network. Examples of the network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and a combination thereof.

[0048] The transmission device 106 is configured to receive or send data via a network. The network includes a wireless network provided by a communication provider of the terminal. In an example, the transmission device 106 includes a network interface controller (NIC) which can be connected to other network devices through a base station so as to communicate with the Internet. In an example, the transmission device 106 can be a radio frequency (RF) module configured to communicate with the Internet in a wireless manner.

[0049] In the embodiment, a management method of a blockchain smart account is provided, Figure 2 The flowchart of the management method of the blockchain smart account in the embodiment is shown in FIG. 2, which includes the following steps: Figure 2

[0050] In step S210, a management request of a user is acquired.

[0051] In step S220, when the management request is a creation request, initialization parameters in parameter information are set based on the creation request. The creation request includes a contract address, an owner address, and a parameter value.

[0052] In step S230, the parameter information is received and decoded in the blockchain to obtain a first decoding result. A corresponding smart contract is called according to the contract address in the first decoding result. Under the smart contract, a smart account of the user is created according to the owner address and the parameter value in the first decoding result.

[0053] ​It should be noted that the management request refers to a request initiated by a user, which can be a request related to the management of a smart account, including but not limited to a creation request, a use request, and an upgrade request, etc. Among them, the use request includes but is not limited to a transfer request, a recharge request, and a transaction request, etc. The specific form of the management request is not limited, for example: the management request can also include an account recovery request, a temporary key application request, etc.

[0054] For the management of a smart account in a blockchain, it can be divided into creation, use, and upgrade management modes. Among them, the creation of a smart account is the basis, and the use and upgrade are realized on the basis of the successful creation of a smart account.

[0055] The creation process of a smart account can be: obtaining a creation request of a user; based on the creation request, setting an initialization parameter in parameter information. Among them, the creation request includes a calling contract address, an owner address, and a parameter value. The initialization parameter (initCode) is determined by the calling contract address, the owner address, and the parameter value; for example: the format of the initialization parameter is in the format of Ethereum Application Binary Interface (ABI), the creation request is encoded in the format of Ethereum ABI to obtain the initialization parameter; the first 20 bytes of the initialization parameter are the calling contract address, and the subsequent owner address (which can also be 20 bytes) and parameter value. After completing the setting of the parameter information, the blockchain decodes the incoming parameter information according to the Ethereum bytecode to obtain a first decoding result; the first decoding result contains the calling contract address, the owner address, and the parameter value; then based on the calling contract address, the corresponding smart contract can be called; for example: the smart contract address is the address of the factory contract, the factory contract is called through the smart contract address, and the owner address and the parameter value are used to generate a smart account address, thereby completing the creation of a smart account of a user.

[0056] In the related art, the implementation scheme for the creation of a blockchain account is as follows: a solidity smart contract is written; in actual execution, the solidity smart contract is converted into bytecode, and the bytecode is executed through a virtual machine, thereby realizing the creation of an account. Since the virtual machine needs to be involved to read and execute the bytecode, the execution performance is low, the consumption is high, and it is difficult to apply on a large scale. In the present embodiment, a user's management request is obtained; when the management request is a creation request, an initialization parameter in parameter information is set based on the creation request; the creation request includes a contract address, an owner address, and a parameter value; the parameter information is received and decoded in the blockchain to obtain a first decoding result; a corresponding smart contract is called according to the contract address in the first decoding result; and a smart account of the user is created under the smart contract according to the owner address and the parameter value in the first decoding result, thereby solving the problem of low execution performance, high consumption, and difficulty in large-scale application in the related art. The creation of a smart account is completed by setting parameter information, without the intervention of a virtual machine, thereby improving the execution performance and reducing the consumption, and thus being applicable to large-scale application.

[0057] In some embodiments, under the smart contract, the smart account of the user is created according to the owner address and the parameter value in the first decoding result, including the following steps:

[0058] Step S231, under the smart contract, a smart account address of the smart account is generated according to the owner address and the parameter value, to complete the creation of the smart account of the user.

[0059] Step S232, the calling method parameter in the parameter information is set to be empty.

[0060] Specifically, the smart contract is only a program running on the Ethereum chain and cannot be manipulated by a person. It is a series of codes (functions) and data (states) located at a specific address on the Ethereum blockchain. Among them, the smart contract is an Ethereum account, which can be regarded as a smart contract account. It has a balance and can become the object of a transaction. A user can interact with the smart contract by submitting a management request to execute a certain function of the smart contract. The smart contract can define rules like a regular contract and automatically enforce them through code. By default, a smart contract cannot be deleted, and interaction with a smart contract is irreversible.

[0061] Therefore, based on the characteristics of the above smart contract, in the blockchain, a smart account address of the smart account can be directly generated according to the owner address and the parameter value, thereby completing the creation of the corresponding smart contract account of the user; and the intervention of a virtual machine is not required, thereby improving the execution performance and reducing the consumption. The parameter value can be a salt value, which is a random value generated by combining a user password. In other embodiments, the parameter value can be a random value obtained in other ways, which is not limited.

[0062] After the creation of the smart account of the user is completed, the smart account address remains unchanged after being generated to improve security. And the calling method parameter in the parameter information is empty, the calling method parameter is empty contract, the receive method and fallback method are implemented by default, thereby accepting the original points of the blockchain, and the corresponding parameter information is set for the newly created smart contract account through subsequent management requests to improve the execution efficiency of the use request or the upgrade request.

[0063] In some embodiments, the management method of the blockchain smart account includes the following steps:

[0064] After obtaining the first decoding result, it is judged whether the initialization parameter is empty or not.

[0065] If the initialization parameter is empty, the corresponding bytecode is read based on the calling contract address in the creation request through the virtual machine; and the smart account of the user is created based on the bytecode.

[0066] Specifically, in order to avoid the situation that the parameter information is not set successfully, affecting the creation of the smart account; when the initialization parameter is empty, the creation request is read through the virtual machine, the calling contract address is parsed from the creation request; the corresponding bytecode is read and executed based on the calling contract address; and the smart account address of the smart account is generated according to the owner address and the parameter value, so as to complete the creation of the smart account of the user.

[0067] Through the embodiment, when the initialization parameter is empty, the virtual machine is used to complete the creation of the smart account, and the stability of the operation is improved without the user's awareness.

[0068] Here, the complete scheme is implemented as follows:

[0069] Obtaining the management request of the user;

[0070] When the management request is a creation request, the initialization parameter in the parameter information is set based on the creation request; the creation request includes the calling contract address, the owner address and the parameter value;

[0071] The parameter information is received and decoded in the blockchain to obtain a first decoding result;

[0072] It is judged whether the initialization parameter is empty or not.

[0073] If the initialization parameter is empty, the corresponding bytecode is read based on the calling contract address in the creation request through the virtual machine; and the smart account of the user is created based on the bytecode.

[0074] If the initialization parameter is not empty, the corresponding smart contract is called according to the calling contract address in the first decoding result; under the smart contract, the smart account of the user is created according to the owner address and the parameter value in the first decoding result.

[0075] In some embodiments, the management method of the blockchain smart account further includes the following steps:

[0076] After the smart account of the user is created, the smart account address and the owner address of the smart account are stored in the blockchain; the smart account address remains unchanged.

[0077] Specifically, the smart account address is generated according to the owner address and the salt value, and after being generated, the smart account address is stored in the blockchain and remains unchanged. The owner address can be determined by the key of the user, for example: the owner address of the user is derived from the key of the user. If the key of the user is lost, the key is re-applied, and then a new owner address can be derived from the newly applied key. However, the smart account address will not change,

[0078] Through the embodiment, after the key of the user is lost, the user only needs to re-apply the key, and the use of the smart account will not be affected.

[0079] It should be noted that for management requests such as use requests and upgrade requests; after receiving such management requests of the user, the blockchain will execute these requests. Obviously, the blockchain can use the smart account to initiate a call to the smart account address. However, there may be malicious users who intentionally give some incorrect requests, thereby wasting the Gas fee. Therefore, signature authentication needs to be performed on these requests. In order to complete the above logic in a standardized manner, an "entry point" contract (EntryPoint) is introduced as an entry for the blockchain call. The EntryPoint will check whether the request of the user is legal, and then execute it as it is. That is, the management request sent to the blockchain can call the handleOps method of the EntryPoint system contract, and the contract is used as an entry contract of the smart account, and the use or upgrade of the smart account calls the contract.

[0080] The case where the management request is a use request is described below:

[0081] In some embodiments, as shown in Figure 3 The management method of the blockchain smart account further includes the following steps:

[0082] In step S310, when the management request is a use request, the calling method parameter and the signature parameter in the parameter information are set according to the use request and the key corresponding to the user;

[0083] Step S320, receiving and decoding the parameter information in the blockchain to obtain a second decoding result;

[0084] Step S330, signing and authenticating the use request according to the signature parameter in the second decoding result;

[0085] Step S340, after the signature authentication passes, calling the corresponding smart contract according to the calling method parameter in the second decoding result; under the smart contract, using the smart account of the user.

[0086] Specifically, the key can be pre-applied by the user, and the user applies through the terminal and stores it in the terminal. In addition to the initialization parameter, the parameter information also includes the calling method parameter (callData) and the signature parameter (signature).

[0087] The calling method parameter is used to use the smart account; it can be set based on the use request. For example: the creation request is a transfer request, which includes the recipient address and the transfer amount; the transfer request is encoded into the calling method parameter according to the format of Ethereum ABI; the first four bytes of the calling method parameter are the signature id of the function; the first four bytes of the calling method parameter are followed by the actual parameters of the calling function. The signature id of the function is obtained by calculating the function name and all input parameter types through an encryption algorithm. The function and the parameter type are related to the request; for the transfer request, the function is transfer; the parameter type is address type (recipient address) and uint256 type (transfer amount). Here, the function and the parameter type will not be illustrated one by one. The signature parameter is used to sign and authenticate the use request. The private key in the key is used to encrypt the owner address (which can be derived from the key when the request is made) to obtain the signature parameter.

[0088] The parameter information is received and decoded in the blockchain to obtain a second decoding result. The second decoding result includes the calling method parameter (recipient address and transfer amount) and the signature parameter; the signature parameter is decrypted using the public key in the key to obtain the owner address, and the decrypted owner address is verified with the owner address in the blockchain. If they are consistent, it is considered that the signature authentication passes, and the corresponding smart contract is called; under the smart contract, the smart account of the user is used according to the recipient address and the transfer amount.

[0089] It should be noted that when the smart account is used, if the smart account is not upgraded, all methods are predefined, and the corresponding smart contract can be directly called by the method. If the smart account is upgraded, the method involved may be user-defined bytecode. Before calling the corresponding smart contract, the predefined method is traversed based on the calling method parameters. If the predefined method is traversed, the ABI method is used to call the method, and the user's smart account is used according to the use request. If the predefined method is not traversed, the virtual machine is used to traverse. If it is traversed through the virtual machine, the user's smart account is used according to the use request; if it is not traversed through the virtual machine, an error is returned, and the use fails; thereby avoiding the situation that the user-defined bytecode affects the normal use of the upgraded smart account.

[0090] The encryption algorithm used by the EntryPoint system contract is consistent with the encryption algorithm used when setting the parameter information, which can improve compatibility; the encryption algorithm includes but is not limited to a hash algorithm, and no limitation is made thereto.

[0091] Through the embodiment, the security of the smart account use can be improved, and the execution performance and scalability of the blockchain can be balanced.

[0092] The case where the management request is an upgrade request will be described below:

[0093] In some embodiments, as shown in Figure 4 The management method of the blockchain smart account further includes the following steps:

[0094] Step S410, when the management request is an upgrade request, setting the calling method parameters and the signature parameters in the parameter information according to the upgrade request and the user's corresponding key;

[0095] Step S420, receiving and decoding the parameter information in the blockchain to obtain a third decoding result;

[0096] Step S430, signing and authenticating the upgrade request according to the signature parameters in the third decoding result;

[0097] Step S440, after the signature authentication passes, calling the corresponding smart contract according to the calling method parameters in the third decoding result; under the smart contract, upgrading the user's smart account.

[0098] In the embodiment, the calling method parameter is used for upgrading the smart account; and the calling method parameter can be set based on the upgrade request. For the upgrade request, the function is upgrade, and the parameter type is bytes. The signature parameter is used for signature authentication of the upgrade request. The owner address (which can be derived from the key at the time of the request) is encrypted by the private key in the key, and the encryption result is used as the signature parameter.

[0099] The parameter information is received and decoded in the blockchain, so as to obtain a third decoding result. The third decoding result includes the calling method parameter and the signature parameter. The signature parameter is decrypted by the public key in the key to obtain the owner address, and the decrypted owner address is verified with the owner address in the blockchain. If they are consistent, it is considered that the signature authentication is passed, and the corresponding smart contract is called. In the smart contract, the smart account of the user is upgraded according to the upgrade request.

[0100] Through the embodiment, the security of the smart account can be improved, and the execution performance and scalability of the blockchain can be balanced.

[0101] It should be noted that the management request is a composite request; the management request is a composite request; the composite request is at least two of the creation request, the use request and the upgrade request.

[0102] For example: the management request is the creation request and the use request (creation use request); the creation request and the upgrade request (creation upgrade request); the creation request, the use request and the upgrade request (creation use upgrade request); the use request and the upgrade request (use upgrade request), etc. In this way, the performance is guaranteed to be efficient, and the smart account is customizable for different management requests, supporting user-defined account functions.

[0103] The following will be described taking the management request of the creation use request as an example:

[0104] In some embodiments, as shown in Figure 5 The management method of the blockchain smart account further includes the following steps:

[0105] Step S510, when the management request is the creation use request, setting the initialization parameter, the calling method parameter and the signature parameter in the parameter information according to the creation use request and the key corresponding to the user; the creation use request includes the creation request and the use request;

[0106] Step S520, receiving and decoding the parameter information in the blockchain to obtain a fourth decoding result;

[0107] Step S530, creating the smart account of the user according to the initialization parameter in the fourth decoding result;

[0108] Step S540, signature authentication is performed on the use request according to the signature parameter in the fourth decoding result;

[0109] Step S550, after the signature authentication is passed, the corresponding smart contract is invoked according to the calling method parameter in the fourth decoding result; under the smart contract, the smart account of the user is used.

[0110] Specifically, the initialization parameter is set based on the creation request; the calling method parameter is set based on the use request; and the signature parameter is set based on the key; that is, for a composite management request, the parameter information is set at one time, thereby saving the execution time, and the specific setting process is not repeated here.

[0111] The parameter information is received and decoded in the blockchain, thereby obtaining the fourth decoding result. The fourth decoding result includes the initialization parameter, the calling method parameter, and the signature parameter.

[0112] The corresponding smart contract is invoked according to the calling contract address of the initialization parameter in the fourth decoding result; under the smart contract, the smart account of the user is created according to the owner address and the parameter value in the fourth decoding result, thereby completing the creation of the smart account. Then, the public key in the key is used to decrypt the signature parameter, thereby obtaining the owner address, and the decrypted owner address is verified with the owner address in the blockchain. If they are consistent, it is considered that the signature authentication is passed, and the corresponding smart contract is invoked; under the smart contract, the smart account of the user is upgraded according to the upgrade request.

[0113] The following takes the management request of the use upgrade request as an example for description:

[0114] In some embodiments, the management method of the blockchain smart account further includes the following steps:

[0115] When the management request is the use upgrade request, the calling method parameter and the signature parameter in the parameter information are set according to the use upgrade request and the key corresponding to the user; the creation request includes the use request and the upgrade request;

[0116] The parameter information is received and decoded in the blockchain, thereby obtaining the fifth decoding result;

[0117] Signature authentication is performed on the use upgrade request according to the signature parameter in the fifth decoding result;

[0118] After the signature authentication is passed, the corresponding smart contract is invoked according to the calling method parameter in the fifth decoding result; under the smart contract, the smart account of the user is used.

[0119] After the signature authentication is passed, the corresponding smart contract is invoked according to the calling method parameter in the fifth decoding result; under the smart contract, the smart account of the user is upgraded.

[0120] In other embodiments, similar principles can be employed to implement other forms of composite requests, which are not illustrated here.

[0121] Through the embodiment, gas consumption can be greatly reduced, different use requirements of the user for the smart contract can be realized, and use performance and flexibility can be improved.

[0122] It should be noted that the steps shown in the above process or the process diagram of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from here.

[0123] In the embodiment, a blockchain smart account management apparatus is also provided, which is used to implement the above embodiments and preferred embodiments, and will not be described again. The terms "module", "unit", "sub-unit" and the like used below can be a combination of software and / or hardware that realizes a predetermined function. Although the apparatus described in the following embodiments is preferably implemented in software, hardware or a combination of software and hardware is also possible and is conceived.

[0124] Figure 6 is a structural block diagram of the blockchain smart account management apparatus of the embodiment, as Figure 6 shown, the apparatus includes:

[0125] The acquisition module 210 is configured to acquire a management request of a user.

[0126] The setting module 220 is configured to, when the management request is a creation request, set an initialization parameter in the parameter information based on the creation request; the creation request includes a contract address, an owner address and a parameter value.

[0127] The management module 230 is configured to receive and decode the parameter information in the blockchain to obtain a first decoding result; call the corresponding smart contract according to the contract address in the first decoding result; and create a smart account of the user under the smart contract according to the owner address and the parameter value in the first decoding result.

[0128] Through the above apparatus, the problem of low execution performance, high consumption and difficulty in large-scale application in the related art is solved, the creation of the smart account can be completed without the intervention of the virtual machine, the execution performance is improved, and the consumption is reduced; thereby being applicable to large-scale application.

[0129] In some embodiments, the management module 230 is further configured to generate a smart account address of the smart account according to the owner address and the parameter value under the smart contract, so as to complete the creation of the smart account of the user.

[0130] The calling method parameter in the parameter information is set as null.

[0131] In some embodiments, the blockchain smart account management apparatus further comprises:

[0132] The judging module is configured to judge whether the initialization parameter is null after obtaining the first decoding result.

[0133] If the initialization parameter is null, the virtual machine reads the corresponding bytecode based on the calling contract address in the creation request, and creates the smart account of the user based on the bytecode.

[0134] In some embodiments, the blockchain smart account management apparatus further comprises:

[0135] The storage module is configured to store the smart account address and the owner address of the smart account in the blockchain after creating the smart account of the user, and keep the smart account address unchanged.

[0136] In some embodiments, the blockchain smart account management apparatus further comprises:

[0137] The first execution module is configured to set the calling method parameter and the signature parameter in the parameter information according to the use request and the corresponding key of the user when the management request is the use request.

[0138] The parameter information is received and decoded in the blockchain to obtain a second decoding result.

[0139] The use request is signed and authenticated according to the signature parameter in the second decoding result.

[0140] After the signature authentication is passed, the corresponding smart contract is called according to the calling method parameter in the second decoding result, and the smart account of the user is used under the smart contract.

[0141] In some embodiments, the blockchain smart account management apparatus further comprises:

[0142] The second execution module is configured to set the calling method parameter and the signature parameter in the parameter information according to the upgrade request and the corresponding key of the user when the management request is the upgrade request.

[0143] The parameter information is received and decoded in the blockchain to obtain a third decoding result.

[0144] The upgrade request is signed and authenticated according to the signature parameter in the third decoding result.

[0145] After the signature authentication is passed, the corresponding smart contract is called according to the calling method parameter in the third decoding result, and the smart account of the user is upgraded under the smart contract.

[0146] In some embodiments, the management apparatus of the blockchain smart account further comprises:

[0147] a third execution module configured to, when the management request is a creation use request, set an initialization parameter, a method parameter and a signature parameter in the parameter information according to the creation use request and the key corresponding to the user; the creation use request comprises a creation request and a use request;

[0148] receive and decode the parameter information in the blockchain to obtain a fourth decoding result;

[0149] create a smart account of the user according to the initialization parameter in the fourth decoding result;

[0150] perform signature authentication on the use request according to the signature parameter in the fourth decoding result;

[0151] after the signature authentication passes, invoke the corresponding smart contract according to the method parameter in the fourth decoding result; and use the smart account of the user under the smart contract.

[0152] It should be noted that each of the above modules can be a functional module or a program module, which can be implemented by software or hardware. For the modules implemented by hardware, each of the above modules can be located in the same processor; or each of the above modules can also be located in different processors in any combination.

[0153] In the present embodiment, a computer device is also provided, which comprises a memory and a processor, the memory stores a computer program, and the processor is configured to execute the computer program to perform the steps in any one of the above method embodiments.

[0154] Optionally, the above computer device can further comprise a transmission device and an input and output device, wherein the transmission device is connected with the processor, and the input and output device is connected with the processor.

[0155] Optionally, in the present embodiment, the processor can be configured to execute the following steps through the computer program:

[0156] S1, obtaining a management request of a user;

[0157] S2, when the management request is a creation request, setting an initialization parameter in the parameter information based on the creation request; the creation request comprises a contract address, an owner address and a parameter value;

[0158] S3, receiving and decoding the parameter information in the blockchain to obtain a first decoding result; calling the corresponding smart contract according to the calling contract address in the first decoding result; under the smart contract, creating a smart account of the user according to the owner address and the parameter value in the first decoding result.

[0159] It should be noted that the specific examples in the embodiment can refer to the examples described in the above embodiments and optional implementation manners, which will not be described herein again.

[0160] In addition, in combination with the management method of the blockchain smart account provided in the above embodiments, a storage medium can also be provided to implement the management method of the blockchain smart account in the embodiment. The storage medium has a computer program stored thereon. The computer program is executed by a processor to implement any one of the management methods of the blockchain smart account in the above embodiments.

[0161] It should be understood that the specific embodiments described herein are only used to explain this application, but not to limit it. According to the embodiments provided in the present application, all other embodiments obtained by those of ordinary skill in the art without creative labor are within the scope of protection of the present application.

[0162] Obviously, the drawings are only some examples or embodiments of the present application, and can also be applied to other similar situations without creative labor for those of ordinary skill in the art. In addition, it can be understood that although the work done in the development process may be complex and long, some design, manufacture or production changes according to the technical content disclosed in the present application are only conventional technical means for those of ordinary skill in the art, and should not be regarded as insufficient disclosure of the present application.

[0163] The word "embodiment" in the present application means that the specific features, structures or characteristics described in combination with the embodiments can be included in at least one embodiment of the present application. The appearance of this phrase in various places in the specification does not necessarily mean the same embodiment, nor does it mean independence or alternative to other embodiments. It can be clearly or implicitly understood by those of ordinary skill in the art that the embodiments described in the present application can be combined with other embodiments without conflict.

[0164] The above described embodiments only express several implementation manners of the present application, which are described in detail and specifically, but should not be understood as limitation to the patent protection scope. It should be noted that for those of ordinary skill in the art, without departing from the concept of the present application, some modifications and improvements can be made, which are within the scope of protection of the present application. Therefore, the protection scope of the present application should be subject to the appended claims.

Claims

1. A method for managing blockchain smart accounts, characterized in that: include: Get the user's management request; When the management request is a creation request, setting the initialization parameters in the parameter information based on the creation request; The creation request includes the calling contract address, owner address and parameter values; the calling contract address is the address of the factory contract; The parameter value is a salt value, which is a random value generated by combining with the user password; Receiving and decoding the parameter information in the blockchain to obtain a first decoding result; calling the corresponding smart contract according to the calling contract address in the first decoding result; Under the smart contract, creating a smart account of the user according to the owner address and the parameter value in the first decoding result; After obtaining the first decoding result, determining whether the initialization parameter is empty; If the initialization parameter is empty, the corresponding bytecode is read based on the calling contract address in the creation request through the virtual machine; Based on the bytecode, a smart account of the user is created.

2. The method for managing blockchain smart accounts according to claim 1, characterized in that: Under the smart contract, creating the user's smart account according to the owner address and the parameter value in the first decoding result includes: Under the smart contract, a smart account address of the smart account is generated according to the owner address and the parameter value to complete the creation of the smart account of the user; Set the calling method parameter in the parameter information to empty.

3. The method for managing blockchain smart accounts according to claim 1, wherein: The method further comprises: After creating the user's smart account, the smart account address and the owner address of the smart account are stored in the blockchain; and the smart account address remains unchanged.

4. The method for managing blockchain smart accounts according to claim 1, wherein: The method further comprises: When the management request is a use request, setting the calling method parameters and signature parameters in the parameter information according to the use request and the key corresponding to the user; Receiving and decoding the parameter information in the blockchain to obtain a second decoding result; Performing signature authentication on the use request according to the signature parameter in the second decoding result; After the signature authentication is passed, the corresponding smart contract is called according to the calling method parameters in the second decoding result; under the smart contract, the user's smart account is used.

5. The method for managing blockchain smart accounts according to claim 1, wherein: The method further comprises: When the management request is an upgrade request, setting the calling method parameters and signature parameters in the parameter information according to the upgrade request and the key corresponding to the user; Receiving and decoding the parameter information in the blockchain to obtain a third decoding result; Performing signature authentication on the upgrade request according to the signature parameter in the third decoding result; After the signature authentication is passed, the corresponding smart contract is called according to the calling method parameters in the third decoding result; and under the smart contract, the user's smart account is upgraded.

6. The method for managing blockchain smart accounts according to claim 1, wherein: The management request is a compound request; the compound request is at least two of a creation request, a use request, and an upgrade request.

7. A blockchain smart account management device, characterized in that: include: The acquisition module is used to obtain the user's management request; A setting module, configured to set initialization parameters in parameter information based on a create request when the management request is a create request; the create request includes a calling contract address, an owner address, and a parameter value; the calling contract address is the address of the factory contract; the parameter value is a salt value, which is a random value generated by combining with the user password; A management module is configured to receive and decode the parameter information in the blockchain to obtain a first decoding result; and call a corresponding smart contract according to the calling contract address in the first decoding result; Under the smart contract, creating a smart account of the user according to the owner address and the parameter value in the first decoding result; After obtaining the first decoding result, determining whether the initialization parameter is empty; If the initialization parameter is empty, the corresponding bytecode is read based on the calling contract address in the creation request through the virtual machine; Based on the bytecode, a smart account of the user is created.

8. A computer device comprising a memory and a processor, characterized in that: A computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps of the blockchain smart account management method according to any one of claims 1 to 6.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the blockchain smart account management method described in any one of claims 1 to 6 are implemented.

Citation Information

Patent Citations

  • Method for deploying smart contract, blockchain node and storage medium

    CN111768200A

  • Method for deploying smart contract, blockchain node and storage medium

    CN111815330A