Digital asset management method and related products
By deploying digital asset generation contracts and identification contracts on the blockchain, and using smart contracts to generate unique asset identifiers, the problem of duplicate storage of digital assets on the blockchain is solved, achieving higher distinguishability and security.
Patent Information
- Application Number
- CN202111241916.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-10-25
- Publication Date
- 2026-08-25
- Estimated Expiration
- 2041-10-25
AI Technical Summary
How can we ensure that digital assets of the same type can be stored separately on the blockchain to avoid duplication and improve storage security?
By deploying digital asset generation contracts and digital asset identification contracts on the blockchain, smart contracts are used to generate unique asset identifiers. These identifiers are then combined with the base58 encoding algorithm to determine the asset type and contract ownership.
It improves the distinguishability and security of digital assets on the blockchain, ensuring that each digital asset has a unique identifier on the blockchain, making it easy to identify and manage.
Smart Images

Figure CN116028484B_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the field of blockchain technology, specifically relating to a digital asset management method, a digital asset management device, a computer-readable medium, an electronic device, and a computer program product. Background Technology
[0002] Digital assets refer to non-monetary assets owned or controlled by an enterprise or individual, existing in electronic data form, held for sale in the ordinary course of business, or in the process of production. Some of these assets are interchangeable, meaning there is no difference between similar assets; two assets of the same quantity have equal value. For these homogeneous and interchangeable assets, only the type needs to be specified. However, many more non-interchangeable assets exist in the real world, such as various contract documents and different digital invoices. While these assets can be categorized into a broad class, they are distinct from each other and must be differentiated.
[0003] As a distributed database, blockchain leverages its decentralized nature to store the same ledger across all blockchain nodes, thereby enhancing the security and reliability of digital asset storage. However, because numerous blockchain nodes can provide digital asset generation and management services to different asset producers, the simultaneous generation of the same type of digital asset by different producers can lead to asset duplication and indistinguishability. Therefore, ensuring differentiated storage of the same type of digital assets on the blockchain is a pressing issue that needs to be addressed. Summary of the Invention
[0004] The purpose of this application is to provide a digital asset management method, digital asset management device, computer-readable medium, electronic device, and computer program product that at least to some extent overcomes the technical problem of poor asset differentiation in related technologies.
[0005] Other features and advantages of this application will become apparent from the following detailed description, or may be learned in part by practice of this application.
[0006] According to one aspect of the embodiments of this application, a digital asset management method is provided, the method comprising: in response to a business request to generate a digital asset, obtaining an asset type carried in the business request; invoking a digital asset generation contract matching the asset type to generate a digital asset corresponding to the business request, the digital asset generation contract being a smart contract deployed on a blockchain for generating digital assets; and invoking a digital asset identification contract to generate an asset identifier based on the asset type and the contract code of the digital asset generation contract, the digital asset identification contract being a smart contract deployed on a blockchain for generating a unique identifier for the digital asset.
[0007] According to one aspect of the embodiments of this application, a digital asset management device is provided, the device comprising: an acquisition module configured to acquire an asset type carried in a business request for generating a digital asset in response to such a business request; a first invocation module configured to invoke a digital asset generation contract matching the asset type to generate a digital asset corresponding to the business request, wherein the digital asset generation contract is a smart contract deployed on a blockchain for generating digital assets; and a second invocation module configured to invoke a digital asset identification contract to generate an asset identifier based on the asset type and the contract code of the digital asset generation contract, wherein the digital asset identification contract is a smart contract deployed on a blockchain for generating a unique identifier for the digital asset.
[0008] According to one aspect of the embodiments of this application, a computer-readable medium is provided, on which a computer program is stored, which, when executed by a processor, implements the digital asset management method as described in the above technical solutions.
[0009] According to one aspect of the embodiments of this application, an electronic device is provided, the electronic device comprising: a processor; and a memory for storing executable instructions of the processor; wherein the processor is configured to perform a digital asset management method as described above by executing the executable instructions.
[0010] According to one aspect of the embodiments of this application, a computer program product or computer program is provided, which includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the digital asset management method as described above.
[0011] In the technical solution provided in this application embodiment, by deploying digital asset generation contracts and digital asset identification contracts on the blockchain, digital assets can be generated on the blockchain by calling smart contracts and a unique asset identifier can be assigned to the generated digital assets. Moreover, the asset type and contract ownership of the digital assets can be determined based on the asset identifier, thus improving the distinguishability and security of digital assets stored on the blockchain.
[0012] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and do not limit this application. Attached Figure Description
[0013] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application. It is obvious that the drawings described below are merely some embodiments of this application, and those skilled in the art can obtain other drawings based on these drawings without any inventive effort.
[0014] Figure 1 A schematic diagram of the composition of the blockchain system in an embodiment of this application is shown.
[0015] Figure 2 The structure of a blockchain maintained on a blockchain network is shown.
[0016] Figure 3 A flowchart illustrating the steps of a digital asset management method according to one embodiment of this application is shown.
[0017] Figure 4 This illustration shows a scenario of digital asset association based on smart contract calls in one embodiment of this application.
[0018] Figure 5 A flowchart illustrating the steps of generating an asset identifier based on field assignment and encoding in one embodiment of this application is shown.
[0019] Figure 6 This illustration shows a process for generating asset identifiers based on field combination encoding in one embodiment of this application.
[0020] Figure 7 This illustration shows a process for generating an asset identifier based on a combination of field codes including an index field, according to one embodiment of this application.
[0021] Figure 8 This illustration shows a process for generating an asset identifier based on a combination of fields, including a version field, in one embodiment of this application.
[0022] Figure 9 This illustration shows a process for generating an asset identifier based on a combination of fields, including a version field, in one embodiment of this application.
[0023] Figure 10 A structural block diagram of the digital asset management device provided in an embodiment of this application is shown.
[0024] Figure 11 A computer system architecture block diagram suitable for implementing the embodiments of this application is shown. Detailed Implementation
[0025] Exemplary embodiments will now be described more fully with reference to the accompanying drawings. However, these exemplary embodiments can be implemented in many forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided to make this application more comprehensive and complete, and to fully convey the concept of the exemplary embodiments to those skilled in the art.
[0026] Furthermore, the described features, structures, or characteristics can be combined in any suitable manner in one or more embodiments. Numerous specific details are provided in the following description to give a thorough understanding of embodiments of this application. However, those skilled in the art will recognize that the technical solutions of this application can be practiced without one or more of the specific details, or other methods, components, apparatuses, steps, etc., can be employed. In other instances, well-known methods, apparatuses, implementations, or operations are not shown or described in detail to avoid obscuring various aspects of this application.
[0027] The block diagrams shown in the accompanying drawings are merely functional entities and do not necessarily correspond to physically independent entities. That is, these functional entities can be implemented in software, in one or more hardware modules or integrated circuits, or in different network and / or processor devices and / or microcontroller devices.
[0028] The flowcharts shown in the accompanying drawings are merely illustrative and do not necessarily include all content and operations / steps, nor do they necessarily have to be performed in the described order. For example, some operations / steps can be broken down, while others can be combined or partially combined; therefore, the actual execution order may change depending on the specific circumstances.
[0029] A blockchain is a shared, chained-block data structure built on transparent and trusted rules in a peer-to-peer network environment. It is designed to be tamper-proof, tamper-proof, and traceable. The chained-block data structure stores transactions occurring over a period of time in blocks, which are then linked chronologically using cryptographic algorithms. The ledger is distributed to all member nodes in the network, permanently recording the history of asset transactions between peer nodes in the sequential chain of blocks linked by hash cryptographic algorithms. All confirmed and verified transactions are linked from the beginning of the chain to the latest block, hence the name blockchain. A blockchain can serve as a single source of truth, and members of a blockchain network can only view transactions relevant to them.
[0030] Figure 1A schematic diagram of the blockchain system composition in this embodiment is shown. The blockchain system 100 may include at least one client 110 and a blockchain network 120. The blockchain network 120 includes at least one blockchain node 121. The client 110 may be various electronic devices such as smartphones, tablets, laptops, desktop computers, smart wearable devices, smart in-vehicle devices, smart payment terminals, and facial recognition terminals. By installing the corresponding client application, it can provide blockchain data services to users. The blockchain node 121 may be a terminal device or a server. For example, the blockchain node 121 may be an independent physical server, a server cluster composed of multiple physical servers, or a cloud server providing cloud computing services.
[0031] In blockchain network 120, each blockchain node 121 receives input information during normal operation and maintains shared data within the blockchain network based on the received input information. To ensure information interoperability, information connections can exist between the various blockchain nodes 121, allowing them to transmit information to each other. For example, when any blockchain node 121 in blockchain network 120 receives input information and broadcasts it within the blockchain network 120, other node devices in blockchain network 120 can obtain the input information according to a consensus algorithm and store it as shared data.
[0032] Each blockchain node 121 in the blockchain network 120 has a corresponding node identifier. Each blockchain node 121 can also store the node identifiers of other blockchain nodes in the same blockchain network, so that the generated block can be broadcast to other nodes in the blockchain network 120 based on their node identifiers. Each blockchain node 121 can maintain a node identifier list as shown in Table 1, storing the node name and node identifier in this list. The node identifier can be an IP (Internet Protocol) address or any other information that can be used to identify the node. Table 1 shows a node identifier list using IP addresses as an example.
[0033] Table 1
[0034] Node 1 117.114.151.174 Node 2 117.116.189.145 … … Node N 119.123.789.258
[0035] Figure 2 This illustrates the structural composition of a blockchain maintained on a blockchain network. For example... Figure 2As shown, a blockchain consists of multiple sequentially linked blocks. Whenever new data needs to be written to the blockchain, this data is aggregated into a newly generated block. This newly generated block is then linked to the end of the blockchain. A consensus algorithm ensures that the blocks added on each node device 121 are identical. The block body of each block records the data of the current block, while its block header stores the hash value of the preceding block. If the transaction data in the preceding block changes, the hash value of the current block will also change accordingly. Therefore, data uploaded to the blockchain network is difficult to tamper with, improving the reliability of shared data.
[0036] The following detailed description, in conjunction with specific embodiments, outlines the technical solutions provided in this application, including digital asset management methods, digital asset management devices, computer-readable media, electronic devices, and computer program products.
[0037] Figure 3 This application illustrates a flowchart of the steps of a digital asset management method according to one embodiment of the present application. The method can be performed by… Figure 1 The client shown can execute the method, or it can be executed by a blockchain node acting as a server. This application embodiment uses a digital asset management method executed by a blockchain node as an example for illustration. Figure 3 As shown, the digital asset management method in this application embodiment can mainly include the following steps S310 to S330.
[0038] Step S310: In response to the business request to generate digital assets, obtain the asset type carried in the business request.
[0039] A variety of digital assets can be stored on a blockchain, including transaction orders, contracts, and electronic invoices generated during user transactions. Users can initiate requests to generate digital assets through client applications installed on their devices. These requests are sent to blockchain nodes connected to the devices and responded to by the nodes. Furthermore, requests to generate digital assets can be transmitted and circulated across various blockchain nodes within the blockchain network.
[0040] When a blockchain node receives a business request, it can parse and process the request to obtain the asset type it carries. Different asset types can be represented by different strings. After parsing and processing the business request, the blockchain node can identify the specified fields related to the asset type in the request, and then obtain the string used to represent the asset type. For example, the asset type of a document asset can be represented as 0x01, and the asset type of a bill asset can be represented as 0x02.
[0041] Step S320: Invoke the digital asset generation contract that matches the asset type to generate the digital asset corresponding to the business request. The digital asset generation contract is a smart contract deployed on the blockchain for generating digital assets.
[0042] A smart contract is a computer protocol designed to disseminate, verify, or execute contracts in an informational manner. Smart contracts allow for trusted transactions without the need for a third party; these transactions are traceable and irreversible. Smart contracts deployed on a blockchain can be invoked and executed on the blockchain network, running pre-written computer logic code that forms the content of the contract.
[0043] Digital asset generation contracts are used to generate digital assets on the blockchain. The generation of digital assets can include generating new digital assets based on user input or relevant asset data stored on the blockchain. For example, based on data such as the transaction name and transaction quantity input by the user, digital assets such as business orders or electronic invoices can be generated for storage on the blockchain.
[0044] In some embodiments of this application, the generation of digital assets may also include transferring externally generated digital assets to the blockchain for storage. For example, users can complete transactions through offline or online channels and transfer digital assets such as business orders or electronic invoices generated by the transactions to the blockchain for storage.
[0045] Multiple digital asset generation contracts corresponding to different asset types are deployed on the blockchain. A single digital asset generation contract can be used to generate a digital asset of a specified asset type. In some embodiments of this application, a single digital asset generation contract can also be used to generate digital assets of multiple specified asset types.
[0046] Blockchain nodes can query the latest digital asset generation contracts on the blockchain based on the asset type, execute the contract content by calling the digital asset generation contract, and generate digital assets corresponding to the business request based on the contract execution result.
[0047] Step S330: Invoke the digital asset identification contract to generate an asset identifier based on the asset type and the contract code of the digital asset generation contract. The digital asset identification contract is a smart contract deployed on the blockchain to generate unique identifiers for digital assets.
[0048] Digital asset identification contracts are used to assign unique asset identifiers to newly generated digital assets on the blockchain. These asset identifiers can be used to distinguish various types of digital assets stored on the blockchain.
[0049] The contract code of a digital asset generation contract is a unique identifier assigned to it when the digital asset generation contract is deployed on the blockchain. The contract code can be a fixed-length string consisting of English letters and numbers. Based on the contract code, a digital asset generation contract corresponding to it can be uniquely identified on the blockchain.
[0050] By inputting the asset type of a digital asset and the contract code of the digital asset generation contract into the digital asset identification contract, and executing the contract content of the digital asset identification contract, an asset identifier can be generated, serving as a unique identifier for the digital asset on the blockchain. Based on the asset identifier, a digital asset can be uniquely identified on the blockchain.
[0051] In the digital asset management method provided in this application embodiment, by deploying digital asset generation contracts and digital asset identification contracts on the blockchain, digital assets can be generated on the blockchain by calling smart contracts and a unique asset identifier can be assigned to the generated digital assets. Moreover, the asset type and contract ownership of the digital assets can be determined based on the asset identifier, thus improving the distinguishability and security of digital assets stored on the blockchain.
[0052] Figure 4 This illustration shows a scenario of digital asset association based on smart contract calls, as shown in one embodiment of this application. Figure 4 As shown, in this application scenario, user 401 can communicate with blockchain node 402 in the blockchain network through a client application installed on the terminal device, and then save and maintain digital assets on the blockchain through the blockchain node.
[0053] In response to a user's request to generate digital assets, the blockchain node receiving the request can invoke a digital asset generation contract (403) deployed on the blockchain, based on the asset type specified in the request. Each asset type can correspond to one or more different digital asset generation contracts.
[0054] By calling the digital asset generation contract 403, a digital asset 404 that meets the business request can be generated. At the same time, the digital asset identification contract 405 deployed on the blockchain can be called. After inputting the asset type and the contract code of the digital asset generation contract 403 into the digital asset identification contract 405, an asset identifier 406 that matches the digital asset 404 is generated according to the execution result of the digital asset identification contract 405.
[0055] After associating digital asset 404 with asset identifier 406, the information is written into the asset generation record. The asset generation record is then broadcast on the blockchain network to enable consensus authentication among various blockchain nodes. Upon successful authentication, the asset generation record is stored in the record buffer pool.
[0056] In one embodiment of this application, when a blockchain node listens to an asset generation record broadcast on the blockchain network, it can first match the asset generation record with the business requests in the transaction pool. When there is a business request in the transaction pool that matches the asset generation record and the information is consistent, a confirmation message can be broadcast on the blockchain network. When the number of confirmation messages sent by each blockchain node broadcast on the blockchain network reaches a preset threshold, it can be determined that the consensus authentication has been passed, and then the asset generation record can be saved in the record buffer pool.
[0057] In a blockchain network, each blockchain node can maintain a transaction pool and a record buffer. The transaction pool stores business requests initiated through the blockchain network for generating digital assets, while the record buffer stores asset generation records obtained after executing asset management methods in response to these requests. When a user initiates a business request to generate digital assets through the blockchain network, each blockchain node can write the request to its own maintained transaction pool upon receiving it. After a service node is elected through voting or other means, the service node invokes the asset generation contract and asset identification contract to generate digital assets and associated asset identifiers, and further broadcasts the asset generation record carrying the digital assets and asset identifiers on the blockchain network. When a blockchain node receives the asset generation record broadcast on the blockchain network and performs consensus authentication on the record content, it writes it to its respective maintained record buffer.
[0058] When the block generation conditions are met, the asset generation records stored in the record buffer pool are packaged into blocks to be added to the blockchain.
[0059] In one embodiment of this application, the block generation conditions include at least one of time conditions and data volume conditions. If the block generation condition is a time condition, the blockchain node can monitor the time difference between the generation time of the most recent block. When the time difference is greater than a preset time threshold, it can be determined that the block generation condition is met, and then a new block can be packaged. Using the time condition as the block generation condition, blocks can be generated at fixed time intervals. If the block generation condition is a data volume condition, the blockchain node can monitor the amount of data stored in the record buffer pool. When the amount of data is greater than a preset data volume threshold, it can be determined that the block generation condition is met, and then a new block can be packaged. Using the data volume condition as the block generation condition, the generation time of each block is not fixed, but it can be guaranteed that the amount of data in each block linked to the blockchain is the same.
[0060] In one embodiment of this application, a blockchain node can simultaneously monitor time conditions and block generation conditions. When either of the two conditions is met, it can be determined that the block generation conditions are met, and then a new block can be packaged.
[0061] In one embodiment of this application, a blockchain node in the blockchain network can be designated as a packaging node through a consensus mechanism. When the block generation conditions are met, the packaging node packages the asset generation records stored in its maintained record buffer pool into blocks to be uploaded to the chain.
[0062] Blocks to be added to the blockchain are broadcast on the blockchain network so that each blockchain node in the blockchain network can perform consensus authentication of the blocks to be added to the blockchain. When the authentication is successful, the blocks to be added to the blockchain are processed to save the blocks carrying the asset generation records on the blockchain.
[0063] Each blockchain node in the blockchain network can listen to broadcast messages on the blockchain network. When it hears a newly generated block to be added to the blockchain, it can compare the asset generation record contained in the block with the record buffer pool it maintains. When the asset generation record in the block matches the data content stored in the record buffer pool maintained by the blockchain node, it can broadcast a confirmation message to the blockchain network. When the number of confirmation messages broadcast on the blockchain network for the block to be added to the blockchain exceeds the threshold, the block to be added to the blockchain can be processed, thus saving the block carrying the asset generation record on the blockchain.
[0064] After the block is uploaded to the blockchain, each blockchain node can clear the asset generation records that have been uploaded to the blockchain from the record buffer pool.
[0065] Figure 5 A flowchart illustrating the steps of generating an asset identifier based on field assignment and encoding in one embodiment of this application is shown. Figure 5 As shown, based on the above embodiments, the step S330 of generating an asset identifier according to the asset type and the contract code of the digital asset contract can include the following steps S510 to S530.
[0066] Step S510: Obtain a field combination from the digital asset identification contract, which includes multiple fields, each field in the field combination having a specified field length.
[0067] The field combination consists of multiple fields to be assigned values, each with a specified length and a specified order. In one embodiment of this application, the field combination includes a version field, a type field, a contract field, an index field, and a verification field. The version field (version) records a version identifier code representing the contract version of the digital asset identification contract, with a length of 1 byte. The type field (type) records a type identifier code representing the asset type of the digital asset, with a length of 4 bytes. The contract field (contractH) records a contract identifier code used to distinguish the digital asset generation contract, with a length of 43 bytes. The index field (index) records an index identifier code representing the call event of the digital asset identification contract, with a length of 8 bytes. The verification field (checkH) records a verification identifier code used to verify the asset identifier, with a length of 8 bytes. After concatenating the strings recorded in each field, a field combination with a total length of 64 bytes is obtained.
[0068] Step S520: Assign values to each field in the field combination based on the asset type and the contract code of the digital asset contract.
[0069] In one embodiment of this application, the method for assigning values to a field combination may include: obtaining a type identifier code that matches the asset type and writing the type identifier code into the type field of the field combination; generating a contract identifier code based on the contract code of the data asset contract and writing the contract identifier code into the contract field of the field combination.
[0070] The type identifier is a string obtained by mapping the asset type according to the rules agreed in the asset identification contract, and the contract identifier is a string obtained by converting the contract code of the asset generation contract according to the rules agreed in the asset identification contract.
[0071] Step S530: Encode the field combination after the field assignment is completed to obtain the asset identifier.
[0072] The field combination that completes the field assignment consists of multiple strings concatenated together. The asset identifier is obtained by encoding the field combination according to the encoding algorithm agreed upon in the asset identifier contract. In one embodiment of this application, the base58 encoding algorithm can be used for encoding. Base58 uses numbers, uppercase letters, and lowercase letters, removing the ambiguous characters 0 (zero), O (uppercase O), I (uppercase i), and l (lowercase L), for a total of 58 characters as the encoding alphabet.
[0073] The process of encoding field combinations using the base58 encoding algorithm includes the following steps:
[0074] Step S531: Convert each byte of the string in the field combination into ASCII code (the string is actually a combination of base 256 numbers).
[0075] For example, the original string is ABD, and the converted ASCII code is 65 66 68.
[0076] Step S532: Convert the 256-base number combination into a decimal number.
[0077] Converting the base 256 number 65 66 68 to base 10, we get (65*256+66)*256+68=4276804.
[0078] Step S533: Convert the decimal number to a base-58 number.
[0079] Converting the decimal number 4276804 to a base-58 number gives 21 53 20 0.
[0080] Step S534: Convert each digit of the base-58 number into its corresponding character according to the code table.
[0081] The code table for the base58 encoding algorithm can be represented as:
[0082] 123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ.
[0083] After looking up the code table for the base-58 number 21 53 20 0, the encoded character nVm1 is obtained.
[0084] Figure 6 This illustration shows a process for generating an asset identifier based on field combination encoding in one embodiment of this application. In this embodiment, the field combination includes a type field (type) and a contract field (contractH). The type field (type) has a length of 4 bytes, and the contract field (contractH) has a length of 43 bytes. Combining these two fields results in a field combination of 47 bytes.
[0085] like Figure 6 As shown, after parsing and processing the business request 601 used to generate digital assets, the asset type 602 of the digital asset can be obtained. The asset type mapping table 604 can be obtained from the digital asset identification contract 603. The asset type mapping table 604 is used to store the mapping relationship between different asset types and type identifier codes. The type identifier code 605 that matches the asset type 602 is then searched in the asset type mapping table 604.
[0086] Obtain a randomly generated hash salt 606 and embed it into the contract code 607 of the digital asset generation contract. Perform a hash operation on the contract code with the embedded hash salt according to the first hash function 608 agreed upon in the digital asset identification contract 603 to obtain the contract identifier code 609. The hash salt is a randomly generated string. Embedding the hash salt into the contract code 607 increases the difficulty of cracking the hash function and improves the security of the hash operation result. A hash function is a method of creating a small digital "fingerprint" from any kind of data. Hash functions compress messages or data into digests, reducing the data size and fixing the data format. Hash functions can shuffle and mix data to recreate a fingerprint called a hash value, which is usually represented by a short string of random letters and numbers. Commonly used hash functions include MD5, SHA-1, SHA-2, SHA-256, SHA-512, SHA-3, RIPEMD-160, etc. The first hash function in this application embodiment can be the SHA-256 algorithm, which can map a contract code of arbitrary length to a contract identifier code of 256 bytes.
[0087] Assign a value to the type field based on type identifier code 605, and assign a value to the contract field based on contract identifier code 609. After the field assignments are completed, use the base58 encoding algorithm to encode the asset identifier ID = base58(data).
[0088] In one embodiment of this application, in order to save storage space and improve data security, this embodiment of the application can extract a string fragment of a specified length from a string and then write the string fragment into a field combination.
[0089] In one embodiment of this application, writing the contract identifier code into a contract field of a field combination includes: obtaining the field length of the contract field in the field combination; extracting a contract identifier code fragment that meets the field length from the contract identifier code according to the first hash value extraction rule agreed in the digital asset identifier contract; and writing the contract identifier code fragment into the contract field of the field combination.
[0090] The first hash value extraction rule is used to determine the position of the string segment to be extracted from the string. For example, if the specified field length is N, a string segment of length N can be extracted from the beginning of the string, or from the end of the string, or from a specified position in the middle of the string. The string segment extracted from the string can be a continuous sequence of characters or a non-contiguous sequence of characters.
[0091] In one embodiment of this application, the contract identifier is a 256-byte string obtained by encoding using the SHA256 encoding algorithm. This embodiment of the application can extract the 43-byte string fragment located at the beginning and write it into the contract field of the field combination.
[0092] In one embodiment of this application, the asset type of a digital asset can be quickly determined based on the asset identifier, and it can also be quickly determined whether the digital asset belongs to a specific digital asset generation contract.
[0093] For example, when it is necessary to determine the asset type of a digital asset, this application embodiment can extract the field value of the type field from the asset identifier, and then look up the corresponding asset type in the asset type mapping table maintained by the digital asset identifier contract based on the field value.
[0094] When it is necessary to determine the contract ownership of a digital asset, this embodiment of the application can extract the contract identifier code from the digital asset generation contract to be verified according to the scheme provided in the above embodiments, and extract fragments of the contract identifier code according to the first hash value extraction rule agreed in the digital asset identifier contract to obtain the identifier code fragment to be verified. The identifier code fragment to be verified is then checked for consistency with the field value of the contract field in the asset identifier. If the verification result is consistent, it indicates that the digital asset belongs to the digital asset generation contract to be verified.
[0095] Figure 7 This illustration shows a process for generating an asset identifier based on a field combination encoding including an index field, according to one embodiment of this application. In this embodiment, the field combination includes a type field (type), a contract field (contractH), and an index field (index), arranged sequentially. The type field (type) has a length of 4 bytes, the contract field (contractH) has a length of 43 bytes, and the index field (index) has a length of 8 bytes. Concatenating these three fields results in a field combination of 55 bytes.
[0096] In this application embodiment, the scheme for assigning values to the type field and the contract field contractH can refer to the above embodiment, and will not be repeated here.
[0097] When assigning a value to the index field, the index identifier code 702 maintained in the digital asset identifier contract 701 is first obtained. The index identifier code 702 adjusts its value in response to the call event of the digital asset identifier contract 701, and then the index identifier code 702 is written into the index field of the field combination. In one embodiment of this application, the digital asset identifier contract deployed on the blockchain can maintain a dynamically changing index identifier code. Whenever a call event of the digital asset identifier contract occurs, the index identifier code adjusts its value once. The index identifier code can be, for example, a continuously changing, automatically increasing value.
[0098] Figure 8 This illustration shows a process for generating an asset identifier based on a field combination encoding including a version field, according to one embodiment of this application. In this embodiment, the field combination includes, in sequence, a version field, a type field, a contract field (contractH), and an index field. The version field has a length of 1 byte, the type field has a length of 4 bytes, the contract field (contractH) has a length of 43 bytes, and the index field (index) has a length of 8 bytes. Concatenating these three fields results in a field combination of 56 bytes.
[0099] In this application embodiment, the scheme for assigning values to the type field, contract field, and index field can refer to the above embodiment, and will not be repeated here.
[0100] When assigning a value to the version field, the version identifier code 802 of the digital asset identifier contract 801 is first obtained, and then the version identifier code 802 is written into the version field of the field combination. In one embodiment of this application, different versions of digital asset identifier contracts are deployed on the blockchain, and different versions of digital asset identifier contracts are distinguished by different version identifier codes. In one embodiment of this application, when it is necessary to upgrade or update the contract content of the digital asset identifier contract, a new version identifier code can be assigned to it. In one embodiment of this application, since the index field has a specified field length, when the index identifier code maintained by the digital asset identifier contract reaches the maximum code value or reaches a code value threshold close to the maximum code value, it means that the digital asset identifier contract has reached or is close to the maximum number of calls. At this time, an updated version of the digital asset identifier contract can also be deployed on the blockchain, and a new version identifier code is assigned to the updated contract.
[0101] Figure 9This illustration shows a process for generating an asset identifier based on a field combination encoding including a version field, according to one embodiment of this application. In this embodiment, the field combination includes, in sequence, a version field, a type field, a contract field (contractH), an index field, and a check field (checkH). The version field has a length of 1 byte, the type field has a length of 4 bytes, the contract field (contractH) has a length of 43 bytes, the index field (index) has a length of 8 bytes, and the check field (checkH) has a length of 8 bytes. Concatenating these three fields results in a field combination of 64 bytes.
[0102] In this application embodiment, the scheme for assigning values to the version field, type field, contract field, and index field can refer to the above embodiment, and will not be repeated here.
[0103] When assigning a value to the verification field checkH, the field values of other fields preceding the verification field checkH in the field combination can be obtained first; then, the field values of other fields are hashed according to the second hash function 902 agreed in the digital asset identification contract 901 to obtain the verification identifier code 903; finally, the verification identifier code 903 is written into the verification field.
[0104] In one embodiment of this application, to improve verification accuracy and save storage space, a verification identifier code with a relatively long length can be obtained after performing a hash operation based on the second hash function. A shorter verification identifier code fragment is then extracted from the verification identifier code and written into the verification field. In this embodiment, the field length of the verification field in the field combination can be obtained first; then, according to the second hash value extraction rule agreed upon in the digital asset identifier contract, a verification identifier code fragment that meets the field length requirement is extracted from the verification identifier code; finally, the verification identifier code fragment is written into the verification field of the field combination. The second hash value extraction rule can be the same as or a different algorithm rule from the first hash value extraction rule in the above embodiments.
[0105] In one embodiment of this application, the second hash function 902 may employ the SHA256 algorithm to perform a hash operation on the 56-byte field value located before the check field checkH, thereby obtaining a 256-byte check identifier code. According to the second hash value extraction rule, an 8-byte check identifier code fragment can be extracted from its header, and then the check identifier code fragment is written into the check field of the field combination.
[0106] It should be noted that although the steps of the method in this application are described in a specific order in the accompanying drawings, this does not require or imply that the steps must be performed in that specific order, or that all the steps shown must be performed to achieve the desired result. Additional or alternative steps may be omitted, multiple steps may be combined into one step, and / or one step may be broken down into multiple steps.
[0107] The following describes an apparatus embodiment of this application, which can be used to execute the digital asset management method described in the above embodiments of this application. Figure 10 A schematic block diagram of the digital asset management device provided in an embodiment of this application is shown. Figure 10 As shown, the digital asset management device 1000 mainly includes:
[0108] The acquisition module 1010 is configured to acquire the asset type carried in the business request in response to a business request to generate digital assets;
[0109] The first calling module 1020 is configured to call a digital asset generation contract that matches the asset type to generate a digital asset corresponding to the business request. The digital asset generation contract is a smart contract deployed on the blockchain for generating digital assets.
[0110] The second calling module 1030 is configured to call a digital asset identification contract to generate an asset identifier based on the asset type and the contract code of the digital asset generation contract. The digital asset identification contract is a smart contract deployed on the blockchain for generating unique identifiers for digital assets.
[0111] In one embodiment of this application, the second invocation module 1030 includes:
[0112] The field combination acquisition module 1031 is configured to acquire a field combination including multiple fields from the digital asset identification contract, wherein each field in the field combination has a specified field length;
[0113] The field assignment module 1032 is configured to assign values to each field in the field combination according to the asset type and the contract code of the digital asset generating contract;
[0114] The field combination encoding module 1033 is configured to encode the field combination after the field assignment is completed to obtain the asset identifier.
[0115] In one embodiment of this application, based on the above embodiments, the field assignment module 1032 includes:
[0116] The type identifier code writing module is configured to obtain a type identifier code that matches the asset type and write the type identifier code into the type field of the field combination;
[0117] The contract identifier writing module is configured to generate a contract identifier based on the contract code of the contract generated by the data asset, and write the contract identifier into the contract field of the field combination.
[0118] In one embodiment of this application, based on the above embodiments, the type identifier code writing module is further configured to: obtain an asset type mapping table from the digital asset identifier contract, wherein the asset type mapping table is used to store the mapping relationship between different asset types and type identifier codes; and search for a type identifier code that matches the asset type in the asset type mapping table.
[0119] In one embodiment of this application, based on the above embodiments, the contract identifier code writing module is further configured to: obtain a randomly generated hash salt; embed the hash salt into the contract code of the digital asset generation contract; perform a hash operation on the contract code embedded with the hash salt according to the first hash function agreed in the digital asset identifier contract to obtain the contract identifier code.
[0120] In one embodiment of this application, based on the above embodiments, the contract identifier code writing module is further configured to: obtain the field length of the contract field in the field combination; extract a contract identifier code fragment that satisfies the field length from the contract identifier code according to the first hash value extraction rule agreed in the digital asset identifier contract; and write the contract identifier code fragment into the contract field of the field combination.
[0121] In one embodiment of this application, based on the above embodiments, the field assignment module 1032 further includes an index identifier code writing module, configured to: obtain the index identifier code maintained in the digital asset identifier contract, wherein the index identifier code adjusts its code value in response to the call event of the digital asset identifier contract; and write the index identifier code into the index field of the field combination.
[0122] In one embodiment of this application, based on the above embodiments, the field assignment module 1032 further includes a version identifier code writing module, configured to: obtain the version identifier code of the digital asset identifier contract; and write the version identifier code into the version field of the field combination.
[0123] In one embodiment of this application, based on the above embodiments, the field assignment module 1032 further includes a verification identifier writing module, configured to: obtain the field values of other fields located before the verification field in the field combination; perform a hash operation on the field values of the other fields according to the second hash function agreed in the digital asset identifier contract to obtain a verification identifier; and write the verification identifier into the verification field.
[0124] In one embodiment of this application, based on the above embodiments, the verification identifier writing module is further configured to: obtain the field length of the verification field in the field combination; extract a verification identifier fragment that satisfies the field length from the verification identifier according to the second hash value extraction rule agreed in the digital asset identifier contract; and write the verification identifier fragment into the verification field of the field combination.
[0125] In one embodiment of this application, based on the above embodiments, the field combination includes a version field, a type field, a contract field, an index field, and a verification field; wherein, the version field records a version identifier code for representing the contract version of the digital asset identification contract, the type field records a type identifier code for representing the asset type of the digital asset, the contract field records a contract identifier code for distinguishing digital asset generation contracts, the index field records an index identifier code for representing the invocation event of the digital asset identification contract, and the verification field records a verification identifier code for verifying the asset identification.
[0126] In one embodiment of this application, based on the above embodiments, the digital asset management device further includes: an asset writing module configured to associate the digital asset with the asset identifier and then write it into an asset generation record; a record broadcasting module configured to broadcast the asset generation record on a blockchain network, so that each blockchain node in the blockchain network performs consensus authentication on the asset generation record, and saves the asset generation record in a record buffer pool when the authentication is successful; a record packaging module configured to package the asset generation record saved in the record buffer pool into a block to be uploaded to the blockchain when the block generation conditions are met; and a block uploading module configured to broadcast the block to be uploaded to the blockchain network, so that each blockchain node in the blockchain network performs consensus authentication on the block to be uploaded to the blockchain, and performs uploading processing on the block to be uploaded to the blockchain when the authentication is successful, so as to save the block to be uploaded to the blockchain carrying the asset generation record.
[0127] The specific details of the digital asset management device provided in the various embodiments of this application have been described in detail in the corresponding method embodiments, and will not be repeated here.
[0128] Figure 11A schematic block diagram of a computer system architecture for implementing an electronic device according to embodiments of the present application is shown.
[0129] It should be noted that, Figure 11 The computer system 1100 of the electronic device shown is merely an example and should not impose any limitation on the functionality and scope of use of the embodiments of this application.
[0130] like Figure 11 As shown, the computer system 1100 includes a central processing unit (CPU) 1101, which can perform various appropriate actions and processes based on programs stored in read-only memory (ROM) 1102 or programs loaded from storage section 1108 into random access memory (RAM). The RAM 1103 also stores various programs and data required for system operation. The CPU 1101, ROM 1102, and RAM 1103 are interconnected via a bus 1104. An input / output interface 1105 (I / O interface) is also connected to the bus 1104.
[0131] The following components are connected to the input / output interface 1105: an input section 1106 including a keyboard, mouse, etc.; an output section 1107 including a cathode ray tube (CRT), liquid crystal display (LCD), etc., and speakers, etc.; a storage section 1108 including a hard disk, etc.; and a communication section 1109 including a network interface card such as a local area network card, modem, etc. The communication section 1109 performs communication processing via a network such as the Internet. A drive 1110 is also connected to the input / output interface 1105 as needed. Removable media 1111, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., are installed on the drive 1110 as needed so that computer programs read from them can be installed into the storage section 1108 as needed.
[0132] Specifically, according to embodiments of this application, the processes described in the various method flowcharts can be implemented as computer software programs. For example, embodiments of this application include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via communication section 1109, and / or installed from removable medium 1111. When the computer program is executed by central processing unit 1101, it performs various functions defined in the system of this application.
[0133] It should be noted that the computer-readable medium shown in the embodiments of this application can be a computer-readable signal medium, a computer-readable storage medium, or any combination of the two. A computer-readable storage medium can be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM), flash memory, optical fiber, portable compact disc read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this application, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In this application, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such transmitted data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. The computer-readable signal medium can also be any computer-readable medium other than a computer-readable storage medium, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to wireless, wired, etc., or any suitable combination thereof.
[0134] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram or flowchart, and combinations of blocks in a block diagram or flowchart, may be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0135] It should be noted that although several modules or units for the device used to perform actions have been mentioned in the detailed description above, this division is not mandatory. In fact, according to the embodiments of this application, the features and functions of two or more modules or units described above can be embodied in one module or unit. Conversely, the features and functions of one module or unit described above can be further divided and embodied by multiple modules or units.
[0136] Through the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein can be implemented by software or by combining software with necessary hardware. Therefore, the technical solutions according to the embodiments of this application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (such as a CD-ROM, USB flash drive, external hard drive, etc.) or on a network, including several instructions to cause a computing device (such as a personal computer, server, touch terminal, or network device, etc.) to execute the method according to the embodiments of this application.
[0137] Other embodiments of this application will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of this application that follow the general principles of this application and include common knowledge or customary techniques in the art not disclosed herein.
[0138] It should be understood that this application is not limited to the precise structure described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this application is limited only by the appended claims.
Claims
1. A digital asset management method, characterized in that, include: In response to a business request to generate digital assets, the asset type carried in the business request is obtained; Invoke a digital asset generation contract that matches the asset type to generate a digital asset corresponding to the business request. The digital asset generation contract is a smart contract deployed on the blockchain for generating digital assets. A digital asset identification contract is invoked to generate an asset identifier based on the asset type and the contract code of the digital asset generation contract. The digital asset identification contract is a smart contract deployed on the blockchain for generating unique identifiers for digital assets. Each field of the asset identifier has a specified field length. The asset identifier includes a type field and a contract field. The type field records a type identifier code representing the asset type of the digital asset. The contract field records a contract identifier code fragment of fixed field length. The contract identifier code is obtained by embedding a randomly generated hash salt into the contract code of the digital asset generation contract and then performing a hash operation on the contract code embedded with the hash salt according to a first hash function agreed upon in the digital asset identification contract. When it is necessary to determine the asset type of a digital asset, the field value of the type field is extracted from the asset identifier of the digital asset, and the asset type corresponding to the field value of the type field is searched in the asset type mapping table maintained by the digital asset identifier contract. When it is necessary to determine the contract ownership of a digital asset, the contract identifier code of the digital asset generation contract to be verified is extracted, and the contract identifier code is fragmented according to the first hash value extraction rule agreed in the digital asset identifier contract to obtain the identifier code fragment to be verified. The identifier code fragment to be verified is then checked for consistency with the field value of the contract field in the asset identifier. If the verification result is consistent, it means that the digital asset belongs to the digital asset generation contract to be verified.
2. The digital asset management method according to claim 1, characterized in that, An asset identifier is generated based on the asset type and the contract code of the digital asset generation contract, including: Obtain a field combination comprising multiple fields from the digital asset identification contract, wherein each field in the field combination has a specified field length; The values of each field in the field combination are assigned according to the asset type and the contract code of the digital asset generation contract; The asset identifier is obtained by encoding the combination of fields that have been assigned values.
3. The digital asset management method according to claim 2, characterized in that, The values in the field combination are assigned according to the asset type and the contract code of the digital asset generation contract, including: Obtain the type identifier code that matches the asset type, and write the type identifier code into the type field of the field combination; A contract identifier code is generated based on the contract code of the digital asset generation contract, and the contract identifier code is written into the contract field of the field combination.
4. The digital asset management method according to claim 3, characterized in that, Obtaining a type identifier code that matches the asset type includes: Obtain an asset type mapping table from the digital asset identification contract. The asset type mapping table is used to store the mapping relationship between different asset types and type identification codes. Search the asset type mapping table for the type identifier code that matches the asset type.
5. The digital asset management method according to claim 3, characterized in that, Generate a contract identifier code based on the contract code of the digital asset generation contract, including: Get the randomly generated hash salt; The hash salt is embedded into the contract code of the digital asset generation contract; The contract identifier code is obtained by performing a hash operation on the contract code embedded with the hash salt according to the first hash function agreed in the digital asset identifier contract.
6. The digital asset management method according to claim 3, characterized in that, Write the contract identifier into the contract fields of the field combination, including: Obtain the field length of the contract field in the field combination; According to the first hash value extraction rule agreed in the digital asset identification contract, extract the contract identification code fragment that meets the field length from the contract identification code; Write the contract identifier fragment into the contract field of the field combination.
7. The digital asset management method according to claim 2, characterized in that, Before encoding the field combinations that have completed field assignment, the method further includes: Obtain the index identifier code maintained in the digital asset identifier contract, the index identifier code value is adjusted in response to the call event of the digital asset identifier contract; Write the index identifier into the index field of the field combination.
8. The digital asset management method according to claim 2, characterized in that, Before encoding the field combinations that have completed field assignment, the method further includes: Obtain the version identifier code of the digital asset identification contract; Write the version identifier code into the version field of the field combination.
9. The digital asset management method according to claim 2, characterized in that, Before encoding the field combinations that have completed field assignment, the method further includes: Obtain the field values of the other fields in the field combination that precede the validation field; The field values of the other fields are hashed according to the second hash function agreed in the digital asset identification contract to obtain the verification identification code; Write the verification identifier code into the verification field.
10. The digital asset management method according to claim 9, characterized in that, Writing the verification identifier code into the verification field includes: Obtain the field length of the validation field in the field combination; According to the second hash value extraction rule agreed in the digital asset identification contract, extract the verification identification code fragment that meets the field length from the verification identification code; Write the verification identifier fragment into the verification field of the field combination.
11. The digital asset management method according to claim 2, characterized in that, The field combination includes a version field, a type field, a contract field, an index field, and a verification field; wherein, the version field records a version identifier code used to indicate the contract version of the digital asset identification contract, the type field records a type identifier code used to indicate the asset type of the digital asset, the contract field records a contract identifier code used to distinguish the digital asset generation contract, the index field records an index identifier code used to indicate the invocation event of the digital asset identification contract, and the verification field records a verification identifier code used to verify the asset identification.
12. The digital asset management method according to any one of claims 1 to 11, characterized in that, After generating an asset identifier based on the asset type and the contract code of the digital asset generation contract, the method further includes: The digital asset is associated with the asset identifier and then written into the asset generation record; The asset generation record is broadcast on the blockchain network so that each blockchain node in the blockchain network can perform consensus authentication of the asset generation record, and save the asset generation record in the record buffer pool when the authentication is successful; When the block generation conditions are met, the asset generation records stored in the record buffer pool are packaged into blocks to be uploaded to the blockchain. The block to be added to the blockchain is broadcast on the blockchain network so that each blockchain node in the blockchain network can perform consensus authentication on the block to be added to the blockchain. When the authentication is successful, the block to be added to the blockchain is processed to save the block carrying the asset generation record on the blockchain.
13. A digital asset management device, characterized in that, include: The acquisition module is configured to acquire the asset type carried in the business request in response to a business request to generate digital assets; The first calling module is configured to call a digital asset generation contract that matches the asset type to generate a digital asset corresponding to the business request. The digital asset generation contract is a smart contract deployed on the blockchain for generating digital assets. The second calling module is configured to invoke a digital asset identification contract to generate an asset identifier based on the asset type and the contract code of the digital asset generation contract. The digital asset identification contract is a smart contract deployed on the blockchain for generating unique identifiers for digital assets. Each field in the asset identifier has a specified length. The asset identifier includes a type field and a contract field. The type field records a type identifier code representing the asset type of the digital asset. The contract field records a fixed-length contract identifier code fragment. The contract identifier code is generated by embedding a randomly generated hash salt into the contract code of the digital asset generation contract and then applying the hash salt to the code according to a first hash function agreed upon in the digital asset identification contract. The salt is obtained by hashing the contract code. When it is necessary to determine the asset type of a digital asset, the field value of the type field is extracted from the asset identifier of the digital asset, and the asset type corresponding to the field value of the type field is searched in the asset type mapping table maintained by the digital asset identifier contract. When it is necessary to determine the contract ownership of a digital asset, the contract identifier code is extracted from the digital asset generation contract to be verified, and the contract identifier code is fragmented according to the first hash value extraction rule agreed in the digital asset identifier contract to obtain the identifier code fragment to be verified. The identifier code fragment to be verified is then checked for consistency with the field value of the contract field in the asset identifier. If the verification result is consistent, it means that the digital asset belongs to the digital asset generation contract to be verified.
14. A computer-readable medium, characterized in that, The computer-readable medium stores a computer program that, when executed by a processor, implements the digital asset management method according to any one of claims 1 to 12.
15. An electronic device, characterized in that, include: processor; as well as Memory for storing the executable instructions of the processor; The processor is configured to cause the electronic device to perform the digital asset management method according to any one of claims 1 to 12 by executing the executable instructions.
16. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the digital asset management method according to any one of claims 1 to 12.
Citation Information
Patent Citations
Asset contract publishing method and device, electronic equipment and readable storage medium
CN112714157A
Article safe and efficient transaction method and system based on block chain network, and storage medium
CN113450092A