CN116996226A - Virtual asset processing method, device, equipment and medium in blockchain - Google Patents

Virtual asset processing method, device, equipment and medium in blockchain Download PDF

Info

Publication number
CN116996226A
CN116996226A CN202210446672.XA CN202210446672A CN116996226A CN 116996226 A CN116996226 A CN 116996226A CN 202210446672 A CN202210446672 A CN 202210446672A CN 116996226 A CN116996226 A CN 116996226A
Authority
CN
China
Prior art keywords
asset
random
random number
contract
transfer
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210446672.XA
Other languages
Chinese (zh)
Inventor
陈自民
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN202210446672.XA priority Critical patent/CN116996226A/en
Publication of CN116996226A publication Critical patent/CN116996226A/en
Pending legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/32Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials
    • H04L9/3247Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials involving digital signatures
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/08Key distribution or management, e.g. generation, sharing or updating, of cryptographic keys or passwords
    • H04L9/0861Generation of secret information including derivation or calculation of cryptographic keys or passwords
    • H04L9/0869Generation of secret information including derivation or calculation of cryptographic keys or passwords involving random numbers or seeds
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/32Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials
    • H04L9/3236Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials using cryptographic hash functions
    • H04L9/3239Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials using cryptographic hash functions involving non-keyed hash functions, e.g. modification detection codes [MDCs], MD5, SHA or RIPEMD
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Financial Or Insurance-Related Operations Such As Payment And Settlement (AREA)

Abstract

The embodiment of the application provides a virtual asset processing method, device, equipment and medium in a blockchain, wherein the method comprises the following steps: receiving an asset acquisition request sent by request equipment, and calling an asset transfer contract in a blockchain based on a random factor carried by the asset acquisition request; invoking a random verifiable contract in the blockchain through the asset transfer contract, generating a private key based on the random factor and the random number stored in the random verifiable contract, and generating an asset transfer random number; and determining a target virtual asset corresponding to the asset transfer random number through an asset transfer contract, and returning the target virtual asset and the asset transfer random number to the requesting device so that the requesting device verifies the validity of the target virtual asset based on the random factor, the asset transfer random number and the random number verification public key. By adopting the embodiment of the application, the randomness of the virtual asset distribution can be ensured, and the verifiability of the virtual asset random distribution can be improved.

Description

Virtual asset processing method, device, equipment and medium in blockchain
Technical Field
The present application relates to the field of blockchain technologies, and in particular, to a method, an apparatus, a device, and a medium for processing virtual assets in a blockchain.
Background
In the current virtual asset scene on the blockchain, after the asset issuing party issues virtual assets on the blockchain, the random retrieval rules of the virtual assets on the blockchain can be issued in an intelligent contract, and under normal conditions, an object can call the intelligent contract in the blockchain to retrieve the virtual assets issued by the asset issuing party in the blockchain, and when the object initiates a transaction for retrieving the virtual assets to the blockchain, the specific retrieved virtual assets are determined, so that the process of retrieving the virtual assets by the object on the blockchain does not have randomness, and the object can control the specific retrieved virtual assets through continuous transaction initiation time, so that the virtual asset issuing process is false.
Disclosure of Invention
The embodiment of the application provides a virtual asset processing method, device, equipment and medium in a blockchain, which can ensure the randomness of virtual asset distribution and can improve the verifiability of virtual asset random distribution.
In one aspect, an embodiment of the present application provides a method for processing a virtual asset in a blockchain, including:
receiving an asset acquisition request sent by request equipment, and calling an asset transfer contract in a blockchain based on a random factor carried by the asset acquisition request;
Invoking a random verifiable contract in the blockchain through the asset transfer contract, generating a private key based on the random factor and the random number stored in the random verifiable contract, and generating an asset transfer random number;
and determining a target virtual asset corresponding to the asset transfer random number through an asset transfer contract, and returning the target virtual asset and the asset transfer random number to the requesting device so that the requesting device verifies the validity of the target virtual asset based on the random factor, the asset transfer random number and the random number verification public key.
In one aspect, an embodiment of the present application provides a method for processing a virtual asset in a blockchain, including:
sending an asset acquisition request carrying a random factor to the block chain link point, so that the block chain link point calls an asset transfer contract in a block chain based on the random factor, and determining a target virtual asset corresponding to the asset transfer random number through the asset transfer contract; the asset transfer random number is generated based on a random factor and a random number generation private key stored in a random verifiable contract, the random verifiable contract being invoked by the asset transfer contract;
and receiving the target virtual asset and the asset transfer random number returned by the block chain node, and obtaining a random verification result of the asset transfer random number through the random factor, the asset transfer random number and the random number verification public key, and determining that the target virtual asset has effectiveness when the random verification result indicates that verification is passed.
An aspect of an embodiment of the present application provides a virtual asset processing apparatus in a blockchain, including:
the contract calling module is used for receiving an asset acquisition request sent by the request equipment and calling an asset transfer contract in the block chain based on a random factor carried by the asset acquisition request;
the random number generation module is used for calling a random verifiable contract in the blockchain through the asset transfer contract, generating a private key based on the random factor and the random number stored in the random verifiable contract, and generating an asset transfer random number;
and the virtual asset determining module is used for determining a target virtual asset corresponding to the asset transfer random number through an asset transfer contract, and returning the target virtual asset and the asset transfer random number to the requesting device so that the requesting device verifies the validity of the target virtual asset based on the random factor, the asset transfer random number and the random number verification public key.
Wherein the contract invoking module comprises:
the validity verification unit is used for receiving the asset retrieval request sent by the request equipment, and verifying the validity of the asset retrieval request to obtain a request verification result corresponding to the asset retrieval request;
and the asset transfer contract calling unit is used for acquiring the random factor carried by the asset acquisition request when the verification result of the request indicates that the verification is successful, and calling the asset transfer contract in the blockchain based on the random factor.
Wherein the validity verification unit includes:
the signature acquisition subunit is used for acquiring the digital signature carried by the asset acquisition request and the object public key corresponding to the request equipment;
the hash operation subunit is used for decrypting the digital signature based on the object public key to obtain first abstract information corresponding to the digital signature, and carrying out hash operation on the asset acquisition request based on a hash algorithm to obtain second abstract information corresponding to the asset acquisition request;
and the verification passing subunit is used for determining a request verification result corresponding to the asset acquisition request as a verification passing result if the first abstract information is the same as the second abstract information.
Wherein, the random number generation module includes:
the asset acquisition permission determination unit is used for acquiring object information carried by the asset acquisition request, and determining that a target object associated with the request equipment has asset acquisition permission when the object information meets asset acquisition conditions indicated by the asset transfer contract;
a random verifiable contract invoking unit for passing the random factor into the random verifiable contract in the blockchain through the asset transfer contract, the random verifiable contract being executed based on the random factor.
Wherein the random number generation module further comprises:
A random number generation service calling unit, configured to obtain a random number generation private key stored in a random verifiable contract, and call a random number generation service through a random factor in the random verifiable contract; the random number generation service does not belong to the blockchain;
and the asset transfer random number generation unit is used for calculating the random number generation private key and the random factor based on the verifiable random function in the random number generation service to obtain the asset transfer random number.
Wherein the virtual asset determination module comprises:
an asset quantity acquisition unit configured to acquire a virtual asset set in an asset transfer contract, and acquire an asset quantity of virtual assets included in the virtual asset set;
and the virtual asset transfer unit is used for executing transfer business logic in the asset transfer contract, acquiring a target virtual asset for transfer according to the asset transfer random number and the asset quantity, and transferring the target virtual asset in the virtual asset set to an object account corresponding to the request equipment.
Wherein the virtual asset transfer unit is specifically configured to:
executing transfer business logic in an asset transfer contract, and performing surplus operation on the number of assets through an asset transfer random number to obtain a first virtual asset;
If the first virtual asset does not belong to the virtual asset set, continuing to perform residual taking operation on the number of assets through the first virtual asset to obtain a second virtual asset;
if the second virtual asset belongs to the set of virtual assets, the first virtual asset is determined to be the target virtual asset for transfer.
An aspect of an embodiment of the present application provides a virtual asset processing apparatus in a blockchain, including:
the sending module is used for sending an asset acquisition request carrying a random factor to the block chain link point so that the block chain link point calls an asset transfer contract in the block chain based on the random factor, and a target virtual asset corresponding to the asset transfer random number is determined through the asset transfer contract; the asset transfer random number is generated based on a random factor and a random number generation private key stored in a random verifiable contract, the random verifiable contract being invoked by the asset transfer contract;
the receiving module is used for receiving the target virtual asset and the asset transfer random number returned by the block link point, obtaining a random verification result of the asset transfer random number through the random factor, the asset transfer random number and the random number verification public key, and determining that the target virtual asset has effectiveness when the random verification result indicates that verification passes.
Wherein the apparatus further comprises:
and the audit request sending module is used for determining that the target virtual asset is not valid when the random verification result indicates verification failure, and sending an asset transfer audit request to the block chain link node so as to enable the block chain node to reallocate the target virtual asset for transfer for the requesting equipment.
Wherein the apparatus further comprises:
the authentication information verification module is used for receiving an object registration request corresponding to a target object, acquiring object authentication information carried by the object registration request, and verifying the object authentication information through the object management interface to obtain an identity authentication result corresponding to the object authentication information;
and the request permission determination module is used for determining that the target object has permission to initiate an asset acquisition request when the identity authentication result indicates that the authentication is successful.
Wherein the apparatus further comprises:
and the random factor generation module is used for acquiring the generation time stamp corresponding to the asset retrieval request, acquiring the random factor according to the generation time stamp, and adding the random factor to the asset retrieval request.
An aspect of an embodiment of the present application provides a computer device, including a memory and a processor, where the memory is connected to the processor, and the memory is used to store a computer program, and the processor is used to call the computer program, so that the computer device performs the method provided in the foregoing aspect of the embodiment of the present application.
An aspect of an embodiment of the present application provides a computer readable storage medium, in which a computer program is stored, the computer program being adapted to be loaded and executed by a processor, to cause a computer device having a processor to perform the method provided in the above aspect of an embodiment of the present application.
According to one aspect of the present application, there is provided a computer program product or computer program comprising computer instructions stored in a computer readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device performs the method provided in the above aspect.
In the embodiment of the application, by arranging the asset transfer contract and the random verifiable contract in the blockchain, after receiving the asset acquisition request sent by the request equipment, the asset transfer contract in the blockchain can be called based on the random factor carried by the asset acquisition request, so that the random verifiable contract in the blockchain can be called through the asset transfer contract, and a private key (a private key corresponding to the random verifiable contract) is generated based on the random factor uploaded by the request equipment and the random number, so that a verifiable asset transfer random number is generated. The target virtual asset corresponding to the asset transfer random number can be determined through the asset transfer contract, the target virtual asset and the asset transfer random number can be returned to the requesting device, the requesting device can verify the validity of the target virtual asset based on the random factor, the asset transfer random number and the random number verification public key, namely, the verifiable asset transfer random number can be generated under the blockchain by introducing the random verifiable contract, the randomness of virtual asset distribution can be ensured by verifying the correctness of the asset transfer random number, and the verifiability of virtual asset distribution can be improved.
Drawings
In order to more clearly illustrate the embodiments of the application or the technical solutions in the prior art, the drawings that are required in the embodiments or the description of the prior art will be briefly described, it being obvious that the drawings in the following description are only some embodiments of the application, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 is a schematic structural diagram of a network architecture according to an embodiment of the present application;
FIG. 2 is a schematic diagram of deployment of a blockchain smart contract provided by an embodiment of the present application;
FIG. 3 is a flow chart of a method for handling virtual assets in a blockchain in accordance with an embodiment of the present application;
FIG. 4 is a schematic diagram of transaction synchronization in a blockchain network according to an embodiment of the present application;
FIG. 5 is a schematic diagram of a virtual asset random acquisition on a blockchain according to an embodiment of the present application;
FIG. 6 is a timing diagram of a virtual asset handling method in a blockchain according to an embodiment of the present application;
FIG. 7 is a schematic view of a scenario of object registration according to an embodiment of the present application;
FIG. 8 is a flow chart of a virtual asset delivery method in a blockchain according to an embodiment of the present application;
FIG. 9 is a schematic diagram of a virtual asset processing device in a blockchain according to an embodiment of the present application;
FIG. 10 is a schematic diagram of another exemplary architecture of a virtual asset processing device in a blockchain according to the present application;
fig. 11 is a schematic structural diagram of a computer device according to an embodiment of the present application.
Detailed Description
The following description of the embodiments of the present application will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present application, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the application without making any inventive effort, are intended to be within the scope of the application.
Embodiments of the present application relate to blockchain technology. The block chain is a set of basic framework which is decentralised and has the characteristic of distributed storage, in particular to a data structure which is formed by using a mode similar to a linked list for data blocks according to time sequence, can safely store data which have a precedence relationship and can be verified in a system, and ensures that the data cannot be tampered and counterfeited in a cryptography mode.
The blockchain bottom platform can include processing modules such as basic services, intelligent contracts, operation management, and the like. The basic service module is deployed on all block chain node devices, is used for verifying the validity of a service request, recording the service request on a storage after the effective request is identified, and for a new service request, the basic service firstly analyzes interface adaptation and authenticates the interface adaptation, encrypts service information (identification management) through an identification algorithm, and transmits the encrypted service information to a shared account book (network communication) completely and consistently, and records and stores the service information; the intelligent contract module is responsible for registering and issuing contracts, triggering contracts and executing contracts, a developer can define contract logic through a certain programming language, issue the contract logic to a blockchain (contract registering), invoke keys or other event triggering execution according to the logic of contract clauses to complete the contract logic, and simultaneously provide a function of registering contract upgrading; the operation management module is mainly responsible for deployment in the product release process, modification of configuration, contract setting, cloud adaptation and visual output of real-time states in product operation, for example: alarms, managing network conditions, managing node device health status, etc.
Intelligent contracts can be understood as computer programs running on a distributed ledger (i.e., blockchain) with preset rules, status, conditional responses, that can encapsulate, validate, perform distributed node complex actions, accomplish information exchange, value transfer, and asset management. Based on the distributed architecture of the blockchain, the consensus algorithm and the like, the intelligent contracts allow mutually-untrusted users to complete transactions without any third party trusted intermediaries or authorities, and meanwhile, the intelligent contracts in digital form can be flexibly embedded into various tangible or intangible assets, transactions and data to realize active or passive asset, information management and control and gradually construct programmable intelligent assets, systems and the like.
Referring to fig. 1, fig. 1 is a schematic structural diagram of a network architecture according to an embodiment of the present application. The network architecture may include an electronic device 10a and a blockchain network, the electronic device 10a may refer to devices that may be outside of the blockchain network; the blockchain network may be composed of a plurality of blockchain links, and the application is not limited to the number of blockchain nodes included in the blockchain network. Fig. 1 illustrates 6 blockchain nodes, where each blockchain node in the blockchain network is networked in a P2P (Peer-to-Peer) manner, and the blockchain nodes may communicate with each other according to a P2P protocol. Each block link point in the block chain network commonly follows a broadcasting mechanism and a consensus mechanism, so that the non-falsifiability and the non-falsifiability of data on the block chain are commonly ensured, and the characteristics of decentralization, trust removal and the like of the block chain are realized.
The electronic device 10a and the blockchain node in the blockchain network may be a user terminal, or may be a server, or may be a system formed by the user terminal and the server, which is not limited in this application. The user terminals may include, but are not limited to: PC (Personal Computer ), smart phone, tablet, notebook, palm top, mobile internet device (mobile internet device, MID), wearable device (e.g., smart watch, smart bracelet, etc.), smart voice interaction device, smart home appliance (e.g., smart television, etc.), vehicle-mounted device, etc.
The server may be an independent physical server, a server cluster or a distributed system formed by a plurality of physical servers, or a cloud server providing cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDNs, basic cloud computing services such as big data and artificial intelligent platforms.
The blockchain commonly maintained by blockchain nodes in a blockchain network may be made up of a series of blocks, which may also be referred to as data blocks; after a block is created, a consensus process needs to be performed in the blockchain network, and when the block consensus is successful, the block is allowed to be added to the blockchain; the blocks in the blockchain may be concatenated in order of creation time stamps from small to large into a chained structure. The blockchain is a distributed ledger, and the information data contained in each block on the blockchain is ledger data of the distributed ledger.
It is to be appreciated that the management object can deploy asset transfer contracts and randomly verifiable contracts on the blockchain using the electronic device 10 a. Wherein, the management object can have the authority of registering users and issuing virtual assets, and the management object can be called a contract deployment object; the asset transfer contract can be used for publishing the virtual asset published by the asset publishing object, and conditions, rules and the like for randomly picking up the virtual asset on a chain; the asset release object can be considered as an enterprise, an organization, a user and the like which release virtual assets on a blockchain, and can manage and transfer virtual self-checking released to own accounts; the virtual asset may include asset credentials (e.g., credentials of an asset held by a user in a blockchain), tokens, etc., the application is not limited in the type of virtual asset.
The random verifiable contract may be used to store a private key of a random number generation algorithm (which may be referred to as a random number generation private key), and the random verifiable contract may invoke a random number generation service outside of the blockchain (i.e., under-chain) and based on the random number generation service may generate a verifiable random number, which may be referred to as an asset transfer random number. Wherein the random verifiable random number may be a VRF (Verifiable Random Function ) contract; the VRF is an encryption scheme mapping the input into verifiable pseudo-random output, and a verifiable asset transfer random number can be output through the VRF, and the validity of the asset transfer random number can be determined through the random number verification public key because the asset transfer random number can contain the signature of the random number generation private key; the random number generation private key and the random number verification public key are public-private key pairs of a random number generation algorithm.
Among them, VRFs have three major characteristics: verifiability, uniqueness, and randomness. The verifiability may refer to that the VRF random number generation algorithm may be verified, by which asset transfer random numbers generated by a random number generation private key and a random factor (which may also be considered a random number) may be verified using a random number verification public key, a random factor, and an asset transfer random number. Uniqueness may mean that the result of the asset transfer random number generated by any one of the random factors is deterministic, i.e., the asset transfer random number obtained by the VRF must be the same for the same random factor. Randomness may mean that the process of generating asset transfer random numbers by the random number generation private key and the random factor is completely random, and the mathematical theorem ensures that the random process is not cracked, for example, for different random factors, the asset transfer random numbers obtained by the VRF are random and uniformly distributed in the range of values.
Alternatively, a generic object may use the electronic device 10a to request to retrieve virtual assets on a blockchain from blockchain points in a blockchain network, the generic object may locally generate a random factor, and send an asset retrieval request carrying the random factor to the blockchain network to randomly retrieve virtual assets on the blockchain. The common object can verify the correctness of the asset transfer random number through the returned asset transfer random number, the random factor and the random number verification public key, so as to ensure the authenticity of the virtual asset random issuing process; the general object may manage its own virtual asset and inquire about detailed information of its own virtual asset. In embodiments of the present application, by introducing VRF technology, it may be ensured that the virtual asset delivery process in the blockchain is random and that the random delivery process may be verified.
Referring to fig. 2, fig. 2 is a schematic diagram illustrating deployment of a blockchain smart contract according to an embodiment of the present application. The user terminal 20a, as shown in fig. 2, may be an electronic device used by a management object (manager), the user terminal 20a may initialize a public-private key pair of a random generation algorithm (e.g., VRF), which may include a random number generation private key and a random number verification public key, which may be disclosed to the object for verification of asset transfer random numbers, which may be stored in a randomly verifiable contract for generating asset transfer random numbers.
The management object may upload the asset transfer contract to the blockchain network in a form of initiating a transaction through the user terminal 20a, and after receiving the transaction including the asset transfer contract submitted by the user terminal 20a, the blockchain node 20b in the blockchain network may perform a signature verification on the received transaction, where the purpose of the signature verification is to detect whether the transaction including the asset transfer contract is tampered with in the transmission process. If the verification signature does not pass, the verification signature indicates that the user terminal 20a may be tampered in the uploading transaction process and needs to be uploaded again; if the verification passes, it indicates that the transaction containing the asset transfer contract has not been tampered with during transmission.
The blockchain node 20b may package the transaction including the asset transfer contract passed by the tag verification into a block X, where the block header of the block X (X is a positive integer) includes a digest value corresponding to the block having the maximum block height in the blockchain, such as the digest value of the block X-1, and may further include the digest value of the current block X and the merker (Xecrkle) root of the current block X; the block of block X may contain complete information data of the current block X, such as an asset transfer contract uploaded by the user terminal 20 a. The blockchain node 20b may broadcast the newly generated blockchain X in the blockchain network, that is, send the blockchain X to all blockchain nodes in the blockchain network that participate in the consensus process, so that the blockchain nodes in the blockchain network that participate in the consensus process perform the consensus verification on the blockchain X, and when the blockchain X passes the consensus, the blockchain X may be added to the blockchain for formal uplink, that is, indicate that the asset transfer is approximately successful in the creation of the blockchain.
Similarly, the management object may upload the random verifiable contract to the blockchain network through the user terminal 20a in a form of initiating a transaction, and the blockchain node 20c in the blockchain network may perform the same operation as the aforementioned asset transfer contract after receiving the transaction including the random verifiable contract submitted by the user terminal 20a, which is not described herein. The blockchain node 20b and the blockchain node 20c may be the same node in the blockchain network or may be different nodes, which is not limited in the present application. The asset transfer contract and the random verifiable contract may be uploaded to the blockchain network by using different transactions, and at this time, the asset transfer contract and the random verifiable contract may be packaged into the same block by using different transactions, or may be packaged into different blocks (for example, a block X containing the asset transfer contract, a block x+1 containing the random verifiable contract), or may be uploaded to the blockchain network by using the same transaction, and at this time, the asset transfer contract and the random verifiable contract may be packaged into the same block, which is not limited by the present application.
It should be noted that, the asset transfer contract and the random verifiable contract may be computer program codes, a developer may write the asset transfer contract and the random verifiable contract in a high-level language of the intelligent contract, a compiler may compile the contract written in the high-level language into byte codes in a virtual machine of the blockchain node, and the virtual machine may be used for explaining and executing the byte codes in the intelligent contract. Smart contract high-level languages include, but are not limited to, solubility (a smart contract programming language), serpent (a smart contract programming language), LLL (a smart contract programming language), such as developers may use solubility to write data contracts and business contracts, and use compilers to compile the solubility-written data contracts and business contracts into virtual machine bytecodes, respectively, and then submit the compiled virtual machine bytecodes to the blockchain network and to be uplink with transactions initiated by the user terminal 20 a.
As shown in FIG. 2, assuming that block X contains an asset transfer contract, block X+1 contains a randomly verifiable contract, after block X and block X+1 are successfully uplink, the blockchain commonly maintained by blockchain nodes in the blockchain network is shown as blockchain 20d, and block X-1, block X and block X+1 in the blockchain 20d can be connected in sequence into a chain structure; the above X-1, X, and X+1 may all be considered block heights for blocks in the blockchain, which may be used to represent the number of blocks connected to the blockchain, and which may be considered identifiers for blocks, which may be used to indicate the locations of blocks in the blockchain. The block height of the created block in the blockchain defaults to 0, the block height of the first block after the created block is 1 (the first block may be referred to as block 1), the block height of the second block after the created block is 2 (the second block may be referred to as block 2), and so on. Each block in the block chain can be divided into a block head and a block body; of course, the complete transaction data in the zone blocks may be organized together in the form of a Xerkle tree.
Where the information data in the block may refer to the original data requested to be published into the blockchain network. The Xerkle tree is an important component of the blockchain technology, where raw data in the plaintext is not typically kept, and the raw data needs to be hashed (which may also be referred to as a hash operation) and stored in the form of a hash value (which may also be referred to as a hash value). The merck tree may be used to organize hash values formed by hashing a plurality of raw data into a binary tree structure that is stored in a block of blocks. The digest value of the present block and the digest value of the previous block contained in the block header of the block may be referred to as hash values.
Referring to fig. 3, fig. 3 is a flowchart illustrating a virtual asset processing method in a blockchain according to an embodiment of the application. It will be appreciated that the method may be performed by any blockchain node in the blockchain network. As shown in fig. 3, the virtual asset processing method in the blockchain may at least include the following steps S101 to S103:
step S101, receiving an asset acquisition request sent by a request device, and calling an asset transfer contract in a blockchain based on a random factor carried by the asset acquisition request.
Specifically, when a user (hereinafter referred to as a target object for convenience of description, where the target object may be the aforementioned common object) wants to retrieve a virtual asset on a blockchain, the random factor may be locally generated by the requesting device, and an asset retrieval request carrying the random factor may be sent to a blockchain node in the blockchain network. Wherein the requesting device may package the asset retrieval request carrying the random factor into a transaction, and submit the transaction to the blockchain network.
A blockchain node in the blockchain network indicates that the blockchain node has received an asset retrieval request sent by the requesting device after receiving a transaction submitted by the requesting device. After the blockchain node obtains the transaction including the asset retrieval request, the transaction needs to be synchronized in the blockchain network, such as broadcasting the transaction including the asset retrieval request to the rest of the nodes in the blockchain network. Referring to fig. 4, fig. 4 is a schematic diagram illustrating transaction synchronization in a blockchain network according to an embodiment of the present application. As shown in FIG. 4, assuming that the blockchain network includes blockchain nodes such as node 1, node 2, node 3, node 4, and node 5, each blockchain node may have a pool of transactions that may be used to temporarily cache transactions that have not been packed into blocks.
When the request device encapsulates the asset pickup request carrying the random factor into a transaction tx1, the transaction tx1 may be submitted to a node 1 in the blockchain network, and after receiving the transaction tx1 submitted by the request device, the node 1 may cache the transaction tx1 into its own transaction pool for packaging. Meanwhile, node 1 may broadcast transaction tx1 in the form of a transaction message to the remaining blockchain nodes in the blockchain network, such as node 2, node 3, node 4, and node 5; after the other block link points receive the transaction tx1, the transaction tx1 in the transaction message can be put into the own transaction pool.
It will be appreciated that there may be a loss of transaction tx1 during the transmission. In order to make the transaction tx1 reach all the blockchain nodes in the blockchain network as much as possible, by broadcasting the blockchain nodes that receive the transaction tx1, one or more adjacent blockchain nodes can be selected according to the network topology and the network traffic policy thereof to perform relay broadcasting, thereby providing a foundation for packaging the transaction tx1 into blocks in the consensus process.
Further, the blockchain node may package the transactions in the transaction pool to generate a new block, and during the consensus process of the block, the blockchain node may execute all the transactions in the block, including the transaction in the block that includes the asset acquisition request. In the process of the blockchain node executing the transaction containing the asset retrieval request, the blockchain node can acquire the random factor carried by the asset retrieval request and call the asset transfer contract in the blockchain based on the random factor. In other words, the random factor may be passed into an asset transfer contract in the blockchain that is run in the virtual machine of the blockchain node.
Step S102, calling a random verifiable contract in the blockchain through the asset transfer contract, generating a private key based on the random factor and the random number stored in the random verifiable contract, and generating the asset transfer random number.
Specifically, when the blockchain node runs an asset transfer contract, the asset transfer contract can call a random verifiable contract in the blockchain through a random factor to acquire a random number generation private key stored in the random verifiable contract, and the random verifiable contract can call a random number generation service outside the chain based on the random factor; and calculating a random number generation private key and a random factor through a Verifiable Random Function (VRF) in the random number generation service to obtain the asset transfer random number.
It should be noted that, in the embodiment of the present application, the asset transfer contract and the random verifiable contract may be pre-deployed in the blockchain by the management object, the management object may also initialize a public-private key pair (including a random number generation private key and a random number verification public key) corresponding to the random number generation algorithm (for example, the verifiable random function VRF), the random number generation private key may be stored in the random verifiable contract, and the random number verification public key may be disclosed. For example, where the random number generation algorithm is a VRF, the asset transfer random number calculation process may include: y=vrf_hash (SK, X), proof=vrf_proof (SK, X); where SK may be represented as a random number generation private key, X may be represented as a random factor, i.e., input information of a random number generation algorithm VRF, Y may be represented as an asset transition random number, and the output result of the VRF may contain a zero knowledge proof for verifying the asset transition random number Y in addition to the asset transition random number Y. The asset transfer random number Y and the zero knowledge proof can be returned to the requesting device after the random distribution of the virtual asset is completed, so that the requesting device can verify the correctness of the asset transfer random number Y and ensure the authenticity of the random distribution process of the virtual asset based on the correctness of the asset transfer random number Y.
And step S103, determining a target virtual asset corresponding to the asset transfer random number through an asset transfer contract, and returning the target virtual asset and the asset transfer random number to the requesting device so that the requesting device verifies the validity of the target virtual asset based on the random factor, the asset transfer random number and the random number verification public key.
Specifically, the random verifiable contract may return the asset transfer random number to the asset transfer random number after the asset transfer random number is obtained, the target virtual asset that is ultimately required to be transferred to the target object may be determined by the asset transfer random number, the asset transfer contract may transfer the target virtual asset to the object account corresponding to the target object in the blockchain, and return the target virtual asset and the asset transfer random number to the requesting device.
After receiving the target virtual asset and the asset transfer random number returned by the block link point, the requesting device may verify the correctness of the asset transfer random number based on the random factor, the asset transfer random number, and the random number verification public key. If the asset transfer random number is verified to be correct, namely the asset transfer random number passes the verification, the process of randomly picking up the target asset virtual asset on the blockchain by the requesting device is indicated to be real; if the asset transfer random number is verified as erroneous, i.e., the verification fails, it indicates that the process of randomly retrieving the target asset virtual asset on the blockchain by the requesting device is not trusted and not valid.
For example, using the above-described VRF as an example, the blockchain node may return to the requesting device a zero knowledge proof that is output along with the asset transfer random number X in addition to the target virtual asset and the asset transfer random number X. The requesting device may calculate whether y=vrf_p2h (proof) is true, and if the foregoing equation is not true, abort the verification, indicating that the asset transfer random number Y verification is wrong; if the foregoing equation holds, then continue to calculate True/False = vrf_verify (PK, X, proof), where True indicates that asset transfer random number Y verification passed, false indicates that verification failed, and PK indicates the random number verification public key.
Referring to fig. 5, fig. 5 is a schematic diagram illustrating a random acquisition of virtual assets on a blockchain according to an embodiment of the application. As shown in fig. 5, the target object may generate a random factor by the requesting device 30a and encapsulate the asset domain request carrying the random factor into a transaction tx2, which may then be uploaded to the blockchain network. The blockchain node 30b in the blockchain network may receive the transaction tx2 and the blockchain node 30b may broadcast the transaction tx2 in the blockchain network such that each blockchain node in the blockchain network receives the transaction tx2 as much as possible.
Each blockchain node (e.g., blockchain node 30 b) in the blockchain network may execute transaction tx2, during execution of transaction tx2, may obtain an asset retrieval request in transaction tx2, and a random factor carried by the asset retrieval request, which may be passed into an asset transfer contract in the blockchain, may run in a virtual machine of blockchain node 30b, which may invoke a randomly verifiable contract deployed in the blockchain by a random factor, which may invoke a random number generation service 30c outside the chain based on the random factor, and may derive an asset transfer random number generated by a random number generation private key and the random factor by a random number generation algorithm (e.g., VRF) in random number generation service 30 c. The asset transfer contract may obtain the asset transfer random number generated by the random number generation service 30c and determine a target virtual asset corresponding to the asset transfer random number based on asset transfer business logic in the asset transfer contract and transfer the target virtual asset to an object account corresponding to the target object on the blockchain. The blockchain node 30b may return the target virtual asset and the asset transfer random number to the requesting device 30a, and the requesting device 30a may verify the correctness of the asset transfer random number based on the random factor, the asset transfer random number, and the random number verification public key. The verification process of the request device 30a on the asset transfer random number may be referred to in the foregoing description, and will not be described herein.
It should be noted that, in the blockchain network, the transaction tx2 may be packed into the block 30d, for example, the blockchain node 30b may pack multiple transactions including the transaction tx2 into the block 30d, and broadcast the block 30d in the blockchain network, so that the rest nodes in the blockchain network perform consensus verification on the block 30d according to the consensus algorithm, when the block 30d is in the consensus, the block 30c may be formally uplink, that is, after the block 30c is in the consensus, the block height of the block 30c may be updated according to the maximum block height in the blockchain stored in the blockchain node 30b, and the updated block 30d is stored in the local database of the blockchain node 30b, where the updated block 30c is the block sequence of the updated block 30c in the local database of the blockchain node 30b, where n+i is used to characterize the block sequence of the updated block 30c in the local blockchain, and N and i are integers greater than or equal to 0.
In the embodiment of the application, by arranging the asset transfer contract and the random verifiable contract in the blockchain, after receiving the asset acquisition request sent by the request equipment, the asset transfer contract in the blockchain can be called based on the random factor carried by the asset acquisition request, so that the random verifiable contract in the blockchain can be called through the asset transfer contract, and a private key (a private key corresponding to the random verifiable contract) is generated based on the random factor uploaded by the request equipment and the random number, so that a verifiable asset transfer random number is generated. The target virtual asset corresponding to the asset transfer random number can be determined through the asset transfer contract, the target virtual asset and the asset transfer random number can be returned to the requesting device, the requesting device can verify the validity of the target virtual asset based on the random factor, the asset transfer random number and the random number verification public key, namely, the verifiable asset transfer random number can be generated under the blockchain by introducing the random verifiable contract, the randomness of virtual asset distribution can be ensured by verifying the correctness of the asset transfer random number, and the verifiability of virtual asset distribution can be improved.
Referring to fig. 6, fig. 6 is a timing diagram of a virtual asset processing method in a blockchain according to an embodiment of the application. As shown in fig. 6, the virtual asset processing method in the blockchain may at least include the following steps S201 to S211:
step S201, receiving an object registration request corresponding to a target object, obtaining object authentication information carried by the object registration request, and verifying the object authentication information through an object management interface to obtain an identity authentication result corresponding to the object authentication information.
Specifically, if the target object wants to get the virtual asset on the blockchain, the target object needs to perform object registration, for example, when the requesting device can access the asset transition background service, the target object may send an object registration request to the requesting device. After receiving the object registration request corresponding to the target object, the request device can acquire the object authentication information carried by the object registration request, and can verify the object authentication information through the object management interface to obtain an identity authentication result corresponding to the object authentication information. Wherein the object management interface may invoke a management system for managing object information, and the object authentication information may include a certificate photograph of the target object, basic information, and the like.
Step S202, when the identity authentication result indicates that authentication is successful, it is determined that the target object has the authority to initiate the asset acquisition request.
Specifically, when the identity authentication result indicates that authentication is successful, it indicates that the identity of the target object has been approved, and it may be determined that the target object has the authority to initiate the asset acquisition request. When the identity authentication result indicates authentication failure, the identity of the target object is not approved, and it can be determined that the target object does not have the right to initiate the asset acquisition request, and the target object is required to provide the object authentication information again for object registration.
Referring to fig. 7, fig. 7 is a schematic view of a scenario of object registration according to an embodiment of the present application. As shown in fig. 7, when a target object wants to pick up a virtual asset on a blockchain, it is necessary to register the target object with an asset transfer background service. When the target object initiates an object registration request in the requesting device 40a, an object authentication input box 40b and an object authentication input box 40c may be displayed in the requesting device 40 a. The target object may input a document front picture in the object authentication input box 40b and a document back picture in the object authentication input box 40c, which may be referred to as object authentication information of the target object.
After the front picture of the certificate and the back picture of the certificate are obtained, the object management system 40d can be called through the object management interface, and the front picture of the certificate and the back picture of the certificate are verified based on the object information in the object management system 40 d; if the certificate front picture and the certificate back picture uploaded by the target object are the same as the information of the existing target object in the object management system 40d, the authentication is successful, and then the target object can be determined to have the authority of initiating the asset acquisition request, and the result of the authentication success is returned to the request equipment 40a; if the information of the certificate front picture and the certificate back picture uploaded by the target object is different from the information of the existing target object in the object management system 40d, the authentication failure is indicated, it can be determined that the target object temporarily does not have the authority to initiate the asset acquisition request, and the result of the authentication failure is returned to the request device 40a to remind the target object to perform object registration again.
Step S203, an asset acquisition request carrying a random factor is sent to the block link.
Specifically, the requesting device may obtain a generation timestamp corresponding to the asset retrieval request, obtain a random factor according to the generation timestamp, add the random factor to the asset retrieval request, and send the asset retrieval request carrying the random factor to a blockchain node in the blockchain network.
Optionally, the requesting device may further obtain an object public key corresponding to the target object, generate a random factor based on the object public key, or generate the random factor by using any random number generation method, which is not limited in the generation manner of the random factor.
Step S204, validity verification is carried out on the asset acquisition request, and a request verification result corresponding to the asset acquisition request is obtained.
Specifically, after receiving an asset acquisition request sent by a request device, the block chain link point can perform validity verification on the asset acquisition request, where the validity verification may include a signature verification process, for example, the block chain node may obtain a digital signature carried by the asset acquisition request and an object public key corresponding to the request device, that is, a public key of a target object; further, the digital signature can be decrypted based on the object public key to obtain first abstract information corresponding to the digital signature, and hash operation is performed on the asset acquisition request based on a hash algorithm to obtain second abstract information corresponding to the asset acquisition request; if the first abstract information is the same as the second abstract information, determining that the request verification result corresponding to the asset retrieval request is a verification passing result, and storing the transaction containing the asset retrieval request into a transaction pool corresponding to the block link point.
In other words, in order to prevent the transaction containing the asset retrieval request from being maliciously tampered in the transmission process, the target object may generate a key pair (including an object private key and an object public key, where the object private key is managed by the target object itself or delegated to a specific service to be managed, and the public key may be notified to all blockchain nodes in the blockchain network), and the target object may perform a hash operation on the asset retrieval request (which may also be understood as a transaction containing the asset retrieval request) by using a hash algorithm, generate first digest information corresponding to the asset retrieval request, encrypt the first digest information by using the generated object private key, where the encrypted first digest information is a digital signature corresponding to the asset retrieval request. The request equipment uploads an asset acquisition request carrying a digital signature to a blockchain network, and after receiving the asset acquisition request carrying the digital signature, a blockchain node can acquire an object public key corresponding to a target object, and decrypt the digital signature based on the object public key to obtain first abstract information corresponding to the digital signature; and then, carrying out hash operation on the asset acquisition request received by the block chain node according to a hash algorithm (namely, the hash algorithm adopted when the target object generates the digital signature), so as to obtain second abstract information corresponding to the received asset acquisition request. If the first abstract information is the same as the second abstract information, the fact that the asset retrieval request is not tampered in the uploading process is indicated, and the verification sign passes, namely, the request verification result corresponding to the asset retrieval request indicates that verification is successful, the transaction containing the asset retrieval request can be stored in a transaction pool, and the transaction in the transaction pool can be used for being packaged into a new block. If the first abstract information is different from the second abstract information, the fact that the asset retrieval request is possibly tampered in the uploading process is indicated, and the verification sign is not passed, namely, the request verification result corresponding to the asset retrieval request indicates verification failure.
It should be appreciated that, before the target object uploads the asset acquisition request through the requesting device, the blockchain node in the blockchain network is already notified of the object public key and the hash algorithm used to generate the digital signature, and if the asset acquisition request is tampered during uploading, the digital signature received by the blockchain node is not the digital signature originally generated by the target object, then the blockchain node cannot solve the digital signature when decrypting the digital signature by using the object public key corresponding to the transaction target object. The hash algorithms may include, but are not limited to, SHA-1, SHA-224, SHA-256, SHA-384, and SHA-512, among others.
In step S205, when the verification result is requested to indicate that the verification is successful, a random factor carried by the asset retrieval request is acquired, and an asset transfer contract in the blockchain is invoked based on the random factor.
Specifically, when the request verification result indicates that verification is successful, a random factor carried by the asset retrieval request may be obtained, and when a transaction including the asset retrieval request is executed, an asset transfer contract in the blockchain may be invoked by the random factor. Such as a random factor, may be used as a condition to trigger an asset transfer contract that is run in the virtual machine of the blockchain node.
Optionally, when the request verification result indicates that the verification fails, indicating that the asset retrieval request is an invalid request, a result of the verification failure may be returned to the requesting device to alert the target object to reinitiate the asset transfer request through the requesting device.
In step S206, the object information carried by the asset retrieval request is obtained, and when the object information satisfies the asset retrieval condition indicated by the asset transfer contract, it is determined that the target object associated with the requesting device has the asset retrieval authority.
Specifically, the asset transfer contract may define the virtual asset acquisition condition of the object, for example, the number of times each object acquires the virtual asset randomly on the blockchain, the time range of acquiring the virtual asset, and the acquisition time interval. The blockchain node may obtain object information (e.g., an object identifier, which may be used to uniquely represent an identity of a target object) carried by the asset retrieval request, and determine that the target object has asset retrieval rights when the object information meets an asset retrieval condition indicated by an asset transfer contract. For example, in the asset transfer contract, each object is limited to only randomly pick up a virtual resource on the blockchain, and if the target object has picked up the virtual resource on the blockchain, it can be determined that the target object does not have asset pick-up authority; if the target object never gets the virtual resource on the blockchain, the getting is the first time, and the target object can be determined to have the asset getting authority.
Step S207, the random factor is passed into a random verifiable contract in the blockchain through the asset transfer contract, and the random verifiable contract is executed based on the random factor.
Specifically, the blockchain node may invoke a randomly verifiable contract (e.g., a VRF contract) in the blockchain by a random factor during execution of the asset transfer contract, i.e., by passing the random factor into the randomly verifiable contract, and executing the randomly verifiable contract based on the random factor.
Step S208, calling a random number generation service through a random factor in the random verifiable contract, and calculating a random number generation private key and the random factor based on a verifiable random function in the random number generation service to obtain the asset transfer random number.
Specifically, the blockchain node may obtain a random number generation private key stored in the random verifiable contract, and may send a request for obtaining a random number to the random number generation service through the random verifiable contract, and after receiving the request for obtaining the random number, the random number generation service may calculate the random number generation private key and the random factor based on a verifiable random function in the random number generation service, so as to obtain the asset transfer random number, where the verifiable random function is one of random number generation methods, which is only one example of the embodiments of the present application, and the present application does not limit the random number generation method. The generation process of the asset transfer random number may be referred to the description in step S102, and will not be described herein.
Step S209, determining a target virtual asset corresponding to the asset transfer random number through an asset transfer contract, and transferring the target virtual asset in the virtual asset set to an object account corresponding to the request device.
Specifically, the random verifiable contract may return the asset transfer random number to the asset transfer contract after the asset transfer random number is obtained by the random number generation service. In the asset transfer contract, a target virtual asset that ultimately needs to be transferred may be determined based on the asset transfer random number; for example, a blockchain node may obtain a set of virtual assets in the asset transfer contract and obtain the number of assets of the virtual assets contained in the set of virtual assets; and when executing the transfer business logic in the asset transfer contract, acquiring a target virtual asset for transfer according to the asset transfer random number and the asset quantity, and transferring the target virtual asset in the virtual asset set to an object account corresponding to the request equipment, namely an object account corresponding to a target object, wherein the transfer process of the target virtual asset is completed on a blockchain.
In the transferring business logic of the asset transferring contract, a rule for calculating the target virtual asset by the asset transferring random number may be specified, for example, the number of assets may be subjected to a remainder operation by the asset transferring random number to obtain a first virtual asset, and if the first virtual asset does not belong to the virtual asset set, the remainder operation may be continuously performed on the number of assets by the first virtual asset to obtain a second virtual asset; if the second virtual asset belongs to the set of virtual assets, the first virtual asset is determined to be the target virtual asset for transfer. If the second virtual asset still does not belong to the virtual asset set, the remainder taking operation may be continued until the obtained virtual asset belongs to the virtual asset set, and the virtual asset which belongs to the virtual asset set and is finally determined as the target virtual asset. It will be appreciated that the foregoing remainder operations are merely exemplary of one embodiment of the present application, and the present application may also employ other operations to determine a final target virtual asset, for example, rounding down the ratio between the asset transfer random number and the number of assets, etc., which is not limited in this regard.
Step S210, returning the target virtual asset and the asset transfer random number to the requesting device.
Specifically, after transferring the target virtual asset to the object account corresponding to the target object, the target virtual asset and the asset transfer random number may be returned to the requesting terminal.
Step S211, obtaining a random verification result of the asset transfer random number through the random factor, the asset transfer random number and the random number verification public key, and determining that the target virtual asset is valid when the random verification result indicates that verification is passed.
Specifically, after receiving the target virtual asset and the asset transfer random number returned by the block link point, the requesting device may verify the correctness of the asset transfer random number based on the random factor, the asset transfer random number, and the random number verification public key. When the random verification result indicates that the verification is passed, the asset transfer random number is verified to be correct, and further the process of randomly picking up the target asset virtual asset on the blockchain by the request device can be considered to be real, and the target virtual asset has validity.
When the random verification result indicates verification failure, the asset transfer random number is verified to be wrong, so that the process of randomly picking up the target asset virtual asset on the block chain by the request equipment can be considered to be lack of authenticity, and the target virtual asset can be determined to be not valid; the requesting terminal may send an asset transfer audit request to the blockchain node to cause the blockchain node to reassign the target virtual asset for transfer to the requesting device. The verification process of the request device on the asset transfer random number may be referred to the description in step S103, and will not be described herein.
Referring to fig. 8, fig. 8 is a flowchart of a virtual asset issuing method in a blockchain according to an embodiment of the present application. As shown in fig. 8, the virtual asset issuing method in the blockchain involves interactions between management objects, target objects, asset transfer services, asset transfer contracts, randomly verifiable contracts, and random number generation services; the asset transfer service may also be referred to as an asset transfer background service, may be integrated in the requesting device, the asset transfer contract, the random verifiable contract may be deployed in the blockchain, the random verifiable contract may be a VRF contract, and the random number generation service may be referred to as a VRF background service. The implementation flow of the virtual asset issuing method in the blockchain may include the following steps S301 to S312:
step S301, initializing a public-private key pair of a random number generation algorithm.
Step S302, deploying an asset transfer contract.
Step S303, deploying a random verifiable contract carrying a random number generation private key.
Specifically, the management object may generate a public-private key pair for the random number generation algorithm, for example, when the random number generation algorithm is a VRF, the public-private key pair of the VRF may be initialized, where the public-private key pair may include a random number generation private key and a random number verification public key, the random number generation private key may be stored in a random verifiable contract, and the random number verification public key may be disclosed. Subsequently, the management object may deploy an asset transfer contract and a random verifiable contract carrying a random number generation private key, respectively, in the blockchain. Wherein, the steps S301-S302 are performed before the virtual asset distribution is performed by the management object.
Step S304, the target object registers real-name authentication.
Step S305, the real-name authentication of the target object is successful.
Specifically, the target object may perform real-name identity authentication in the asset transfer service, and the asset transfer service may verify the object authentication information of the target object through the object management interface, where the target object after passing the authentication has the authority to acquire the virtual asset on the blockchain, for example, has the authority to initiate the asset acquisition request.
Step S306, a virtual asset acquisition request carrying a random factor.
Step S307, calling a pickup interface of the asset transfer contract based on the random factor.
Step S308, checking the asset acquisition authority of the target object.
Specifically, the target object may send an asset acquisition request carrying a random factor to the block link through the asset transfer service, and invoke the acquisition interface of the asset transfer contract through the asset transfer service, where the target object may default to delegate its own object private key to the asset transfer service for management. If the target object does not delegate its own object private key to the asset transfer service for management, but is managed by itself, then the target object does not need to invoke the retrieval interface of the asset transfer contract by the asset transfer service, but invokes it directly.
After the random factor is transmitted into the asset transfer contract, whether the target object has the asset acquisition right or not can be checked, and when the target object has the asset acquisition right, the follow-up steps can be continuously executed; execution of the asset transfer contract may be aborted when the target object does not have asset acquisition rights.
Step S309, a random factor is input to obtain a random number.
Step S310, a request for acquiring a random number is sent.
Specifically, the asset transfer contract may introduce a random factor to the randomly verifiable contract, the randomly verifiable contract may send a request to obtain a random number through the random factor to a random number generation service, which may generate an asset transfer random number based on the random factor and a random number generation private key, and return the asset transfer random number to the asset transfer contract.
Step S311, transferring the target virtual asset on the chain according to the asset transfer random number.
Specifically, after the asset transfer contract obtains the asset transfer random number returned by the random verifiable contract, operations such as taking the remainder of the number of the assets of the virtual asset set can be performed through the asset transfer random number, and the final transferred target virtual asset can be determined. The target virtual asset can be transferred to an object account of the target object on the blockchain through an asset transfer contract, and the target virtual asset and the asset transfer random number are returned to the target object.
Step S312, verifying the correctness of the random process by a random factor, asset transfer random number, and random number verification public key.
Specifically, the target object may verify the correctness of the asset transfer random number based on the random factor, the asset transfer random number, and the random number verification public key to ensure that the issuance process of the target virtual asset is random. The verification process of the asset transfer random number may be referred to in the foregoing related description, and will not be described herein.
It will be appreciated that in the specific embodiments of the present application, identity information, account information, etc. of the target object may be involved, and when the above embodiments of the present application are applied to specific products or technologies, permission or consent of the user needs to be obtained, and the collection, use and processing of relevant data needs to comply with relevant laws and regulations and standards of relevant countries and regions.
In the embodiment of the application, by arranging the asset transfer contract and the random verifiable contract in the blockchain, after receiving the asset acquisition request sent by the request equipment, the asset transfer contract in the blockchain can be called based on the random factor carried by the asset acquisition request, so that the random verifiable contract in the blockchain can be called through the asset transfer contract, and a private key (a private key corresponding to the random verifiable contract) is generated based on the random factor uploaded by the request equipment and the random number, so that a verifiable asset transfer random number is generated. The target virtual asset corresponding to the asset transfer random number can be determined through the asset transfer contract, the target virtual asset and the asset transfer random number can be returned to the requesting device, the requesting device can verify the validity of the target virtual asset based on the random factor, the asset transfer random number and the random number verification public key, namely, the verifiable asset transfer random number can be generated under the blockchain by introducing the random verifiable contract, the randomness of virtual asset distribution can be ensured by verifying the correctness of the asset transfer random number, and the verifiability of virtual asset distribution can be improved.
Referring to fig. 9, fig. 9 is a schematic structural diagram of a virtual asset processing device in a blockchain according to an embodiment of the application. It will be appreciated that the virtual asset processing device 1 in the blockchain may be applied to any blockchain node in a blockchain system; as shown in fig. 9, the virtual asset processing apparatus 1 in the blockchain may include: a contract calling module 11, a random number generating module 12, a virtual asset determining module 13;
the contract calling module 11 is used for receiving an asset acquisition request sent by the request equipment and calling an asset transfer contract in the blockchain based on a random factor carried by the asset acquisition request;
a random number generation module 12 for invoking a random verifiable contract in the blockchain via the asset transfer contract, generating a private key based on the random factor, and the random number stored in the random verifiable contract, generating an asset transfer random number;
the virtual asset determining module 13 is configured to determine, by means of an asset transfer contract, a target virtual asset corresponding to the asset transfer random number, and return the target virtual asset and the asset transfer random number to the requesting device, so that the requesting device verifies the validity of the target virtual asset based on the random factor, the asset transfer random number, and the random number verification public key.
The specific function implementation manner of the contract invoking module 11, the random number generating module 12, and the virtual asset determining module 13 may refer to step S101-step S103 in the embodiment corresponding to fig. 3, which is not described herein.
In one or more embodiments, the contract invoking module 11 may include: a validity verification unit 111, an asset transfer contract calling unit 112;
the validity verification unit 111 is configured to receive an asset retrieval request sent by the requesting device, perform validity verification on the asset retrieval request, and obtain a request verification result corresponding to the asset retrieval request;
and an asset transfer contract calling unit 112, configured to obtain a random factor carried by the asset retrieval request when the verification result of the request indicates that the verification is successful, and call an asset transfer contract in the blockchain based on the random factor.
Alternatively, the validity verification unit 111 includes: signature acquisition subunit 1111, hash operation subunit 1112, verification pass subunit 1113;
a signature obtaining subunit 1111, configured to obtain a digital signature carried by the asset acquisition request and an object public key corresponding to the requesting device;
a hash operation subunit 1112, configured to decrypt the digital signature based on the object public key to obtain first digest information corresponding to the digital signature, and perform hash operation on the asset retrieval request based on a hash algorithm to obtain second digest information corresponding to the asset retrieval request;
The verification passing subunit 1113 is configured to determine that the request verification result corresponding to the asset acquisition request is a verification passing result if the first summary information is the same as the second summary information.
The validity verification unit 111, the asset transfer contract calling unit 112, and the signature acquisition subunit 1111 and the hash operation subunit 1112 included in the validity verification unit 111 may refer to step S204 and step S205 in the embodiment corresponding to fig. 6 for specific functional implementation of the verification pass subunit 1113, which are not described herein.
In one or more embodiments, the random number generation module 12 may include: an asset acquisition authority determination unit 121, a random verifiable contract calling unit 122, a random number generation service calling unit 123, an asset transfer random number generation unit 124;
an asset acquisition right determining unit 121, configured to acquire object information carried by an asset acquisition request, and determine that a target object associated with a requesting device has asset acquisition rights when the object information satisfies an asset acquisition condition indicated by an asset transfer contract;
a random verifiable contract invoking unit 122 for passing the random factor into the random verifiable contracts in the blockchain through the asset transfer contract, executing the random verifiable contracts based on the random factor.
A random number generation service calling unit 123 for acquiring a random number generation private key stored in the random verifiable contract, and calling a random number generation service by a random factor in the random verifiable contract; the random number generation service does not belong to the blockchain;
asset transfer random number generation unit 124 is configured to operate on the random number generation private key and the random factor based on the verifiable random function in the random number generation service to obtain an asset transfer random number.
The specific functional implementation manner of the asset acquisition permission determining unit 121, the random verifiable contract calling unit 122, the random number generation service calling unit 123, and the asset transfer random number generating unit 124 may refer to step S206-step S208 in the embodiment corresponding to fig. 6, and will not be described herein.
In one or more embodiments, the virtual asset determination module 13 may include: an asset number acquisition unit 131, a virtual asset transfer unit 132;
an asset quantity acquisition unit 131 for acquiring a virtual asset set in an asset transfer contract, the asset quantity of virtual assets contained in the virtual asset set;
the virtual asset transfer unit 132 is configured to execute transfer business logic in the asset transfer contract, obtain a target virtual asset for transfer according to the asset transfer random number and the asset number, and transfer the target virtual asset in the virtual asset set to an object account corresponding to the requesting device.
Alternatively, the virtual asset transfer unit 132 is specifically configured to:
executing transfer business logic in an asset transfer contract, and performing surplus operation on the number of assets through an asset transfer random number to obtain a first virtual asset;
if the first virtual asset does not belong to the virtual asset set, continuing to perform residual taking operation on the number of assets through the first virtual asset to obtain a second virtual asset;
if the second virtual asset belongs to the set of virtual assets, the first virtual asset is determined to be the target virtual asset for transfer.
The specific functional implementation of the asset quantity obtaining unit 131 and the virtual asset transfer unit 132 may refer to step S209 in the embodiment corresponding to fig. 6, and will not be described herein.
In the embodiment of the application, by arranging the asset transfer contract and the random verifiable contract in the blockchain, after receiving the asset acquisition request sent by the request equipment, the asset transfer contract in the blockchain can be called based on the random factor carried by the asset acquisition request, so that the random verifiable contract in the blockchain can be called through the asset transfer contract, and a private key (a private key corresponding to the random verifiable contract) is generated based on the random factor uploaded by the request equipment and the random number, so that a verifiable asset transfer random number is generated. The target virtual asset corresponding to the asset transfer random number can be determined through the asset transfer contract, the target virtual asset and the asset transfer random number can be returned to the requesting device, the requesting device can verify the validity of the target virtual asset based on the random factor, the asset transfer random number and the random number verification public key, namely, the verifiable asset transfer random number can be generated under the blockchain by introducing the random verifiable contract, the randomness of virtual asset distribution can be ensured by verifying the correctness of the asset transfer random number, and the verifiability of virtual asset distribution can be improved.
Referring to fig. 10, fig. 10 is a schematic structural diagram of a virtual asset processing device in a blockchain according to another embodiment of the application. It will be appreciated that the virtual asset processing apparatus 2 in the blockchain may be applied to a requesting device; as shown in fig. 10, the virtual asset processing device 2 in the blockchain may include: a transmitting module 21, a receiving module 22;
a sending module 21, configured to send an asset acquisition request carrying a random factor to the block link point, so that the block link point invokes an asset transfer contract in the block chain based on the random factor, and determines a target virtual asset corresponding to the asset transfer random number through the asset transfer contract; the asset transfer random number is generated based on a random factor and a random number generation private key stored in a random verifiable contract, the random verifiable contract being invoked by the asset transfer contract;
the receiving module 22 is configured to receive the target virtual asset and the asset transfer random number returned by the block link point, obtain a random verification result of the asset transfer random number by using the random factor, the asset transfer random number and the random number verification public key, and determine that the target virtual asset has validity when the random verification result indicates that the verification is passed.
The specific functional implementation manner of the transmitting module 21 and the receiving module 22 may refer to step S203, step S210 and step S211 in the embodiment corresponding to fig. 6, which are not described herein.
In one or more embodiments, the virtual asset processing device 2 in the blockchain further includes: an audit request transmitting module 23, an authentication information verifying module 24, a request authority determining module 25, a random factor generating module 26;
and an audit request sending module 23, configured to determine that the target virtual asset is not valid when the random verification result indicates that verification fails, and send an asset transfer audit request to the blockchain node, so that the blockchain node reallocates the target virtual asset for transfer for the requesting device.
The authentication information verification module 24 is configured to receive an object registration request corresponding to a target object, obtain object authentication information carried by the object registration request, and verify the object authentication information through an object management interface to obtain an identity authentication result corresponding to the object authentication information;
the request permission determining module 25 is configured to determine that the target object has permission to initiate the asset acquisition request when the identity authentication result indicates that authentication is successful.
The random factor generating module 26 is configured to obtain a generation timestamp corresponding to the asset retrieval request, obtain a random factor according to the generation timestamp, and add the random factor to the asset retrieval request.
The specific functional implementation manners of the audit request sending module 23, the authentication information verifying module 24, the request authority determining module 25, and the random factor generating module 26 may refer to step S201-step S202 in the embodiment corresponding to fig. 6, and will not be described herein.
In the embodiment of the application, by arranging an asset transfer contract and a random verifiable contract in a blockchain, a request device can locally generate a random factor and send an asset acquisition request carrying the random factor to a blockchain link, and a blockchain node can call the asset transfer contract in the blockchain based on the random factor carried by the asset acquisition request, further call the random verifiable contract in the blockchain through the asset transfer contract, and the random verifiable contract can call a random number generation service, and generate a private key (a private key corresponding to the random verifiable contract) through the random factor and the random number so as to generate a verifiable asset transfer random number. The target virtual asset corresponding to the asset transfer random number can be determined through the asset transfer contract, the target virtual asset and the asset transfer random number can be returned to the requesting device, the requesting device can verify the validity of the target virtual asset based on the random factor, the asset transfer random number and the random number verification public key, namely, the verifiable asset transfer random number can be generated under the blockchain by introducing the random verifiable contract, the randomness of virtual asset distribution can be ensured by verifying the correctness of the asset transfer random number, and the verifiability of virtual asset distribution can be improved.
Referring to fig. 11, fig. 11 is a schematic structural diagram of a computer device according to an embodiment of the application. As shown in fig. 11, the computer device 1000 may be a user terminal or a server, which is not limited herein. For ease of understanding, the present application takes a computer device as an example of a user terminal, and the computer device 1000 may include: processor 1001, network interface 1004, and memory 1005, in addition, the computer device 1000 may further comprise: a user interface 1003, and at least one communication bus 1002. Wherein the communication bus 1002 is used to enable connected communication between these components. The user interface 1003 may also include a standard wired interface, a wireless interface, among others. The network interface 1004 may optionally include a standard wired interface, a wireless interface (e.g., WI-FI interface). The memory 1004 may be a high-speed RAM memory or a non-volatile memory (non-volatile memory), such as at least one disk memory. The memory 1005 may also optionally be at least one storage device located remotely from the processor 1001. As shown in fig. 11, an operating system, a network communication module, a user interface module, and a device control application may be included in the memory 1005, which is one type of computer-readable storage medium.
The network interface 1004 in the computer device 1000 may also provide network communication functions, and the optional user interface 1003 may also include a Display screen (Display) and a Keyboard (Keyboard). In the computer device 1000 shown in FIG. 11, the network interface 1004 may provide network communication functions; while user interface 1003 is primarily used as an interface for providing input to a user; and the processor 1001 may be used to invoke a device control application stored in the memory 1005 to implement:
receiving an asset acquisition request sent by request equipment, and calling an asset transfer contract in a blockchain based on a random factor carried by the asset acquisition request;
invoking a random verifiable contract in the blockchain through the asset transfer contract, generating a private key based on the random factor and the random number stored in the random verifiable contract, and generating an asset transfer random number;
and determining a target virtual asset corresponding to the asset transfer random number through an asset transfer contract, and returning the target virtual asset and the asset transfer random number to the requesting device so that the requesting device verifies the validity of the target virtual asset based on the random factor, the asset transfer random number and the random number verification public key.
Alternatively, the processor 1001 may implement:
sending an asset acquisition request carrying a random factor to the block chain link point, so that the block chain link point calls an asset transfer contract in a block chain based on the random factor, and determining a target virtual asset corresponding to the asset transfer random number through the asset transfer contract; the asset transfer random number is generated based on a random factor and a random number generation private key stored in a random verifiable contract, the random verifiable contract being invoked by the asset transfer contract;
and receiving the target virtual asset and the asset transfer random number returned by the block chain node, and obtaining a random verification result of the asset transfer random number through the random factor, the asset transfer random number and the random number verification public key, and determining that the target virtual asset has effectiveness when the random verification result indicates that verification is passed.
It should be understood that the computer device 1000 described in the embodiments of the present application may perform the description of the virtual asset processing method in the blockchain in any of the embodiments corresponding to fig. 3, 6 and 8, or may perform the description of the virtual asset processing apparatus 1 in the blockchain in the embodiment corresponding to fig. 9, or perform the description of the virtual asset processing apparatus 2 in the blockchain in the embodiment corresponding to fig. 10, which will not be repeated herein. In addition, the description of the beneficial effects of the same method is omitted.
Furthermore, it should be noted here that: the embodiment of the present application further provides a computer readable storage medium, in which a computer program executed by the virtual asset processing apparatus 1 in a blockchain or the virtual asset processing apparatus 2 in a blockchain mentioned above is stored, and the computer program includes program instructions, when executed by a processor, can execute the description of the virtual asset processing method in the blockchain in any of the embodiments corresponding to fig. 3, fig. 6 and fig. 8, and therefore, a description will not be given here. In addition, the description of the beneficial effects of the same method is omitted. For technical details not disclosed in the embodiments of the computer-readable storage medium according to the present application, please refer to the description of the method embodiments of the present application. As an example, program instructions may be deployed to be executed on one computing device or on multiple computing devices at one site or, alternatively, across multiple computing devices distributed across multiple sites and interconnected by a communication network, where the multiple computing devices distributed across multiple sites and interconnected by the communication network may constitute a blockchain system.
In addition, it should be noted that: embodiments of the present application also provide a computer program product or computer program that may include computer instructions that may be stored in a computer-readable storage medium. The processor of the computer device reads the computer instructions from the computer readable storage medium, and the processor can execute the computer instructions, so that the computer device performs the above description of the virtual asset processing method in the blockchain in any of the embodiments corresponding to fig. 3, fig. 6 and fig. 8, and therefore, a detailed description will not be given here. In addition, the description of the beneficial effects of the same method is omitted. For technical details not disclosed in the computer program product or the computer program embodiments according to the present application, reference is made to the description of the method embodiments according to the present application.
It should be noted that, for simplicity of description, the foregoing method embodiments are all expressed as a series of action combinations, but it should be understood by those skilled in the art that the present application is not limited by the order of action described, as some steps may be performed in other order or simultaneously according to the present application. Further, those skilled in the art will also appreciate that the embodiments described in the specification are all preferred embodiments, and that the acts and modules referred to are not necessarily required for the present application.
The steps in the method of the embodiment of the application can be sequentially adjusted, combined and deleted according to actual needs.
The modules in the device of the embodiment of the application can be combined, divided and deleted according to actual needs.
Those skilled in the art will appreciate that implementing all or part of the above-described methods may be accomplished by way of a computer program stored in a computer-readable storage medium, which when executed may comprise the steps of the embodiments of the methods described above. The storage medium may be a magnetic disk, an optical disk, a Read-Only Memory (ROM), a random access Memory (Random Access Memory, RAM), or the like.
The foregoing disclosure is illustrative of the present application and is not to be construed as limiting the scope of the application, which is defined by the appended claims.

Claims (16)

1. A method of virtual asset handling in a blockchain, comprising:
receiving an asset acquisition request sent by request equipment, and calling an asset transfer contract in a blockchain based on a random factor carried by the asset acquisition request;
Invoking a random verifiable contract in the blockchain through the asset transfer contract, generating a private key based on the random factor and a random number stored in the random verifiable contract, and generating an asset transfer random number;
and determining a target virtual asset corresponding to the asset transfer random number through the asset transfer contract, and returning the target virtual asset and the asset transfer random number to the request device so that the request device verifies the validity of the target virtual asset based on the random factor, the asset transfer random number and a random number verification public key.
2. The method of claim 1, wherein receiving the asset retrieval request sent by the requesting device invokes an asset transfer contract in a blockchain based on a random factor carried by the asset retrieval request, comprising:
receiving an asset acquisition request sent by request equipment, and carrying out validity verification on the asset acquisition request to obtain a request verification result corresponding to the asset acquisition request;
and when the request verification result indicates that verification is successful, acquiring a random factor carried by the asset acquisition request, and calling an asset transfer contract in the blockchain based on the random factor.
3. The method according to claim 2, wherein the verifying the validity of the asset pickup request to obtain a request verification result corresponding to the asset pickup request includes:
acquiring a digital signature carried by the asset acquisition request and an object public key corresponding to the request equipment;
decrypting the digital signature based on the object public key to obtain first abstract information corresponding to the digital signature, and performing hash operation on the asset acquisition request based on a hash algorithm to obtain second abstract information corresponding to the asset acquisition request;
and if the first abstract information is the same as the second abstract information, determining that the request verification result corresponding to the asset acquisition request is a verification passing result.
4. The method of claim 1, wherein the invoking the randomly verifiable contract in the blockchain through the asset transfer contract comprises:
acquiring object information carried by the asset acquisition request, and determining that a target object associated with the request device has asset acquisition permission when the object information meets asset acquisition conditions indicated by the asset transfer contract;
Passing the random factor into a randomly verifiable contract in the blockchain through the asset transfer contract, the randomly verifiable contract being executed based on the random factor.
5. The method of claim 4, wherein the generating a private key based on the random factor and the random number stored in the random verifiable contract, generating an asset transfer random number comprises:
acquiring a random number generation private key stored in the random verifiable contract, and calling a random number generation service through the random factor in the random verifiable contract; the random number generation service does not belong to the blockchain;
and operating the random number generation private key and the random factor based on a verifiable random function in the random number generation service to obtain the asset transfer random number.
6. The method of claim 1, wherein the determining, by the asset transfer contract, the target virtual asset to which the asset transfer random number corresponds comprises:
acquiring a virtual asset set in the asset transfer contract, and acquiring the asset quantity of the virtual assets contained in the virtual asset set;
And executing transfer business logic in the asset transfer contract, acquiring target virtual assets for transfer according to the asset transfer random number and the asset quantity, and transferring the target virtual assets in the virtual asset set to the object account corresponding to the request equipment.
7. The method of claim 6, wherein said executing the transfer business logic in the asset transfer contract to obtain a target virtual asset for transfer based on the asset transfer random number and the asset quantity comprises:
executing transfer business logic in the asset transfer contract, and performing surplus operation on the asset quantity through the asset transfer random number to obtain a first virtual asset;
if the first virtual asset does not belong to the virtual asset set, continuing to perform remainder taking operation on the asset quantity through the first virtual asset to obtain a second virtual asset;
and if the second virtual asset belongs to the virtual asset set, determining the first virtual asset as a target virtual asset for transfer.
8. A method of virtual asset handling in a blockchain, comprising:
Sending an asset acquisition request carrying a random factor to a block chain link node so that the block chain node invokes an asset transfer contract in a block chain based on the random factor, and determining a target virtual asset corresponding to an asset transfer random number through the asset transfer contract; the asset transfer random number is generated based on the random factor and a random number generation private key stored in a random verifiable contract, the random verifiable contract being invoked by the asset transfer contract;
and receiving the target virtual asset and the asset transfer random number returned by the blockchain node, obtaining a random verification result of the asset transfer random number through the random factor, the asset transfer random number and a random number verification public key, and determining that the target virtual asset has validity when the random verification result indicates verification pass.
9. The method as recited in claim 8, further comprising:
and when the random verification result indicates verification failure, determining that the target virtual asset is not valid, and sending an asset transfer audit request to the blockchain node so that the blockchain node reallocates the target virtual asset for transfer for the requesting device.
10. The method as recited in claim 8, further comprising:
receiving an object registration request corresponding to a target object, acquiring object authentication information carried by the object registration request, and verifying the object authentication information through an object management interface to obtain an identity authentication result corresponding to the object authentication information;
and when the identity authentication result indicates that authentication is successful, determining that the target object has the authority to initiate the asset acquisition request.
11. The method as recited in claim 8, further comprising:
and acquiring a generation time stamp corresponding to the asset acquisition request, acquiring the random factor according to the generation time stamp, and adding the random factor to the asset acquisition request.
12. A virtual asset processing apparatus in a blockchain, comprising:
the contract calling module is used for receiving an asset acquisition request sent by the request equipment and calling an asset transfer contract in the block chain based on a random factor carried by the asset acquisition request;
a random number generation module for invoking a random verifiable contract in the blockchain through the asset transfer contract, generating a private key based on the random factor and the random number stored in the random verifiable contract, and generating an asset transfer random number;
And the virtual asset determining module is used for determining a target virtual asset corresponding to the asset transfer random number through the asset transfer contract, and returning the target virtual asset and the asset transfer random number to the request device so that the request device verifies the validity of the target virtual asset based on the random factor, the asset transfer random number and a random number verification public key.
13. A virtual asset processing apparatus in a blockchain, comprising:
the sending module is used for sending an asset acquisition request carrying a random factor to the block chain link node so that the block chain node invokes an asset transfer contract in a block chain based on the random factor, and determining a target virtual asset corresponding to an asset transfer random number through the asset transfer contract; the asset transfer random number is generated based on the random factor and a random number generation private key stored in a random verifiable contract, the random verifiable contract being invoked by the asset transfer contract;
and the receiving module is used for receiving the target virtual asset returned by the blockchain node and the asset transfer random number, obtaining a random verification result of the asset transfer random number through the random factor, the asset transfer random number and a random number verification public key, and determining that the target virtual asset has validity when the random verification result indicates verification pass.
14. A computer device comprising a memory and a processor;
the memory is connected to the processor, the memory is used for storing a computer program, and the processor is used for calling the computer program to enable the computer device to execute the method of any one of claims 1-11.
15. A computer readable storage medium, characterized in that the computer readable storage medium has stored therein a computer program adapted to be loaded and executed by a processor to cause a computer device having the processor to perform the method of any of claims 1-11.
16. A computer program product comprising computer programs/instructions which, when executed by a processor, implement the method of any of claims 1-11.
CN202210446672.XA 2022-04-26 2022-04-26 Virtual asset processing method, device, equipment and medium in blockchain Pending CN116996226A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210446672.XA CN116996226A (en) 2022-04-26 2022-04-26 Virtual asset processing method, device, equipment and medium in blockchain

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210446672.XA CN116996226A (en) 2022-04-26 2022-04-26 Virtual asset processing method, device, equipment and medium in blockchain

Publications (1)

Publication Number Publication Date
CN116996226A true CN116996226A (en) 2023-11-03

Family

ID=88530799

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210446672.XA Pending CN116996226A (en) 2022-04-26 2022-04-26 Virtual asset processing method, device, equipment and medium in blockchain

Country Status (1)

Country Link
CN (1) CN116996226A (en)

Similar Documents

Publication Publication Date Title
CN113691597B (en) Block chain contract deployment method, device, equipment and storage medium
CN112214780B (en) Data processing method and device, intelligent equipment and storage medium
CN111445333B (en) Block generation method, device, computer equipment and storage medium
CN110009494B (en) Method and device for monitoring transaction content in block chain
CN110199287A (en) It is unsealed using the data that area is surrounded in sealing
CN110199288A (en) Crossover-platform surrounds area's seal data
CN112446785A (en) Cross-chain transaction method, system, device, equipment and storage medium
CN110199286A (en) The seal data in area is surrounded using sealing
CN110214324A (en) Key vault surrounds area
CN110199284A (en) Crossover-platform surrounds area's identity
CN110226167A (en) It is abstract to surround area's identity
CN111241557B (en) Service request method and device based on block chain
CN110199285A (en) Subordinate surrounds area's binary file
CN112669147B (en) Service request method and device based on block chain
CN111597567B (en) Data processing method, data processing device, node equipment and storage medium
CN111488372A (en) Data processing method, device and storage medium
CN110096894A (en) A kind of data anonymous shared system and method based on block chain
CN110214321A (en) Nesting surrounds area's identity
CN113946877A (en) Data security calculation method, system, computer equipment, storage medium and terminal
CN112532646A (en) Data sharing method, system, device, equipment and storage medium
CN116996226A (en) Virtual asset processing method, device, equipment and medium in blockchain
CN116781292A (en) Data processing method, device, equipment and readable storage medium
CN116996331B (en) Block chain-based data processing method, device, equipment and medium
CN114866409B (en) Password acceleration method and device based on password acceleration hardware
US11108744B2 (en) Network encryption methods for realizing encryption of local area networks at the bottom layer driver of network cards of embedded devices

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination