CN116488822B - Identification method and system for digital blind box subscription legal user - Google Patents

Identification method and system for digital blind box subscription legal user Download PDF

Info

Publication number
CN116488822B
CN116488822B CN202310198816.9A CN202310198816A CN116488822B CN 116488822 B CN116488822 B CN 116488822B CN 202310198816 A CN202310198816 A CN 202310198816A CN 116488822 B CN116488822 B CN 116488822B
Authority
CN
China
Prior art keywords
blind
box
user
opening
blind box
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.)
Active
Application number
CN202310198816.9A
Other languages
Chinese (zh)
Other versions
CN116488822A (en
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.)
Guangzhou Yousheng Network Technology Co ltd
Original Assignee
Guangzhou Yousheng Network Technology 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 Guangzhou Yousheng Network Technology Co ltd filed Critical Guangzhou Yousheng Network Technology Co ltd
Priority to CN202310198816.9A priority Critical patent/CN116488822B/en
Publication of CN116488822A publication Critical patent/CN116488822A/en
Application granted granted Critical
Publication of CN116488822B publication Critical patent/CN116488822B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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/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
    • 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
    • H04L2209/00Additional information or applications relating to cryptographic mechanisms or cryptographic arrangements for secret or secure communication H04L9/00
    • H04L2209/08Randomization, e.g. dummy operations or using noise

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The application relates to the technical field of blockchain, in particular to a method and a system for identifying a digital blind box subscription legal user. The method comprises the following steps: in the stage of pre-selling the blind boxes, when a user purchases the blind boxes, generating an open blind box credential in the user side of the current user and sending the open blind box credential to a blockchain intelligent contract for storage; and in the blind opening stage, responding to a blind opening request of a user, verifying blind opening evidence to confirm the legitimacy of the current blind opening request user, if the verification is passed, executing blind opening box selection according to a preset blind opening rule in an intelligent contract, and casting the NFT to the user, and if the verification is not passed, failing to open the blind box. According to the application, the blind opening box credential is introduced when a user purchases the blind box in the blind box pre-selling stage, so that the blind opening box credential can be used for identifying legal users of the blind box subscription in the blind opening box stage, the safety is enhanced, and the blind opening box credential can be used for increasing the randomness in the blind opening box stage, namely, the problem of enhancing the randomness and the safety is solved simultaneously.

Description

Identification method and system for digital blind box subscription legal user
Technical Field
The application relates to the technical field of blockchain, in particular to a method and a system for identifying a digital blind box subscription legal user.
Background
The blockchain is open-source, the data on the blockchain is open to all people, anyone can query the blockchain data and develop related applications through a disclosed interface, so that the whole system information is highly transparent, a user account is represented by a public key, a private key is generated by a random number, the public key is derived from the private key through an algorithm, but the private key cannot be derived from the public key, the public key and the private key exist in pairs, and the functions of the public key and the private key are as follows: public key encryption and private key decryption; private key signature and public key signature verification. A typical blockchain uses a public key as an address or account number on the chain.
In the field of blockchain, NFT (Non-flexible Token) is an asset credential implemented by an intelligent contract technology, and takes ERC721 standard as an example, NFT has uniqueness and functions of creation, transfer, destruction and the like. The NFT can be used as a non-homogeneous certificate for the validation of assets such as artwork copyrights, game props, notes, etc. NFT may circulate and trade over the blockchain. The NFT, which is an asset credential, has a unique feature and also has self-describing capability, and a metadata field exists on the smart contract to describe the NFT.
The blind box is a toy box which can not be known by consumers in advance of specific product styles and has random attributes. Only if the consumer opens will he know what style of product he or she has drawn. The blind boxes comprise a plurality of different series, the number of initial blind boxes corresponding to a whole box in each series is different, and the blind boxes in each whole box are not repeated. The blind box is not automatically replenished after being drawn away until the whole box is drawn out. And the digital blind box refers to the entertainment consumer product in a digital form adopting the blind box playing method.
Digital blind box play of the blockchain+nft has become a current trend, and the process generally comprises a blind box pre-selling stage and a blind box opening stage of users. However, in the prior art, a decentralization means is often lacking in a blind box opening stage of a user to identify the legitimacy of the user, and the adoption of the decentralization means also leads to insufficient public confidence or insufficient safety, or the fact that whether the user who breaks the blind box is a legal blind box subscription user in a legal blind box pre-sale stage cannot be accurately judged.
Disclosure of Invention
The application aims to identify the legal user of digital blind box subscription by utilizing the irreversible characteristic of hash operation and the intelligent contract technology of block chain, thereby improving the safety. In order to achieve the purpose of the application, the following technical scheme is adopted:
the identification method of the legal user of the digital blind box subscription comprises a blind box pre-selling stage and a blind box opening stage, wherein in the blind box pre-selling stage, when a user purchases a blind box, an blind box opening credential is generated in a user side of the current user and is sent to a blockchain intelligent contract for storage;
and in the blind opening stage, responding to a blind opening request of a user, verifying blind opening evidence to confirm the legitimacy of the current blind opening request user, if the verification is passed, executing blind opening box selection according to a preset blind opening rule in an intelligent contract, and casting the NFT to the user, and if the verification is not passed, failing to open the blind box.
In some embodiments, the generating an open-blind box credential in the user side of the current user when the user purchases the blind box and sending the open-blind box credential to the blockchain smart contract for saving includes:
when a user purchases a blind box, generating an under-chain random number in the user side of the current user and holding the under-chain random number by the user;
obtaining a first hash value by hash operation through the under-chain random number, the current timestamp and the current user address and holding the first hash value by a user;
and obtaining a second hash value from the under-chain random number and the first hash value through hash operation, and sending the second hash value serving as an open blind box credential to a blockchain intelligent contract for storage.
In some embodiments, the verifying the blind-open box credential to confirm the legitimacy of the current blind-open box requesting user comprises:
receiving a random number under a chain to be verified and a first hash value to be verified, which are input by a user in a client, carrying out hash operation on the random number under the chain to be verified and the first hash value to be verified, obtaining a verification hash value, judging whether the verification hash value is equal to an open blind box credential stored by the user in a blockchain intelligent contract, if so, verifying to pass, and if not, verifying to fail.
In some embodiments, prior to verifying the blind-opening box credential to confirm the legitimacy of the current blind-opening box requesting user, further comprising:
and when responding to the blind opening box request of the user, generating a blind opening box random number in the user terminal of the current user as an on-chain random source, wherein the blind opening box random number is used for blind box selection according to a preset blind opening box rule in the intelligent contract and casting the NFT to the user.
In some embodiments, the blind box selecting and casting the NFT to the user according to the blind box opening rule preset in the intelligent contract includes:
after converting the open-blind box random number into the int256 type, taking the remainder of the total number of the preset blind boxes in the blockchain intelligent contract, taking the obtained remainder as a blind box array index to perform blind box selection, and casting the NFT to a user.
In some embodiments, the blind box selecting and casting the NFT to the user using the obtained remainder as the blind box array index includes:
checking whether the blind box corresponding to the currently obtained blind box array index is already opened, adding 1 to the blind box array index if the blind box array index is already opened, checking whether the corresponding blind box is already opened, and the like, if the maximum value of the blind box array index is exceeded, looping back to the blind box array index 0, and checking whether the blind box is already opened until one blind box is successfully opened.
In some embodiments, the smart contract is deployed on a blockchain, and it meets the ERC721 standard protocol or the ERC1155 standard protocol.
Based on the same inventive concept, the exemplary embodiment of the present application further provides an authentication system for a digital blind box subscription legal user, including:
the blind opening box credential generation module is used for generating a blind opening box credential in the user side of the current user and sending the blind opening box credential to the blockchain intelligent contract for storage in the blind box pre-selling stage when the user purchases the blind box;
the verification module is used for responding to the blind opening request of the user in the blind opening stage, verifying the blind opening evidence to confirm the legitimacy of the current blind opening request user, if the verification is passed, executing blind opening box selection according to the preset blind opening box rule in the intelligent contract, and casting the NFT to the user, and if the verification is not passed, failing to open the blind box;
and the blind box selection module is used for executing blind box selection according to blind box opening rules preset in the intelligent contract and casting the NFT to the user when the verification module verifies to pass.
Based on the same inventive concept, the exemplary embodiments of the present application also provide an electronic device, including a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, the processor implementing a method for authenticating a digital blind box subscription legal user according to any one of the above.
Based on the same inventive concept, the exemplary embodiments of the present application also provide a computer readable storage medium, which includes a stored computer program, wherein the apparatus in which the computer readable storage medium is located is controlled to perform an authentication method of a digital blind box subscription legal user according to any one of the above when the computer program is run.
Compared with the prior art, the application has the following advantages:
according to the application, the blind opening box credential is introduced when a user purchases the blind box in the blind box pre-selling stage, so that the blind opening box credential can be used for identifying legal users of the blind box subscription in the blind opening box stage, the identification efficiency and accuracy are high, and the safety is enhanced, and on the other hand, the blind opening box credential can be used for increasing the randomness in the blind opening box stage, namely, the problem of enhancing the randomness and the safety is solved.
Drawings
In order to more clearly illustrate the technical solutions of the present application or related art, the drawings that are required to be used in the description of the embodiments or related art will be briefly described below, and it is apparent that the drawings in the following description are only embodiments of the present application, and other drawings may be obtained according to the drawings without inventive effort to those of ordinary skill in the art.
FIG. 1 is a flow chart of an authentication method for a digital blind box subscription legal user according to an embodiment of the application;
FIG. 2 is a detailed flow chart of an authentication method for a digital blind box subscription legal user according to an embodiment of the application;
FIG. 3 is a flowchart of generating an open-blind box credential in a client of a current user and sending the open-blind box credential to a blockchain smart contract for saving when the user purchases the blind box in an embodiment of the present application;
FIG. 4 is a flow chart of verifying blind-opening box credentials to confirm the legitimacy of a current blind-opening box requesting user in an embodiment of the present application;
FIG. 5 is a flow chart of generating an open-blind box random number in an embodiment of the application;
fig. 6 is a flowchart of blind box selection and NFT casting to a user according to preset blind box opening rules in an embodiment of the present application;
FIG. 7 is a flow chart of blind box selection and NFT casting for a user using the obtained remainder as a blind box array index in an embodiment of the present application;
FIG. 8 is a schematic diagram of an authentication system for a digital blind box subscription legal user according to an embodiment of the present application;
fig. 9 is a schematic diagram of an electronic device according to an embodiment of the application.
Detailed Description
Embodiments of the present application are described in detail below, examples of which are illustrated in the accompanying drawings, wherein like or similar reference numerals refer to like or similar elements or elements having like or similar functions throughout. The embodiments described below by referring to the drawings are exemplary. And are intended to be illustrative of the application only and are not to be construed as limiting the application.
As used herein, the singular forms "a", "an", "the" and "the" are intended to include the plural forms as well, unless expressly stated otherwise, as understood by those skilled in the art. It will be further understood that the terms "comprises" and/or "comprising," when used in this specification, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof. It will be understood that when an element is referred to as being "connected" or "coupled" to another element, it can be directly connected or coupled to the other element or intervening elements may also be present. Further, "connected" or "coupled" as used herein may include wirelessly connected or wirelessly coupled. The term "and/or" as used herein includes all or any element and all combination of one or more of the associated listed items.
It will be understood by those skilled in the art that all terms (including technical and scientific terms) used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs unless defined otherwise. It will be further understood that terms, such as those defined in commonly used dictionaries, should be interpreted as having a meaning that is consistent with their meaning in the context of the prior art and will not be interpreted in an idealized or overly formal sense unless expressly so defined herein.
The application refers to the hardware of the name "user end", which is essentially an electronic device with personal computer, and is a hardware device with a central processing unit (including an arithmetic unit and a controller), a memory, an input device and an output device, wherein the computer program is stored in the memory, the central processing unit calls the program stored in the memory to run, executes instructions in the program, and interacts with the input and output devices, thereby completing specific functions.
The block chain disclosed by the application comprises a public chain, a private chain, a alliance chain and other realization forms unless specified by a plaintext, has the characteristic of distributed encryption storage, and executes corresponding instructions by calling the client or the server of the application through an open interface so as to complete corresponding tasks.
Those skilled in the art will appreciate that: although the various methods of the present application are described based on the same concepts so as to be common to each other, the methods may be performed independently of each other unless specifically indicated otherwise. Similarly, for the various embodiments disclosed herein, all concepts described herein are presented based on the same general inventive concept, and thus, concepts described herein with respect to the same general inventive concept, and concepts that are merely convenient and appropriately modified, although different, should be interpreted as equivalents.
The various embodiments of the present application to be disclosed herein, unless the plain text indicates a mutually exclusive relationship with each other, the technical features related to the various embodiments may be cross-combined to flexibly construct a new embodiment as long as such combination does not depart from the inventive spirit of the present application and can satisfy the needs in the art or solve the deficiencies in the prior art. This variant will be known to the person skilled in the art.
The principles and spirit of the present application are explained in detail below with reference to several representative embodiments thereof.
Summary of the application:
digital blind box play of the blockchain+nft has become a current trend, and the process generally comprises a blind box pre-selling stage and a blind box opening stage of users. However, in the prior art, the legitimacy of the user is often lack of authentication in the blind box opening stage of the user, so that whether the user who breaks the blind box is a legal user who subscribes in the blind box pre-selling stage cannot be accurately judged, and the safety is insufficient.
In order to solve the problems, the application improves the safety by introducing the blind opening evidence when a user purchases the blind box in the blind box pre-selling stage and verifying the blind opening evidence in the blind opening stage.
To this end, a first aspect of the embodiment of the present application provides a method for authenticating a digital blind box subscription legal user, as shown in fig. 1 and fig. 2, the method includes the following steps:
step S1, a blind box pre-selling stage:
step S11, when the user purchases the blind box, an open blind box credential is generated in the user side of the current user and sent to the blockchain intelligent contract for storage.
It is appreciated that intelligent contracts conforming to the NFT specification are deployed on the blockchain, and specifically, ERC721 or ERC1155 specifications may be employed. Specifically, the blockchain network has the function of an intelligent contract, and the intelligent contract is deployed on the blockchain in a alliance chain mode, meets the ERC721 standard protocol, and can be used for casting the NFT according to the opened blind box information.
And, the following blind box characteristics and data structures are added in the intelligent contract:
n: the total number of blind boxes, which need to be disclosed to the purchasing user of the blind boxes. For example, n=15, indicating that the total number of blind boxes is 15.
Box [ N ] array: a collection of blind boxes to be opened for storing an array of digital asset objects to be sold. Taking the total number N of blind boxes as 15 as an example, blind boxes with subscripts of 0-14 are stored in the Box [ N ] array.
Boxed [ N ] array: to store the blind box digital asset object array that has been opened, the box [ N ] array is used to store which of the subscripted blind boxes have been opened.
user_hash [ N ] array: an open-blind box credential array is recorded for all users participating in the purchase of blind boxes during the blind box pre-sale phase.
It can be appreciated that the user cannot immediately open the blind box after purchasing, waiting time is required to perform the blind box opening action, after the blind box pre-selling stage is finished, the NFT intelligent contract enters the subsequent blind box opening stage, and at this time, the buyer user can initiate the blind box opening request and perform the subsequent blind box opening casting NFT after verifying the blind box opening evidence.
Step S2, blind opening stage:
step S21, responding to the blind opening request of the user, verifying the blind opening evidence to confirm the legitimacy of the current blind opening request user, if the verification is passed, executing step S22, and if the verification is not passed, failing to open the blind.
And S22, blind box selection is carried out according to a preset blind box opening rule in the intelligent contract, and the NFT is cast for a user.
In some embodiments, as shown in fig. 3, in step S11, when the user purchases the blind box, an open blind box credential is generated in the user side of the current user and sent to the blockchain smart contract for saving, which specifically includes the following steps:
step S111, when the user purchases the blind box, an under-chain random number is generated in the user side of the current user and held by the user. Thus, a random number under the chain which is known by the user is obtained, and the explicit user cannot be revealed to other people.
It should be appreciated that the random algorithm that generates the under-chain random numbers may be custom, e.g., limited to cost considerations may be implemented using a pseudo-random number algorithm that is a "linear congruence method". Other random algorithms can be adopted by those skilled in the art according to actual needs, and the embodiment is not specifically limited herein.
Step S112, obtaining a first hash value by hash operation through the under-chain random number, the current time stamp and the current user address and holding the first hash value by the user. Thus, a first hash value which is known only by the user is obtained, and the explicit user cannot be revealed to other people.
Step S113, obtaining a second hash value as an open blind box credential through hash operation by the under-chain random number and the first hash value, and sending the second hash value to a blockchain intelligent contract for storage.
Illustrating:
assuming that N is the current N-th blind box purchasing user, namely, user N and Kn represent a downlink random number generated by a user side of the user N, userdaress represents a user address of the current blind box purchasing user, hn represents a first hash value obtained by combining multiple factors through hash operation on the user N, user_hash [ N ] in a user_hash [ N ] array represents an open blind box credential of the user N, and hash () is a hash algorithm, the generation process of Hn can be represented by the following formula: hn=hash (kn+userdaress+current timestamp). The generation process of the user_hash [ n ] is as follows: user_hash [ n ] =hash (Hn, kn).
Notably, the hash algorithm described in this embodiment may be generally implemented using a Secure Hash Algorithm (SHA), or a hash algorithm based on the blockchain itself. Those skilled in the art can set the device according to actual needs.
In some embodiments, as shown in fig. 4, the verifying the blind-open box credential to confirm the legitimacy of the current blind-open box requesting user in step S21 includes:
step S211, receiving a to-be-verified under-chain random number and a to-be-verified first hash value input by a user in a client.
Step S212, hash operation is carried out on the input random number under the chain to be verified and the first hash value to be verified to obtain a verification hash value.
Step S213, judging whether the verification hash value is equal to the blind-opening box credential stored in the blockchain intelligent contract by the user, if so, passing the verification, and if not, not passing the verification.
Illustrating: kn1 represents a random number of the user N under a chain to be verified, hn1 represents a first hash value of the user N under the chain to be verified, the first hash value is input by the user N at the user, and when the user_hash [ N ] = hash (Hn 1, kn 1) is verified, wherein the user_hash [ N ] is stored in a user_hash [ N ] array in a block chain in a blind box pre-selling stage, if the random number is equal, the random number under the chain to be verified, which is input by the user, and the first hash value to be verified are correct, and the verification is passed, and the user is legal.
It should be understood that there is no need to worry about whether the open blind box credential user_hash [ n ] of the user n will leak or not, because the first hash value is obtained by hashing the under-chain random number generated by the user terminal, the user address of the user purchasing the blind box, and the time stamp at the time in the pre-selling stage, and only the user knows and holds the under-chain random number and the time stamp, and the address match, the under-chain random number and the first hash value cannot be obtained by reversely pushing the user_hash [ n ] from the hash value, so that it can be confirmed that the current address user inputting the correct under-chain random number and the first hash value is the legal blind box pre-selling purchasing user.
In some embodiments, as shown in fig. 4, in step S21, before verifying the blind-opening box credential to confirm the validity of the current blind-opening box requesting user, further includes:
step S210, when responding to a blind opening box request of a user, generating a blind opening box random number in a user side of the current user as an on-chain random source, wherein the blind opening box random number is used for blind box selection and NFT casting for the user according to a blind opening box rule preset in an intelligent contract after the subsequent verification is passed.
In some embodiments, as shown in fig. 5, in step S210, an open-blind box random number is generated in the user side of the current user as an on-chain random source in response to the open-blind box request of the user, and the specific steps include:
in step S2101, in response to the blind-opening box request of the user, a blockchain random number generated based on the blind-opening box request is received at the user side of the current user.
It will be appreciated that by introducing a blockchain random number, it is possible to more fully manifest fairness by adding random uncontrollable factors during blind-opening.
Step S2102, reading blind-opening box credentials stored in the blockchain intelligent contract by the current user.
It will be appreciated that the blind-opening box credential is generated by the user when buying the blind box during the blind-box pre-sale phase, and each user corresponds to a unique blind-opening box credential and is stored in the blind-opening box credential array user_hash [ N ].
Step S2103, obtaining a hash value as an open-blind box random number by hash operation according to the blockchain random number, the current timestamp and the open-blind box credential in the user terminal of the current user.
The following is illustrative: assuming that n represents the current n-th purchase blind box user, base_hash represents the blockchain random number, user_hash [ n ] represents the blind-opening box credential stored in the blockchain smart contract by user n, index_hash [ n ] represents the blind-opening box random number of user n, and Hash () is a Hash algorithm, the generation process of index_hash [ n ] can be represented by the following formula: index_hash [ n ] =hash (base_hash+current timestamp+user_hash [ n ]).
In some embodiments, in step S2101, the step of receiving, at the user side of the current user, a blockchain random number generated based on the blind-opening box request, specifically includes the steps of:
reading the current timestamp, the block height, the last block hash value and the transaction number of the last block in the block chain, and carrying out hash operation on the current timestamp, the block height, the last block hash value and the transaction number of the last block to obtain a hash value as a block chain random number.
Illustrating: the block chain random number is represented by base_hash, and Hash () is a Hash algorithm, then base_hash=hash (current timestamp+block height+last block Hash value+last block transaction number).
The method of the application realizes randomness of the blockchain in the NFT blind box selling and casting process, provides better user experience for NFT casting and selling, and simultaneously provides an innovative method for randomness on the blockchain, and realizes the randomness on the chain by adding a random factor under the chain into the thought of calculation on the chain.
In some embodiments, as shown in fig. 6, in step S22, the blind box selecting and casting the NFT to the user according to the blind box opening rule preset in the smart contract specifically includes:
step S221, after converting the blind-opening box random number into the int256 type, taking remainder for the preset blind box total number in the blockchain intelligent contract.
Illustrating: as shown in fig. 7, assuming that md represents the remainder, the expression is: md=int 256 (index_hash [ N ])%n.
Step S222, the obtained remainder is used as a blind box array index to carry out blind box selection and NFT is cast for a user.
In some embodiments, in step S222, the blind box selecting and casting the NFT to the user using the obtained remainder as the blind box array index includes:
checking whether the blind box corresponding to the currently obtained blind box array index is already opened, adding 1 to the blind box array index if the blind box array index is already opened, checking whether the corresponding blind box is already opened, and the like, if the maximum value of the blind box array index is exceeded, looping back to the blind box array index 0, and checking whether the blind box is already opened until one blind box is successfully opened.
The application can further maintain high randomness by taking the remainder as an index.
The whole idea is to set two array sets, namely a Box [ N ] array and a Box [ N ] array, wherein the Box [ N ] array is an array for storing digital asset objects to be sold, the Box [ N ] array is an array for storing blind Box digital asset objects which are already opened, the obtained remainder is taken as an array index to check whether the corresponding value in the Box [ N ] array is 0 or not at first, if not, the blind Box corresponding to the index is opened, at the moment, 1 is added to the index, then, whether the corresponding value in the Box [ N ] array is 0 or not is checked, if the maximum value of the array index is exceeded, the array index is looped back to 0, and the like. If the corresponding value of the index in the Box [ N ] array is 0, the blind Box corresponding to the representative index is not opened, at the moment, the digital blind Box corresponding to the index in the Box [ N ] array is opened for the user, and the corresponding value of the index in the Box [ N ] array is marked to be not 0.
Illustrating: assuming that the total number of blind boxes n=15, i.e. the total number of blind boxes is 15, the Box N array stores blind boxes with subscripts of 0-14, and the Box N array is used to store which of the subscripted blind boxes have been opened.
After converting the open blind Box random number into the int256 type, it is necessary to be a number of int256, then taking the remainder of 15 to obtain a remainder smaller than 15, assuming that the obtained remainder is 14, taking 14 as an index, if the value of Box [14] in the Box [ N ] array is not equal to 0, indicating that the blind Box corresponding to the index N '=14 is already opened, at this time, N' =14+1=15 needs to be executed, and 15 is beyond the array index range of 0-14, so that it is necessary to loop back to N '=0, if the value of Box [ N' ] =box [0] is=0, indicating that the blind Box corresponding to the index N '=0 is not opened, at this time, opening the blind Box corresponding to Box [ N' ] =box [0] is given to the user, at the same time, indicating that the Box [0] =box in the Box [ N ] array needs to be marked, and the open blind Box is ended; if the value of box [0] is not equal to 0, meaning that the blind box corresponding to index N ' =0 has been opened, we still need to continue to execute N ' =0+1=1, and see if box [1] is equal to 0, if not, we still continue to determine the next N ' =1+1=2.
In some embodiments, the smart contract is deployed on a blockchain, and it meets the ERC721 standard protocol or the ERC1155 standard protocol.
The second aspect of the embodiment of the present application proposes a system for identifying a digital blind box subscription legal user, as shown in fig. 8, which is a schematic structural diagram of a system for identifying a digital blind box subscription legal user provided by an embodiment of the present application, and corresponds to a method for identifying a digital blind box subscription legal user provided by an embodiment of the present application, since the system for identifying a digital blind box subscription legal user provided by an embodiment of the present application corresponds to the method for identifying a digital blind box subscription legal user provided by an embodiment of the present application, the implementation of the method for identifying a digital blind box subscription legal user provided by the foregoing embodiment of the present application is also applicable to the system for identifying a digital blind box subscription legal user provided by the present embodiment.
Specifically, as shown in fig. 8, the authentication system for a digital blind box subscription legal user includes:
and the blind opening box credential generation module is used for generating a blind opening box credential in the user side of the current user when the user purchases the blind box in a blind box pre-selling stage and sending the blind opening box credential to the blockchain intelligent contract for storage.
And the verification module is used for responding to the blind opening box request of the user in the blind opening box opening stage, verifying the blind opening box evidence to confirm the legitimacy of the current blind opening box request user, if the verification is passed, executing blind opening box selection according to the preset blind opening box rule in the intelligent contract, and casting the NFT to the user, and if the verification is not passed, failing to open the blind box.
And the blind box selection module is used for executing blind box selection according to blind box opening rules preset in the intelligent contract and casting the NFT to the user when the verification module verifies to pass.
Referring to fig. 9, an embodiment of the present application also correspondingly provides an electronic device and a computer readable storage medium.
Fig. 9 is a schematic diagram of an electronic device according to an embodiment of the present application. The electronic device of this embodiment includes: a processor 11, a memory 12 and a computer program stored in said memory and executable on said processor 11. The steps of the above-described embodiment of the authentication method for a digital blind box subscription legal user are implemented by the processor 11 when executing the computer program. Alternatively, the processor 11 may implement the functions of the modules/units in the above-described embodiments of the apparatus when executing the computer program.
The computer program may be divided into one or more modules/units, which are stored in the memory and executed by the processor 11 to accomplish the present application, for example. The one or more modules/units may be a series of computer program instruction segments capable of performing the specified functions, which instruction segments are used for describing the execution of the computer program in the electronic device.
The electronic device may include, but is not limited to, a processor, a memory. It will be appreciated by those skilled in the art that the schematic diagram is merely an example of an electronic device and is not limiting of the electronic device, and may include more or fewer components than shown, or may combine certain components, or different components, e.g., the electronic device may also include an input-output device, a network access device, a bus, etc.
The processor 11 may be a central processing unit (Central Processing Unit, CPU), but may also be other general purpose processors, digital signal processors (Digital Signal Processor, DSP), application specific integrated circuits (Application Specific Integrated Circuit, ASIC), off-the-shelf programmable gate arrays (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or the like. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like that is a control center of the electronic device, connecting various parts of the overall electronic device using various interfaces and lines.
The memory 12 may be used to store the computer programs and/or modules, and the processor may perform various functions of the electronic device by executing or executing the computer programs and/or modules stored in the memory, and invoking data stored in the memory. The memory may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system 121, an application program 122 (such as a sound playing function, an image playing function, etc.) required for at least one function, and the like; the storage data area may store data (such as audio data, phonebook, etc.) created according to the use of the handset, etc. In addition, the memory may include high-speed random access memory, and may also include non-volatile memory, such as a hard disk, memory, plug-in hard disk, smart Media Card (SMC), secure Digital (SD) Card, flash Card (Flash Card), at least one disk storage device, flash memory device, or other volatile solid-state storage device.
Wherein the integrated modules/units of the electronic device may be stored in a computer readable storage medium if implemented in the form of software functional units and sold or used as stand alone products. Based on such understanding, the present application may implement all or part of the flow of the method of the above embodiment, or may be implemented by a computer program to instruct related hardware, where the computer program may be stored in a computer readable storage medium, and when the computer program is executed by a processor, the computer program may implement the steps of each of the method embodiments described above. Wherein the computer program comprises computer program code which may be in source code form, object code form, executable file or some intermediate form etc. The computer readable medium may include: any entity or device capable of carrying the computer program code, a recording medium, a U disk, a removable hard disk, a magnetic disk, an optical disk, a computer Memory, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), an electrical carrier signal, a telecommunications signal, a software distribution medium, and so forth.
It should be noted that the above-described apparatus embodiments are merely illustrative, and the units described as separate units may or may not be physically separate, and units shown as units may or may not be physical units, may be located in one place, or may be distributed over a plurality of network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment. In addition, in the system embodiment of the present application, the connection relationship between the modules represents that there is a communication connection between them, and may be specifically implemented as one or more communication buses or signal lines. Those of ordinary skill in the art will understand and implement the present application without undue burden.
Those of ordinary skill in the art will appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
The above embodiments are only for illustrating the technical solution of the present application, and not for limiting the same; although the application has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical scheme described in the foregoing embodiments can be modified or some technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit and scope of the technical solutions of the embodiments of the present application, and are intended to be included in the scope of the present application.

Claims (8)

1. The identification method of the digital blind box subscription legal user comprises a blind box pre-selling stage and a blind box opening stage, and is characterized in that:
in the stage of blind box pre-selling, when a user purchases a blind box, generating an open blind box credential in the user side of the current user and sending the open blind box credential to a blockchain intelligent contract for storage, wherein the open blind box credential comprises the following components: when a user purchases a blind box, generating an under-chain random number in the user side of the current user and holding the under-chain random number by the user; obtaining a first hash value by hash operation through the under-chain random number, the current timestamp and the current user address and holding the first hash value by a user; obtaining a second hash value from the under-chain random number and the first hash value through hash operation, and sending the second hash value serving as an open blind box credential to a blockchain intelligent contract for storage; the blind opening box credential is used for identifying validity of a blind box subscription user in the blind opening box stage;
in the blind opening stage, responding to the blind opening request of the user, verifying the blind opening evidence to confirm the legitimacy of the current blind opening request user, and comprising the following steps: receiving a random number under a chain to be verified and a first hash value to be verified, which are input by a user in a user side, carrying out hash operation on the random number under the chain to be verified and the first hash value to be verified, obtaining a verification hash value, judging whether the verification hash value is equal to an open blind box credential stored by the user in a blockchain intelligent contract, if so, verifying to pass, and if not, verifying to fail;
and if the verification is passed, blind box selection is carried out according to a preset blind box opening rule in the intelligent contract, the NFT is cast to the user, and if the verification is not passed, the blind box opening fails.
2. The method for authenticating a digital blind box subscription legal user according to claim 1, wherein the method comprises the following steps: the method further comprises the following steps before verifying the blind opening box credential to confirm the legitimacy of the current blind opening box request user:
and when responding to the blind opening box request of the user, generating a blind opening box random number in the user terminal of the current user as an on-chain random source, wherein the blind opening box random number is used for blind box selection according to a preset blind opening box rule in the intelligent contract and casting the NFT to the user.
3. The method for authenticating a digital blind box subscription legal user according to claim 2, wherein the method comprises the following steps: the blind box selection is performed according to a preset blind box opening rule in the intelligent contract, and the NFT is cast to a user, including:
after converting the open-blind box random number into the int256 type, taking the remainder of the total number of the preset blind boxes in the blockchain intelligent contract, taking the obtained remainder as a blind box array index to perform blind box selection, and casting the NFT to a user.
4. A method for authenticating a digital blind cartridge subscription legal user according to claim 3, characterized in that: the blind box selection is carried out by taking the obtained remainder as a blind box array index, and the NFT is cast to a user, comprising the following steps:
checking whether the blind box corresponding to the currently obtained blind box array index is already opened, adding 1 to the blind box array index if the blind box array index is already opened, checking whether the corresponding blind box is already opened, and the like, if the maximum value of the blind box array index is exceeded, looping back to the blind box array index 0, and checking whether the blind box is already opened until one blind box is successfully opened.
5. The method for authenticating a digital blind box subscription legal user according to claim 1, wherein the method comprises the following steps: the smart contract is deployed on a blockchain and it meets either the ERC721 standard protocol or the ERC1155 standard protocol.
6. An authentication system for a digital blind cartridge subscription legal user, characterized by performing an authentication method for a digital blind cartridge subscription legal user according to any one of claims 1-5, comprising:
the blind opening box credential generation module is used for generating a blind opening box credential in the user side of the current user and sending the blind opening box credential to the blockchain intelligent contract for storage in the blind box pre-selling stage when the user purchases the blind box;
the verification module is used for responding to the blind opening request of the user in the blind opening stage, verifying the blind opening evidence to confirm the legitimacy of the current blind opening request user, if the verification is passed, carrying out blind opening selection according to the preset blind opening rule in the intelligent contract, and casting the NFT to the user, and if the verification is not passed, failing to open the blind;
and the blind box selection module is used for carrying out blind box selection according to blind box opening rules preset in the intelligent contract and casting the NFT to the user when the verification module passes the verification.
7. An electronic device, characterized in that: comprising a processor, a memory and a computer program stored in the memory and configured to be executed by the processor, the processor implementing a method of authenticating a digital blind cartridge subscription legal user according to any one of claims 1 to 5 when the computer program is executed.
8. A computer-readable storage medium, characterized by: the computer readable storage medium comprises a stored computer program, wherein the computer program when run controls a device in which the computer readable storage medium is located to perform an authentication method of a digital blind box subscription legal user according to any one of claims 1 to 5.
CN202310198816.9A 2023-03-03 2023-03-03 Identification method and system for digital blind box subscription legal user Active CN116488822B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310198816.9A CN116488822B (en) 2023-03-03 2023-03-03 Identification method and system for digital blind box subscription legal user

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310198816.9A CN116488822B (en) 2023-03-03 2023-03-03 Identification method and system for digital blind box subscription legal user

Publications (2)

Publication Number Publication Date
CN116488822A CN116488822A (en) 2023-07-25
CN116488822B true CN116488822B (en) 2023-12-12

Family

ID=87214479

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310198816.9A Active CN116488822B (en) 2023-03-03 2023-03-03 Identification method and system for digital blind box subscription legal user

Country Status (1)

Country Link
CN (1) CN116488822B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113807917A (en) * 2021-09-13 2021-12-17 广州酷狗计算机科技有限公司 Virtual blind box circulation and order placing control method and device, equipment, medium and product
CN113822974A (en) * 2021-11-24 2021-12-21 支付宝(杭州)信息技术有限公司 Method, apparatus, electronic device, medium, and program for generating avatar
CN114328754A (en) * 2022-03-04 2022-04-12 中科计算技术创新研究院 Blind box management method, blind box management node and digital blind box system
CN114820188A (en) * 2022-04-18 2022-07-29 网易(杭州)网络有限公司 Virtual asset transaction method and device, electronic equipment and readable storage medium

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2022132718A1 (en) * 2020-12-14 2022-06-23 Ontologix, Llc Technologies for trust protocol with immutable chain storage and invocation tracking

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113807917A (en) * 2021-09-13 2021-12-17 广州酷狗计算机科技有限公司 Virtual blind box circulation and order placing control method and device, equipment, medium and product
CN113822974A (en) * 2021-11-24 2021-12-21 支付宝(杭州)信息技术有限公司 Method, apparatus, electronic device, medium, and program for generating avatar
CN114328754A (en) * 2022-03-04 2022-04-12 中科计算技术创新研究院 Blind box management method, blind box management node and digital blind box system
CN114820188A (en) * 2022-04-18 2022-07-29 网易(杭州)网络有限公司 Virtual asset transaction method and device, electronic equipment and readable storage medium

Also Published As

Publication number Publication date
CN116488822A (en) 2023-07-25

Similar Documents

Publication Publication Date Title
CN108898389B (en) Content verification method and device based on block chain and electronic equipment
CN108667632B (en) Credit record sharing method and device based on block chain and electronic equipment
CN108492180B (en) Asset management method and device and electronic equipment
WO2020063185A1 (en) Blockchain-based anti-counterfeiting method and apparatus, and electronic device
EP3247070B1 (en) Cryptocurrency-based event participation verification
CN114730422A (en) System and method for commerce in a distributed system with blockchain protocol and intelligent contracts
JPWO2018158936A1 (en) Blockchain management device, blockchain management method and program
CN108737106A (en) User authentication method, device, terminal device and storage medium on block catenary system
KR20210009791A (en) Electronic authentication apparatus using block chain and a method thereof
CN104038924A (en) Method and system for achieving resource exchange information processing
CN111985007A (en) Contract signing and executing method and device based on block chain
JP2013118650A (en) Communication terminal device, communication device, electronic card and method for providing certificate, for providing verification
CN111460400A (en) Data processing method and device and computer readable storage medium
CN113988857A (en) NFT transaction method, transaction system, computer-readable storage medium and terminal device
KR102333811B1 (en) System and method for processing card payment based on block-chain
CN112769548B (en) Block chain numerical information transmission method, system, device and computer medium
CN114742654A (en) Digital asset circulation method, system, electronic device and medium based on alliance chain
CN116488822B (en) Identification method and system for digital blind box subscription legal user
CN110070365B (en) Commodity evidence storing method and device based on block chain and electronic equipment
CN116346349B (en) Digital blind box management method and system based on block chain and NFT
CN115545683A (en) Block chain-based electronic ticket processing method and device
CN113904774A (en) Block chain address authentication method and device and computer equipment
CN113055178B (en) Block chain system, and method, system, device and medium for transmitting numerical information
WO2020252753A1 (en) Blockchain node device, authentication method and device thereof, and storage medium
WO2019107000A1 (en) Information processing device, information processing system, information processing method and program

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
GR01 Patent grant
GR01 Patent grant