A blockchain asset protection method and device based on a smart contract

By introducing time locks and asset recovery mechanisms into smart contracts on the blockchain, the security issues of blockchain assets during storage and transfer are solved, achieving the protection effect that assets cannot be stolen even if the private key is stolen.

CN115564435BActive Publication Date: 2025-12-23HANGZHOU RIVTOWER TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211203619.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-09-29
Publication Date
2025-12-23
Estimated Expiration
2042-09-29

AI Technical Summary

Technical Problem

Existing blockchain asset protection mechanisms are vulnerable to private key theft, leading to asset theft. How can a more robust protection mechanism be designed to ensure secure asset storage and prevent theft during transfer?

Method used

A time lock and asset recovery mechanism based on smart contracts is introduced. By creating and deploying smart contracts, and using time locks and hot wallet addresses for dynamic adjustment, the storage, unlocking, retrieval and recovery operations of blockchain assets are realized, combined with the dual protection of transfer private keys and recovery private keys.

Benefits of technology

It effectively prevents hackers from stealing blockchain assets by using time locks and dynamically adjusting hot wallet addresses to ensure the security of assets during the transfer process, and can even prevent assets from being stolen when the private key is stolen.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115564435B_ABST
    Figure CN115564435B_ABST
Patent Text Reader

Abstract

The embodiment of the specification discloses a kind of based on smart contract's blockchain asset protection method and device, wherein the method includes: creating and deploying the smart contract for blockchain asset protection, the method of smart contract includes the storage, unlocking, taking out, recovery operation and / or setting time lock to the blockchain asset;Call storage method, so that the blockchain asset to be protected is saved to smart contract;When user intends to take out blockchain asset, call unlocking method, so that blockchain asset is marked as to be taken out;When time lock expires, call taking out method, so that the blockchain asset to be taken out is transferred to hot wallet address;When user intends to stop taking out blockchain asset, call recovery method, so that the blockchain asset to be taken out is reset to locked state.The present application scheme introduces time lock and recovery double mechanism on the basis of smart contract, by dynamically adjusting hot wallet address and time lock, can effectively prevent hacker from stealing blockchain asset.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present specification relates to the technical field of computer software, and particularly relates to a blockchain asset protection method and device based on a smart contract, an electronic device and a storage medium. BACKGROUND

[0002] Current blockchain asset protection mechanisms mainly use verification private keys to achieve this. For example, offline private keys are stored in cold wallets, hardware wallets are used, paper wallets are stored in physical isolation, and multiple private keys are used for multisignature. However, even with such rigorous protection mechanisms and measures, hackers still have the possibility of stealing private keys. Once the private key is stolen by hackers, the blockchain assets will eventually be stolen by hackers. How to design a more perfect blockchain asset protection mechanism can not only achieve the storage security of blockchain assets, but also ensure that blockchain assets are not stolen during the transfer process, and even if the private key is stolen by hackers, the blockchain assets cannot be stolen. It is a technical problem that needs to be solved. SUMMARY

[0003] The purpose of the embodiments of the present specification is to solve the above problems, and to provide a blockchain asset protection method and device based on a smart contract, an electronic device and a storage medium.

[0004] To solve the above technical problems, the embodiments of the present specification are implemented as follows:

[0005] In a first aspect, a blockchain asset protection method based on a smart contract is provided, comprising:

[0006] Creating and deploying a smart contract for blockchain asset protection; wherein the variables of the smart contract at least include a time lock and / or a hot wallet address, the time lock is used to set the duration of the blockchain assets to be taken out, and the hot wallet address is used to specify the address receiving the unlocked blockchain assets; the methods of the smart contract at least include storing, unlocking, taking out, restoring operations and / or setting a time lock on the blockchain assets;

[0007] Calling the storage method of the smart contract to save the blockchain assets to be protected to the smart contract;

[0008] When a user wants to take out the blockchain assets, the unlocking method of the smart contract is called to mark the blockchain assets as to be taken out;

[0009] When the time lock expires, the taking-out method of the smart contract is called to transfer the blockchain assets to be taken out to the hot wallet address;

[0010] When the user intends to stop taking out the blockchain asset before the time lock expires, the recovery method of the smart contract is called to reset the blockchain asset to be taken out to a locked state.

[0011] Further, the variables of the smart contract further include an asset type, a transfer public key, a recovery public key, a minimum time lock, and / or a taking-out time.

[0012] Further, the process of creating and deploying the smart contract for blockchain asset protection includes:

[0013] A transfer private key and a recovery private key are generated and backed up respectively;

[0014] The asset type, the transfer public key, the recovery public key, the hot wallet address, the time lock, and the minimum time lock are initialized; wherein the time lock is equal to the minimum time lock, and the hot wallet address includes a smart contract address or a public key address generated by a private key.

[0015] Further, the process of calling the storage method of the smart contract includes: verifying the asset type of the blockchain asset; and saving the blockchain asset satisfying the asset type to the smart contract and marking it as a locked asset.

[0016] Further, the process of calling the time lock setting method of the smart contract includes: setting the taking-out time to the current block time plus the time lock corresponding duration.

[0017] Further, the process of calling the unlocking method of the smart contract includes:

[0018] The transfer private key signature is verified;

[0019] The blockchain asset to be unlocked and its quantity are obtained;

[0020] If the corresponding quantity of the blockchain asset to be unlocked is a locked asset, the state of the blockchain asset is marked as a to-be-taken-out asset;

[0021] The time lock setting method of the smart contract is called to update the taking-out time;

[0022] An unlocking event message is sent to enable a blockchain external listener to process the result of the corresponding transaction.

[0023] Further, the process of calling the taking-out method of the smart contract includes:

[0024] The transfer private key signature is verified;

[0025] When the set taking-out time is met, the to-be-taken-out asset is transferred to the hot wallet address.

[0026] Send a retrieval event message to enable external blockchain listeners to retrieve the corresponding transaction processing result.

[0027] Furthermore, the process of invoking the recovery method of the smart contract includes:

[0028] Verify the recovery private key signature and the transfer private key signature;

[0029] The blockchain assets to be withdrawn are reset to a locked state;

[0030] Send an asset recovery event message to enable external blockchain listeners to monitor the transaction processing results corresponding to asset recovery.

[0031] Furthermore, the blockchain asset protection method based on smart contracts also includes invoking the hot wallet address update method of the smart contract to update the hot wallet address to a new address; wherein, the process of invoking the hot wallet address update method includes:

[0032] Verify the signature of the recovery private key;

[0033] Update the hot wallet address to the new hot wallet address;

[0034] Send a hot wallet address update event message to enable external blockchain listeners to monitor the hot wallet address for updates to the corresponding transaction processing results.

[0035] Secondly, a blockchain asset protection device based on smart contracts is proposed, including:

[0036] The first module is capable of creating and deploying smart contracts for blockchain asset protection; wherein, the variables of the smart contract include at least a time lock and / or a hot wallet address, the time lock being used to set the duration for which the blockchain asset is to be withdrawn, and the hot wallet address being used to specify the address for receiving the unlocked blockchain asset; the methods of the smart contract include at least performing storage, unlocking, withdrawal, and recovery operations on the blockchain asset and / or setting a time lock;

[0037] The second module is capable of calling the storage method of the smart contract to save the blockchain asset to be protected to the smart contract;

[0038] The third module is able to call the unlocking method of the smart contract when a user intends to withdraw the blockchain asset, so that the blockchain asset is marked as pending withdrawal;

[0039] The fourth module is able to call the retrieval method of the smart contract when the time lock expires, so that the blockchain assets to be retrieved are transferred to the hot wallet address.

[0040] The fifth module is capable of calling the recovery method of the smart contract to reset the blockchain asset to be taken out to a locked state when the user intends to stop taking out the blockchain asset before the time lock expires.

[0041] Further, the smart contract-based blockchain asset protection device further comprises:

[0042] The sixth module is capable of calling the hot wallet address updating method of the smart contract to update the hot wallet address to a new address.

[0043] In a third aspect, an electronic device is provided, comprising: a processor; and a memory arranged to store computer-executable instructions that, when executed, cause the processor to perform the method of the first aspect.

[0044] In a fourth aspect, a computer-readable storage medium is provided, storing one or more programs, which, when executed by an electronic device comprising a plurality of applications, cause the electronic device to perform the method of the first aspect.

[0045] The present specification can achieve at least the following technical effects:

[0046] The present application introduces a time lock and asset recovery double protection mechanism based on a smart contract, dynamically adjusts the hot wallet address and the time lock, and recovers the blockchain asset before the time lock expires, thereby perfecting the blockchain asset protection mechanism and effectively preventing hackers from stealing the blockchain asset. BRIEF DESCRIPTION OF DRAWINGS

[0047] In order to more clearly illustrate the technical solutions in the embodiments of the present specification or the prior art, the drawings needed in the embodiment or prior art description will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments described in the present specification, and those skilled in the art can also obtain other drawings according to these drawings without creative labor.

[0048] Figure 1 A smart contract-based blockchain asset protection method provided by an embodiment of the present specification.

[0049] Figure 2 A smart contract-based blockchain asset protection method provided by an embodiment of the present specification.

[0050] Figure 3 A smart contract-based blockchain asset protection method provided by an embodiment of the present specification.

[0051] Figure 4 FIG. 4 is a schematic diagram of a blockchain asset protection method based on a smart contract according to an embodiment of the present specification.

[0052] Figure 5 FIG. 5 is a schematic diagram of a blockchain asset protection method based on a smart contract according to an embodiment of the present specification.

[0053] Figure 6 FIG. 6 is a schematic diagram of a blockchain asset protection method based on a smart contract according to an embodiment of the present specification.

[0054] Figure 7 FIG. 7 is a schematic diagram of a blockchain asset protection method based on a smart contract according to an embodiment of the present specification.

[0055] Figure 8 FIG. 8 is a schematic diagram of a blockchain asset protection method based on a smart contract according to an embodiment of the present specification.

[0056] Figure 9 FIG. 1 is a schematic diagram of a blockchain asset protection device based on a smart contract according to an embodiment of the present specification.

[0057] Figure 10 FIG. 2 is a schematic diagram of a blockchain asset protection device based on a smart contract according to an embodiment of the present specification.

[0058] Figure 11 FIG. 3 is a schematic diagram of an electronic device according to an embodiment of the present specification. DETAILED DESCRIPTION

[0059] In order to enable those skilled in the art to better understand the technical solutions in the present specification, the technical solutions in the present specification will be described clearly and completely in conjunction with the drawings in the embodiments of the present specification. Obviously, the described embodiments are only some of the embodiments of the present specification, not all the embodiments. Based on the embodiments in the present specification, all other embodiments obtained by those skilled in the art without creative labor should fall within the scope of protection of the present specification.

[0060] A blockchain asset protection scheme based on a smart contract according to the present specification will be described in detail below through specific examples.

[0061] The application focuses on how to design a more perfect blockchain asset protection mechanism, which can realize the storage security of blockchain assets, ensure that the blockchain assets are not stolen in the transfer process, and even realize that even if the private key is stolen by hackers, the blockchain assets cannot be stolen. Based on the description of the above problems, the scheme idea of the application for realizing the protection of blockchain assets based on smart contract is: first, the user initializes and deploys the blockchain smart contract through the constructor, and the smart contract at least provides methods for storing, unlocking, taking out, and recovering the blockchain assets; second, after the smart contract is successfully deployed, the user stores the blockchain assets to be protected in the smart contract through the storage method of the smart contract; third, when the user needs to obtain the assets, the asset state is changed from locked to to-be-taken-out through the unlocking method of the smart contract, and after the time lock expires, the user transfers the assets to the hot wallet address through the taking-out method of the smart contract. When the user changes the idea in the to-be-taken-out state of the blockchain assets, the recovery method of the smart contract can be used to re-lock the blockchain assets.

[0062] Embodiment one

[0063] As shown in the figure, it is a blockchain asset protection method based on smart contract, including: Figure 1 S1: create and deploy a smart contract for blockchain asset protection; wherein the variables of the smart contract at least include a time lock and / or a hot wallet address, the time lock is used to set the duration of the blockchain assets to be taken out, and the hot wallet address is used to specify the address receiving the unlocked blockchain assets; the methods of the smart contract at least include storing, unlocking, taking out, and recovering the blockchain assets and / or setting the time lock.

[0064]

[0065] ​Optionally, the variable of the smart contract further comprises an asset type, a transfer public key, a recovery public key, a minimum time lock, and / or a take-out time. Specifically, the transfer public key is used for transferring the asset in the contract out of the contract, resetting the to-be-taken-out asset, and the type is a public key or an address. The recovery public key is used for modifying the hot wallet address or updating the time lock or resetting the to-be-taken-out asset, and the type is a public key or an address. The time lock is used for when the user takes out the locked asset in the hot wallet, it needs to be first converted into a to-be-taken-out asset state, and needs to wait for the time set by the time lock before being transferred from the contract to the hot wallet. For example, if the time lock is set to 24 hours, it means that when the locked asset is converted into a to-be-taken-out asset state, the current time of the blockchain plus the time lock setting of 24 hours is used as the time when the asset can be transferred to the hot wallet. In less than 24 hours, the asset cannot be transferred to the hot wallet, and the asset is protected by time delay. The minimum time lock is used to indicate that the user cannot update the time lock value to be less than the minimum time lock value. The take-out time is used to update the take-out time to the current time of the blockchain plus the time lock duration when the asset in the contract is converted from the locked state to the to-be-taken-out state. The transfer public key, the recovery public key, and the minimum time lock are set during the initialization of the smart contract and cannot be modified once the smart contract is successfully deployed.

[0066] Optionally, as shown in Figure 2 the process of creating and deploying the smart contract for blockchain asset protection comprises:

[0067] S101: Generate a transfer private key and a recovery private key, and backup and save them respectively.

[0068] S102: Initialize the asset type, the transfer public key, the recovery public key, the time lock, the minimum time lock, the hot wallet address, and the hot wallet private key; wherein the time lock is equal to the minimum time lock, and the hot wallet address comprises a smart contract address or a public key address generated by a private key.

[0069] S2: Call the storage method of the smart contract to save the blockchain asset to be protected to the smart contract.

[0070] Optionally, as shown in Figure 3 the process of calling the storage method of the smart contract comprises:

[0071] S201: Verify the asset type of the blockchain asset.

[0072] S202: Save the blockchain asset satisfying the asset type to the smart contract and mark it as a locked asset.

[0073] Specifically, any account can store a blockchain asset of a specified asset type into the smart contract by calling a store method of the smart contract. Once stored into the smart contract, the blockchain asset will be saved as a locked asset and enter a locked state, and the locked asset cannot be directly taken out but can be first converted into a to-be-taken-out state.

[0074] S3: When a user intends to take out the blockchain asset, the unlock method of the smart contract is called to mark the blockchain asset as to-be-taken-out.

[0075] Optionally, as shown in Figure 4 the process of calling the unlock method of the smart contract includes:

[0076] S301: Verify the transfer private key signature.

[0077] S302: Obtain the blockchain asset to be unlocked and the quantity thereof.

[0078] S303: If the corresponding quantity of the blockchain asset to be unlocked is a locked asset, mark the state of the blockchain asset as a to-be-taken-out asset.

[0079] S304: Call the time lock setting method of the smart contract to update the taking-out time. Optionally, the process of calling the time lock setting method of the smart contract includes: setting the taking-out time as the current block time plus the time lock corresponding duration.

[0080] S305: Send an unlock event message to enable a blockchain external part to listen to the unlocking corresponding transaction processing result.

[0081] S4: When the time lock expires, the taking-out method of the smart contract is called to convert the to-be-taken-out blockchain asset to the hot wallet address.

[0082] Optionally, as shown in Figure 5 the process of calling the taking-out method of the smart contract includes:

[0083] S401: Verify the transfer private key signature.

[0084] S402: When the set taking-out time is met, convert the to-be-taken-out asset to the hot wallet address.

[0085] S403: Send a taking-out event message to enable a blockchain external part to listen to the taking-out corresponding transaction processing result.

[0086] S5: When a user intends to stop taking out the blockchain asset before the time lock expires, the recovery method of the smart contract is called to reset the to-be-taken-out blockchain asset to a locked state.

[0087] Optionally, as shown in Figure 6 the process of calling the asset recovery method includes:

[0088] S501: verifying the recovery private key signature and the transfer private key signature;

[0089] S502: resetting the blockchain asset to be taken out to a locked state;

[0090] S503: sending an asset recovery event message to enable a blockchain external listener to monitor the asset recovery corresponding transaction processing result.

[0091] The embodiment proposes another implementation scheme of a blockchain asset protection method based on a smart contract, as shown in Figure 7 the process of calling the hot wallet address updating method includes:

[0092] S6: calling a hot wallet address updating method of the smart contract to update the hot wallet address to a new address.

[0093] Optionally, as shown in Figure 8 the process of calling the hot wallet address updating method includes:

[0094] S601: verifying the recovery private key signature.

[0095] S602: updating the hot wallet address to a new hot wallet address.

[0096] S603: sending a hot wallet address updating event message to enable a blockchain external listener to monitor the hot wallet address updating corresponding transaction processing result.

[0097] The effectiveness of the method proposed in the above embodiment will be described below in combination with specific application scenarios, especially the scenario of a hacker stealing a private key.

[0098] For the scenario of a hot wallet address private key being stolen, when a hacker steals the hot wallet address private key, the user can call the change hot wallet address function of the contract using the asset recovery private key to update the hot wallet address.

[0099] For the scenario of an asset transfer private key being stolen, when a hacker steals the asset transfer private key, since the assets in the contract can only be transferred to the hot wallet address, the hacker cannot successfully transfer the assets.

[0100] For the scenario of an asset transfer private key and a hot wallet address private key being stolen, when a hacker simultaneously masters the asset transfer private key and the hot wallet address private key, the user can still update the hot wallet address using the asset recovery private key at this time, and the hacker cannot transfer the assets to its address at this time.

[0101] For the scenario of asset recovery private key theft, when the hacker steals the asset recovery private key, the hacker can change the hot wallet address, but cannot successfully transfer the asset because the hacker does not have the asset transfer private key, and cannot restore the to-be-taken-out asset to the locked state. Even when the hacker modifies the hot wallet address, the user can still initiate a transaction transaction by deploying a third-party contract at this time, and update the hot wallet address before transferring the asset to the new hot wallet address when the asset is taken out.

[0102] For the scenario of asset transfer private key and asset recovery private key theft, when the hacker steals the asset transfer private key and the asset recovery private key, the hacker can perform asset transfer, modify the hot wallet address, and the asset recovery function, and the hacker and the user have the same functions. However, when the hacker transfers the asset, the asset needs to be in the to-be-taken-out state for a period of time, that is, the time lock, and only when the time expires can the asset be successfully transferred to the hot wallet address. At this time, the user still has a certain time to use the asset recovery function to re-lock the asset, and the hacker and the user enter such a loop of game, and the hacker cannot take out the asset. The asset finally enters a cycle of continuous unlocking and locking, so in the worst case, the hacker cannot take back the asset, and through this mechanism, the hacker is fundamentally deterred from stealing the asset.

[0103] In order to ensure the safety of the asset, the user should ensure that the minimum time lock time is long enough, so that the user has sufficient reaction time to respond. At the same time, in order to be able to know the dynamic of the wallet at any time, the user can use the client to listen to the contract events at any time. In order to achieve higher security, the user can even use a one-time hot wallet address, generate the latest private key or contract every time the asset needs to be transferred out, and then transfer the asset into the hot wallet address, so as to avoid the previous hot wallet address private key being stolen by the hacker after use.

[0104] Embodiment two

[0105] Figure 9 The structure diagram of the smart contract-based blockchain asset protection device 900 provided for an embodiment of the present specification is shown. Please refer to Figure 9 In an embodiment, the smart contract-based blockchain asset protection device 900 comprises:

[0106] The first module 901 is capable of creating and deploying a smart contract for blockchain asset protection; wherein the variables of the smart contract at least include a time lock and / or a hot wallet address, the time lock is used to set the duration of the to-be-taken-out blockchain asset, and the hot wallet address is used to specify the address receiving the unlocked blockchain asset; the methods of the smart contract at least include storing, unlocking, taking out, restoring, and / or setting a time lock for the blockchain asset.

[0107] The second module 902 is capable of calling the storage method of the smart contract to save the blockchain asset to be protected to the smart contract.

[0108] The third module 903 is capable of calling the unlocking method of the smart contract to mark the blockchain asset as to be taken out when the user intends to take out the blockchain asset.

[0109] The fourth module 904 is capable of calling the taking-out method of the smart contract to transfer the blockchain asset to be taken out to the hot wallet address when the time lock expires.

[0110] The fifth module 905 is capable of calling the asset recovery method of the smart contract to reset the blockchain asset to be taken out to the locked state.

[0111] The second implementation scheme of the blockchain asset protection device based on the smart contract is provided in the embodiment, as shown in Figure 10 The second implementation scheme of the blockchain asset protection device based on the smart contract is provided in the embodiment, as shown in

[0112] The sixth module 906 is capable of calling the hot wallet address updating method of the smart contract to update the hot wallet address to a new address.

[0113] It should be understood that the blockchain asset protection device based on the smart contract in the embodiment of the present specification can also execute the method performed by the blockchain asset protection device based on the smart contract in the Figures 1 to 8 The blockchain asset protection device based on the smart contract (or equipment) executes the method, and realizes the functions of the blockchain asset protection device based on the smart contract (or equipment) in the example shown in Figures 1 to 8 The functions of the blockchain asset protection device based on the smart contract (or equipment) in the example shown in

[0114] Embodiment Three

[0115] Figure 11 is a structural schematic diagram of an electronic device of an embodiment of the present specification. Please refer to Figure 11 At the hardware level, the electronic device includes a processor, and optionally further includes an internal bus, a network interface, and a memory. The memory can include a memory such as a high-speed random-access memory (RAM), and can also include a non-volatile memory such as at least one disk memory. Of course, the electronic device can also include other hardware required by the business.

[0116] The processor, the network interface and the memory can be connected with each other through an internal bus, which can be an ISA (Industry Standard Architecture) bus, a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 11 Only one bidirectional arrow is used to represent the bus, but it does not mean that there is only one bus or only one type of bus.

[0117] The memory is used to store programs. Specifically, the program can include program code, which includes computer operation instructions. The memory can include internal memory and non-volatile memory, and provide instructions and data for the processor.

[0118] The processor reads the corresponding computer program from the non-volatile memory into the memory and then runs, and forms a shared resource access control device at a logical level. The processor executes the program stored in the memory, and is specifically used for executing the following operations:

[0119] Creating and deploying a smart contract for blockchain asset protection; wherein the variables of the smart contract at least include a time lock and / or a hot wallet address, the time lock is used to set the duration of the blockchain asset to be taken out, and the hot wallet address is used to specify the address receiving the unlocked blockchain asset; the methods of the smart contract at least include storage, unlocking, taking out, recovery operation and / or setting time lock of the blockchain asset;

[0120] Calling the storage method of the smart contract to save the blockchain asset to be protected to the smart contract;

[0121] When the user intends to take out the blockchain asset, the unlocking method of the smart contract is called to mark the blockchain asset as to be taken out;

[0122] When the time lock expires, the taking out method of the smart contract is called to transfer the blockchain asset to be taken out to the hot wallet address;

[0123] When the user intends to stop taking out the blockchain asset before the time lock expires, the recovery method of the smart contract is called to reset the blockchain asset to be taken out to a locked state.

[0124] The above as described in the specification Figures 1 to 8The smart contract-based blockchain asset protection method disclosed by the embodiment can be applied to a processor or implemented by the processor. The processor can be an integrated circuit chip with signal processing capability. In the implementation process, each step of the above method can be completed by integrated logic circuits of hardware in the processor or instructions in the form of software. The above processor can be a general processor, including a central processing unit (CPU), a network processor (NP), etc.; or a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. Each method, step and logic block disclosed in the embodiments of the present specification can be implemented or executed. The general processor can be a microprocessor or any conventional processor. The steps of the method disclosed in combination with the embodiments of the present specification can be directly embodied as a hardware decoding processor for execution, or a combination of hardware and software modules in the decoding processor for execution. The software module can be located in a random access memory, a flash memory, a read-only memory, a programmable read-only memory or an electrically erasable programmable memory, a register or other mature storage media in the art. The storage medium is located in the memory, and the processor reads the information in the memory and combines the hardware to complete the steps of the above method.

[0125] Of course, in addition to the software implementation, the electronic device of the embodiments of the present specification does not exclude other implementation manners, such as logic devices or a combination of software and hardware, etc., that is, the execution subject of the following processing flow is not limited to each logic unit, but can also be hardware or logic devices.

[0126] Embodiment four

[0127] The embodiments of the present specification also propose a computer readable storage medium storing one or more programs, the one or more programs including instructions capable of causing the portable electronic device including a plurality of application programs to execute the following methods when the instructions are executed by the portable electronic device: Figures 1 to 8 The method of the embodiment, and specifically for executing the following methods:

[0128] create and deploy a smart contract for blockchain asset protection; wherein variables of the smart contract include at least a time lock and / or a hot wallet address, the time lock is used to set a duration for the blockchain asset to be taken out, and the hot wallet address is used to specify an address receiving the unlocked blockchain asset; methods of the smart contract include at least storing, unlocking, taking out, recovering, and / or setting a time lock for the blockchain asset;

[0129] invoke the storage method of the smart contract to save the blockchain asset to be protected to the smart contract;

[0130] When a user intends to take out the blockchain asset, the unlocking method of the smart contract is invoked to mark the blockchain asset as to be taken out;

[0131] When the time lock expires, the taking out method of the smart contract is invoked to transfer the blockchain asset to be taken out to the hot wallet address;

[0132] When the user intends to stop taking out the blockchain asset before the time lock expires, the recovery method of the smart contract is invoked to reset the blockchain asset to be taken out to a locked state.

[0133] In summary, the above only describes preferred embodiments of the present specification, and is not used to limit the protection scope of the present specification. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present specification shall be included in the protection scope of the present specification.

[0134] The systems, devices, modules or units illustrated by the above embodiments can be specifically implemented by a computer chip or entity, or by a product with certain functions. A typical implementation device is a computer. Specifically, the computer may, for example, be a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.

[0135] Computer-readable media includes permanent and non-permanent, movable and non-movable media that can be implemented by any method or technology to store information. The information can be computer-readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassette, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information accessible by a computing device. According to the definition herein, computer-readable media does not include transitory media such as modulated data signals and carriers.

[0136] It should also be noted that the terms "comprising", "containing", or any other variant thereof are intended to cover non-exclusive inclusions, so that a process, method, article or apparatus that includes a list of elements does not only include those elements, but also includes other elements not explicitly listed, or inherent to such a process, method, article or apparatus. Without more limitations, the element defined by the statement "comprising a" does not exclude the presence of additional identical elements in the process, method, article or apparatus that includes the element.

[0137] Each of the embodiments in the specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other. Each embodiment focuses on the difference from other embodiments. In particular, for system embodiments, since they are basically similar to method embodiments, the description is relatively simple, and the relevant parts can be referred to the part of the method embodiment.

Claims

1. A smart contract-based blockchain asset protection method, characterized in that, The method comprises: creating and deploying a smart contract for blockchain asset protection, wherein variables of the smart contract comprise at least a time lock and / or a hot wallet address, the time lock is used to set a duration for which the blockchain asset is to be taken out, and the hot wallet address is used to specify an address that receives the unlocked blockchain asset; methods of the smart contract comprise at least a storage operation, an unlocking operation, a taking-out operation, a recovery operation, and / or a time lock setting operation on the blockchain asset; calling the storage operation of the smart contract to save the blockchain asset to be protected to the smart contract; when a user intends to take out the blockchain asset, calling the unlocking operation of the smart contract to mark the blockchain asset as to be taken out; when the time lock expires, calling the taking-out operation of the smart contract to transfer the blockchain asset to be taken out to the hot wallet address; when the user intends to stop taking out the blockchain asset before the time lock expires, calling the recovery operation of the smart contract to reset the blockchain asset to be taken out to a locked state; variables of the smart contract further comprise an asset type, a transfer public key, a recovery public key, a minimum time lock, and / or a taking-out time, and the process of creating and deploying the smart contract for blockchain asset protection comprises: generating a transfer private key and a recovery private key and backing them up respectively; initializing the asset type, the transfer public key, the recovery public key, the time lock, the minimum time lock, the hot wallet address, and a hot wallet private key; wherein the time lock is equal to the minimum time lock, and the hot wallet address comprises a smart contract address or a public key address generated by a private key; the method further comprises: calling a hot wallet address updating operation of the smart contract to update the hot wallet address to a new address; wherein the process of calling the hot wallet address updating operation comprises: verifying a signature of the recovery private key; updating the hot wallet address to a new hot wallet address; sending a hot wallet address updating event message to enable a blockchain external listener to process a transaction processing result corresponding to the hot wallet address updating. 2.The smart contract based blockchain asset protection method of claim 1, wherein, the process of calling the storage operation of the smart contract comprises: verifying an asset type of the blockchain asset; and saving the blockchain asset satisfying the asset type to the smart contract and marking it as a locked asset. 3.The smart contract based blockchain asset protection method of claim 1, wherein, the process of calling the time lock setting operation of the smart contract comprises: setting a taking-out time as a current block time plus a duration corresponding to the time lock. 4.The smart contract-based blockchain asset protection method of claim 3, wherein, the process of calling the unlocking operation of the smart contract comprises: verifying a signature of the transfer private key; obtaining the blockchain asset to be unlocked and a quantity thereof; if the corresponding quantity of the blockchain asset to be unlocked is a locked asset, marking a state of the blockchain asset as a to-be-taken-out asset; calling the time lock setting operation of the smart contract to update the taking-out time; sending an unlocking event message to enable a blockchain external listener to process a transaction processing result corresponding to the unlocking. 5.The smart contract based blockchain asset protection method of claim 1, wherein, the process of calling the taking-out operation of the smart contract comprises: verifying a signature of the transfer private key; When the set withdrawal time is met, the asset to be withdrawn is transferred to the hot wallet address; A withdrawal event message is sent to enable external blockchain to listen to the withdrawal transaction processing result. 6.The smart contract based blockchain asset protection method of claim 1, wherein, The process of calling the recovery operation of the smart contract includes: Verifying the signature of the recovery private key and the signature of the transfer private key; Resetting the blockchain asset to be withdrawn to a locked state; An asset recovery event message is sent to enable external blockchain to listen to the asset recovery transaction processing result. 7.A smart contract-based blockchain asset protection apparatus, characterized by, Comprise: A first module capable of creating and deploying a smart contract for blockchain asset protection; wherein the variables of the smart contract at least include a time lock and / or a hot wallet address, the time lock is used to set the duration of the blockchain asset to be withdrawn, and the hot wallet address is used to specify the address receiving the unlocked blockchain asset; the methods of the smart contract at least include storage operation, unlocking operation, withdrawal operation, recovery operation and / or setting time lock operation on the blockchain asset; A second module capable of calling the storage operation of the smart contract to save the blockchain asset to be protected to the smart contract; A third module capable of calling the unlocking operation of the smart contract when a user intends to withdraw the blockchain asset, so as to mark the blockchain asset as to be withdrawn; A fourth module capable of calling the withdrawal operation of the smart contract when the time lock expires, so as to transfer the blockchain asset to be withdrawn to the hot wallet address; A fifth module capable of calling the recovery operation of the smart contract when a user intends to stop withdrawing the blockchain asset before the time lock expires, so as to reset the blockchain asset to be withdrawn to a locked state; The variables of the smart contract further include asset type, transfer public key, recovery public key, minimum time lock and / or withdrawal time, and the first module is further used for: Generating a transfer private key and a recovery private key and saving them respectively; Initializing the asset type, the transfer public key, the recovery public key, the time lock, the minimum time lock, the hot wallet address and the hot wallet private key; wherein the time lock is equal to the minimum time lock, and the hot wallet address includes a smart contract address or a public key address generated by a private key; The device further comprises: A sixth module capable of calling the hot wallet address update operation of the smart contract to update the hot wallet address to a new address; wherein the process of calling the hot wallet address update operation includes: Verifying the signature of the recovery private key; Updating the hot wallet address to a new hot wallet address; Sending a hot wallet address update event message to enable external blockchain to listen to the hot wallet address update transaction processing result.

8. An electronic device, comprising: Comprise: A processor; And A memory arranged to store computer executable instructions that, when executed, cause the processor to perform the blockchain asset protection method of the smart contract of any one of claims 1 to 6.

9. A computer-readable storage medium, characterized in that, The computer readable storage medium stores one or more programs, which when executed by an electronic device comprising a plurality of application programs, cause the electronic device to perform the blockchain asset protection method of the smart contract of any one of claims 1 to 6.

Citation Information

Patent Citations

  • Block chain asset cross-chain transaction method

    CN113538150A

  • System and method for blockchain operation

    CN114207643A