Processing Method, Device, Electronic Device and Storage Medium for Blockchain Digital Assets
By deploying proxy contracts in the blockchain and expanding the reservation function, the problem of digital assets being unable to be repeatedly mortgaged is solved, and the safe and efficient flow of digital assets between different services is achieved, which improves usage rate.
Patent Information
- Application Number
- CN202211606909.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-14
- Publication Date
- 2025-07-25
- Estimated Expiration
- 2042-12-14
AI Technical Summary
Existing blockchain technology cannot support duplicate collateral of digital assets, resulting in a significant restriction of its usage rate and affecting market liquidity.
Deploy proxy contracts in the blockchain, expand multiple reservation functions through proxy contracts to call smart contracts, realize different collateral services for the same digital asset, and transfer the ownership rights when each service agreement is not terminated until all services are completed.
The duplicate mortgage of the same digital asset between different mortgage services is realized, which improves the utilization rate of digital assets and ensures the security of each mortgage service.
Smart Images

Figure CN116128643B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of blockchain technology, and in particular, to a method, apparatus, electronic device, and storage medium for processing blockchain digital assets. Background Art
[0002] A non-fungible token (NFT) is a unique and trustworthy digital rights certificate in a blockchain network. Due to the non-replaceable nature of NFTs, this means that it can be used to represent unique things, such as original paintings, land, game accounts, etc. Therefore, NFTs are also regarded as assets stored in digital form on the blockchain and are called digital assets in this field.
[0003] At present, there are many types of mortgage services for digital assets, such as loans, leases, etc. These mortgage services require users to transfer the ownership of digital assets to the blockchain for safekeeping to ensure the security of service execution.
[0004] In many scenarios, users have reasonable needs to apply for multiple mortgage services for digital assets. For example, a user first applies for a mortgage loan for their digital assets. During the loan period, since the lease of digital assets does not affect the user's repayment of the loan, the user also has the right to lease out their digital assets in exchange for income.
[0005] However, the current blockchain technology does not support the repeated mortgage of digital assets. If a user applies for a mortgage service for digital assets, they need to wait until the termination of the mortgage service before applying for another mortgage service. This has greatly restricted the utilization rate of digital assets and seriously affected the liquidity of digital assets in the market, which is a technical problem that urgently needs to be solved at present. Summary of the Invention
[0006] The purpose of the present application is to provide a method, apparatus, electronic device, and storage medium for processing blockchain digital assets, which can provide different mortgage services for users for target digital assets through blockchain technology under reasonable usage requirements.
[0007] To achieve the above object, the embodiments of the present application are implemented as follows:
[0008] In a first aspect, a method for processing blockchain digital assets is provided, including:
[0009] In response to a request for a first mortgage service initiated by a target user, a first smart contract is deployed in the blockchain, where the first smart contract is used to execute the service agreement of the first mortgage service, the service agreement of the first mortgage service includes first protocol logic for executing a mortgage on the collateral, and the target digital assets of the target user are the collateral for the first mortgage service;
[0010] Submit a first transaction to a blockchain node to run an agent contract execution in the blockchain: configure a first reservation function in the agent contract to call the first smart contract to be extended into a first collateral service function, and set the owner of the target digital asset to the first smart contract so that the first smart contract collateralizes the target digital asset. Wherein, the agent contract includes reservation functions of multiple smart contracts to be configured. After the agent contract is extended to obtain the first collateral service function, the first smart contract is called based on the first collateral service function to execute the service agreement of the first collateral service;
[0011] In response to a request for a second collateral service initiated by a target user, deploy a second smart contract in the blockchain. Wherein, the second smart contract is used to execute the service agreement of the second collateral service, and the service agreement of the second collateral service includes second protocol logic for collateralizing the collateral, and the target digital asset serves as the collateral for the second collateral service;
[0012] Submit a second transaction to a blockchain node to run the agent contract execution in the blockchain: configure a second reservation function in the agent contract to call the second smart contract to be extended into a second collateral service function. Wherein, after the agent contract is extended to obtain the second collateral service function, the second smart contract is called based on the second collateral service function to execute the service agreement of the second collateral service. After the service agreement of the first smart contract terminates, set the owner of the target digital asset to a smart contract whose service agreement called by other collateral service functions in the agent contract has not terminated, so that the smart contract whose service agreement has not terminated collateralizes the target digital asset.
[0013] In a second aspect, a processing device for blockchain digital assets is provided, including:
[0014] A first contract deployment module, which, in response to a request for a first collateral service initiated by a target user, deploys a first smart contract in the blockchain. Wherein, the first smart contract is used to execute the service agreement of the first collateral service, and the service agreement of the first collateral service includes protocol logic for collateralizing the collateral, and the target digital asset of the target user serves as the collateral for the first collateral service;
[0015] The first contract invocation module is used to submit a first transaction to a blockchain node to run an agent contract in the blockchain. The agent contract execution includes: configuring a reserved function in the agent contract to invoke the first smart contract to be extended into a first mortgage service function, and setting the owner of the target digital asset to the first smart contract, so that the first smart contract mortgages the target digital asset. Among them, the agent contract contains multiple reserved functions that can be configured to invoke smart contracts. After the agent contract is extended to obtain the first mortgage service function, the agent contract invokes the first smart contract based on the first mortgage service function to execute the service agreement of the first mortgage service.
[0016] The second contract deployment module is used to deploy a second smart contract in the blockchain in response to a request for a second mortgage service initiated by a target user. Among them, the second smart contract is used to execute the service agreement of the second mortgage service. The service agreement of the second mortgage service includes second protocol logic for mortgaging the collateral. The target digital asset serves as the collateral for the second mortgage service.
[0017] The second contract invocation module is used to submit a second transaction to a blockchain node to run the agent contract in the blockchain. The agent contract execution includes: configuring another reserved function in the agent contract to invoke the second smart contract to be extended into a second mortgage service function. Among them, after the agent contract is extended to obtain the second mortgage service function, the agent contract invokes the second smart contract based on the second mortgage service function to execute the service agreement of the second mortgage service, and after the service agreement of the first smart contract terminates, sets the owner of the target digital asset to a smart contract whose service agreement called by other mortgage service functions in the agent contract has not terminated, so that the smart contract whose service agreement has not terminated mortgages the target digital asset.
[0018] In a third aspect, an embodiment of the present application provides an electronic device, including: a processor; and a memory configured to store computer-executable instructions, where the computer-executable instructions, when executed, cause the processor to execute the method described in the first aspect.
[0019] In a fourth aspect, a computer-readable storage medium is provided, where the computer-readable storage medium is used to store computer-executable instructions, and the computer-executable instructions, when executed by a processor, implement the method described in the first aspect.
[0020] The solution of this application deploys an agency contract in the blockchain. The agency contract includes multiple reserved functions waiting to configure and call smart contracts. The target user can apply for different mortgage services for their target digital assets before and after, so as to deploy a smart contract for executing the corresponding service protocol in the blockchain. At the same time, whenever the blockchain deploys a smart contract for a new mortgage service for the target digital assets, the agency contract is run to configure the newly deployed smart contract for the mortgage service to be called by one of the reserved functions in the agency contract. In this way, the originally unempowered reserved function is extended into a mortgage service function for executing the service protocol of the corresponding mortgage service. It should be understood that the solution of this application can extend multiple mortgage service functions for the target digital assets in the agency contract, so that multiple mortgage services for the target digital assets can be provided for users simultaneously based on the function call function of the agency contract. In addition, the contract logic of the agency contract is also configured to first set the owner of the target digital assets in the smart contract called by the earliest extended mortgage service function, so that the smart contract first mortgages the target digital assets. After the service protocol of the smart contract called by the earliest extended mortgage service function is terminated, the owner of the target digital assets is set to other smart contracts whose service protocols are not terminated, so that other smart contracts can mortgage the target digital assets until there is no smart contract in the agency contract that calls a smart contract with an un-terminated service protocol, and then the ownership of the target digital assets is returned to the target user. That is to say, the agency contract transfers the target digital assets to each smart contract with an un-terminated service protocol for mortgage in a relay manner, and will not return the target digital assets to the target user in advance when all mortgage services are not completed, thus ensuring the service security of each mortgage service. It can be seen that the solution of this application enables the blockchain to support repeated mortgages of the same digital asset for different mortgage services. For users, after applying for a mortgage service for their digital assets, they can apply for another mortgage service without waiting for the termination of the previous mortgage service, thereby improving the utilization rate of digital assets. Brief Description of the Drawings
[0021] In order to more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the following will briefly introduce the drawings required for the description of the embodiments or the prior art. Obviously, the drawings in the following description are only some embodiments recorded in the embodiments of this application. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.
[0022] Figure 1 It is a schematic diagram of the scenario of the method for processing blockchain digital assets in the embodiments of this application.
[0023] Figure 2 It is the first structural schematic diagram of the diamond contract in the embodiments of this application.
[0024] Figure 3 It is a schematic flowchart of a method for processing blockchain digital assets according to an embodiment of the present application.
[0025] Figure 4 It is a second structural schematic diagram of a diamond contract according to an embodiment of the present application.
[0026] Figure 5 It is a structural schematic diagram of a device for processing blockchain digital assets according to an embodiment of the present application.
[0027] Figure 6 It is a structural schematic diagram of an electronic device according to an embodiment of the present application. Detailed implementation manners
[0028] As described above, at the current stage, many types of mortgage services have been developed for digital assets, such as loans, leases, etc. These mortgage services require users to transfer the ownership of digital assets to the blockchain for safekeeping to ensure the security of the services.
[0029] Here, the mortgage process is introduced by taking a loan as an example: First, the user submits a loan application to the business platform. If a loan agreement is reached between the two parties, then the user or the business platform applies to the blockchain to create a smart contract for executing the loan agreement. Among them, a smart contract is an event-driven program that runs on the blockchain and can automatically execute according to preset conditions. The smart contract of the loan agreement can seize the user's digital assets and grant a loan to the user; in addition, after the user repays the loan, the smart contract of the loan agreement returns the digital assets to the user.
[0030] Based on blockchain technology, users cannot apply multiple mortgage services to their digital assets because the smart contracts of each mortgage service have their own digital asset mortgage rules, and once a smart contract is deployed on the blockchain, it cannot be modified. The smart contract created at a previous time cannot adjust the mortgage rules for the smart contract created at a later time, which results in the inability to realize the mortgage and return of digital assets through a reasonable logic when creating smart contracts for multiple mortgage services for a digital asset.
[0031] Here is a simple example for illustration: Suppose a user applies for a loan service for their digital assets. The smart contract of the loan service requires that after the user repays the loan, the mortgaged digital assets be returned to the target user. If the user applies for another loan service during the loan service period, the reasonable situation should be that after the user settles the loan of the previous loan service, the smart contract of the previous loan service transfers the digital assets to the smart contract of the latter loan service for secondary mortgage. However, when the smart contract of the previous loan service was created, it did not know that the user would apply for other loan services later. The logic of its smart contract only returns the digital assets directly to the user after the user settles the loan. This results in the actual situation that after the user settles the loan of the previous loan service, the user directly redeems and obtains their digital assets through the smart contract of the previous loan service. And the smart contract of the latter loan service still provides a loan to the user without mortgaged digital assets, making it impossible to restrain the user from repaying the loan by detaining the digital assets.
[0032] It can be seen that the current blockchain technology does not support the secondary mortgage of digital assets. If a user applies for a mortgage service for digital assets, another mortgage service can only be applied for after the termination of the current mortgage service. This greatly limits the utilization rate of digital assets and seriously affects the liquidity of digital assets in the market.
[0033] Therefore, the purpose of this application is to provide a processing solution for blockchain digital assets, which can provide different mortgage services for users for target digital assets through blockchain technology under reasonable usage requirements.
[0034] Figure 1 The following is a scenario schematic diagram of the processing solution for blockchain digital assets in this application, including: a client, a business platform, and a blockchain. Among them, the client can be the user's personal terminal or an application on the personal terminal. The business platform can refer to a platform that provides digital asset mortgage services. For example, the loan service corresponds to a financial platform, and the NFT avatar rental service corresponds to a metaverse social platform. The blockchain is the issuer and trading platform of digital assets. Users register their original works, land, game accounts, etc. as digital assets through the blockchain for trading in the blockchain. Users can apply for the mortgage service of their target digital assets through the client. After the business platform and the user reach a service agreement for the mortgage service, the business platform or the client deploys the smart contract of the mortgage service in the blockchain, and the smart contract executes the service agreement of the mortgage service.
[0035] Specifically, a proxy contract is set in the blockchain in the solution of this application. The structure of the proxy contract is as Figure 2 shown, mainly including multiple reserved functions ( Figure 2Take n reserved function examples). Each of the reserved functions is used to call a smart contract in the blockchain, that is, according to the call address set in its own configuration parameters, find and run the corresponding smart contract in the blockchain.
[0036] For the scenario of this application, the user can apply for different mortgage services for the target digital asset before and after, so as to deploy the smart contract of the corresponding service protocol in the blockchain. Whenever the blockchain deploys a new smart contract for the mortgage service of the target digital asset, the proxy contract is run to configure the newly deployed smart contract for the mortgage service to be called by one of the reserved functions in the proxy contract. In this way, the originally unempowered reserved function is extended into a mortgage service function that executes the service protocol of the corresponding mortgage service. It should be understood that this application can extend multiple mortgage service functions for the target digital asset in the proxy contract, so that the proxy contract automatically calls the corresponding smart contract based on its respective mortgage service functions to run the service protocol of the smart contract, thereby providing the user with multiple mortgage services for the target digital asset.
[0037] At the same time, the contract logic of the proxy contract is also configured to first set the owner of the target digital asset in the smart contract called by the earliest extended mortgage service function, so that the smart contract first mortgages the target digital asset, and after the service protocol of the smart contract called by the earliest extended mortgage service function terminates, set the owner of the target digital asset to other smart contracts whose service protocols have not terminated, so that other smart contracts can mortgage the target digital asset, until there is no smart contract in the proxy contract that calls a smart contract whose service protocol has not terminated, and then return the ownership of the target digital asset to the target user. That is to say, the proxy contract transfers the target digital asset to each smart contract whose service protocol has not terminated in a relay manner for mortgage, and will not return the target digital asset to the target user in advance when all mortgage services have not ended, thus ensuring the service security of each mortgage service.
[0038] It can be seen that the solution of this application enables the blockchain to support repeated mortgages of the same digital asset for different mortgage services. For users, after applying for a mortgage service for their digital assets, they can apply for another mortgage service without waiting for the termination of the previous mortgage service, thereby improving the utilization rate of digital assets.
[0039] To enable those skilled in the art to better understand the technical solutions in this specification, the technical solutions in the embodiments of the present application will be further described clearly and completely below in conjunction with the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of this specification, rather than all of them. All other embodiments obtained by those of ordinary skill in the art based on the embodiments in this specification without creative efforts shall fall within the scope of protection of this specification.
[0040] Based on Figure 1 the architecture of the shown style scenario, the embodiments of the present application provide a method for processing blockchain digital assets, and this processing method can be executed by Figure 1 the business platform therein. Among them, Figure 3 is a schematic flowchart of the processing method of the embodiments of the present application, which specifically includes the following steps:
[0041] S302, in response to a request for a first mortgage service initiated by a target user, deploy a first smart contract in the blockchain, where the first smart contract is used to execute the service agreement of the first mortgage service, and the service agreement of the first mortgage service includes a first protocol logic for mortgaging the collateral, and the target digital asset of the target user is used as the collateral for the first mortgage service.
[0042] In the present application, the first mortgage service refers to a service that requires mortgaging the digital assets of the target user, such as loan, lease and other services, or it can also be the F-NFT service for fragmenting digital assets (before fragmenting digital assets, the digital assets need to be mortgaged).
[0043] The first smart contract refers to a program that executes the service agreement of the first mortgage service, and the request for the first mortgage service provides the information required for the first smart contract to execute the service agreement of the first mortgage service.
[0044] Here, the first mortgage service is taken as an example of a loan service. The information provided by the first transaction may include the address of the target user's digital wallet and the loan amount. Based on the information provided by the first transaction, the first smart contract can provide a loan to the target user and settle the repayment of the target user; at the same time, the service agreement of the first smart contract specifically includes a first protocol logic for mortgaging the collateral, and the first smart contract mortgages the target digital asset through this first protocol logic. For example: after lending to the target user, mortgage the target digital asset; after the target user repays the loan, release the mortgage of the target digital asset and return the target digital asset to the target user.
[0045] S304. Submit a first transaction to a blockchain node to run an agency contract execution in the blockchain: configure a first reservation function in the agency contract to call the first smart contract to be extended into a first mortgage service function, and set the owner of the target digital asset to the first smart contract so that the first smart contract can mortgage the target digital asset. The agency contract contains reservation functions of multiple smart contracts to be configured. After the agency contract is extended to obtain the first mortgage service function, the first smart contract is called based on the first mortgage service function to execute the service agreement of the first mortgage service.
[0046] It should be noted that in the existing blockchain technology, if you want to run a certain contract in the blockchain, it is requested by submitting a transaction to a blockchain node.
[0047] In this application, the agency contract is deployed in the blockchain by the blockchain node according to the request of the target user for the mortgage service initiated for the first time for the target digital asset. After the blockchain node deploys the agency contract, it will feedback the address of the agency contract to the target user.
[0048] If the first mortgage service is not the mortgage service applied by the target user for the target digital asset for the first time, the first transaction may carry the address of the agency contract provided by the target user in the request for the first mortgage service. In this way, after receiving the first transaction, the blockchain node directly finds and runs the agency contract according to the address of the agency contract in the first transaction; if the first mortgage service is the mortgage service applied by the target user for the target digital asset for the first time, at this time the agency contract has not been created, and the first transaction may not carry the address of the agency contract. After receiving the first transaction, if the blockchain node confirms that the first transaction does not provide the address of the agency contract, it can actively create an agency contract for the target digital asset and deploy it to the blockchain.
[0049] In addition, the first transaction also provides the address of the first smart contract and the corresponding operation identifier. The operation identifier is used to indicate to the agency contract that the address of the first smart contract needs to be set as the call address of one of the reservation functions for this run. After importing the address of the first smart contract and the corresponding operation identifier provided by the first transaction into the agency contract for running, the agency contract can automatically select a reservation function and set its call address to the address of the first smart contract.
[0050] It should be understood that the reservation function whose call address is set to the address of the first smart contract can automatically run the first smart contract according to the call address, so as to execute the service agreement of the first smart contract. At the same time, the agency contract will also set the owner of the target digital asset from the original target user to the first smart contract, so that the first smart contract can mortgage the target digital asset.
[0051] S306. In response to a request for a second mortgage service initiated by a target user, deploy a second smart contract in the blockchain, where the second smart contract is used to execute the service agreement of the second mortgage service. The service agreement of the second mortgage service includes second protocol logic for mortgaging the collateral, and the target digital asset serves as the collateral for the second mortgage service.
[0052] In this application, the request for the second mortgage service is initiated by the target user after obtaining the first mortgage service. The second mortgage service also refers to a service that requires mortgaging the digital assets of the target user, such as loan, lease, etc. In some scenarios, the second mortgage service can be of the same service type as the first mortgage service, but the second mortgage service is different from the first mortgage service.
[0053] Similarly, the second smart contract refers to a program that executes the service agreement of the second mortgage service, and the request for the second mortgage service provides the information required for the second smart contract to execute the service agreement of the second mortgage service.
[0054] Here, taking the second mortgage service as a lease service as an example, the information provided by the second transaction may include the address of the target user's digital wallet, the address of the lessee's digital wallet, the lease amount, and the lease term. Based on the information provided by the second transaction, the second smart contract can generate a lease smart contract for granting the right to use the target digital asset to the lessee during the lease term and settling the lease fee of the target digital asset. At the same time, the service agreement of the second smart contract specifically includes second protocol logic for mortgaging the collateral, and the second smart contract mortgages the target digital asset through this second protocol logic. For example, after setting the right to use the target digital asset for another user for lease, mortgage the target digital asset; after the lease expires, release the mortgage of the target digital asset and return the target digital asset to the target user.
[0055] S308. Submit a second transaction to the blockchain node to run the proxy contract in the blockchain to execute: configure the second reserved function in the proxy contract to call the second smart contract to be extended into a second mortgage service function. After the proxy contract is extended to obtain the second mortgage service function, call the second smart contract based on the second mortgage service function to execute the service agreement of the second mortgage service, and after the service agreement of the first smart contract terminates, set the owner of the target digital asset to the smart contract whose service agreement called by other mortgage service functions in the proxy contract has not terminated, so that the smart contract whose service agreement has not terminated can mortgage the target digital asset.
[0056] In this application, the second transaction provides the address of the second smart contract and the corresponding operation identifier. The operation identifier is used to indicate to the proxy contract that the address of the second smart contract needs to be set as the call address of one of the reserved functions during this run. After importing the address of the second smart contract and the corresponding operation identifier provided by the second transaction into the proxy contract for execution, the proxy contract can automatically select a reserved function and set its call address as the address of the second smart contract.
[0057] Similarly, the reserved function whose call address is set as the address of the second smart contract can automatically run the second smart contract, thereby executing the service agreement of the second smart contract.
[0058] It should be noted that for the second mortgage service, as long as the target user cannot transfer the target digital asset during the effective period of the service agreement, the service security can be ensured. Therefore, it can meet the requirements that the target digital asset is mortgaged in any smart contract of the mortgage service called by the proxy contract.
[0059] That is to say, when the owner of the target digital asset is set as the first smart contract, there is no need to consider whether to mortgage the target digital asset in the second smart contract. After the service agreement of the first smart contract terminates, the proxy contract then sets the owner of the target digital asset from the original first smart contract to the second smart contract to mortgage the target digital asset through the first smart contract. In addition, after the service agreement of the second smart contract also terminates, if the target user has not applied for other mortgage services for the target digital asset, the proxy contract will finally set the owner of the target digital asset back to the target user to complete the return.
[0060] Next, combined with the actual application, the principle of the proxy contract will be introduced in detail.
[0061] Specifically, this application uses a diamond contract to call the smart contracts of each mortgage service corresponding to the target digital asset to execute the service agreements of each mortgage service.
[0062] The diamond contract is a type of proxy contract specified by the Ethereum EIP-2535 protocol. The diamond contract has functions with multiple functions. Among these functions, some functions are implemented by calling the aspect facet contract to achieve the corresponding functions. This application can pre-deploy unempowered facet contracts (unempowered facet contracts have no actual effect) in the blockchain and set a certain number of functions in the diamond contract to call the unempowered facet contracts. Among them, the function that calls the unempowered facet contract is the reserved function described in this application.
[0063] In addition, the current diamond contract also sets up a diamondCut function responsible for contract upgrades of the diamond contract. The diamondCut function has three functions: function addition, function modification, and function deletion. Among them, the function addition function is used to add new functions to the proxy contract; the function deletion function is used to delete functions other than the diamondCut function in the proxy contract; the function modification function is used to modify the address of the facet contract called by the function in the proxy contract. It should be noted here that the function modification function refers to modifying the contract called by the function, rather than modifying the logic in the called smart contract.
[0064] After the target user requests the mortgage service for the target digital asset, this application can submit a transaction to the blockchain node to run the diamond contract. Through the function modification function of the diamondCut function in the diamond contract, the address of the facet contract called by one of the reserved functions is changed to the address of the smart contract of the mortgage service, so that it is extended into the corresponding mortgage service function.
[0065] Here, take the first transaction as an example (the second transaction is the same and will not be elaborated in this article). The first transaction can carry the address of the unempowered facet contract, the identifier of the function modification function of the diamondCut function, and the address of the first smart contract. After receiving the first transaction, the blockchain node retrieves the diamond contract summarized in the blockchain and imports the address of the unempowered facet contract, the operation identifier of the modification operation, and the address of the first smart contract in the first transaction into the diamondCut function. The diamondCut function determines the process of the function modification function that needs to be executed this time according to the operation identifier provided by the first transaction, including: determining the reserved function in the diamond contract whose call address is the same as the address of the facet contract provided by the first transaction, and modifying the call address of the determined reserved function to the address of the first smart contract provided by the first transaction.
[0066] It can be seen that the diamondCut function is the key to the service agreement that enables the diamond contract to perform the mortgage service. To prevent users from maliciously invoking the diamondCut function to delete the mortgage service function in the diamond contract or add functions with illegal functions, this application can further configure the usage permission of the diamondCut function in the diamond contract, so that the diamondCut function is only open to the target user for the function modification function. Any transaction submitted for invoking the diamond contract needs to provide the identifier of the initiator. In this way, when the diamond contract is invoked by a transaction carrying the identifier of the target user, the two functions of function addition and function deletion in the diamondCut function can be closed according to the identifier of the target user, so that the target user can only expand new functions for performing the mortgage service in the diamond contract through the diamondCut function.
[0067] In addition, this application also adds a digital asset management function in the diamond contract to be responsible for setting the owner of the target digital asset. Among them, the digital asset management function has its own execution logic and cannot be invoked through externally submitted transactions. The digital asset management function is configured as follows: after the proxy contract first expands to obtain the mortgage service function, set the owner of the target digital asset to the smart contract called by the first expanded mortgage service function. And, after the smart contract that is the owner of the target digital asset terminates the service agreement, determine whether there are other mortgage service functions in the proxy contract that call smart contracts with un-terminated service agreements; if so, set the owner of the target digital asset to the other mortgage service functions in the smart contract that call smart contracts with un-terminated service agreements; if not, set the owner of the target digital asset to the target user.
[0068] Here, an example is given where the target user applies for the first mortgage service and the second mortgage service for the target digital asset before and after. The first mortgage service is the mortgage service first requested by the target user for the target digital asset. Therefore, the first mortgage service function obtained by the diamond contract's first expansion is the first mortgage service function. The digital asset management function first sets the owner of the target digital asset to the first smart contract called by the first mortgage service function, so that the first smart contract mortgages the target digital asset. When the first smart contract terminates the service agreement, if the second smart contract has not terminated the service agreement at this time, the digital asset management function will then set the owner of the target digital asset to the second smart contract called by the second mortgage service function, so that the second smart contract mortgages the target digital asset; if the second smart contract terminates the service agreement before the first smart contract, the digital asset management function will set the owner of the target digital asset back to the target user.
[0069] The following introduces the application scenario of the method of the embodiment of the present application by taking the client of the target user as the execution subject.
[0070] In this application scenario, after the target user applies for a loan service for the target digital asset, he further applies for a leasing service for the target digital asset. For the corresponding process, refer to Figure 4 As shown, including:
[0071] S1, the target user initiates a loan request for the target digital asset to the business platform through the client. After the loan service agreement is reached, the client requests the blockchain node to deploy a smart contract for executing the loan service agreement (hereinafter collectively referred to as the loan smart contract) and a diamond contract in the blockchain.
[0072] S2, the target user submits the first transaction of calling the diamond contract to the blockchain node through the client. The first transaction carries the target user's identifier (such as the signature of the target user's electronic wallet), the operation identifier of the diamondCut function (the identifier of the function adding function = 0, the identifier of the function modifying function = 1, and the identifier of the function deleting function = 2) and the address of the loan smart contract.
[0073] Correspondingly, after receiving the first transaction, the blockchain node retrieves the diamond contract from the blockchain and runs the code of the diamond contract to execute:
[0074] S3, determining the usage authority of the diamondCut function through the identifier of the target user in the first transaction.
[0075] In this application scenario, the diamondCut function only opens the function modification function for reserved functions to the target users.
[0076] This step first determines whether the operation identifier in the first transaction is "1", that is, confirms whether the function of the diamondCut function requested by the first transaction matches the usage authority of the target user.
[0077] If it is not "1", the call of the first transaction is ignored.
[0078] If it is "1", continue to execute S4.
[0079] S4, based on the function modification function of the diamondCut function, the calling address of the reserved function 1 in the diamond contract is changed from the address of the original facet contract to the address of the loan smart contract provided by the first exchange. At this time, the reserved function 1 is expanded into a loan service function.
[0080] S5. After the reserved function 1 is extended into a loan service function, it will automatically execute the service agreement of the loan smart contract and save the execution information of the service agreement in the diamond contract as an execution record. At the same time, the digital asset management function of the diamond contract sets the owner of the target digital asset to the calling loan smart contract, and the calling loan smart contract mortgages the target digital asset based on its own digital asset mortgage function.
[0081] S6. During the period when the target digital asset is mortgaged in the loan smart contract, if the target user further wants to lease out the target digital asset, a lease request for the target digital asset is initiated to the business platform through the client. Correspondingly, after the business platform finds a lessee who has reached a lease agreement with the target user, the client requests the blockchain node to deploy a smart contract for executing the lease service agreement in the blockchain (hereinafter collectively referred to as the lease smart contract).
[0082] S7. The client of the target user submits a second transaction to call the diamond contract to the blockchain node. The second transaction carries the identifier of the target user, the operation identifier of the diamondCut function, and the address of the lease smart contract.
[0083] Correspondingly, after receiving the second transaction, the blockchain node retrieves the diamond contract from the blockchain and runs the code of the diamond contract to execute:
[0084] S8. Determine the usage permission of the diamondCut function through the identifier of the target user in the second transaction.
[0085] Similarly, in this step, first judge whether the operation identifier in the second transaction is "1", that is, confirm whether the function of the second transaction requesting the diamondCut function matches the usage permission of the target user.
[0086] If it is not "1", the call of this second transaction is ignored;
[0087] If it is "1", execute S9.
[0088] S9. Based on the function modification function of the diamondCut function, modify the call address of the reserved function 2 in the diamond contract from the original aspect contract address to the lease smart contract address provided by the second transaction. At this time, the reserved function 2 is extended into a lease service function.
[0089] S10. After the reserved function 2 is extended into a lease service function, it will automatically execute the service agreement of the lease smart contract and save the execution information in the diamond contract as an execution record.
[0090] S11, during this period, the digital asset management function will retrieve the execution records of each service agreement in the diamond contract to determine whether the loan smart contract terminates the service agreement.
[0091] S12, assuming that the leasing smart contract terminates the service agreement later than the loan smart contract, when the digital asset management function determines that the loan smart contract terminates the service agreement, the owner of the target digital asset is set to the leasing smart contract, and the leasing smart contract is called based on its own digital asset mortgage function to mortgage the target digital asset.
[0092] In addition, the digital asset management function will also retrieve the execution records of each service agreement in the diamond contract to determine whether the leasing smart contract terminates the service agreement, and after subsequently determining that the leasing smart contract terminates the service agreement, the owner of the target digital asset will be set back to the target user.
[0093] It should be understood that the above application scenarios are only used to exemplify how to enable the blockchain to execute service agreements for different mortgage services on the same digital asset through the diamond contract. As long as it is under reasonable usage requirements, the first mortgage service and the second mortgage service of this application can be any mortgage service for digital assets. For example, the target user first applies for a leasing service for the target digital asset, and then further applies for a loan service for the target digital asset; for another example, the target user applies for a leasing service for the target digital asset, leases the target digital asset to user A, and further applies for other leasing services for the target digital asset, and leases the target digital asset to user B at the same time.
[0094] With the above Figure 3 Corresponding to the method shown, an embodiment of the present application also provides a device for processing blockchain digital assets.
[0095] Figure 5 is a schematic diagram of the structure of a processing device 500 according to an embodiment of the present application, including:
[0096] The first contract deployment module 510 is used to deploy a first smart contract in the blockchain in response to a request for a first mortgage service initiated by a target user, wherein the first smart contract is used to execute a service agreement of the first mortgage service, the service agreement of the first mortgage service includes a protocol logic for executing a mortgage on a collateral, and the target digital asset of the target user is the collateral of the first mortgage service.
[0097] The first contract invocation module 520 is used to submit a first transaction to a blockchain node to run an agent contract in the blockchain to execute: configuring a reserved function in the agent contract to invoke the first smart contract to be extended into a first mortgage service function, and setting the owner of the target digital asset to the first smart contract so that the first smart contract mortgages the target digital asset. Among them, the agent contract contains multiple reserved functions that can be configured to invoke smart contracts. After the agent contract is extended to obtain the first mortgage service function, the first smart contract is invoked based on the first mortgage service function to execute the service agreement of the first mortgage service.
[0098] The second contract deployment module 530 is used to, in response to a request for a second mortgage service initiated by a target user, deploy a second smart contract in the blockchain. Among them, the second smart contract is used to execute the service agreement of the second mortgage service. The service agreement of the second mortgage service contains second protocol logic for mortgaging the collateral, and the target digital asset serves as the collateral for the second mortgage service.
[0099] The second contract invocation module 540 is used to submit a second transaction to a blockchain node to run the agent contract in the blockchain to execute: configuring another reserved function in the agent contract to invoke the second smart contract to be extended into a second mortgage service function. Among them, after the agent contract is extended to obtain the second mortgage service function, the second smart contract is invoked based on the second mortgage service function to execute the service agreement of the second mortgage service, and after the service agreement of the first smart contract terminates, the owner of the target digital asset is set to a smart contract whose service agreement called by other mortgage service functions in the agent contract has not terminated, so that the smart contract whose service agreement has not terminated mortgages the target digital asset.
[0100] It can be seen from the processing device according to the embodiments of the present application that: in the solution of the present application, a proxy contract is deployed in the blockchain, and the proxy contract includes a plurality of reserved functions waiting to configure and call smart contracts. The target user can apply for different mortgage services for their target digital assets before and after, so as to deploy smart contracts for executing corresponding service protocols in the blockchain. At the same time, whenever the blockchain deploys a smart contract for a new mortgage service for the target digital asset, the proxy contract is run to configure the newly deployed smart contract for the mortgage service to be called by one of the reserved functions in the proxy contract. In this way, the originally unempowered reserved function is extended to become a mortgage service function for executing the service protocol of the corresponding mortgage service. It should be understood that the solution of the present application can extend various mortgage service functions for the target digital asset in the proxy contract, so that multiple mortgage services for the target digital asset can be provided for users simultaneously based on the function call function of the proxy contract. In addition, the contract logic of the proxy contract is further configured to first set the owner of the target digital asset in the smart contract called by the earliest extended mortgage service function, so that the smart contract first mortgages the target digital asset, and after the service protocol of the smart contract called by the earliest extended mortgage service function is terminated, the owner of the target digital asset is set to other smart contracts with the service protocol not terminated, so that other smart contracts mortgage the target digital asset until there is no other mortgage service function in the proxy contract that calls a smart contract with the service protocol not terminated, and then the ownership of the target digital asset is returned to the target user. That is to say, the proxy contract circulates the target digital asset to each smart contract with the service protocol not terminated in a relay manner for mortgage, and will not return the target digital asset to the target user in advance when all mortgage services have not ended, thus ensuring the service security of each mortgage service. It can be seen that the solution of the present application enables the blockchain to support repeated mortgages of the same digital asset for different mortgage services. For users, after applying for a mortgage service for their digital assets, they can apply for another mortgage service without waiting for the termination of the mortgage service, thereby improving the utilization rate of digital assets.
[0101] Optionally, after the service protocol of the first smart contract is terminated, if there is no other mortgage service function in the proxy contract that calls a smart contract with the service protocol not terminated, the proxy contract sets the owner of the target digital asset as the target user.
[0102] Optionally, the proxy contract is a diamond contract, and each reserved function in the proxy contract calls an unempowered aspect contract before being extended into a mortgage service function;
[0103] The first contract call module 520 configures a reserved function in the proxy contract to call the first smart contract, including: replacing the unempowered aspect contract called by a reserved function in the proxy contract with the first smart contract; and configuring another reserved function in the proxy contract to call the second smart contract, including: replacing the unempowered aspect contract called by another reserved function in the proxy contract with the second smart contract.
[0104] Optionally, the proxy contract is further provided with a diamond cut function, and the diamond cut function has a function modification function, and the function modification function is used to modify the call address of other functions in the proxy contract except the diamond cut function; the first transaction carries the address of the unempowered aspect contract, the identifier of the function modification function, and the address of the first smart contract. The first contract call module 520 replaces the unempowered aspect contract called by a reserved function in the proxy contract with the first smart contract, including: importing the address of the unempowered aspect contract, the identifier of the function modification function, and the address of the first smart contract carried in the first transaction into the diamond cut function in the proxy contract; executing the function modification function through the diamond cut function, determining a first reserved function in the proxy contract whose call address is the address of the unempowered aspect contract, and modifying the call address of the determined reserved function to the address of the first smart contract; and
[0105] The second transaction carries the address of the unempowered aspect contract, the identifier of the function modification function, and the address of the second smart contract. The first contract call module 520 replaces the unempowered aspect contract called by another reserved function in the proxy contract with the second smart contract, including: importing the address of the unempowered aspect contract, the identifier of the function modification function, and the address of the second smart contract in the second transaction into the diamond cut function in the proxy contract; executing the function modification function through the diamond cut function, determining a second reserved function in the proxy contract whose call address is the address of the unempowered aspect contract, and modifying the call address of the determined another reserved function to the address of the second smart contract.
[0106] Optionally, the diamond cut function further has a function addition function and / or a function deletion function. The function addition function is used to add a new function to the proxy contract, and the function deletion function is used to delete other functions in the proxy contract except the diamond cut function; the first transaction and the second transaction further carry the signature identifier of the target user, and the diamond contract opens the function modification function of the diamond cut function for transactions carrying the signature identifier of the target user.
[0107] Optionally, the first collateral service is the collateral service first requested by the target user for the target digital asset. The proxy contract is further provided with a digital asset management function. The proxy contract sets the owner of the target digital asset based on the digital asset management function. The digital asset management function is configured to: after the proxy contract is first extended to obtain a collateral service function, set the owner of the target digital asset to the smart contract called by the collateral service function obtained by the first extension.
[0108] Optionally, the digital asset management function is further configured to: after the smart contract serving as the owner of the target digital asset terminates the service agreement, determine whether there is any other collateral service function in the proxy contract that calls a smart contract with an un-terminated service agreement; if so, set the owner of the target digital asset to the other collateral service function that calls the smart contract with an un-terminated service agreement; if not, set the owner of the target digital asset to the target user.
[0109] Optionally, the first contract deployment module 510 is further configured to: before submitting the first transaction to the blockchain node, in response to the request of the first collateral service initiated by the target user, deploy the proxy contract in the blockchain.
[0110] Obviously, Figure 5 the processing device shown can be used as Figure 3 the execution subject of the method shown, and thus can implement the steps and corresponding functions of the method in Figure 3 shown. Since the principle is the same, it will not be elaborated herein.
[0111] Figure 6 is a schematic structural diagram of an electronic device according to an embodiment of this specification. Please refer to Figure 6 , at the hardware level, the electronic device includes a processor, and optionally also includes an internal bus, a network interface, and a memory. Among them, the memory may include a memory, such as a high-speed random access memory (Random-Access Memory, RAM), and may also include a non-volatile memory, such as at least one disk memory, etc. Of course, the electronic device may also include other hardware required for other services.
[0112] The processor, network interface, and memory can be interconnected via an internal bus, which can be an ISA (Industry Standard Architecture) bus, a PCI (Peripheral Component Interconnect) bus, 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 the sake of representation, Figure 6 only a bidirectional arrow is used in Figure 6 , but it does not mean that there is only one bus or one type of bus.
[0113] A memory, which is used to store programs. Specifically, the program can include program code, and the program code includes computer operation instructions. The memory can include a memory and a non-volatile memory, and provide instructions and data to the processor.
[0114] Optionally, the processor reads the corresponding computer program from the non-volatile memory into the memory and then runs it, forming the processing device shown above at the logical level. Correspondingly, the processor executes the program stored in the memory and is specifically used to perform the following operations: Figure 5 In response to a request for a first mortgage service initiated by a target user, deploy a first smart contract in the blockchain, where the first smart contract is used to execute the service agreement of the first mortgage service, and the service agreement of the first mortgage service includes a first protocol logic for executing a mortgage on the collateral, and the target digital asset of the target user is the collateral for the first mortgage service.
[0115] Submit a first transaction to a blockchain node to run the proxy contract in the blockchain to execute: configure the first reservation function in the proxy contract to call the first smart contract to be extended into a first mortgage service function, and set the owner of the target digital asset to the first smart contract, so that the first smart contract can mortgage the target digital asset, where the proxy contract includes reservation functions of multiple smart contracts to be configured. After the proxy contract is extended to obtain the first mortgage service function, the first smart contract is called based on the first mortgage service function to execute the service agreement of the first mortgage service.
[0116]
[0117] In response to a request for a second mortgage service initiated by a target user, a second smart contract is deployed in the blockchain, where the second smart contract is used to execute the service agreement of the second mortgage service, and the service agreement of the second mortgage service includes a second protocol logic for executing the mortgage of the collateral, and the target digital asset serves as the collateral for the second mortgage service.
[0118] Submit a second transaction to a blockchain node to run the proxy contract in the blockchain to execute: configure the second reservation function in the proxy contract to call the second smart contract to be extended into a second mortgage service function, where after the proxy contract is extended to obtain the second mortgage service function, the second smart contract is called based on the second mortgage service function to execute the service agreement of the second mortgage service, and after the service agreement of the first smart contract terminates, the owner of the target digital asset is set to the smart contract whose service agreement called by other mortgage service functions in the proxy contract has not terminated, so that the smart contract whose service agreement has not terminated can mortgage the target digital asset.
[0119] As can be seen from the electronic device according to the embodiments of the present application: In the solution of the present application, a proxy contract is deployed in the blockchain. The proxy contract includes multiple reserved functions waiting to configure and call smart contracts. The target user can apply for different mortgage services for their target digital assets before and after, so as to deploy smart contracts for executing corresponding service agreements in the blockchain. At the same time, whenever the blockchain deploys a smart contract for a new mortgage service for the target digital asset, the proxy contract is run to configure the newly deployed smart contract for the mortgage service to be called by one of the reserved functions in the proxy contract. In this way, the originally unempowered reserved function is extended to a mortgage service function for executing the service agreement of the corresponding mortgage service. It should be understood that the solution of the present application can extend multiple mortgage service functions for the target digital asset in the proxy contract, so that multiple mortgage services for the target digital asset can be provided for users simultaneously based on the function call function of the proxy contract. In addition, the contract logic of the proxy contract is also configured to first set the owner of the target digital asset in the smart contract called by the earliest extended mortgage service function, so that the smart contract first mortgages the target digital asset. After the service agreement of the smart contract called by the earliest extended mortgage service function is terminated, the owner of the target digital asset is set to other smart contracts with the service agreement not terminated, so that other smart contracts mortgage the target digital asset until there is no smart contract with the service agreement not terminated called in the proxy contract, and then the ownership of the target digital asset is returned to the target user. That is to say, the proxy contract transfers the target digital asset to each smart contract with the service agreement not terminated in a relay manner for mortgage, and will not return the target digital asset to the target user in advance when all mortgage services have not ended, thus ensuring the service security of each mortgage service. It can be seen that the solution of the present application enables the blockchain to support repeated mortgages of the same digital asset for different mortgage services. For users, after applying for a mortgage service for their digital assets, they can apply for another mortgage service without waiting for the termination of the previous mortgage service, thereby improving the utilization rate of digital assets.
[0120] The method for processing blockchain digital assets disclosed in the embodiments as shown in this specification can be applied to a processor and implemented by the processor. The processor may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by the integrated logic circuit in the hardware of the processor or instructions in the form of software. The above-mentioned processor may be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it may also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components. It can implement or execute the various methods, steps, and logic block diagrams disclosed in the embodiments of the present application. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc. The steps of the method disclosed in combination with the embodiments of the present application can be directly embodied as being executed and completed by a hardware decoding processor, or executed and completed by a combination of hardware and software modules in the decoding processor. The software module may be located in a mature storage medium in the art such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, or an electrically erasable programmable memory, a register, etc. This storage medium is located in the memory, and the processor reads the information in the memory and combines its hardware to complete the steps of the above method.
[0121] Of course, in addition to the software implementation method, the electronic device in this specification does not exclude other implementation methods, such as a logic device or a combination of software and hardware, etc. That is to say, the execution subject of the following processing flow is not limited to each logic unit, and can also be hardware or a logic device.
[0122] In addition, the embodiments of the present application also propose a computer-readable storage medium that stores one or more programs, and the one or more programs include instructions.
[0123] Optionally, when the above instructions are executed by a portable electronic device including multiple application programs, the portable electronic device can be enabled to execute Figure 3 the steps of the method shown, including:
[0124] In response to a request for a first mortgage service initiated by a target user, a first smart contract is deployed in the blockchain, where the first smart contract is used to execute the service agreement of the first mortgage service. The service agreement of the first mortgage service includes first protocol logic for mortgaging the collateral, and the target digital assets of the target user are the collateral for the first mortgage service.
[0125] Submit a first transaction to a blockchain node to run the proxy contract in the blockchain to execute: configure the first reserved function in the proxy contract to call the first smart contract to be extended into a first mortgage service function, and set the owner of the target digital assets to the first smart contract so that the first smart contract mortgages the target digital assets. The proxy contract includes reserved functions of multiple smart contracts to be configured. After the proxy contract is extended to obtain the first mortgage service function, the first smart contract is called based on the first mortgage service function to execute the service agreement of the first mortgage service.
[0126] In response to a request for a second mortgage service initiated by a target user, a second smart contract is deployed in the blockchain, where the second smart contract is used to execute the service agreement of the second mortgage service. The service agreement of the second mortgage service includes second protocol logic for mortgaging the collateral, and the target digital assets are the collateral for the second mortgage service.
[0127] Submit a second transaction to a blockchain node to run the proxy contract in the blockchain to execute: configure the second reserved function in the proxy contract to call the second smart contract to be extended into a second mortgage service function. After the proxy contract is extended to obtain the second mortgage service function, the second smart contract is called based on the second mortgage service function to execute the service agreement of the second mortgage service. After the service agreement of the first smart contract is terminated, the owner of the target digital assets is set to the smart contract whose service agreement called by other mortgage service functions in the proxy contract is not terminated, so that the smart contract whose service agreement is not terminated mortgages the target digital assets.
[0128] Those skilled in the art should understand that the embodiments of this specification can be provided as methods, systems, or computer program products. Therefore, this specification can take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware aspects. Moreover, this specification can take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0129] The above describes specific embodiments of the present specification. Other embodiments are within the scope of the appended claims. In some cases, the acts or steps recited in the claims may be performed in a different order than in the embodiments and still achieve the desired result. Additionally, the processes depicted in the figures do not necessarily require the particular order or sequential order shown to achieve the desired result. In certain embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0130] The above are only embodiments of the present specification and are not intended to limit the present specification. For those skilled in the art, various modifications and changes can be made to the present specification. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principle of the present specification shall be included within the scope of the claims of the present specification. In addition, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of this document.
Claims
1. A processing method for blockchain digital assets, applied to a business platform, characterized in that, Including: In response to a request for a first mortgage service initiated by a target user, a first smart contract is deployed in the blockchain, where the first smart contract is used to execute the service agreement of the first mortgage service. The service agreement of the first mortgage service includes first protocol logic for mortgaging the collateral, and the target digital assets of the target user are the collateral for the first mortgage service; Submit a first transaction to a blockchain node to run the proxy contract in the blockchain to execute: configure the first reserved function in the proxy contract to call the first smart contract to expand into a first mortgage service function, and set the owner of the target digital assets to the first smart contract, so that the first smart contract mortgages the target digital assets. The proxy contract includes reserved functions of multiple smart contracts to be configured. After the proxy contract expands to obtain the first mortgage service function, it calls the first smart contract based on the first mortgage service function to execute the service agreement of the first mortgage service; In response to a request for a second mortgage service initiated by a target user, a second smart contract is deployed in the blockchain, where the second smart contract is used to execute the service agreement of the second mortgage service. The service agreement of the second mortgage service includes second protocol logic for mortgaging the collateral, and the target digital assets serve as the collateral for the second mortgage service; Submit a second transaction to a blockchain node to run the proxy contract in the blockchain to execute: configure the second reserved function in the proxy contract to call the second smart contract to expand into a second mortgage service function. After the proxy contract expands to obtain the second mortgage service function, it calls the second smart contract based on the second mortgage service function to execute the service agreement of the second mortgage service, and after the service agreement of the first smart contract terminates, set the owner of the target digital assets to the smart contract whose service agreement called by other mortgage service functions in the proxy contract has not terminated, so that the smart contract whose service agreement has not terminated mortgages the target digital assets.
2. The method according to claim 1, wherein: After the service agreement of the first smart contract terminates, if there is no other mortgage service function in the proxy contract that calls a smart contract whose service agreement has not terminated, the proxy contract sets the owner of the target digital assets to the target user.
3. The method according to claim 2, wherein: The proxy contract is a diamond contract, and each reserved function in the proxy contract calls an unempowered aspect contract before expanding into a mortgage service function; Configuring a reserved function in the proxy contract to call the first smart contract includes: replacing the unempowered aspect contract called by a reserved function in the proxy contract with the first smart contract; and, Configuring one of the other reserved functions in the proxy contract to call the second smart contract includes: replacing the unempowered aspect contract called by the other reserved function in the proxy contract with the second smart contract.
4. The method according to claim 3, wherein The proxy contract is further provided with a diamond cut function, and the diamond cut function has a function modification function, and the function modification function is used to modify the call address of other functions in the proxy contract except the diamond cut function; The first transaction carries the address of the unempowered aspect contract, the identifier of the function modification function, and the address of the first smart contract. Replacing the unempowered aspect contract called by one of the reserved functions in the proxy contract with the first smart contract includes: Importing the address of the unempowered aspect contract, the identifier of the function modification function, and the address of the first smart contract carried in the first transaction into the diamond cut function in the proxy contract; Executing the function modification function through the diamond cut function, determining a first reserved function in the proxy contract whose call address is the address of the unempowered aspect contract, and modifying the call address of the determined reserved function to the address of the first smart contract; and The second transaction carries the address of the unempowered aspect contract, the identifier of the function modification function, and the address of the second smart contract. Replacing the unempowered aspect contract called by another reserved function in the proxy contract with the second smart contract includes: Importing the address of the unempowered aspect contract, the identifier of the function modification function, and the address of the second smart contract in the second transaction into the diamond cut function in the proxy contract; Executing the function modification function through the diamond cut function, determining a second reserved function in the proxy contract whose call address is the address of the unempowered aspect contract, and modifying the call address of the determined another reserved function to the address of the second smart contract.
5. The method according to claim 4, wherein The diamond cut function further has a function addition function and / or a function deletion function. The function addition function is used to add a new function in the proxy contract, and the function deletion function is used to delete other functions in the proxy contract except the diamond cut function; The first transaction and the second transaction also carry the signature identifier of the target user, and the diamond contract opens the function modification function of the diamond cut function for transactions carrying the signature identifier of the target user.
6. The method according to claim 3, wherein The first pledge service is the pledge service first requested by the target user for the target digital asset. The proxy contract is also provided with a digital asset management function. The proxy contract sets the owner of the target digital asset based on the digital asset management function. The digital asset management function is configured to: after the proxy contract is first extended to obtain a pledge service function, set the owner of the target digital asset to the smart contract called by the first extended pledge service function.
7. The method according to claim 6, wherein the digital asset management function is further configured to: after the smart contract serving as the owner of the target digital asset terminates the service agreement, determine whether there is any other pledge service function in the proxy contract that calls a smart contract with an un-terminated service agreement; if so, set the owner of the target digital asset to the other pledge service function that calls the smart contract with an un-terminated service agreement; if not, set the owner of the target digital asset to the target user.
8. A processing device for blockchain digital assets, characterized in that including: a first contract deployment module, configured to, in response to a request for a first pledge service initiated by a target user, deploy a first smart contract in the blockchain, wherein the first smart contract is used to execute the service agreement of the first pledge service, and the service agreement of the first pledge service includes protocol logic for pledging the collateral, and the target digital asset of the target user is the collateral for the first pledge service; a first contract invocation module, configured to submit a first transaction to a blockchain node to run the proxy contract in the blockchain to: configure a reserved function in the proxy contract to call the first smart contract to be extended into a first pledge service function, and set the owner of the target digital asset to the first smart contract, so that the first smart contract pledges the target digital asset, wherein the proxy contract includes a plurality of reserved functions that can be configured to call smart contracts, and after the proxy contract is extended to obtain the first pledge service function, the proxy contract calls the first smart contract based on the first pledge service function to execute the service agreement of the first pledge service; a second contract deployment module, configured to, in response to a request for a second pledge service initiated by a target user, deploy a second smart contract in the blockchain, wherein the second smart contract is used to execute the service agreement of the second pledge service, and the service agreement of the second pledge service includes second protocol logic for pledging the collateral, and the target digital asset serves as the collateral for the second pledge service; The second contract call module is used to submit a second transaction to a blockchain node to run the proxy contract in the blockchain to execute: configuring another reserved function in the proxy contract to call the second smart contract to be extended into a second mortgage service function, wherein after the proxy contract is extended to obtain the second mortgage service function, the second smart contract is called based on the second mortgage service function to execute the service agreement of the second mortgage service, and after the service agreement of the first smart contract terminates, setting the owner of the target digital asset to the smart contract whose service agreement called by other mortgage service functions in the proxy contract has not terminated, so that the smart contract whose service agreement has not terminated mortgages the target digital asset.
9. An electronic device, characterized in that, The device includes: a processor; and a memory configured to store computer-executable instructions, the computer-executable instructions when executed cause the processor to execute the method for processing blockchain digital assets according to any one of claims 1-8.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium is used to store computer-executable instructions, and the computer-executable instructions when executed by a processor implement the method for processing blockchain digital assets according to any one of claims 1-8.
Citation Information
Patent Citations
Blockchain-based resource value evaluation method and device
CN108648071A
Data verification and data updating method and system
CN114781003A