A blockchain-based cash withdrawal method, system, device, and storage medium.
By having users pay their own transaction fees, the system solves the problem of low withdrawal efficiency caused by service providers charging transaction fees, thus achieving a more efficient withdrawal process.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- NETEASE (HANGZHOU) NETWORK CO LTD
- Filing Date
- 2023-02-07
- Publication Date
- 2026-05-26
AI Technical Summary
In the blockchain field, when users apply to withdraw NFT/ERC20 tokens, the service provider cannot directly collect the transaction fee, so users need to first deposit the corresponding number of tokens with the service provider as a transaction fee, which reduces the efficiency of withdrawal.
Users initiate withdrawal transactions and pay the transaction fees themselves. The transaction service provider sends the transaction data with the administrator's signature to the blockchain wallet. The blockchain wallet signs the data and sends it to the smart contract. The smart contract verifies the transaction data item by item, and transfers the target amount from the user's account assets once all conditions are met.
This solves the problem of low withdrawal efficiency caused by service provider fees, and the method of users paying the fees themselves improves withdrawal efficiency.
Smart Images

Figure CN116012018B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of blockchain technology, and more specifically, to a blockchain-based withdrawal method, system, device, and storage medium. Background Technology
[0002] In the blockchain field, the current withdrawal method is as follows: the user initiates a withdrawal request, the service provider actively transfers the requested tokens to the user, and after the transfer is completed, the service provider publishes the transfer transaction on the blockchain and charges the user a certain transaction fee.
[0003] With this withdrawal method, since the transaction is published on the blockchain by the service provider, the service provider needs to collect a fee from the user first, and then transfer the collected fee to the blockchain. Specifically, when the user requests to withdraw NFT (Non-Fungible Token) / ERC (Ethereum Request for Comment) 20 tokens, if the user's account does not contain NFT / ERC20 tokens, the service provider cannot directly collect the fee from the user. This forces the user to first deposit the corresponding amount of NFT / ERC20 tokens into the address provided by the service provider as a fee, thus reducing the user's withdrawal efficiency. Summary of the Invention
[0004] In view of this, the purpose of this application is to provide a blockchain-based withdrawal method, system, device and storage medium, which solves the problem of reduced withdrawal efficiency caused by service providers charging transaction fees by allowing users to initiate withdrawal transactions themselves and pay the transaction fees themselves.
[0005] To make the above-mentioned objectives, features and advantages of this application more apparent and understandable, preferred embodiments are described below in detail with reference to the accompanying drawings.
[0006] In a first aspect, embodiments of this application provide a blockchain-based withdrawal method, the withdrawal method comprising:
[0007] In response to a user's withdrawal request, the transaction service provider sends first transaction data, carrying the administrator's signature of the transaction service provider, to the user's blockchain wallet; wherein, the first transaction data represents the transaction data used to complete the withdrawal request;
[0008] In response to the user's confirmation to sign the received first transaction data, the blockchain wallet sends the first transaction data carrying the user's signature as the second transaction data to the user's smart contract.
[0009] The smart contract verifies each withdrawal condition by checking whether the received second transaction data meets the withdrawal conditions. After determining that the second transaction data meets all the withdrawal conditions, the smart contract transfers a target amount of account assets from the user's pre-stored account assets to the blockchain wallet. The target amount is the same as the withdrawal amount included in the withdrawal request.
[0010] Secondly, embodiments of this application provide a blockchain-based withdrawal system, the withdrawal system comprising:
[0011] The transaction service provider, in response to a user's withdrawal request, sends first transaction data carrying the administrator's signature of the transaction service provider to the user's blockchain wallet; wherein, the first transaction data represents the transaction data used to complete the withdrawal request;
[0012] The blockchain wallet is used to respond to the user's confirmation to sign the received first transaction data, and send the first transaction data carrying the user's signature as second transaction data to the user's smart contract;
[0013] The smart contract is used to verify each withdrawal condition by the received second transaction data, so that after determining that the second transaction data meets all the withdrawal conditions, it transfers a target amount of account assets from the user's pre-stored account assets to the blockchain wallet; wherein the target amount is the same as the withdrawal amount included in the withdrawal application.
[0014] Thirdly, embodiments of this application provide a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of the above-described blockchain-based withdrawal method.
[0015] Fourthly, embodiments of this application provide a computer-readable storage medium storing a computer program, which, when executed by a processor, performs the steps of the aforementioned blockchain-based withdrawal method.
[0016] The technical solutions provided by the embodiments of this application may include the following beneficial effects:
[0017] This application provides a blockchain-based withdrawal method, system, device, and storage medium. In response to a user's withdrawal request, the transaction service provider sends first transaction data, bearing the administrator's signature, to the user's blockchain wallet. The blockchain wallet, in response to the user's confirmation of signing the received first transaction data, sends the first transaction data bearing the user's signature as second transaction data to the user's smart contract. The smart contract verifies each withdrawal condition of the received second transaction data item by item. Once it is determined that the second transaction data meets all withdrawal conditions, the target amount of account assets is transferred from the user's pre-deposited account assets to the blockchain wallet. Thus, this application solves the problem of reduced withdrawal efficiency caused by service provider fees by having the user initiate the withdrawal transaction and pay the transaction fee themselves. Attached Figure Description
[0018] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of this application and should not be regarded as a limitation of the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0019] Figure 1 A schematic flowchart of a blockchain-based withdrawal method provided in an embodiment of this application is shown.
[0020] Figure 2 This document illustrates a flowchart of a method for a transaction service provider to obtain an administrator's signature, as provided in an embodiment of this application.
[0021] Figure 3 This illustration shows a flowchart of a method for verifying the transaction initiation address of a withdrawal request, as provided in an embodiment of this application.
[0022] Figure 4 This illustration shows a flowchart of a method for verifying the administrator signature of a transaction service provider according to an embodiment of this application;
[0023] Figure 5 The illustration shows a flowchart of a method for verifying a user's withdrawal random number on the blockchain, according to an embodiment of this application.
[0024] Figure 6 A flowchart illustrating a method for verifying the height of a target block according to an embodiment of this application is shown.
[0025] Figure 7This illustration shows a flowchart of a method for monitoring the target block height before the withdrawal application ends, according to an embodiment of this application.
[0026] Figure 8 A schematic diagram of the structure of a blockchain-based withdrawal system provided in an embodiment of this application is shown;
[0027] Figure 9 This is a schematic diagram of the structure of an electronic device 900 provided in an embodiment of this application. Detailed Implementation
[0028] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. It should be understood that the accompanying drawings in this application are for illustrative and descriptive purposes only and are not intended to limit the scope of protection of this application. Furthermore, it should be understood that the schematic drawings are not drawn to scale. The flowcharts used in this application illustrate operations implemented according to some embodiments of this application. It should be understood that the operations in the flowcharts may not be implemented in sequence, and steps without logical contextual relationships may be reversed or implemented simultaneously. In addition, those skilled in the art, guided by the content of this application, may add one or more other operations to the flowcharts, or remove one or more operations from the flowcharts.
[0029] Furthermore, the described embodiments are merely some, not all, of the embodiments of this application. The components of the embodiments of this application described and illustrated herein can typically be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of this application provided in the accompanying drawings is not intended to limit the scope of the claimed application, but merely to illustrate selected embodiments of the application. All other embodiments obtained by those skilled in the art based on the embodiments of this application without inventive effort are within the scope of protection of this application.
[0030] It should be noted that the term "comprising" will be used in the embodiments of this application to indicate the presence of the features declared thereafter, but does not exclude the addition of other features.
[0031] In the blockchain field, under the current withdrawal method, since the transaction is published on the blockchain by the service provider, the service provider needs to collect a transaction fee from the user first, and then transfer the collected transaction fee to the blockchain. In particular, when the tokens requested by the user for withdrawal are NFT (Non-Fungible Token) / ERC (Ethereum Request for Comment) 20 tokens, if the user's account does not have NFT / ERC20 tokens, the service provider cannot directly collect the transaction fee from the user. This forces the user to first deposit the corresponding amount of NFT / ERC20 tokens to the address provided by the service provider as a transaction fee, which reduces the user's withdrawal efficiency.
[0032] Based on this, the embodiments of this application provide a blockchain-based withdrawal method, system, device, and storage medium, which solves the problem of reduced withdrawal efficiency caused by service providers charging transaction fees by having users initiate withdrawal transactions themselves and pay the transaction fees themselves.
[0033] The following is a detailed description of a blockchain-based withdrawal method, apparatus, device, and storage medium provided in the embodiments of this application.
[0034] Reference Figure 1 As shown, Figure 1 The diagram illustrates a flowchart of a blockchain-based withdrawal method provided in an embodiment of this application. The withdrawal method includes steps S101-S103; specifically:
[0035] S101, in response to the user's withdrawal request, the transaction service provider sends the first transaction data, carrying the administrator's signature of the transaction service provider, to the user's blockchain wallet.
[0036] S102, in response to the user's confirmation to sign the received first transaction data, the blockchain wallet sends the first transaction data carrying the user's signature as second transaction data to the user's smart contract.
[0037] S103, the smart contract verifies each withdrawal condition by checking whether the received second transaction data meets each withdrawal condition, so that after determining that the second transaction data meets all the withdrawal conditions, it transfers the target amount of account assets from the user's pre-stored account assets to the blockchain wallet.
[0038] The blockchain-based withdrawal method provided in this application involves the following steps: In response to a user's withdrawal request, the transaction service provider sends first transaction data, bearing the administrator's signature, to the user's blockchain wallet. The blockchain wallet, in response to the user's confirmation of signing the received first transaction data, sends the first transaction data bearing the user's signature as second transaction data to the user's smart contract. The smart contract verifies each withdrawal condition of the received second transaction data, and after determining that the second transaction data meets all withdrawal conditions, transfers the target amount of account assets from the user's pre-deposited account assets to the blockchain wallet. Thus, this application solves the problem of reduced withdrawal efficiency caused by service provider fees by having the user initiate the withdrawal transaction and pay the transaction fee themselves.
[0039] The following is an exemplary description of each step in the blockchain-based withdrawal method provided in the embodiments of this application:
[0040] S101, in response to the user's withdrawal request, the transaction service provider sends the first transaction data, carrying the administrator's signature of the transaction service provider, to the user's blockchain wallet.
[0041] Here, the aforementioned transaction service provider may include: the target DAPP (decentralization application) application and the service provider backend corresponding to the target DAPP application; wherein, the aforementioned first transaction data represents the transaction data used to complete the withdrawal application.
[0042] Specifically, in response to a user's withdrawal request, the target DApp assembles the transaction data used to complete the withdrawal request to obtain the first transaction data. While assembling the transaction data, the target DApp also requests the administrator's signature from the service provider's backend to send the first transaction data carrying the administrator's signature to the user's blockchain wallet.
[0043] Here, in addition to the administrator signature of the transaction service provider, the first transaction data may also include: the transaction initiation address of the withdrawal request, the withdrawal amount in the withdrawal request (including the type of token to be withdrawn and the token data to be withdrawn), the withdrawal interface definition of the smart contract, the block height for which the administrator signature is valid, the user's withdrawal nonce (random number) on the blockchain, and other transaction data used to complete the withdrawal request; this application embodiment does not limit the specific data content included in the first transaction data.
[0044] It should be noted that since a blockchain wallet is equivalent to the initiator of withdrawal transactions, the transaction initiation address of the aforementioned withdrawal request is also equivalent to the wallet address of the blockchain wallet.
[0045] Specifically, in the process of the transaction service provider responding to the user's withdrawal request, as an optional embodiment, the user can also choose to interrupt the current withdrawal process. In this case, the transaction service provider, upon receiving the user's interruption request for the withdrawal request, can automatically end the response to the withdrawal request. That is, after receiving the user's interruption request for the withdrawal request, the target DAPP application in the transaction service provider will no longer assemble the transaction data, and the service provider's backend in the transaction service provider will no longer provide the transaction service provider's administrator signature.
[0046] In addition, it should be noted that the transaction service provider's backend stores the user's account asset details. During the process of the transaction service provider responding to the user's withdrawal request, the service provider's backend can also query the total amount of account assets currently stored in the smart contract from the user's account asset details. When the total amount of account assets found is less than the withdrawal amount in the withdrawal request, the transaction service provider can also choose to interrupt the current withdrawal process and send the corresponding prompt information to the user through the blockchain wallet to indicate that the user's current account assets are insufficient to support the completion of this withdrawal.
[0047] S102, in response to the user's confirmation to sign the received first transaction data, the blockchain wallet sends the first transaction data carrying the user's signature as second transaction data to the user's smart contract.
[0048] Here, the transaction service provider only stores the user's account asset details. The user's actual account assets are stored in the user's smart contract. The smart contract provides a withdrawal interface, through which the user can withdraw the account assets stored in the smart contract to their own blockchain wallet.
[0049] Specifically, the transaction service provider sends the first transaction data to the blockchain wallet so that the user can confirm the first transaction data to be signed through the blockchain wallet. After the user confirms that the received first transaction data has been signed, the blockchain wallet sends the first transaction data carrying the user's signature (that is, the above-mentioned second transaction data is just the first transaction data with the user's signature added) to the smart contract so that the smart contract can verify whether the received second transaction data meets the withdrawal conditions.
[0050] S103, the smart contract verifies each withdrawal condition by checking whether the received second transaction data meets each withdrawal condition, so that after determining that the second transaction data meets all the withdrawal conditions, it transfers the target amount of account assets from the user's pre-stored account assets to the blockchain wallet.
[0051] Here, the target amount is the same as the withdrawal amount included in the withdrawal application. That is, after the smart contract determines that the second transaction data meets all the withdrawal conditions, it will transfer the same amount of account assets as the withdrawal amount from the user's pre-deposited account assets to the blockchain wallet.
[0052] Specifically, the second transaction data is simply the first transaction data with the user's signature added. For the specific data content included in the second transaction data, please refer to the relevant explanation of the first transaction data in step S101 above. Repeated parts will not be repeated here.
[0053] In this embodiment of the application, in conjunction with the relevant description of the first transaction data in step S101 above, when the smart contract verifies whether the second transaction data meets each withdrawal condition, it can at least verify whether the data included in the second transaction data, such as the transaction initiation address of the withdrawal application, the administrator signature of the transaction service provider, the user's withdrawal nonce on the blockchain, and the block height where the administrator signature is valid, meet their respective withdrawal conditions. This embodiment of the application does not limit the specific verification order for each withdrawal condition.
[0054] It's important to note that, unlike existing withdrawal methods where transaction services charge users fees (primarily gas fees), this new method involves the user's smart contract simultaneously publishing a successful withdrawal event on the blockchain after transferring the target amount of account assets to the blockchain wallet. At this point, the blockchain will charge the user a separate fee for this withdrawal request. The transaction service provider does not need to charge the user any fees, nor does it need to pay the fees on behalf of the user to the blockchain. This method, where the user initiates the withdrawal transaction and pays the fees themselves, solves the problem of reduced withdrawal efficiency caused by service providers charging fees.
[0055] Specifically, in this embodiment, when a user initiates a withdrawal request, they can pre-set the maximum allowable transaction fee (i.e., gas limit) for this withdrawal. During the execution of steps S101-S103 (i.e., during the withdrawal transaction execution), the blockchain calculates the transaction fee the user currently needs to pay based on the actual computing resources consumed during the withdrawal transaction. When the calculated transaction fee is less than or equal to the user's pre-set gas limit, the blockchain will charge the user the actual calculated transaction fee separately. After the withdrawal transaction ends, the remaining tokens in the gas limit after deducting the charged transaction fee will be returned to the user. This embodiment does not limit how the blockchain separately charges the user the withdrawal fee.
[0056] The specific implementation process of each of the above steps in the embodiments of this application will be described in detail below:
[0057] Regarding the specific implementation process of step S101 above, as follows: Figure 2 As shown, Figure 2 This paper illustrates a flowchart of a method for a transaction service provider to obtain an administrator's signature, according to an embodiment of this application. During step S101, the method includes steps S201-S203; specifically:
[0058] S201, Read the latest block height on the blockchain, and use the sum of the read block height and the first preset number of blocks as the target block height for this signature to be valid.
[0059] Here, block height is the number of blockchains connected to the main chain, that is, the number of blocks connected to the blockchain. Block height can accurately define the position of a block on the blockchain.
[0060] Specifically, the latest block height mentioned above is the number of blocks that can be read on the blockchain at the time of reading. The first preset number of blocks is added to the latest block height, and the result of this addition is used as the target block height. This ensures that the administrator signature obtained in this instance is only valid within the target block height. Since the time corresponding to each additional block on the blockchain is relatively stable, there is a finite time interval between the latest block height being read and the actual block height becoming the target block height. Therefore, the administrator signature obtained in this instance remains valid only within this finite time interval.
[0061] It should be noted that, considering that the block time may be affected by the local time of the block packaging, thus the accuracy of the block time cannot be guaranteed, therefore, in this embodiment of the application, the valid time corresponding to the administrator signature is not directly defined using the specific valid block time (but is indirectly defined through the above-mentioned target block height).
[0062] It should be noted that the number of the first preset blocks can be n. This application embodiment does not limit the specific value of n, that is, the specific value of the number of the first preset blocks.
[0063] For example, if the latest block height read from the blockchain is m, when the first preset number of blocks is n, then m+n blocks are the target block height for this signature to be valid.
[0064] S202, obtain the user's withdrawal random number on the blockchain, and use the sum of the withdrawal random number and the preset step size as the first withdrawal random number.
[0065] Here, the withdrawal random number can be the user's withdrawal nonce on the blockchain. The nonce is a continuous integer. There is a nonce in every transaction initiated by the user. When each user initiates a transaction from the same blockchain node, the nonce starts from 0 and accumulates continuously. Each accumulation represents the completion of a transaction. The next nonce will be processed only after the previous nonce has been processed.
[0066] Based on this, the preset step size can be set to 1. That is, by adding 1 to the obtained withdrawal random number, the first withdrawal random number can be obtained.
[0067] It should be noted that, in the Ethereum system, nonce usually adopts the above-mentioned continuous accumulation update method by default. Therefore, in the preferred embodiment, the above-mentioned preset step size can be 1. In addition, the specific value of the above-mentioned preset step size can also be adjusted according to the actual withdrawal transaction needs. This application embodiment does not limit the specific value of the above-mentioned preset step size.
[0068] S203, based on the target signature algorithm, the smart contract address, the smart contract withdrawal interface definition, the blockchain wallet address, the withdrawal amount, the target block height, and the first withdrawal random number are signed to obtain the administrator signature.
[0069] Here, the target signature algorithm can be a hash signature algorithm or any other available signature algorithm. Hash signature algorithms include, but are not limited to, MD4, MD5, SHA-1 (Secure Hash Algorithm 1), etc. This application embodiment does not limit the specific algorithm type of the target signature algorithm.
[0070] For example, taking the hash signature algorithm, the transaction service provider (specifically, the service provider backend corresponding to the target DAPP application) can hash the contract address of the smart contract, the withdrawal interface definition of the smart contract, the wallet address of the blockchain wallet, the withdrawal amount, the target block height, and the first withdrawal random number, and then use the private key of the admin (i.e., the administrator) to sign it, so as to obtain the above administrator signature.
[0071] Regarding the specific implementation process of step S103 above, without limiting the verification order of each withdrawal condition, different withdrawal conditions can be verified according to the following different optional implementation methods, specifically:
[0072] In one optional implementation, when the smart contract verifies the transaction initiation address of the withdrawal request included in the second transaction data, such as Figure 3 As shown, Figure 3 This illustration shows a flowchart of a method for verifying the transaction initiation address of a withdrawal request according to an embodiment of this application. During the execution of step S103, the method includes steps S301-S303; specifically:
[0073] S301, the smart contract, based on the target signature algorithm, reconstructs the wallet address of the blockchain wallet and the transaction initiation address of the withdrawal request from the second transaction data.
[0074] Here, the target signature algorithm is the same as the target signature algorithm in S203 above, and the repetition will not be repeated here.
[0075] S302, verify whether the wallet address matches the transaction initiation address.
[0076] Here, since the withdrawal request initiated by the user is a withdrawal transaction, and the initiator of a withdrawal transaction is the user's blockchain wallet, the wallet address of the blockchain wallet is both the withdrawal address corresponding to the withdrawal request and the transaction initiation address of the withdrawal request.
[0077] Based on this, smart contracts can verify whether the wallet address on the blockchain matches the transaction initiation address of the withdrawal request. If it is determined that the wallet address does not match the transaction initiation address, the withdrawal process can be interrupted immediately, reducing the transaction risks in the withdrawal process.
[0078] S303, when it is determined that the wallet address matches the transaction initiation address, the system verifies whether the second transaction data meets the next withdrawal condition.
[0079] Here, since the embodiments of this application do not limit the specific verification order of each withdrawal condition, after executing step S303, any one of the following steps S401-S403, steps S501-S503, and steps S601-S603 can be adaptively executed for the verification of withdrawal conditions. In this regard, the embodiments of this application do not impose any limitations.
[0080] In one alternative implementation, when the smart contract verifies the administrator signature of the transaction service provider included in the second transaction data, such as Figure 4 As shown, Figure 4 This illustration shows a flowchart of a method for verifying the administrator signature of a transaction service provider according to an embodiment of this application. During the execution of step S103, the method includes steps S401-S403; specifically:
[0081] S401, the smart contract uses a target signature algorithm to reconstruct the signature address corresponding to the administrator's signature from the second transaction data.
[0082] Here, the target signature algorithm is the same as the target signature algorithm in S203 above, and the repetition will not be repeated here.
[0083] S402, verify whether the signature address matches the administrator address of the transaction service provider.
[0084] Here, since both the second and first transaction data include the administrator's signature of the transaction service provider, the smart contract can verify whether the signature address matches the administrator's address of the transaction service provider based on the signature address corresponding to the restored administrator signature.
[0085] Specifically, if the smart contract determines that the aforementioned signature address does not match the administrator address of the transaction service provider, it can immediately interrupt the withdrawal process, thereby reducing the transaction risks involved in the withdrawal process.
[0086] S403, when it is determined that the signature address matches the administrator address, the system verifies whether the second transaction data meets the next withdrawal condition.
[0087] Here, since the embodiments of this application do not limit the specific verification order of each withdrawal condition, after executing step S403, any one of the verification steps of withdrawal conditions in the above steps S301-S303, the following steps S501-S503, and steps S601-S603 can be adaptively executed. In this regard, the embodiments of this application do not impose any limitations.
[0088] In one alternative implementation, when the smart contract verifies the user's withdrawal nonce on the blockchain included in the second transaction data, such as... Figure 5 As shown, Figure 5 This illustration shows a flowchart of a method for verifying a user's withdrawal random number on a blockchain, according to an embodiment of this application. During step S103, the method includes steps S501-S503; specifically:
[0089] S501, the smart contract uses a target signature algorithm to reconstruct the first withdrawal random number from the second transaction data.
[0090] Here, the target signature algorithm is the same as the target signature algorithm in S203 above, and the repetition will not be repeated here.
[0091] S502, verify whether the first withdrawal random number is valid.
[0092] Here, when verifying the validity of the first withdrawal random number, it is mainly used to verify whether the first withdrawal random number is duplicated with other withdrawal random numbers that the user already has on the blockchain, in order to prevent the double-spending problem (wherein, the double-spending problem refers to the situation where account assets in the same transaction on the blockchain are reused, which can also be called a double-spending attack).
[0093] Specifically, every transaction a user makes on the blockchain has a unique nonce. Therefore, by verifying the validity of the first withdrawal nonce, smart contracts can effectively solve the double-spending problem caused by duplicate withdrawal nonces and reduce transaction risks during withdrawal transactions.
[0094] S503, when the first withdrawal random number is determined to be valid, the second transaction data is verified to see if it meets the next withdrawal condition.
[0095] Here, since the embodiments of this application do not limit the specific verification order of each withdrawal condition, after executing step S503, any one of the verification steps of withdrawal conditions in the above steps S301-S303, steps S401-S403, and the following steps S601-S603 can be adaptively executed. In this regard, the embodiments of this application do not impose any limitations.
[0096] In one optional implementation, when the smart contract verifies the block height (i.e., the aforementioned target block height) for the valid administrator signature, such as Figure 6 As shown, Figure 6 This illustration shows a flowchart of a method for verifying the height of a target block according to an embodiment of this application. During the execution of step S103, the method includes steps S601-S603; specifically:
[0097] S601, the smart contract uses a target signature algorithm to reconstruct the target block height from the second transaction data.
[0098] Here, the target signature algorithm is the same as the target signature algorithm in S203 above, and the repetition will not be repeated here.
[0099] S602, read the current block height on the blockchain and verify whether the current block height is less than or equal to the target block height.
[0100] Here, based on the above steps S201-S203, it can be seen that the target block height is obtained by adding the first preset number of blocks to the latest block height read by the transaction service provider. That is, the administrator signature given by the transaction service provider is only valid in blocks within the target block height.
[0101] Based on this, the smart contract can first read the current block height on the blockchain, and then verify whether the current block height is less than or equal to the target block height given by the transaction service provider. If it is determined that the current block height exceeds the target block height given by the transaction service provider, the smart contract can confirm that the administrator signature given by the transaction service provider for this withdrawal request has expired. At this time, the smart contract can also immediately interrupt the withdrawal process, reducing the transaction risks in the withdrawal process.
[0102] S603, when it is determined that the current block height is less than or equal to the target block height, verify whether the second transaction data meets the next withdrawal condition.
[0103] Here, since the embodiments of this application do not limit the specific verification order of each withdrawal condition, after executing step S603, any one of the above-mentioned steps S301-S303, steps S401-S403, and steps S501-S503 can be adaptively executed. In this regard, the embodiments of this application do not impose any limitations.
[0104] Regarding the specific implementation process of step S103 above, based on the target block height (i.e. the block height where the administrator's signature is valid this time), before the smart contract transfers the target amount of account assets to the blockchain wallet, the transaction service provider can also monitor the unfinished withdrawal application. When it is detected that the latest block height on the blockchain has exceeded the block height where the administrator's signature is valid by a certain number of blocks, the withdrawal process will be interrupted in time, and the corresponding account assets will be returned to the user in a timely manner.
[0105] Based on this, such as Figure 7 As shown, Figure 7 This illustration shows a flowchart of a method for monitoring the target block height before the end of a withdrawal application, according to an embodiment of this application. During step S103, the method includes steps S701-S702; specifically:
[0106] S701, the transaction service provider, in response to detecting that the current block height on the blockchain is greater than the sum of the target block height and the second preset number of blocks, determines that the administrator signature is invalid and sends a target control instruction to the smart contract to terminate the withdrawal application.
[0107] Specifically, based on the relevant explanation of the target block height in step S201 above, when it is detected that the current block height on the blockchain is greater than the sum of the target block height and the second preset number of blocks, it is equivalent to the current block time exceeding the block time corresponding to the second preset number of blocks, based on the valid block time corresponding to the target block height. Therefore, it can be determined that the administrator signature has expired, thereby reducing data security risks.
[0108] Here, the specific value of the second preset block number can be adjusted according to the specific setting requirements of the transaction service provider for the validity of the administrator's signature. This application embodiment does not limit the specific value of the second preset block number.
[0109] For example, taking a second preset block size of 5, the transaction service provider can continuously monitor withdrawal requests that have not yet ended (i.e., no successful withdrawal event has been detected on the blockchain). When the current block height on the blockchain is detected to be greater than the target block height + 5, it can be determined that the administrator signature given for the withdrawal request has expired. At this time, the transaction service provider can interact with the smart contract through off-chain signing and send the target control instruction to the smart contract to prompt the smart contract that the administrator signature of the transaction service provider corresponding to the withdrawal request has expired.
[0110] S702, in response to receiving the target control instruction, the smart contract ends the step of verifying whether the second transaction data meets each withdrawal condition item by item.
[0111] Here, the specific instruction form of the target control command is not limited in this embodiment.
[0112] Specifically, after receiving the aforementioned target control instruction, the smart contract can confirm that the administrator signature provided by the transaction service policy for the withdrawal application has expired. Similar to the situation in step S602 above where the administrator signature has expired, the smart contract can immediately interrupt the withdrawal process, reducing the transaction risks present in the withdrawal transaction.
[0113] After executing steps S101-S103 above, the smart contract is also used to publish the successful withdrawal event corresponding to the withdrawal request on the blockchain according to step a1, specifically:
[0114] Step a1: After transferring the target amount of account assets to the blockchain wallet, the smart contract publishes the withdrawal success event corresponding to the withdrawal request on the blockchain.
[0115] At this point, after detecting the successful withdrawal event, the transaction service provider will automatically end the processing of the withdrawal request according to step b1, specifically:
[0116] Step b1: Upon detecting a successful withdrawal event on the blockchain, the transaction service provider ends the processing of the withdrawal request and subtracts the target amount of account assets from the user's account asset details to keep the account asset details synchronized with the user's pre-stored account assets in the smart contract.
[0117] Based on the withdrawal method provided in this application, in response to a user's withdrawal request, the transaction service provider sends first transaction data carrying the administrator's signature of the transaction service provider to the user's blockchain wallet. In response to the user's confirmation of signing the received first transaction data, the blockchain wallet sends the first transaction data carrying the user's signature as second transaction data to the user's smart contract. The smart contract verifies each withdrawal condition of the received second transaction data item by item. After determining that the second transaction data meets all withdrawal conditions, it transfers the target amount of account assets from the user's pre-deposited account assets to the blockchain wallet. Thus, this application solves the problem of reduced withdrawal efficiency caused by service provider fees by having the user initiate the withdrawal transaction and pay the transaction fee themselves.
[0118] Based on the same inventive concept, this application also provides a withdrawal system corresponding to the above-mentioned blockchain-based withdrawal method. Since the principle of the withdrawal system in this application is similar to that of the above-mentioned blockchain-based withdrawal method in this application, the implementation of the withdrawal system can refer to the implementation of the above-mentioned withdrawal method, and the repeated parts will not be described again.
[0119] Reference Figure 8 As shown, Figure 8 This paper illustrates a schematic diagram of a blockchain-based withdrawal system provided in an embodiment of this application. The withdrawal system includes: a transaction service provider 801, a user's blockchain wallet 802, and a user's smart contract 803; wherein:
[0120] Transaction service provider 801 is used to respond to a user's withdrawal request by sending first transaction data carrying the administrator signature of transaction service provider 801 to the user's blockchain wallet 802; wherein, the first transaction data represents the transaction data used to complete the withdrawal request;
[0121] Blockchain wallet 802 is used to respond to the user's confirmation to sign the received first transaction data, and send the first transaction data carrying the user's signature as second transaction data to the user's smart contract 803;
[0122] Smart contract 803 is used to verify each withdrawal condition by the received second transaction data, so that after determining that the second transaction data meets all the withdrawal conditions, it transfers a target amount of account assets from the user's pre-stored account assets to the blockchain wallet 802; wherein the target amount is the same as the withdrawal amount included in the withdrawal application.
[0123] In one optional implementation, the transaction service provider 801 obtains the administrator's signature using the following method:
[0124] Read the latest block height on the blockchain, and use the sum of the read block height and the first preset number of blocks as the target block height for this signature to be valid;
[0125] Obtain the user's withdrawal random number on the blockchain, and use the sum of the withdrawal random number and a preset step size as the first withdrawal random number;
[0126] Based on the target signature algorithm, the contract address of smart contract 803, the withdrawal interface definition of smart contract 803, the wallet address of the blockchain wallet, the withdrawal amount, the target block height, and the first withdrawal random number are signed to obtain the administrator signature.
[0127] In an optional implementation, when verifying whether the received second transaction data meets each withdrawal condition item by item, smart contract 803 is used to:
[0128] Based on the target signature algorithm, the wallet address of blockchain wallet 802 and the transaction initiation address of the withdrawal request are restored from the second transaction data;
[0129] Verify whether the wallet address matches the transaction initiation address;
[0130] When it is determined that the wallet address matches the transaction initiation address, the second transaction data is verified to see if it meets the next withdrawal condition.
[0131] In an optional implementation, when verifying whether the received second transaction data meets each withdrawal condition item by item, smart contract 803 is used to:
[0132] Based on the target signature algorithm, the signature address corresponding to the administrator's signature is recovered from the second transaction data;
[0133] Verify whether the signature address matches the administrator address of the transaction service provider 801;
[0134] When it is determined that the signature address matches the administrator address, the second transaction data is verified to meet the next withdrawal condition.
[0135] In an optional implementation, when verifying whether the received second transaction data meets each withdrawal condition item by item, smart contract 803 is used to:
[0136] Based on the target signature algorithm, the first withdrawal random number is recovered from the second transaction data;
[0137] Verify whether the first withdrawal random number is valid;
[0138] Once the first withdrawal random number is determined to be valid, the second transaction data is then verified to ensure it meets the next withdrawal condition.
[0139] In an optional implementation, when verifying whether the received second transaction data meets each withdrawal condition item by item, smart contract 803 is used to:
[0140] Based on the target signature algorithm, the target block height is reconstructed from the second transaction data;
[0141] Read the current block height on the blockchain and verify whether the current block height is less than or equal to the target block height;
[0142] When it is determined that the current block height is less than or equal to the target block height, the second transaction data is verified to meet the next withdrawal condition.
[0143] In one optional implementation, after transferring the target amount of account assets to the blockchain wallet 802, the smart contract 803 is further configured to: publish the successful withdrawal event corresponding to the withdrawal request on the blockchain;
[0144] The transaction service provider is also used to: in response to the successful withdrawal event detected on the blockchain, end the processing flow for the withdrawal application, and subtract the target amount of account assets from the user's account asset details, so that the account asset details are synchronized with the account assets pre-stored by the user in smart contract 803.
[0145] In an optional implementation, during the process of the transaction service provider 801 responding to the withdrawal request initiated by the user, the transaction service provider 801 is further configured to: in response to receiving the user's interruption request for the withdrawal request, terminate the response to the withdrawal request.
[0146] In an optional implementation, before the smart contract 803 transfers the target amount of account assets to the blockchain wallet 802, the transaction service provider 801 is further configured to: in response to detecting that the current block height on the blockchain is greater than the sum of the target block height and the second preset number of blocks, determine that the administrator signature is invalid, and send a target control instruction to the smart contract 803 to terminate the withdrawal application.
[0147] Smart contract 803 is also used to: in response to receiving the target control instruction, terminate the step of verifying whether the second transaction data meets each withdrawal condition item by item.
[0148] Based on the withdrawal system provided in this application embodiment, in response to a user's withdrawal request, the transaction service provider sends first transaction data carrying the administrator's signature of the transaction service provider to the user's blockchain wallet; in response to the user's confirmation of signing the received first transaction data, the blockchain wallet sends the first transaction data carrying the user's signature as second transaction data to the user's smart contract; the smart contract verifies each withdrawal condition of the received second transaction data item by item, and after determining that the second transaction data meets all withdrawal conditions, transfers the target amount of account assets from the user's pre-deposited account assets to the blockchain wallet. Thus, this application solves the problem of reduced withdrawal efficiency caused by service provider fees by having the user initiate the withdrawal transaction and pay the transaction fee themselves.
[0149] Figure 9 A schematic diagram of the structure of an electronic device 900 provided in this application embodiment includes: a processor 901, a storage medium 902, and a bus 903. The storage medium 902 stores machine-readable instructions executable by the processor 901. When the electronic device runs a blockchain-based withdrawal method as described in the embodiment, the processor 901 communicates with the storage medium 902 via the bus 903. The processor 901 executes the machine-readable instructions, wherein the processor 901 executes the following steps when executing the machine-readable instructions:
[0150] In response to a user's withdrawal request, the transaction service provider sends first transaction data, carrying the administrator's signature of the transaction service provider, to the user's blockchain wallet; wherein, the first transaction data represents the transaction data used to complete the withdrawal request;
[0151] The blockchain wallet responds to the user's confirmation by signing the received first transaction data, and sends the first transaction data carrying the user's signature as the second transaction data to the user's smart contract;
[0152] The smart contract verifies each withdrawal condition of the received second transaction data item by item. After determining that the second transaction data meets all the withdrawal conditions, the target amount of account assets is transferred from the user's pre-stored account assets to the blockchain wallet. The target amount is the same as the withdrawal amount included in the withdrawal application.
[0153] In an optional implementation, the processor 901 is configured to control the transaction service provider to obtain the administrator signature through the following method:
[0154] Read the latest block height on the blockchain, and use the sum of the read block height and the first preset number of blocks as the target block height for this signature to be valid;
[0155] Obtain the user's withdrawal random number on the blockchain, and use the sum of the withdrawal random number and a preset step size as the first withdrawal random number;
[0156] Based on the target signature algorithm, the smart contract address, the smart contract withdrawal interface definition, the blockchain wallet address, the withdrawal amount, the target block height, and the first withdrawal random number are signed to obtain the administrator signature.
[0157] In an optional implementation, when the smart contract verifies each withdrawal condition by checking whether the received second transaction data meets each withdrawal condition, the processor 901 is configured to:
[0158] The smart contract uses a target signature algorithm to reconstruct the wallet address of the blockchain wallet and the transaction initiation address of the withdrawal request from the second transaction data.
[0159] Verify whether the wallet address matches the transaction initiation address;
[0160] When it is determined that the wallet address matches the transaction initiation address, the second transaction data is verified to see if it meets the next withdrawal condition.
[0161] In an optional implementation, when the smart contract verifies each withdrawal condition by checking whether the received second transaction data meets each withdrawal condition, the processor 901 is configured to:
[0162] The smart contract uses a target signature algorithm to reconstruct the signature address corresponding to the administrator's signature from the second transaction data.
[0163] Verify whether the signature address matches the administrator address of the transaction service provider;
[0164] When it is determined that the signature address matches the administrator address, the second transaction data is verified to meet the next withdrawal condition.
[0165] In an optional implementation, when the smart contract verifies each withdrawal condition by checking whether the received second transaction data meets each withdrawal condition, the processor 901 is configured to:
[0166] The smart contract uses a target signature algorithm to reconstruct the first withdrawal random number from the second transaction data.
[0167] Verify whether the first withdrawal random number is valid;
[0168] Once the first withdrawal random number is determined to be valid, the second transaction data is then verified to ensure it meets the next withdrawal condition.
[0169] In an optional implementation, when the smart contract verifies each withdrawal condition by checking whether the received second transaction data meets each withdrawal condition, the processor 901 is configured to:
[0170] The target block height is reconstructed from the second transaction data using the smart contract based on the target signature algorithm.
[0171] Read the current block height on the blockchain and verify whether the current block height is less than or equal to the target block height;
[0172] When it is determined that the current block height is less than or equal to the target block height, the second transaction data is verified to meet the next withdrawal condition.
[0173] In an alternative implementation, the processor 901 is further configured to:
[0174] After transferring the target amount of account assets to the blockchain wallet, the smart contract publishes the successful withdrawal event corresponding to the withdrawal request on the blockchain;
[0175] Upon receiving a successful withdrawal event on the blockchain, the transaction service provider terminates the processing of the withdrawal request and subtracts the target amount of account assets from the user's account asset details to keep the account asset details synchronized with the user's pre-stored account assets in the smart contract.
[0176] In an optional implementation, during the process of the transaction service provider responding to the user's withdrawal request, the processor 901 is further configured to:
[0177] The transaction service provider responds to the user's interruption request for the withdrawal request by ending the response to the withdrawal request.
[0178] In an optional implementation, before the smart contract transfers the target amount of account assets to the blockchain wallet, the processor 901 is further configured to:
[0179] The transaction service provider, upon detecting that the current block height on the blockchain is greater than the sum of the target block height and the second preset number of blocks, determines that the administrator signature is invalid and sends a target control instruction to the smart contract to terminate the withdrawal request.
[0180] Upon receiving the target control instruction, the smart contract terminates the step of verifying each withdrawal condition of the second transaction data.
[0181] Based on the electronic device 900 provided in this application embodiment, in response to a user's withdrawal request, the transaction service provider sends first transaction data carrying the administrator's signature of the transaction service provider to the user's blockchain wallet; in response to the user's confirmation of signing the received first transaction data, the blockchain wallet sends the first transaction data carrying the user's signature as second transaction data to the user's smart contract; the smart contract verifies each withdrawal condition of the received second transaction data item by item, and after determining that the second transaction data meets all withdrawal conditions, transfers the target amount of account assets from the user's pre-deposited account assets to the blockchain wallet. Thus, this application solves the problem of reduced withdrawal efficiency caused by service provider fees by having the user initiate the withdrawal transaction and pay the transaction fee themselves.
[0182] Based on the same inventive concept, embodiments of this application also provide a computer-readable storage medium storing a computer program, which is executed by a processor, wherein the processor performs the following steps:
[0183] In response to a user's withdrawal request, the transaction service provider sends first transaction data, carrying the administrator's signature of the transaction service provider, to the user's blockchain wallet; wherein, the first transaction data represents the transaction data used to complete the withdrawal request;
[0184] The blockchain wallet responds to the user's confirmation by signing the received first transaction data, and sends the first transaction data carrying the user's signature as the second transaction data to the user's smart contract;
[0185] The smart contract verifies each withdrawal condition of the received second transaction data item by item. After determining that the second transaction data meets all the withdrawal conditions, the target amount of account assets is transferred from the user's pre-stored account assets to the blockchain wallet. The target amount is the same as the withdrawal amount included in the withdrawal application.
[0186] In one optional implementation, the processor is configured to control the transaction service provider to obtain the administrator's signature through the following method:
[0187] Read the latest block height on the blockchain, and use the sum of the read block height and the first preset number of blocks as the target block height for this signature to be valid;
[0188] Obtain the user's withdrawal random number on the blockchain, and use the sum of the withdrawal random number and a preset step size as the first withdrawal random number;
[0189] Based on the target signature algorithm, the smart contract address, the smart contract withdrawal interface definition, the blockchain wallet address, the withdrawal amount, the target block height, and the first withdrawal random number are signed to obtain the administrator signature.
[0190] In an optional implementation, when the smart contract verifies each withdrawal condition by checking whether the received second transaction data meets each withdrawal condition, the processor is configured to:
[0191] The smart contract uses a target signature algorithm to reconstruct the wallet address of the blockchain wallet and the transaction initiation address of the withdrawal request from the second transaction data.
[0192] Verify whether the wallet address matches the transaction initiation address;
[0193] When it is determined that the wallet address matches the transaction initiation address, the second transaction data is verified to see if it meets the next withdrawal condition.
[0194] In an optional implementation, when the smart contract verifies each withdrawal condition by checking whether the received second transaction data meets each withdrawal condition, the processor is configured to:
[0195] The smart contract uses a target signature algorithm to reconstruct the signature address corresponding to the administrator's signature from the second transaction data.
[0196] Verify whether the signature address matches the administrator address of the transaction service provider;
[0197] When it is determined that the signature address matches the administrator address, the second transaction data is verified to meet the next withdrawal condition.
[0198] In an optional implementation, when the smart contract verifies each withdrawal condition by checking whether the received second transaction data meets each withdrawal condition, the processor is configured to:
[0199] The smart contract uses a target signature algorithm to reconstruct the first withdrawal random number from the second transaction data.
[0200] Verify whether the first withdrawal random number is valid;
[0201] Once the first withdrawal random number is determined to be valid, the second transaction data is then verified to ensure it meets the next withdrawal condition.
[0202] In an optional implementation, when the smart contract verifies each withdrawal condition by checking whether the received second transaction data meets each withdrawal condition, the processor is configured to:
[0203] The target block height is reconstructed from the second transaction data using the smart contract based on the target signature algorithm.
[0204] Read the current block height on the blockchain and verify whether the current block height is less than or equal to the target block height;
[0205] When it is determined that the current block height is less than or equal to the target block height, the second transaction data is verified to meet the next withdrawal condition.
[0206] In one alternative implementation, the processor is further configured to:
[0207] After transferring the target amount of account assets to the blockchain wallet, the smart contract publishes the successful withdrawal event corresponding to the withdrawal request on the blockchain;
[0208] Upon receiving a successful withdrawal event on the blockchain, the transaction service provider terminates the processing of the withdrawal request and subtracts the target amount of account assets from the user's account asset details to keep the account asset details synchronized with the user's pre-stored account assets in the smart contract.
[0209] In one optional implementation, during the process of the transaction service provider responding to the user's withdrawal request, the processor is further configured to:
[0210] The transaction service provider responds to the user's interruption request for the withdrawal request by ending the response to the withdrawal request.
[0211] In one alternative implementation, before the smart contract transfers the target amount of account assets to the blockchain wallet, the processor is further configured to:
[0212] The transaction service provider, upon detecting that the current block height on the blockchain is greater than the sum of the target block height and the second preset number of blocks, determines that the administrator signature is invalid and sends a target control instruction to the smart contract to terminate the withdrawal request.
[0213] Upon receiving the target control instruction, the smart contract terminates the step of verifying each withdrawal condition of the second transaction data.
[0214] Based on the computer-readable storage medium provided in this application embodiment, in response to a user's withdrawal request, the transaction service provider sends first transaction data carrying the administrator's signature of the transaction service provider to the user's blockchain wallet; in response to the user's confirmation of signing the received first transaction data, the blockchain wallet sends the first transaction data carrying the user's signature as second transaction data to the user's smart contract; the smart contract verifies each withdrawal condition of the received second transaction data item by item, and after determining that the second transaction data meets all withdrawal conditions, transfers the target amount of account assets from the user's pre-deposited account assets to the blockchain wallet. Thus, this application solves the problem of reduced withdrawal efficiency caused by service provider fees by having the user initiate the withdrawal transaction and pay the transaction fee themselves.
[0215] In this embodiment, the computer program, when run by the processor, can also execute other machine-readable instructions to perform the withdrawal methods described in other embodiments. For details on the specific execution steps and principles, please refer to the description of the embodiments, which will not be repeated here.
[0216] In the embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. The apparatus embodiments described above are merely illustrative. For example, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. Furthermore, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Additionally, the displayed or discussed mutual couplings, direct couplings, or communication connections may be through some communication interfaces; indirect couplings or communication connections between devices or units may be electrical, mechanical, or other forms.
[0217] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0218] In addition, the functional units in the embodiments provided in this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.
[0219] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0220] It should be noted that similar labels and letters in the following figures indicate similar items. Therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures. In addition, the terms "first", "second", "third", etc. are used only to distinguish descriptions and should not be construed as indicating or implying relative importance.
[0221] Finally, it should be noted that the above-described embodiments are merely specific implementations of this application, used to illustrate the technical solutions of this application, and not to limit them. The protection scope of this application is not limited thereto. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that any person skilled in the art can still modify or easily conceive of changes to the technical solutions described in the foregoing embodiments, or make equivalent substitutions for some of the technical features, within the scope of the technology disclosed in this application; and these modifications, changes, or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application. All should be covered within the protection scope of this application. Therefore, the protection scope of this application should be determined by the protection scope of the claims.
Claims
1. A blockchain-based withdrawal method, characterized in that, The withdrawal methods include: In response to a user's withdrawal request, the transaction service provider sends first transaction data, carrying the administrator's signature of the transaction service provider, to the user's blockchain wallet; wherein, the first transaction data represents the transaction data used to complete the withdrawal request; In response to the user's confirmation to sign the received first transaction data, the blockchain wallet sends the first transaction data carrying the user's signature as the second transaction data to the user's smart contract. The smart contract verifies each withdrawal condition by checking whether the received second transaction data meets the withdrawal conditions. After determining that the second transaction data meets all the withdrawal conditions, the smart contract transfers a target amount of account assets from the user's pre-stored account assets to the blockchain wallet. The target amount is the same as the withdrawal amount included in the withdrawal application. After transferring the target amount of account assets to the blockchain wallet, the smart contract publishes the withdrawal success event corresponding to the withdrawal request on the blockchain; wherein, in response to the publication of the withdrawal success event, the blockchain separately charges the user the handling fee required for this withdrawal request.
2. The method of claim 1, wherein, The transaction service provider obtains the administrator's signature using the following method: Read the latest block height on the blockchain, and use the sum of the read block height and the first preset number of blocks as the target block height for this signature to be valid; Obtain the user's withdrawal random number on the blockchain, and use the sum of the withdrawal random number and a preset step size as the first withdrawal random number; Based on the target signature algorithm, the smart contract address, the smart contract withdrawal interface definition, the blockchain wallet address, the withdrawal amount, the target block height, and the first withdrawal random number are signed to obtain the administrator signature.
3. The method of claim 1, wherein, The smart contract verifies each withdrawal condition by checking whether the received second transaction data meets the following criteria: The smart contract, based on the target signature algorithm, reconstructs the wallet address of the blockchain wallet and the transaction initiation address of the withdrawal request from the second transaction data; and verifies whether the wallet address matches the transaction initiation address. When it is determined that the wallet address matches the transaction initiation address, the second transaction data is verified to see if it meets the next withdrawal condition.
4. The method of claim 1, wherein, The smart contract verifies each withdrawal condition by checking whether the received second transaction data meets the following criteria: The smart contract uses a target signature algorithm to reconstruct the signature address corresponding to the administrator's signature from the second transaction data. Verify whether the signature address matches the administrator address of the transaction service provider; When it is determined that the signature address matches the administrator address, the second transaction data is verified to meet the next withdrawal condition.
5. The method of claim 2, wherein, The smart contract verifies each withdrawal condition by checking whether the received second transaction data meets the following criteria: The smart contract uses a target signature algorithm to reconstruct the first withdrawal random number from the second transaction data; Verify whether the first withdrawal random number is valid; Once the first withdrawal random number is determined to be valid, the second transaction data is then verified to ensure it meets the next withdrawal condition.
6. The method of claim 2, wherein, The smart contract verifies each withdrawal condition by checking whether the received second transaction data meets the following criteria: The smart contract uses a target signature algorithm to reconstruct the target block height from the second transaction data. Read the current block height on the blockchain and verify whether the current block height is less than or equal to the target block height; When it is determined that the current block height is less than or equal to the target block height, the second transaction data is verified to meet the next withdrawal condition.
7. The method of claim 1, wherein, The withdrawal method also includes: Upon detecting the successful withdrawal event on the blockchain, the transaction service provider terminates the processing of the withdrawal request and subtracts the target amount of account assets from the user's account asset details to keep the account asset details synchronized with the user's pre-stored account assets in the smart contract.
8. The method of claim 1, wherein, During the process of the transaction service provider responding to the user's withdrawal request, the withdrawal method further includes: The transaction service provider, upon receiving the user's interruption request for the withdrawal request, terminates its response to the withdrawal request.
9. The method of claim 2, wherein, Before the smart contract transfers the target amount of account assets to the blockchain wallet, the withdrawal method further includes: The transaction service provider, upon detecting that the current block height on the blockchain is greater than the sum of the target block height and the second preset number of blocks, determines that the administrator signature is invalid and sends a target control instruction to the smart contract to terminate the withdrawal application. Upon receiving the target control instruction, the smart contract terminates the step of verifying each withdrawal condition of the second transaction data.
10. A blockchain-based cash withdrawal system, characterized in that, The withdrawal system includes: The transaction service provider, in response to a user's withdrawal request, sends first transaction data carrying the administrator's signature of the transaction service provider to the user's blockchain wallet; wherein, the first transaction data represents the transaction data used to complete the withdrawal request; The blockchain wallet is used to respond to the user's confirmation to sign the received first transaction data, and send the first transaction data carrying the user's signature as second transaction data to the user's smart contract; The smart contract is used to verify each withdrawal condition by the received second transaction data, so that after determining that the second transaction data meets all the withdrawal conditions, it transfers a target amount of account assets from the user's pre-stored account assets to the blockchain wallet; wherein the target amount is the same as the withdrawal amount included in the withdrawal application. The smart contract is also used to publish the withdrawal success event corresponding to the withdrawal request on the blockchain after transferring the target amount of account assets to the blockchain wallet; wherein, the blockchain is used to collect the handling fee required for this withdrawal request from the user separately in response to the publication of the withdrawal success event.
11. An electronic device, characterized in that, include: The device includes a processor, a memory, and a bus. The memory stores machine-readable instructions executable by the processor. When the electronic device is running, the processor communicates with the memory via the bus. When the machine-readable instructions are executed by the processor, they perform the steps of the withdrawal method as described in any one of claims 1 to 9.
12. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, performs the steps of the withdrawal method as described in any one of claims 1 to 9.