Evidence storage method, system and device based on move virtual machine
By depositing the unique identifier entered by the user as the key value into the smart contract address, the key-value pairs passed by the user can be put on the link, which solves the problem that users cannot write key-value pairs in the MOVE smart contract, and achieves a more flexible and applicable data proof storage requirement.
Patent Information
- Application Number
- CN202411606921.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-12
- Publication Date
- 2025-03-04
AI Technical Summary
In the MOVE smart contract programming language, users cannot write key value pairs arbitrarily, resulting in difficulty in querying data.
By obtaining the address of the smart contract, the unique identifier (signer value) entered by the user is stored as the key value into the smart contract address, so that the key-value pairs passed by the user can be linked.
It solves the problem that MOVE virtual machines cannot perform key-value pairing on the link, and realizes that users can write key-value pairing data arbitrarily, meets more diverse data proof requirements, and improves query flexibility and adaptability.
Smart Images

Figure CN119557312A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of blockchain, and in particular to a method, system and device for storing evidence based on a move virtual machine. Background Art
[0002] One of the main applications of blockchain technology is to write proof information into the blockchain to prevent tampering. Proof information is usually written into the blockchain in the structure of key-value pairs, which requires the blockchain smart contract programming language to provide an interface for users. The interface input parameters are key and value, that is, fn set_proof(key, value). However, in the MOVE smart contract programming language, users are only allowed to pass value, not key, and the key is generated by the MOVE smart contract programming language. In the MOVE virtual machine, only signer can be used as an address. The virtual machine calculates a key value through the value passed by the user and stores the key value in the address signer. That is, the user can only write value arbitrarily, but cannot write key arbitrarily. This results in the inability of subsequent query users to query data through key, causing the problem of difficult data query.
[0003] There is currently no effective solution to the above problems in the prior art. Summary of the invention
[0004] To solve the above problems, the present invention provides a notarization method, system and device based on the move virtual machine. By obtaining the address of the smart contract, the unique identifier input by the user, that is, the singer value, is stored as the key value in the smart contract address, so that the key-value pairs transmitted by the user can be uploaded to the chain to ensure subsequent queries, thereby solving the problem in the prior art that the move virtual machine cannot upload key-value pairs to the chain.
[0005] To achieve the above-mentioned purpose, the present invention provides a notarization method based on a move virtual machine, comprising: obtaining a smart contract of a target product; wherein the smart contract includes a unique identifier and related information of the target product; executing the smart contract through a move virtual machine; according to the smart contract address of the executed smart contract, using the unique identifier and related information as a key-value pair, and writing the key-value pair into a blockchain.
[0006] Further optionally, according to the smart contract address of the executed smart contract, the unique identifier and related information are used as a key-value pair, and the key-value pair is written into the blockchain, including: determining the smart contract address of the smart contract; using the unique identifier as singer and the related information as T; and writing singer and T as a key-value pair into the smart contract address.
[0007] Further optionally, before executing the smart contract through the move virtual machine, it includes: performing a hash value calculation on the unique identifier and related information to obtain a verification hash value; after executing the smart contract through the move virtual machine, it includes: storing the verification hash value in the smart contract address.
[0008] Further optionally, before writing the key-value pair into the blockchain, the method includes: performing a security check on the key-value pair; and writing the key-value pair that passes the security check into the blockchain.
[0009] On the other hand, the present invention also provides a notarization system based on the move virtual machine, comprising: a data acquisition module, used to obtain the smart contract of the target product; wherein the smart contract includes a unique identifier and related information of the target product; a contract execution module, used to execute the smart contract through the move virtual machine; an notarization module, used to use the unique identifier and related information as a key-value pair according to the smart contract address of the executed smart contract, and write the key-value pair into the blockchain.
[0010] Further optionally, the evidence storage module includes: a contract address determination submodule, used to determine the smart contract address of the smart contract; a data storage submodule, used to use the unique identifier as singer and the relevant information as T; and a writing submodule, used to write singer and T as a key-value pair into the smart contract address.
[0011] Further optionally, the system also includes: a hash value calculation module, used to perform hash value calculation on the unique identifier and related information to obtain a verification hash value; and a hash value writing module, used to store the verification hash value in the smart contract address.
[0012] Further optionally, the system also includes: a verification module, used to perform security verification on the key-value pair; and a post-verification writing module, used to write the key-value pair that passes the security verification into the blockchain.
[0013] On the other hand, the present invention also provides a evidence storage device based on a move virtual machine, including the above-mentioned evidence storage system based on a move virtual machine.
[0014] On the other hand, the present invention also provides a computer-readable storage medium having a computer program stored thereon, and when the program is executed by a processor, the above-mentioned evidence storage method based on the move virtual machine is implemented.
[0015] The above technical solution has the following beneficial effects: it changes the original limitations of the move virtual machine, allowing users to arbitrarily write key-value pairs of data through the address of the smart contract, meeting more diverse data storage needs; ensuring that querying users can query relevant information of corresponding products based on the key, improving flexibility and adaptability, and being applicable to the storage needs of different industries. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0017] Figure 1 It is a flow chart of a method for storing evidence based on a move virtual machine provided in an embodiment of the present invention;
[0018] Figure 2 is a flow chart of a key-value pair uplink method provided by an embodiment of the present invention;
[0019] Figure 3 is a flow chart of an information verification method provided by an embodiment of the present invention;
[0020] Figure 4 is a flow chart of a security verification method provided by an embodiment of the present invention;
[0021] Figure 5 It is a structural diagram of a proof storage system based on a move virtual machine provided in an embodiment of the present invention;
[0022] Figure 6 It is a structural diagram of a certificate storage module provided in an embodiment of the present invention;
[0023] Figure 7 is a schematic diagram of the structure of a module for information verification provided by an embodiment of the present invention;
[0024] Figure 8 It is a schematic diagram of the structure of a module for security verification provided by an embodiment of the present invention.
[0025] Figure numerals: 100 - data acquisition module; 200 - contract execution module; 300 - evidence storage module; 3001 - contract address determination submodule; 3002 - data storage submodule; 3003 - writing submodule; 400 - hash value calculation module; 500 - hash value writing module; 600 - verification module; 700 - post-verification writing module. DETAILED DESCRIPTION
[0026] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0027] In order to solve the problem in the prior art that the move virtual machine cannot allow users to write keys, an embodiment of the present invention provides a method for storing evidence based on the move virtual machine. Figure 1 is a flow chart of a method for storing evidence based on a move virtual machine provided in an embodiment of the present invention, such as Figure 1 As shown, the method includes:
[0028] S1. Obtain a smart contract for a target product; wherein the smart contract includes a unique identifier of the target product and related information;
[0029] In order to ensure the traceability of certain products, the product information of the target product is often stored in the blockchain. Due to the characteristics of blockchain such as openness, immutability, and traceability, it can be used as an effective and authoritative evidence database.
[0030] For example, in the field of luxury goods notarization, the manufacturer of luxury goods can set the unique identifier of the target product (such as serial number, production batch, etc.) and related information of the target product (such as manufacturer, production date, product description, etc.). The unique identifier and related information of luxury goods can be uploaded to the chain through smart contracts to complete information notarization.
[0031] S2. Execute smart contracts through the move virtual machine;
[0032] The move virtual machine is the core environment for the execution of smart contracts. At this stage, the smart contract is loaded into the move virtual machine, which is responsible for executing the instructions in the smart contract. During the execution process, the move virtual machine ensures that all operations of the smart contract (such as writing, updating, etc.) comply with the pre-set logical rules of the contract. The move virtual machine also provides resource management and security control to ensure that the operation of the contract does not abuse resources or affect the execution of other contracts.
[0033] S3. According to the smart contract address of the executed smart contract, the unique identifier and related information are used as a key-value pair, and the key-value pair is written into the blockchain.
[0034] The smart contract address is the unique identifier of the corresponding smart contract on the blockchain. At this point, the MOVE virtual machine has completed the execution of the smart contract and obtained the smart contract address that stores the luxury goods information.
[0035] The move virtual machine uses the unique identifier and related information as a key-value pair based on the smart contract address, and writes the key-value pair to the smart contract address on the blockchain. This process means that the identification and information of the luxury goods are permanently stored in the blockchain, and any subsequent query and verification operations can directly access the address to read the information of the luxury goods.
[0036] As an optional implementation, Figure 2 is a flow chart of a key-value pair uplink method provided by an embodiment of the present invention, such as Figure 2 As shown, according to the smart contract address of the executed smart contract, the unique identifier and related information are used as a key-value pair, and the key-value pair is written into the blockchain, including:
[0037] S301. Determine the smart contract address of the smart contract;
[0038] S302, taking the unique identifier as singer and the relevant information as T;
[0039] S303. Write singer and T as a key-value pair into the smart contract address.
[0040] Determine the contract address of the smart contract to be run this time, name it address, use the unique identifier as signer, i.e. the key in the key-value pair, and use the relevant information as T, i.e. the value in the key-value pair. Write the key-value data (signer, T) into the address address to achieve the key-value pair on-chain.
[0041] As an optional implementation, Figure 3 is a flow chart of an information verification method provided by an embodiment of the present invention, such as Figure 3 As shown, before executing the smart contract through the move virtual machine, it includes:
[0042] S4. Calculate the hash value of the unique identifier and related information to obtain a verification hash value;
[0043] After executing the smart contract through the move virtual machine, it includes:
[0044] S5. Store the verification hash value in the smart contract address.
[0045] Before the unique identifier and related information of the target product are input into the move virtual machine, the unique identifier and related information are hashed to generate a verification hash value. The verification hash value is stored in the smart contract address together with the unique identifier and related information of the target product. In subsequent inquiries, the hash value of the unique identifier and related information of the target product is recalculated and compared with the stored verification hash value to ensure the integrity of the stored data and ensure that the queried data has not been tampered with.
[0046] As an optional implementation, Figure 4 is a flow chart of a security verification method provided by an embodiment of the present invention, such as Figure 4 As shown, before writing the key-value pair into the blockchain, it includes:
[0047] S6. Perform security verification on the key-value pair;
[0048] S7. Write the key-value pairs that pass the security verification into the blockchain.
[0049] Before data is written into the blockchain, the unique identifier and related information of the target product are securely verified. The security verification includes multiple forms of verification, such as format verification, data integrity verification, and authenticity verification.
[0050] Data that has passed multiple security verifications meets the requirements for evidence storage, and the key-value pairs that have passed security verification will be stored in the blockchain.
[0051] The embodiment of the present invention also provides a proof storage system based on the move virtual machine. Figure 5 is a schematic diagram of the structure of the evidence storage system based on the move virtual machine provided in an embodiment of the present invention, such as Figure 5 As shown, the system includes:
[0052] The data acquisition module 100 is used to acquire the smart contract of the target product; wherein the smart contract includes the unique identifier of the target product and related information;
[0053] In order to ensure the traceability of certain products, the product information of the target product is often stored in the blockchain. Due to the characteristics of blockchain such as openness, immutability, and traceability, it can be used as an effective and authoritative evidence database.
[0054] For example, in the field of luxury goods notarization, the manufacturer of luxury goods can set the unique identifier of the target product (such as serial number, production batch, etc.) and related information of the target product (such as manufacturer, production date, product description, etc.). The unique identifier and related information of luxury goods can be uploaded to the chain through smart contracts to complete information notarization.
[0055] The contract execution module 200 is used to execute the smart contract through the move virtual machine;
[0056] The move virtual machine is the core environment for the execution of smart contracts. At this stage, the smart contract is loaded into the move virtual machine, which is responsible for executing the instructions in the smart contract. During the execution process, the move virtual machine ensures that all operations of the smart contract (such as writing, updating, etc.) comply with the pre-set logical rules of the contract. The move virtual machine also provides resource management and security control to ensure that the operation of the contract does not abuse resources or affect the execution of other contracts.
[0057] The evidence storage module 300 is used to use the unique identifier and related information as a key-value pair according to the smart contract address of the executed smart contract, and write the key-value pair into the blockchain.
[0058] The smart contract address is the unique identifier of the corresponding smart contract on the blockchain. At this point, the MOVE virtual machine has completed the execution of the smart contract and obtained the smart contract address that stores the luxury goods information.
[0059] The move virtual machine uses the unique identifier and related information as a key-value pair based on the smart contract address, and writes the key-value pair to the smart contract address on the blockchain. This process means that the identification and information of the luxury goods are permanently stored in the blockchain, and any subsequent query and verification operations can directly access the address to read the information of the luxury goods.
[0060] As an optional implementation, Figure 6 is a schematic diagram of the structure of the evidence storage module provided by an embodiment of the present invention, such as Figure 6 As shown, the evidence storage module 300 includes:
[0061] The contract address determination submodule 3001 is used to determine the smart contract address of the smart contract;
[0062] The data storage submodule 3002 is used to use the unique identifier as singer and the related information as T;
[0063] The writing submodule 3003 is used to write singer and T as a key-value pair into the smart contract address.
[0064] Determine the contract address of the smart contract to be run this time, name it address, use the unique identifier as signer, i.e. the key in the key-value pair, and use the relevant information as T, i.e. the value in the key-value pair. Write the key-value data (signer, T) into the address address to achieve the key-value pair on-chain.
[0065] As an optional implementation, Figure 7is a schematic diagram of the structure of a module for information verification provided by an embodiment of the present invention, such as Figure 7 As shown, the system also includes:
[0066] A hash value calculation module 400 is used to calculate a hash value for a unique identifier and related information to obtain a verification hash value;
[0067] The hash value writing module 500 is used to store the verification hash value into the smart contract address.
[0068] Before the unique identifier and related information of the target product are input into the move virtual machine, the unique identifier and related information are hashed to generate a verification hash value. The verification hash value is stored in the smart contract address together with the unique identifier and related information of the target product. In subsequent inquiries, the hash value of the unique identifier and related information of the target product is recalculated and compared with the stored verification hash value to ensure the integrity of the stored data and ensure that the queried data has not been tampered with.
[0069] As an optional implementation, Figure 8 is a schematic diagram of the structure of a module for security verification provided by an embodiment of the present invention, such as Figure 8 As shown, the system also includes:
[0070] Verification module 600, used to perform security verification on key-value pairs;
[0071] The post-verification writing module 700 is used to write the key-value pairs that have passed the security verification into the blockchain.
[0072] Before data is written into the blockchain, the unique identifier and related information of the target product are securely verified. The security verification includes multiple forms of verification, such as format verification, data integrity verification, and authenticity verification.
[0073] Data that has passed multiple security verifications meets the requirements for evidence storage, and the key-value pairs that have passed security verification will be stored in the blockchain.
[0074] An embodiment of the present invention further provides a move virtual machine-based evidence storage device, including the above-mentioned move virtual machine-based evidence storage system.
[0075] An embodiment of the present invention further provides a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, the above-mentioned evidence storage method based on the move virtual machine is implemented.
[0076] The above storage media include but are not limited to: CDs, floppy disks, hard disks, erasable memory, etc.
[0077] The above technical solution has the following beneficial effects: it changes the original limitations of the move virtual machine, allowing users to arbitrarily write key-value pairs of data through the address of the smart contract, meeting more diverse data storage needs; ensuring that querying users can query relevant information of corresponding products based on the key, improving flexibility and adaptability, and being applicable to the storage needs of different industries.
[0078] The specific implementation methods of the above invention further illustrate the objectives, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above content is only the specific implementation methods of the present invention and is not intended to limit the protection scope of the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the protection scope of the present invention.
Claims
1. A method for storing evidence based on a move virtual machine, characterized in that: include: Obtaining a smart contract for a target product; wherein the smart contract includes a unique identifier of the target product and related information; Execute the smart contract through the move virtual machine; According to the smart contract address of the executed smart contract, the unique identifier and related information are used as a key-value pair, and the key-value pair is written into the blockchain.
2. The evidence storage method based on the move virtual machine according to claim 1 is characterized in that: The method of using the unique identifier and related information as a key-value pair according to the smart contract address of the executed smart contract, and writing the key-value pair into the blockchain includes: Determining a smart contract address of the smart contract; The unique identifier is taken as singer, and the related information is taken as T; Write singer and T as a key-value pair into the smart contract address.
3. The evidence storage method based on the move virtual machine according to claim 2 is characterized in that: Before executing the smart contract through the move virtual machine, it includes: Performing hash value calculation on the unique identifier and related information to obtain a verification hash value; After the smart contract is executed through the move virtual machine, it includes: The verification hash value is stored in the smart contract address.
4. The evidence storage method based on the move virtual machine according to claim 1 is characterized in that: Before writing the key-value pair into the blockchain, the process includes: Performing security verification on the key-value pair; Write the key-value pairs that pass security verification into the blockchain.
5. A proof storage system based on move virtual machine, characterized in that: include: A data acquisition module, used to acquire a smart contract of a target product; wherein the smart contract includes a unique identifier of the target product and related information; A contract execution module, used to execute the smart contract through the move virtual machine; The evidence storage module is used to use the unique identifier and related information as a key-value pair according to the smart contract address of the executed smart contract, and write the key-value pair into the blockchain.
6. The evidence storage system based on the move virtual machine according to claim 5 is characterized in that: The evidence storage module includes: A contract address determination submodule, used to determine the smart contract address of the smart contract; A data storage submodule, used to use the unique identifier as singer and the related information as T; The writing submodule is used to write singer and T as a key-value pair into the smart contract address.
7. The evidence storage system based on the move virtual machine according to claim 6 is characterized in that: Also includes: A hash value calculation module, used to perform hash value calculation on the unique identifier and related information to obtain a verification hash value; The hash value writing module is used to store the verification hash value in the smart contract address.
8. The evidence storage system based on the move virtual machine according to claim 5 is characterized in that: Also includes: A verification module, used to perform security verification on the key-value pair; The post-verification writing module is used to write key-value pairs that have passed security verification into the blockchain.
9. A proof storage device based on a move virtual machine, characterized in that: It includes a move virtual machine-based evidence storage system as described in any one of claims 5 to 8.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by the processor, the evidence storage method based on the move virtual machine as described in any one of claims 1 to 4 is implemented.