Account contract processing method, device, equipment and storage medium

文档序号:87320 发布日期:2021-10-08 浏览:12次 中文

阅读说明:本技术 一种账户合约的处理方法、装置、设备及存储介质 (Account contract processing method, device, equipment and storage medium ) 是由 邓泰生 顾费勇 曹崇瑞 李刚锐 常鸿飞 张皓旭 陈冰宇 崔阳 冯超 刘静媛 于 2021-07-12 设计创作,主要内容包括:本申请提供一种账户合约的处理方法、装置、设备及存储介质,属于区块链合约技术领域。该方法应用于区块链节点,区块链节点上部署有账户合约,账户合约包括:一个控制账户以及多个恢复账户,该方法包括:响应于第一账户发起的更换控制账户指令,向至少一个第二账户发送验证请求,更换控制账户指令包括:待更换为新的控制账户的目标账户,第一账户为账户合约中的任一账户,第二账户为恢复账户中的任一账户;接收第二账户发送的验证结果;基于验证结果确定新的控制账户。本申请可以通过更换其他账户作为控制账户从而实现账户的挂失和恢复,提高区块链的易用性。(The application provides a processing method, a processing device, equipment and a storage medium of an account contract, and belongs to the technical field of block chain contracts. The method is applied to the block chain nodes, account contracts are deployed on the block chain nodes, and the account contracts comprise: a control account and a plurality of recovery accounts, the method comprising: sending a verification request to at least one second account in response to a change control account instruction initiated by the first account, the change control account instruction comprising: the method comprises the steps that a target account to be replaced by a new control account is obtained, the first account is any one of account contracts, and the second account is any one of recovery accounts; receiving a verification result sent by the second account; a new control account is determined based on the verification result. According to the method and the device, other accounts can be replaced to serve as control accounts, so that account loss reporting and recovery are achieved, and usability of the block chain is improved.)

1. A method for processing account contracts, the method being applied to a block chain node on which an account contract is deployed, the account contract comprising: a control account and a plurality of recovery accounts, the method comprising:

sending a verification request to at least one second account in response to a change control account instruction initiated by a first account, the change control account instruction comprising: a target account to be replaced with a new control account, the first account being any one of the account contracts, the second account being any one of the recovery accounts;

receiving a verification result sent by the second account;

determining a new control account based on the verification result.

2. The method of claim 1, wherein the determining a new control account based on the verification result comprises:

and determining the new control account according to the information of the reference second account, wherein the verification result sent by the reference second account is verification passing.

3. The method of claim 2, wherein determining the new control account based on the information referencing the second account comprises:

and if the reference second account exists, taking the target account as a new control account.

4. The method of claim 2, wherein determining the new control account based on the information referencing the second account comprises:

and if the number of the reference second accounts is larger than or equal to the preset number, taking the target account as a new control account.

5. The method of any of claims 1-4, wherein the account contract further comprises: an account status identifier;

the method further comprises the following steps:

and in response to the loss report instruction sent by the recovery account, changing the account state identifier of the block chain account contract into a frozen state.

6. The method of claim 5, wherein the method further comprises:

sending a transaction request to an application contract, the transaction request including an identification of the control account and an account status identification of the blockchain account contract;

and receiving a return instruction sent by the application contract, wherein the return instruction is used for indicating that the transaction request does not meet a preset condition.

7. The method of claim 6, wherein receiving the return instruction sent by the application contract comprises:

and if the identification of the control account is not matched with the control account of the current block chain account contract, receiving a return instruction sent by the application contract.

8. The method of claim 6, wherein receiving the return instruction sent by the application contract comprises:

and if the account status identifier of the block chain account contract is in a frozen state, receiving a return instruction sent by the application contract.

9. An account contract processing device, wherein the device is applied to a block chain node, an account contract is deployed on the block chain node, and the account contract comprises: a control account and a plurality of recovery accounts, the apparatus comprising: the device comprises a response module, a receiving module and a determining module;

the response module is configured to send a verification request to at least one second account in response to a control account replacement instruction initiated by a first account, where the control account replacement instruction includes: a target account to be replaced with a new control account, the first account being any one of the account contracts, the second account being any one of the recovery accounts;

the receiving module is used for receiving the verification result sent by the second account;

the determination module is used for determining a new control account based on the verification result.

10. A computer device, comprising: memory in which a computer program is stored which is executable on the processor, and a processor which, when executing the computer program, carries out the steps of the method according to any one of the preceding claims 1 to 8.

11. A computer-readable storage medium, characterized in that the storage medium has stored thereon a computer program which, when being executed by a processor, carries out the steps of the method of any one of claims 1 to 8.

Technical Field

The present application relates to the technical field of block chain contracts, and in particular, to a method, an apparatus, a device, and a storage medium for processing an account contract.

Background

In the blockchain technology, processes such as a contract transaction are generally performed through one account, and an account address of each account corresponds to one private key, and the private key cannot be modified.

In the process of account transaction and the like in the prior art, the transaction is usually performed by taking a single account as a main body, that is, when the account address of the account is lost corresponding to the private key, the user cannot use the corresponding account to perform the transaction, and cannot perform loss reporting and recovery of the account, which results in lower usability of the block chain.

Disclosure of Invention

The application aims to provide a processing method, a processing device, processing equipment and a storage medium of an account contract, wherein transaction can be carried out through the account contract, a plurality of accounts are involved in the account contract, when a control account is lost, loss report and recovery of the account can be realized by replacing other accounts as the control account, and usability of a block chain is improved.

The embodiment of the application is realized as follows:

in one aspect of the embodiments of the present application, a method for processing an account contract is provided, where the method is applied to a block chain node, an account contract is deployed on the block chain node, and the account contract includes: a control account and a plurality of recovery accounts, the method comprising:

sending a verification request to at least one second account in response to a change control account instruction initiated by the first account, the change control account instruction comprising: the method comprises the steps that a target account to be replaced by a new control account is obtained, the first account is any one of account contracts, and the second account is any one of recovery accounts;

receiving a verification result sent by the second account;

a new control account is determined based on the verification result.

Optionally, determining a new control account based on the verification result comprises:

and determining a new control account according to the information of the reference second account, wherein the verification result sent by the reference second account is verification pass.

Optionally, determining a new control account according to the information referring to the second account includes:

and if the reference second account exists, the target account is used as a new control account.

Optionally, determining a new control account according to the information referring to the second account includes:

and if the number of the reference second accounts is larger than or equal to the preset number, taking the target account as a new control account.

Optionally, the account contract further comprises: an account status identifier;

the method further comprises the following steps:

and changing the account state identification of the block chain account contract into a frozen state in response to the loss report instruction sent by the recovery account.

Optionally, the method further comprises:

sending a transaction request to the application contract, the transaction request including an identification of the control account and an account status identification of the blockchain account contract;

and receiving a return instruction sent by the application contract, wherein the return instruction is used for indicating that the transaction request does not meet the preset condition.

Optionally, receiving a return instruction sent by the application contract, including:

and if the identification of the control account is not matched with the control account of the current block chain account contract, receiving a return instruction sent by the application contract.

Optionally, receiving a return instruction sent by the application contract, including:

and if the account status identifier of the block chain account contract is in the frozen state, receiving a return instruction sent by the application contract.

In another aspect of the embodiments of the present application, there is provided an account contract processing apparatus, where the apparatus is applied to a block chain node, where an account contract is deployed on the block chain node, and the account contract includes: a control account and a plurality of recovery accounts, the apparatus comprising: the device comprises a response module, a receiving module and a determining module;

a response module, configured to send a verification request to at least one second account in response to a control account replacement instruction initiated by a first account, where the control account replacement instruction includes: the method comprises the steps that a target account to be replaced by a new control account is obtained, the first account is any one of account contracts, and the second account is any one of recovery accounts;

the receiving module is used for receiving the verification result sent by the second account;

a determination module to determine a new control account based on the verification result.

Optionally, the determining module is specifically configured to determine a new control account according to the information referring to the second account, and the verification result sent by referring to the second account is that the verification is passed.

Optionally, the determining module is specifically configured to take the target account as a new control account if the reference second account exists.

Optionally, the determining module is further configured to take the target account as a new control account if the number of the reference second accounts is greater than or equal to the preset number.

Optionally, the account contract further comprises: an account status identifier; and the response module is also used for responding to the loss reporting instruction sent by the recovery account, and changing the account state identifier of the block chain account contract into a frozen state.

Optionally, the receiving module is further configured to send a transaction request to the application contract, where the transaction request includes an identifier of the control account and an account status identifier of the blockchain account contract; and receiving a return instruction sent by the application contract, wherein the return instruction is used for indicating that the transaction request does not meet the preset condition.

Optionally, the receiving module is specifically configured to receive a return instruction sent by the application contract if the identifier of the control account does not match the control account of the current blockchain account contract.

Optionally, the receiving module is specifically configured to receive a return instruction sent by the application contract if the account status identifier of the blockchain account contract is the frozen status.

In another aspect of the embodiments of the present application, there is provided a computer device, including: the account contract processing method comprises the steps of storing a computer program capable of running on a processor in the memory, and realizing the account contract processing method when the processor executes the computer program.

Optionally, the computer device is specifically configured to execute a control account replacement instruction initiated in response to the first account, and send a verification request to the at least one second account, where the control account replacement instruction includes: the method comprises the steps that a target account to be replaced by a new control account is obtained, the first account is any one of account contracts, and the second account is any one of recovery accounts; receiving a verification result sent by the second account; a new control account is determined based on the verification result.

Optionally, the computer device is specifically configured to determine a new control account according to the information referring to the second account, and a verification result sent by referring to the second account is that verification is passed.

Optionally, the computer device is specifically configured to execute, if there is a reference second account, taking the target account as a new control account.

Optionally, the computer device is specifically configured to execute the step of taking the target account as a new control account if the number of the reference second accounts is greater than or equal to the preset number.

Optionally, the account contract further comprises: an account status identifier; the computer device is specifically configured to execute a loss report instruction sent in response to the recovery account, and change the account status identifier of the blockchain account contract to a frozen status.

Optionally, the computer device is specifically configured to perform sending a transaction request to the application contract, the transaction request including an identification of the control account and an account status identification of the blockchain account contract; and receiving a return instruction sent by the application contract, wherein the return instruction is used for indicating that the transaction request does not meet the preset condition.

Optionally, the computer device is specifically configured to receive a return instruction sent by the application contract if the identity of the control account does not match the control account of the current blockchain account contract.

Optionally, the computer device is specifically configured to receive a return instruction sent by the application contract if the account status identifier of the blockchain account contract is the frozen status.

In another aspect of the embodiments of the present application, a computer-readable storage medium is provided, where a computer program is stored on the storage medium, and when the computer program is executed by a processor, the steps of the method for processing an account contract are implemented.

Optionally, the computer-readable storage medium is specifically configured to send a verification request to at least one second account in response to a control account change instruction initiated by the first account, where the control account change instruction includes: the method comprises the steps that a target account to be replaced by a new control account is obtained, the first account is any one of account contracts, and the second account is any one of recovery accounts; receiving a verification result sent by the second account; a new control account is determined based on the verification result.

Optionally, the computer-readable storage medium is specifically configured to determine a new control account according to the information referring to the second account, and the verification result sent with reference to the second account is verification pass.

Optionally, the computer-readable storage medium is specifically configured to perform, if there is a reference second account, regarding the target account as a new control account.

Optionally, the computer-readable storage medium is specifically configured to execute taking the target account as a new control account if the number of the reference second accounts is greater than or equal to the preset number.

Optionally, the account contract further comprises: an account status identifier; the computer-readable storage medium is specifically configured to execute changing the account status identifier of the blockchain account contract to a frozen state in response to a loss-of-report instruction sent by the recovery account.

Optionally, the computer-readable storage medium is specifically configured to perform sending a transaction request to the application contract, the transaction request including an identification of the control account and an account status identification of the blockchain account contract; and receiving a return instruction sent by the application contract, wherein the return instruction is used for indicating that the transaction request does not meet the preset condition.

Optionally, the computer-readable storage medium is specifically configured to perform receiving a return instruction sent by the application contract if the identity of the control account does not match the control account of the current blockchain account contract.

Optionally, the computer-readable storage medium is specifically configured to receive a return instruction sent by the application contract if the account status identifier of the blockchain account contract is in the frozen status.

The beneficial effects of the embodiment of the application include:

in the method, the apparatus, the device, and the storage medium for processing an account contract provided in the embodiments of the present application, a verification request may be sent to at least one second account in response to a control account replacement instruction initiated by a first account, where the control account replacement instruction includes: the method comprises the steps that a target account to be replaced by a new control account is obtained, the first account is any one of account contracts, and the second account is any one of recovery accounts; receiving a verification result sent by the second account; determining a new control account based on the verification result, wherein the method can be applied to a block chain node, and an account contract is deployed on the block chain node, and the account contract comprises the following steps: one control account and multiple recovery accounts. The method comprises the steps that a plurality of accounts are set in an account contract mode, when a private key of an account address of a control account is lost, other accounts initiate a process of replacing the control account, the whole account contract can be prevented from being lost, and therefore safety of the account contract can be improved.

Drawings

In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are required to be used in the embodiments will be briefly described below, it should be understood that the following drawings only illustrate some embodiments of the present application and therefore should not be considered as limiting the scope, and for those skilled in the art, other related drawings can be obtained from the drawings without inventive effort.

FIG. 1 is a schematic illustration of an account contract provided by an embodiment of the present application;

fig. 2 is a first flowchart illustrating a method for processing an account contract according to an embodiment of the present application;

fig. 3 is a second flowchart illustrating a processing method of an account contract according to an embodiment of the present application;

fig. 4 is a schematic diagram illustrating control of account initiated replacement in a processing method of an account contract according to an embodiment of the present application;

fig. 5 is a schematic diagram illustrating recovery of account initiated replacement in the processing method of an account contract according to the embodiment of the present application;

fig. 6 is a schematic diagram illustrating recovery of an account initiated loss report in the method for processing an account contract according to the embodiment of the present application;

fig. 7 is a schematic diagram of application contract return in the processing method of an account contract provided in the embodiment of the present application;

fig. 8 is a schematic structural diagram of a processing device for an account contract according to an embodiment of the present application;

fig. 9 is a schematic structural diagram of a computer device according to an embodiment of the present application.

Detailed Description

In order to make the objects, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are some embodiments of the present application, but not all embodiments. The components of the embodiments of the present application, generally described and illustrated in the figures herein, can be arranged and designed in a wide variety of different configurations.

Thus, the following detailed description of the embodiments of the present application, presented in the accompanying drawings, is not intended to limit the scope of the claimed application, but is merely representative of selected embodiments of the application. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.

It should be noted that: like reference numbers and letters refer to like items in the following figures, and thus, once an item is defined in one figure, it need not be further defined and explained in subsequent figures.

In the description of the present application, it is noted that the terms "first", "second", "third", and the like are used merely for distinguishing between descriptions and are not intended to indicate or imply relative importance.

The content included in the account contract proposed in the embodiment of the present application and the related interactive functions that can be performed will be specifically explained below.

Fig. 1 is a schematic diagram of an account contract provided in an embodiment of the present application, please refer to fig. 1, where the account contract may include a plurality of accounts, specifically, may include a control account and a plurality of recovery accounts, and the account contract shown in fig. 1 is exemplified by having 3 recovery accounts, but is not limited thereto.

Optionally, fig. 1 includes an account a, an account B, an account C, and an account D, where the account a is a control account, the account B, the account C, and the account D is a recovery account, and each account may be controlled by one user through an electronic device, that is, the user a, the user B, the user C, and the user D in fig. 1.

The interactive functions that an account contract may perform include: forward transactions, change control accounts, loss-of-account, etc., account contracts may interact with application contracts on the blockchain.

Alternatively, the control account may be an account having control authority for the account contract, and the control account may perform work such as forwarding transactions, replacing control accounts, and the like through the account contract.

Alternatively, the recovery account may be an account having the account contract recovery authority, and the recovery account may perform work of replacing the control account, losing the account, or the like through the account contract. It should be noted that the user who is recovering the account may be a close friend of the user who controls the account.

Alternatively, forwarding the transaction may be the process of sending a transaction request to the application contract through the account contract, thereby effecting a forwarded transaction on the blockchain.

Alternatively, changing a control account may be the process of changing the current control account in the account contract to a new control account.

Optionally, the loss reporting account may be a control account of the account contract, where the account contract cannot initiate a forwarding transaction or the like for a certain time in a loss reporting state.

Optionally, the account contract may specifically be a contract set at a link point of the block chain, and is composed of the control account, the recovery account, and the above functions, and the account contract may perform information interaction with the application contract, thereby implementing interaction between nodes of the block chain.

Alternatively, the application contract may be a contract set on a node of the blockchain, and may perform information interaction with the account contract to forward a request, instruction, and the like sent by the account contract to other nodes on the blockchain. Wherein the application contract and the account contract may be located on the same node on the blockchain.

Optionally, the account on the blockchain may have a private key, a public key, and an address, where a public key (public key for short) and a private key (private key for short) are public keys of contents of an asymmetric encryption algorithm in cryptography, and the private key is to be safely kept. The private key is generated from a random seed, and the public key is derived from the private key through an algorithm. Since the public key is too long, for simplicity and practicality, the public key is characterized by an address, which is derived from the public key. These deductions are unidirectional and irreversible. That is, the address cannot deduce the public key, and the public key cannot deduce the private key.

Optionally, the current blockchain account address generation process is as follows: 256-bit private keys are generated through a cryptographic algorithm, public keys are deduced from the private keys, and addresses are deduced from the public keys, namely, the current account addresses can only be controlled by the private keys.

In the prior art, an account can only be controlled by a unique private key, cannot be modified and cannot be retrieved. When the private key is lost, the token or the managed information on the account cannot be obtained, the account is always out of control, and great inconvenience and economic loss are caused to the use of the user. And the private key is long in length, cannot be memorized by people, and can only be stored or recorded on paper through a terminal, for example, the private key is lost when the terminal is damaged or a recorded book is lost. The private key is difficult to store and cannot be retrieved, and the usability of the block chain is greatly influenced. In addition, when the private key is stolen, the private key cannot be reported.

Alternatively, each account may be an account obtained by registering application software in the electronic device, a user may perform operations related to the account through the electronic device, and different accounts may log in, operate on, and the like on different electronic devices, which is not limited herein.

The following explains a specific implementation procedure of the account contract based on the processing method of the account contract provided in the embodiment of the present application.

Fig. 2 is a first flowchart of a method for processing an account contract according to an embodiment of the present application, please refer to fig. 2, where the method includes:

s210: and sending a verification request to at least one second account in response to the command of replacing the control account initiated by the first account.

Wherein, changing the control account instruction comprises: to be replaced with the target account of the new control account.

Optionally, the first account is any account in an account contract, such as a control account or any one of the recovery accounts. The second account is any one of the recovery accounts.

Optionally, the control account replacement instruction is used to replace the current control account with a new control account, that is, a process for implementing the function of replacing the control account. The target account to be replaced with a new control account may be another account under the contract of the account, or may be any account specified by the initiating account instructed to replace the control account, which is not limited herein.

Optionally, the verification request may specifically be to inquire whether each second account agrees to perform control account replacement, the verification request may also include a target account to be replaced by a new control account, a current control account, a first account, and the like, and specifically, the content that may be carried may be set according to actual needs of the user.

Optionally, the instruction initiated by the first account to replace the control account may be specifically sent by the user through the first account on the corresponding application software through the electronic device, which is not limited herein.

For example: the user A can initiate a command of replacing the control account through the first account, and can send a verification request to the second account used by the user B according to the command of replacing the control account.

S220: and receiving the verification result sent by the second account.

Optionally, the verification result may be a recovery result corresponding to the verification request received by the user based on the second account, for example: the verification result may be a verification result that the user agrees with the replacement, or a verification result that the user does not agree with the replacement, and the specific verification result may be determined according to a related selection operation of the user on the second account, which is not limited herein.

Optionally, different second accounts may respectively send different verification results, and there is no correlation between the verification results.

S230: a new control account is determined based on the verification result.

Optionally, after receiving the verification result sent by each second account, a new control account may be determined according to the verification result. Specifically, the comprehensive determination may be performed according to the verification results sent by the plurality of second accounts, respectively.

For example: if both user B and user C send verification results through different second accounts, a new control account may be determined based on the two verification results in combination.

In the processing method of the account contract provided by the embodiment of the present application, a verification request may be sent to at least one second account in response to a control account replacement instruction initiated by a first account, where the control account replacement instruction includes: the method comprises the steps that a target account to be replaced by a new control account is obtained, the first account is any one of account contracts, and the second account is any one of recovery accounts; receiving a verification result sent by the second account; determining a new control account based on the verification result, wherein the method can be applied to a block chain node, and an account contract is deployed on the block chain node, and the account contract comprises the following steps: one control account and multiple recovery accounts. The method comprises the steps that a plurality of accounts are set in an account contract mode, when a private key of an account address of a control account is lost, other accounts initiate a process of replacing the control account, the whole account contract can be prevented from being lost, and therefore safety of the account contract can be improved.

Optionally, determining a new control account based on the verification result comprises:

and determining a new control account according to the information of the reference second account.

Optionally, the reference second account may be a second account that passes the verification after the sent verification result, and specifically, the determination of the new control account may be implemented according to whether the number of the reference second accounts meets a preset condition.

Alternatively, if the above condition is not satisfied, the current control account is kept unchanged.

Optionally, determining a new control account according to the information referring to the second account includes:

and if the reference second account exists, the target account is used as a new control account.

Alternatively, if the first account is a control account, the determination may be performed by using the method described above, and the control account may be actively replaced with a new control account.

Accordingly, if there is no reference second account, the current control account is kept unchanged.

Optionally, determining a new control account according to the information referring to the second account includes:

and if the number of the reference second accounts is larger than or equal to the preset number, taking the target account as a new control account.

Optionally, the manner of determining the new control account is different for different first accounts, and if the first account is a recovery account, the determination may be performed by using the method described above.

For example, if the number of the reference second accounts satisfies (X × 2/3-1) or more, the number of the reference second accounts may be considered to satisfy the preset condition, where X is the total number of the second accounts, and if the first account is the recovery account, the account defaults to that the verification result is verified, so that repeated calculation is not required.

Specifically, if restoring the account includes: account B, account C, and account D, where account B is the first account, and if the default verification of account B is passed, according to the preset calculation relationship, it satisfies (3 × 2/3-1), that is, if there is one second account in account C and account D as the reference second account, a new control account may be determined. And the determined new control account is the target account to be replaced by the new control account in the control account replacing instruction.

Optionally, the account contract further comprises: an account status identifier; the method further comprises the following steps:

and changing the account state identification of the block chain account contract into a frozen state in response to the loss report instruction sent by the recovery account.

Optionally, the account status identifier may be an identifier for characterizing the status of the account contract, and may include, for example, a normal status and a frozen status; the normal state may be a state in which the account contract can normally work; while the frozen state may be a state in which the account contract is prohibited from performing certain functions, such as: forbidding forward transactions, etc., and is not limited herein.

Alternatively, the loss report instruction may be an instruction indicating that the current control account has been lost, typically initiated by one of the recovery accounts.

Optionally, after receiving the loss report instruction, the account status identifier of the blockchain account contract may be changed to a frozen status, and the status is maintained for a preset time, for example: the time period is 10 hours, and can be specifically set according to actual requirements, and is not limited herein.

Optionally, when in the frozen state, the account contract may not execute the forward transaction process, but may still execute the function of replacing the control account, and when the preset time is exceeded, the frozen state may be automatically released, so that the account contract may be restored to the normal state.

Another specific implementation procedure of the processing method of the account contract provided in the embodiment of the present application is specifically explained below.

Fig. 3 is a second flowchart of a processing method of an account contract according to an embodiment of the present application, please refer to fig. 3, where the method further includes:

s310: a transaction request is sent to the application contract.

Wherein the transaction request includes an identification of the control account and an account status identification of the blockchain account contract.

Optionally, the application contract is another contract which can exchange information with the account contract, and the contract may also be configured on another node on the same blockchain, and the application contract may receive the transaction request sent by the account contract.

Optionally, the transaction request is a forward transaction function under the account contract, and processes such as performing transactions between an account under the account contract and other accounts can be realized through the transaction request, which is not limited herein.

Alternatively, the transaction request may be initiated by a control account in the account contract, and when the control account is lost, in order to prevent the control account from being maliciously utilized by a person to forward the transaction, the transaction request may be implemented by the aforementioned methods of losing the account, replacing the control account, and the like.

S320: a return instruction sent by the application contract is received.

Wherein the return instruction is used for indicating that the transaction request does not meet the preset condition.

Alternatively, the return instruction may be an instruction generated by the application contract according to the transaction request, and the instruction may be specifically used to indicate that the corresponding transaction request does not satisfy a preset condition, where the preset condition may be set by the user according to an actual situation, and is not limited herein.

Optionally, receiving a return instruction sent by the application contract, including: and if the identification of the control account is not matched with the control account of the current block chain account contract, receiving a return instruction sent by the application contract.

Optionally, the application contract may specifically be determined according to an identifier of the control account, where the identifier of the control account is used to characterize the control account of the account contract when the transaction request is initiated, and if the identifier is not matched with the control account of the current block chain account contract, it may be determined that the transaction request is not sent by the current control account, and a return instruction is correspondingly generated if the transaction request is not considered to be matched.

Optionally, receiving a return instruction sent by the application contract, including: and if the account status identifier of the block chain account contract is in the frozen state, receiving a return instruction sent by the application contract.

Optionally, in addition to the foregoing returning manner, the determination may be performed according to an account status identifier of the blockchain account contract, and if the status identifier is in a frozen state, it may be determined that the recovery account initiates a loss report operation, and accordingly, in the loss report operation state, the account contract may not execute the function of forwarding the transaction, and may generate and send a return instruction.

In the processing method of the account contract provided in the embodiment of the application, a transaction request can be sent to an application contract; a return instruction sent by the application contract is received. The account contract can be prohibited from performing the account forwarding transaction function through the return instruction, so that the account is prevented from being maliciously subjected to forwarding transaction under the condition of loss.

In the embodiment of the application, the account private key can be modified; when the account private key is lost, a recovery means is provided to help the user to modify the private key and regain control of the account; when the private key is stolen, the loss reporting function is provided, and timely freezing can be realized.

The following explains a specific application of the processing method of the account contract provided in the embodiment of the present application by a schematic diagram of a plurality of accounts.

Fig. 4 is a schematic diagram illustrating a control account initiating replacement in a processing method of an account contract provided in the embodiment of the present application, please refer to fig. 4, where a control account and three recovery accounts are taken as examples in this scenario, if a first account is a control account, that is, an account a, when a control account is replaced, only one of an account B, an account C, and an account D needs to be referred to as a second account.

Optionally, in this embodiment, the illustrated nodes on the blockchain network include an account contract and an application contract, the account contract includes one control account and three recovery accounts, and the function of replacing the control account is performed through the control account.

Fig. 5 is a schematic diagram of initiating replacement by recovering an account in the processing method of an account contract provided in the embodiment of the present application, please refer to fig. 5, where a control account and three recovery accounts are taken as an example in this scenario, if a first account is one of the recovery accounts, for example, account B, when a control account is replaced, account C and account D need to be verified respectively, including account B, and two second accounts exist as reference second accounts, so that the replacement processing of the control account can be implemented.

Optionally, in this embodiment, the illustrated nodes on the blockchain network include an account contract and an application contract, the account contract includes one control account and three recovery accounts, and the function of replacing the control account is performed through the recovery accounts.

Fig. 6 is a schematic diagram of recovering account initiation loss in the processing method of an account contract provided in the embodiment of the present application, and please refer to fig. 6, in this scenario, taking one control account and three recovery accounts as an example, if a recovery account B initiates loss, an account contract status identifier of the account contract may be changed to a frozen status.

Optionally, in this embodiment, the illustrated nodes on the blockchain network include an account contract and an application contract, the account contract includes one control account and three recovery accounts, and the function of checking out accounts is performed through the recovery accounts.

Fig. 7 is a schematic diagram of application contract return in the processing method of an account contract provided in the embodiment of the present application, please refer to fig. 7, where in this scenario, for example, one control account and three recovery accounts are taken as an example, if an account contract initiates a forward transaction and the status of the account contract is identified as a frozen status, the application contract may send a return instruction for indicating that the account contract cannot currently execute a forward transaction function.

Optionally, in this embodiment, the illustrated nodes on the blockchain network include an account contract and an application contract, the account contract includes one control account and three recovery accounts, and the return condition when the function of forwarding the transaction is performed through the whole account contract.

Optionally, the above-mentioned fig. 4 to fig. 7 respectively explain functions of replacing the control account, the loss report account and forwarding the transaction in the case of taking one control account and three recovery accounts as an example, and here, the number of the recovery accounts is not limited, and the specific number and the related rule may be set according to actual requirements.

The following describes a device, a storage medium, and the like corresponding to the processing method for executing the account contract provided by the present application, and specific implementation procedures and technical effects thereof are referred to above and will not be described again below.

Fig. 8 is a schematic structural diagram of a processing apparatus for an account contract according to an embodiment of the present application, please refer to fig. 8, where the apparatus is applied to a block chain node, and an account contract is disposed on the block chain node, where the account contract includes: a control account and a plurality of recovery accounts, the apparatus comprising: a response module 810, a receiving module 820, a determining module 830;

a response module 810, configured to send a verification request to at least one second account in response to a change control account instruction initiated by the first account, where the change control account instruction includes: the method comprises the steps that a target account to be replaced by a new control account is obtained, the first account is any one of account contracts, and the second account is any one of recovery accounts;

a receiving module 820, configured to receive a verification result sent by the second account;

a determining module 830 for determining a new control account based on the verification result.

Optionally, the determining module 830 is specifically configured to determine a new control account according to the information referring to the second account, and the verification result sent by referring to the second account is that the verification is passed.

Optionally, the determining module 830 is specifically configured to use the target account as a new control account if there is a reference to the second account.

Optionally, the determining module 830 is further configured to take the target account as a new control account if the number of the reference second accounts is greater than or equal to the preset number.

Optionally, the account contract further comprises: an account status identifier; the response module 810 is further configured to change the account status identifier of the blockchain account contract to the frozen status in response to the loss report instruction sent by the recovery account.

Optionally, the receiving module 820 is further configured to send a transaction request to the application contract, where the transaction request includes an identification of the control account and an account status identification of the blockchain account contract; and receiving a return instruction sent by the application contract, wherein the return instruction is used for indicating that the transaction request does not meet the preset condition.

Optionally, the receiving module 820 is specifically configured to receive a return instruction sent by the application contract if the identity of the control account does not match the control account of the current blockchain account contract.

Optionally, the receiving module 820 is specifically configured to receive a return instruction sent by the application contract if the account status identifier of the blockchain account contract is the frozen status.

In the processing apparatus for an account contract provided in an embodiment of the present application, a verification request may be sent to at least one second account in response to a control account replacement instruction initiated by a first account, where the control account replacement instruction includes: the method comprises the steps that a target account to be replaced by a new control account is obtained, the first account is any one of account contracts, and the second account is any one of recovery accounts; receiving a verification result sent by the second account; determining a new control account based on the verification result, wherein the method can be applied to a block chain node, and an account contract is deployed on the block chain node, and the account contract comprises the following steps: one control account and multiple recovery accounts. The method comprises the steps that a plurality of accounts are set in an account contract mode, when a private key of an account address of a control account is lost, other accounts initiate a process of replacing the control account, the whole account contract can be prevented from being lost, and therefore safety of the account contract can be improved.

The above-mentioned apparatus is used for executing the method provided by the foregoing embodiment, and the implementation principle and technical effect are similar, which are not described herein again.

These above modules may be one or more integrated circuits configured to implement the above methods, such as: one or more Application Specific Integrated Circuits (ASICs), or one or more microprocessors (DSPs), or one or more Field Programmable Gate Arrays (FPGAs), among others. For another example, when one of the above modules is implemented in the form of a Processing element scheduler code, the Processing element may be a general-purpose processor, such as a Central Processing Unit (CPU) or other processor capable of calling program code. For another example, these modules may be integrated together and implemented in the form of a system-on-a-chip (SOC).

Fig. 9 is a schematic structural diagram of a computer device according to an embodiment of the present application, and referring to fig. 9, the computer device includes: the memory 910 and the processor 920, wherein the memory 910 stores a computer program operable on the processor 920, and the processor 920 implements the steps of the method for processing the account contract when executing the computer program.

Optionally, the computer device is specifically configured to execute a control account replacement instruction initiated in response to the first account, and send a verification request to the at least one second account, where the control account replacement instruction includes: the method comprises the steps that a target account to be replaced by a new control account is obtained, the first account is any one of account contracts, and the second account is any one of recovery accounts; receiving a verification result sent by the second account; a new control account is determined based on the verification result.

Optionally, the computer device is specifically configured to determine a new control account according to the information referring to the second account, and a verification result sent by referring to the second account is that verification is passed.

Optionally, the computer device is specifically configured to execute, if there is a reference second account, taking the target account as a new control account.

Optionally, the computer device is specifically configured to execute the step of taking the target account as a new control account if the number of the reference second accounts is greater than or equal to the preset number.

Optionally, the account contract further comprises: an account status identifier; the computer device is specifically configured to execute a loss report instruction sent in response to the recovery account, and change the account status identifier of the blockchain account contract to a frozen status.

Optionally, the computer device is specifically configured to perform sending a transaction request to the application contract, the transaction request including an identification of the control account and an account status identification of the blockchain account contract; and receiving a return instruction sent by the application contract, wherein the return instruction is used for indicating that the transaction request does not meet the preset condition.

Optionally, the computer device is specifically configured to receive a return instruction sent by the application contract if the identity of the control account does not match the control account of the current blockchain account contract.

Optionally, the computer device is specifically configured to receive a return instruction sent by the application contract if the account status identifier of the blockchain account contract is the frozen status.

In the computer device provided in the embodiment of the present application, a verification request may be sent to at least one second account in response to a control account replacement instruction initiated by a first account, where the control account replacement instruction includes: the method comprises the steps that a target account to be replaced by a new control account is obtained, the first account is any one of account contracts, and the second account is any one of recovery accounts; receiving a verification result sent by the second account; determining a new control account based on the verification result, wherein the method can be applied to a block chain node, and an account contract is deployed on the block chain node, and the account contract comprises the following steps: one control account and multiple recovery accounts. The method comprises the steps that a plurality of accounts are set in an account contract mode, when a private key of an account address of a control account is lost, other accounts initiate a process of replacing the control account, the whole account contract can be prevented from being lost, and therefore safety of the account contract can be improved.

In another aspect of the embodiments of the present application, there is also provided a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the steps of the method for processing an account contract.

Optionally, the computer-readable storage medium is specifically configured to send a verification request to at least one second account in response to a control account change instruction initiated by the first account, where the control account change instruction includes: the method comprises the steps that a target account to be replaced by a new control account is obtained, the first account is any one of account contracts, and the second account is any one of recovery accounts; receiving a verification result sent by the second account; a new control account is determined based on the verification result.

Optionally, the computer-readable storage medium is specifically configured to determine a new control account according to the information referring to the second account, and the verification result sent with reference to the second account is verification pass.

Optionally, the computer-readable storage medium is specifically configured to perform, if there is a reference second account, regarding the target account as a new control account.

Optionally, the computer-readable storage medium is specifically configured to execute taking the target account as a new control account if the number of the reference second accounts is greater than or equal to the preset number.

Optionally, the account contract further comprises: an account status identifier; the computer-readable storage medium is specifically configured to execute changing the account status identifier of the blockchain account contract to a frozen state in response to a loss-of-report instruction sent by the recovery account.

Optionally, the computer-readable storage medium is specifically configured to perform sending a transaction request to the application contract, the transaction request including an identification of the control account and an account status identification of the blockchain account contract; and receiving a return instruction sent by the application contract, wherein the return instruction is used for indicating that the transaction request does not meet the preset condition.

Optionally, the computer-readable storage medium is specifically configured to perform receiving a return instruction sent by the application contract if the identity of the control account does not match the control account of the current blockchain account contract.

Optionally, the computer-readable storage medium is specifically configured to receive a return instruction sent by the application contract if the account status identifier of the blockchain account contract is in the frozen status.

In the computer-readable storage medium provided in the embodiment of the present application, a verification request may be sent to at least one second account in response to a control account replacement instruction initiated by a first account, where the control account replacement instruction includes: the method comprises the steps that a target account to be replaced by a new control account is obtained, the first account is any one of account contracts, and the second account is any one of recovery accounts; receiving a verification result sent by the second account; determining a new control account based on the verification result, wherein the method can be applied to a block chain node, and an account contract is deployed on the block chain node, and the account contract comprises the following steps: one control account and multiple recovery accounts. The method comprises the steps that a plurality of accounts are set in an account contract mode, when a private key of an account address of a control account is lost, other accounts initiate a process of replacing the control account, the whole account contract can be prevented from being lost, and therefore safety of the account contract can be improved.

In the embodiments provided in the present invention, it should be understood that the disclosed apparatus and method may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, a division of a unit is merely a logical division, and an actual implementation may have another division, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.

Units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.

In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, or in a form of hardware plus a software functional unit.

The integrated unit implemented in the form of a software functional unit may be stored in a computer readable storage medium. The software functional unit is stored in a storage medium and includes several instructions to enable a computer device (which may be a personal computer, a server, or a network device) or a processor (processor) to execute some steps of the methods according to the embodiments of the present invention. And the aforementioned storage medium includes: a U disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.

The above description is only for the specific embodiments of the present application, but the scope of the present application is not limited thereto, and any person skilled in the art can easily conceive of the changes or substitutions within the technical scope of the present application, and shall be covered by the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

The above description is only a preferred embodiment of the present application and is not intended to limit the present application, and various modifications and changes may be made by those skilled in the art. Any modification, equivalent replacement, improvement and the like made within the spirit and principle of the present application shall be included in the protection scope of the present application.

19页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:分布式支付系统安全处理方法及装置

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!