CN109672693B - Lottery ticket prize exchanging method and device based on block chain - Google Patents

Lottery ticket prize exchanging method and device based on block chain Download PDF

Info

Publication number
CN109672693B
CN109672693B CN201910106736.XA CN201910106736A CN109672693B CN 109672693 B CN109672693 B CN 109672693B CN 201910106736 A CN201910106736 A CN 201910106736A CN 109672693 B CN109672693 B CN 109672693B
Authority
CN
China
Prior art keywords
lottery
ciphertext
purchaser
block chain
public
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
CN201910106736.XA
Other languages
Chinese (zh)
Other versions
CN109672693A (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.)
JIANGSU PAY EGIS TECHNOLOGY Co.,Ltd.
Jiangsu tongfudun blockchain Technology Co., Ltd
Original Assignee
Jiangsu Pay Egis Technology Co ltd
Jiangsu Tongfudun Blockchain 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 Jiangsu Pay Egis Technology Co ltd, Jiangsu Tongfudun Blockchain Technology Co Ltd filed Critical Jiangsu Pay Egis Technology Co ltd
Priority to CN201910106736.XA priority Critical patent/CN109672693B/en
Publication of CN109672693A publication Critical patent/CN109672693A/en
Application granted granted Critical
Publication of CN109672693B publication Critical patent/CN109672693B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/04Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks
    • H04L63/0428Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks wherein the data content is protected, e.g. by encrypting or encapsulating the payload
    • H04L63/0442Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks wherein the data content is protected, e.g. by encrypting or encapsulating the payload wherein the sending and receiving network entities apply asymmetric encryption, i.e. different keys for encryption and decryption
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q30/00Commerce
    • G06Q30/02Marketing; Price estimation or determination; Fundraising
    • G06Q30/0207Discounts or incentives, e.g. coupons or rebates
    • G06Q30/0208Trade or exchange of goods or services in exchange for incentives or rewards
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q30/00Commerce
    • G06Q30/02Marketing; Price estimation or determination; Fundraising
    • G06Q30/0207Discounts or incentives, e.g. coupons or rebates
    • G06Q30/0225Avoiding frauds
    • GPHYSICS
    • G07CHECKING-DEVICES
    • G07CTIME OR ATTENDANCE REGISTERS; REGISTERING OR INDICATING THE WORKING OF MACHINES; GENERATING RANDOM NUMBERS; VOTING OR LOTTERY APPARATUS; ARRANGEMENTS, SYSTEMS OR APPARATUS FOR CHECKING NOT PROVIDED FOR ELSEWHERE
    • G07C15/00Generating random numbers; Lottery apparatus
    • G07C15/006Generating random numbers; Lottery apparatus electronically

Landscapes

  • Engineering & Computer Science (AREA)
  • Business, Economics & Management (AREA)
  • Accounting & Taxation (AREA)
  • Finance (AREA)
  • Strategic Management (AREA)
  • Development Economics (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Marketing (AREA)
  • Entrepreneurship & Innovation (AREA)
  • General Business, Economics & Management (AREA)
  • Economics (AREA)
  • Game Theory and Decision Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Hardware Design (AREA)
  • Computing Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The invention discloses a lottery ticket prize exchanging method and device based on a block chain. The method comprises the following steps: acquiring a lottery purchase request carrying a first lottery ciphertext; calling a preset intelligent contract to store the first lottery ciphertext into the block chain according to the lottery purchase request; and acquiring a public key provided by a lottery purchaser after lottery drawing, and performing winning verification by using the public key, the lottery drawing plaintext and the first lottery ciphertext. The lottery center acquires the first lottery ciphertext and does not know the lottery plaintext specifically purchased by a lottery purchaser, so that the lottery plaintext cannot be counted in a big data mode, and the fairness of cashing is ensured; the block chain is used for storing the first lottery ciphertext, so that data cannot be tampered, and authenticity and safety of the data are guaranteed; the lottery purchaser only provides the public key to the lottery center without providing the private key, so that the public and private keys do not need to be generated each time, and the defect of verification failure caused by confusion of the public and private keys is avoided.

Description

Lottery ticket prize exchanging method and device based on block chain
Technical Field
The invention relates to the technical field of lottery tickets, in particular to a lottery ticket cashing method and a lottery ticket cashing device based on a block chain.
Background
The conventional lottery industry has problems such as inconvenience in purchasing lottery tickets, opaqueness in lottery counting (there may be a case where a specific ticket number is generated according to a statistical result), and the like, and has a problem that data is inevitably tampered by insiders or hackers.
The block chain has the characteristics of openness, tamper resistance and the like, and along with the vigorous development of the block chain technology, the characteristics and the encryption algorithm of the block chain can be well applied to the lottery industry, so that the fairness and the fairness of the lottery are realized, the purchase simplicity is realized, and a large amount of manpower and material resources are saved.
Chinese patent application publication No. CN 106504174 a provides a lottery issuing system and device based on block chain, in this scheme, lottery information is stored in public form on the block chain, anyone can check the lottery information purchased by all persons, and these information can be inquired and utilized, thereby affecting the fairness of the prize exchange, and the lottery purchaser can not prove that it is the winner of the prize, resulting in the prize exchange being a loss of fairness.
Disclosure of Invention
In view of the above, the present invention has been made to provide a block chain based lottery ticket redemption method and apparatus that overcomes or at least partially solves the above problems.
According to one aspect of the present invention, there is provided a block chain-based lottery redemption method, each lottery purchaser having a pair of public and private keys, the method comprising:
acquiring a lottery purchase request carrying a first lottery ciphertext, wherein the first lottery ciphertext is obtained by encrypting a purchased lottery plaintext by a lottery purchaser by using a public key in a public and private key;
calling a preset intelligent contract to store the first lottery ciphertext into the block chain according to the lottery purchase request;
and acquiring a public key provided by a lottery purchaser after lottery drawing, and performing winning verification by using the public key, the lottery drawing plaintext and the first lottery ciphertext.
According to another aspect of the present invention, there is provided a block chain-based lottery redemption apparatus, each lottery purchaser having a pair of public and private keys, the apparatus comprising:
the acquisition module is suitable for acquiring a lottery purchase request carrying a first lottery ciphertext, wherein the first lottery ciphertext is obtained by encrypting a purchased lottery plaintext by a lottery purchaser by using a public key in a public and private key;
the processing module is suitable for calling a preset intelligent contract to store the first lottery ciphertext into the block chain according to the lottery purchasing request;
and the winning verification module is suitable for acquiring a public key provided by a lottery purchaser after lottery drawing, and performing winning verification by using the public key, the lottery drawing plaintext and the first lottery ciphertext.
According to yet another aspect of the present invention, there is provided a computing device comprising: the processor, the memory and the communication interface complete mutual communication through the communication bus;
the memory is used for storing at least one executable instruction, and the executable instruction enables the processor to execute the operation corresponding to the lottery ticket rewarding method based on the block chain.
According to yet another aspect of the present invention, a computer storage medium is provided, wherein at least one executable instruction is stored in the storage medium, and the executable instruction causes a processor to execute operations corresponding to the block chain based lottery ticket rewarding method as described above.
According to still another aspect of the present invention, there is provided a block chain-based lottery redemption method, each lottery purchaser generating a pair of public and private keys, the method including:
encrypting a lottery plaintext purchased by a lottery purchaser by using a public key in the public and private keys to obtain a first lottery ciphertext;
sending a lottery purchasing request carrying a first lottery ciphertext to a lottery center, so that the lottery center calls a preset intelligent contract to store the first lottery ciphertext into a block chain according to the lottery purchasing request;
after determining the lottery winning, the public key is provided to the lottery center, so that the lottery center can check the winning by using the public key, the lottery drawing plaintext and the first lottery ciphertext.
According to still another aspect of the present invention, there is provided a block chain-based lottery redemption apparatus, each lottery purchaser generating a pair of public and private keys, the apparatus comprising:
the encryption module is suitable for encrypting a lottery plaintext purchased by a lottery purchaser by using a public key in the public and private keys to obtain a first lottery ciphertext;
the transmitting module is suitable for transmitting a lottery purchasing request carrying the first lottery ciphertext to the lottery center, so that the lottery center calls a preset intelligent contract to store the first lottery ciphertext into the block chain according to the lottery purchasing request;
and the providing module is suitable for providing the public key to the lottery center after determining that the lottery wins, so that the lottery center can check the winning by utilizing the public key, the lottery drawing plaintext and the first lottery ciphertext.
According to yet another aspect of the present invention, there is provided a computing device comprising: the processor, the memory and the communication interface complete mutual communication through the communication bus;
the memory is used for storing at least one executable instruction, and the executable instruction enables the processor to execute the operation corresponding to the lottery ticket rewarding method based on the block chain.
According to yet another aspect of the present invention, a computer storage medium is provided, wherein at least one executable instruction is stored in the storage medium, and the executable instruction causes a processor to execute operations corresponding to the block chain based lottery ticket rewarding method as described above.
According to the scheme provided by the invention, the lottery center acquires the first lottery ciphertext and does not know the lottery plaintext specifically purchased by a lottery purchaser, and the lottery plaintext cannot be counted in a big data mode, so that the fairness of cashing is ensured; because the lottery purchaser can prove that the lottery purchaser wins the lottery without providing a private key to the lottery center, the public and private keys are not required to be generated every time, the lottery plaintext purchased by one lottery purchaser at any time is bound with the pair of public and private keys of the lottery purchaser, the lottery purchaser is not required to keep a plurality of sets of public and private keys, the defect that the verification fails due to confusion of the public and private keys is avoided, and finally, the lottery purchaser does not need to participate in justice through multiple parties of a public party and a distributor, and a large amount of manpower and material resources are saved.
The foregoing description is only an overview of the technical solutions of the present invention, and the embodiments of the present invention are described below in order to make the technical means of the present invention more clearly understood and to make the above and other objects, features, and advantages of the present invention more clearly understandable.
Drawings
Various other advantages and benefits will become apparent to those of ordinary skill in the art upon reading the following detailed description of the preferred embodiments. The drawings are only for purposes of illustrating the preferred embodiments and are not to be construed as limiting the invention. Also, like reference numerals are used to refer to like parts throughout the drawings. In the drawings:
fig. 1 illustrates a flow diagram of a block chain based lottery redemption method according to one embodiment of the present invention;
fig. 2 is a flow diagram illustrating a block chain based lottery redemption method according to one embodiment of the present invention;
fig. 3 illustrates a flow diagram of a block chain based lottery redemption method according to one embodiment of the present invention;
fig. 4 illustrates a block chain based lottery redemption device in accordance with one embodiment of the present invention;
fig. 5 illustrates a block chain based lottery redemption device in accordance with one embodiment of the present invention;
FIG. 6 shows a schematic structural diagram of a computing device according to one embodiment of the invention.
Detailed Description
Exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be embodied in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
Fig. 1 is a flow chart illustrating a block chain-based lottery redemption method according to one embodiment of the present invention. As shown in fig. 1, the method comprises the steps of:
step S100, the lottery purchaser encrypts the purchased lottery plaintext by using the public key in the public and private keys to obtain a first lottery ciphertext.
In the embodiment, each lottery purchaser generates a pair of public and private keys, and the lottery purchaser uses the public and private keys to purchase lottery at any time without repeatedly generating the public and private keys.
The lottery plaintext is the unencrypted lottery number or lottery character, and the like, the specific content and the specific meaning can be known visually, and the lottery purchaser can see the lottery plaintext when purchasing the lottery.
Taking the plaintext of the lottery ticket as an example of the lottery ticket number, the lottery ticket purchaser a can randomly pick out 6 combinations of numbers from 1 to 10 to arrange, so as to generate the plaintext of the lottery ticket, for example, the plaintext of the lottery ticket purchased by the lottery ticket purchaser is 1, 7, 6, 3, 5, 2, and then the lottery ticket purchaser a uses the public key in the public and private keys thereof to match the plaintext of the purchased lottery ticket with: 1. 7, 6, 3, 5 and 2 are encrypted to obtain a first lottery ciphertext, wherein the first lottery ciphertext is a character which cannot be directly understood.
The clear text of the lottery purchased by the lottery purchaser is encrypted by using the public key in the public and private keys, so that the clear text of the lottery purchased by the lottery purchaser is invisible, and other people except the lottery purchaser cannot know the clear text of the lottery according to the corresponding cipher text of the lottery, thereby ensuring the fairness of lottery cashing of the lottery center.
Step S101, the lottery purchaser sends a lottery purchase request carrying the first lottery ciphertext to the lottery center.
The lottery ticket purchaser purchases lottery tickets through the lottery ticket purchasing system, and simultaneously sends a lottery ticket purchasing request carrying the first lottery ticket cryptograph to the lottery ticket center.
Step S102, the lottery center obtains a lottery purchase request carrying the first lottery ciphertext.
And step S103, the lottery center calls a preset intelligent contract to store the first lottery ciphertext into the block chain according to the lottery purchase request.
The lottery buyer can check the condition of chaining of the lottery ciphertext by using a transaction Hash through tools such as a block chain browser and the like to confirm whether the lottery is successfully purchased. In practical application, block packing is operated by a block chain, the lottery center calls a preset intelligent contract to store a first lottery ciphertext into the block chain, the block chain performs block packing processing on the first lottery ciphertext according to block packing requirements, and stores a packed block, and at this moment, the first lottery ciphertext is stored to be effective.
The preset intelligent contract is an intelligent contract pre-created by the lottery center, and only the lottery center has the calling authority. Therefore, when the lottery is exchanged, the safety of the lottery can be improved by verifying the calling party storing the first lottery ciphertext, if the calling party storing the first lottery ciphertext is determined to be not the lottery center through verification, the fact that the preset intelligent contract is called to store the first lottery ciphertext is determined not to be done by the lottery center at this time, the stored first lottery ciphertext is invalid, and therefore the situation that a hacker attacks the preset intelligent contract is avoided, and some first lottery ciphertexts which are not determined to be winning prizes are stored in a block chain to influence the lottery exchange is avoided.
In the embodiment, the first lottery ciphertext is stored in the block chain, and the lottery center does not know what the lottery plaintext bet by the lottery purchaser is, so that the lottery plaintext cannot be counted in a big data manner, thereby ensuring the fairness of the prize exchanging result.
Step S104, the lottery purchaser provides the public key to the lottery center after determining the lottery winning.
The lottery center plays the lottery according to the lottery specification, the lottery plaintext of the lottery of the current winning is determined by adopting a traditional lottery playing mode during the lottery playing, the lottery plaintext is disclosed, each lottery purchaser can determine whether the lottery purchaser wins the lottery by looking at the disclosed lottery plaintext, and if the lottery purchaser determines that the lottery purchaser wins the lottery, the lottery center can be provided with the public key of the lottery purchaser after the lottery is determined to be winning the lottery.
Step S105, the lottery center obtains the public key provided by the lottery purchaser after the lottery is drawn, and conducts winning verification by using the public key, the drawing lottery plaintext and the first lottery ciphertext.
The lottery center obtains a public key provided by a lottery purchaser after lottery drawing, and then verifies whether the lottery purchaser wins the prize by using the public key provided by the lottery purchaser, the lottery drawing plaintext and the first lottery ciphertext to carry out winning verification.
In this embodiment, the lottery center may specifically adopt the following method to verify whether the lottery purchaser wins:
encrypting a lottery plaintext by using the public key to obtain a second lottery ciphertext; judging whether a first lottery ciphertext matched with the second lottery ciphertext is stored in the block chain; if the block chain does not store the first lottery ciphertext matched with the second lottery ciphertext, determining that the winning verification fails; if the block chain stores a first lottery ciphertext matched with a second lottery ciphertext, encrypting the first random data by using a public key, and returning an encryption result to a lottery purchaser so that the lottery purchaser can decrypt the encryption result by using a private key in a public and private key; acquiring second random data returned after the lottery purchaser decrypts the encrypted result by using a private key in the public and private keys; and judging whether the first random data is the same as the second random data or not, and if so, determining that the winning verification is passed.
Specifically, the lottery center encrypts the lottery drawing plaintext by using the public key provided by the lottery purchaser to obtain a second lottery ciphertext, and then the lottery center needs to verify whether the second lottery ciphertext is stored in the block chain, for example, whether a first lottery ciphertext matched with the second lottery ciphertext is stored in the block chain is judged, if the first lottery ciphertext matched with the second lottery ciphertext is not stored in the block chain, the winning verification fails, so that the lottery purchaser can be determined not to win, the lottery purchaser has a prize cheating behavior, and a certain penalty can be given to the lottery purchaser;
if the block chain stores a first lottery ciphertext matched with a second lottery ciphertext, continuing to execute the next step, encrypting first random data (wherein the first random data can be generated by using a random number generation algorithm, and the first random data is only known by a lottery center and is not disclosed to the public) by using a public key provided by a lottery purchaser, returning an encryption result to the lottery purchaser, decrypting the encryption result by using a private key in a public and private key after receiving the encryption result returned by the lottery purchaser to obtain second random data, sending the second random data obtained by decryption to the lottery purchaser by using the private key in the public and private key, and obtaining the second random data returned after the encryption result is decrypted by the lottery purchaser by using the private key in the public and private key by the lottery purchaser; judging whether the first random data is the same as the second random data, if the first random data is the same as the second random data, determining that the lottery buyer passes a winning verification, thereby determining that the lottery buyer wins the prize and giving the corresponding prize to the lottery buyer; if the first random data is not the same as the second random data, it is determined that the winning check is failed, and thus it can be determined that the lottery purchaser has no prize, and the lottery purchaser has a fraud and can be given a certain penalty.
The following description is made with reference to an example, where the public key of the lottery purchaser a is P, the lottery purchaser a sends the public key P to the lottery center, the plaintext of the lottery drawing at this time is 1, 7, 6, 3, 5, 2, and the lottery center uses the public key P to match the plaintext of the lottery drawing: 1. 7, 6, 3, 5 and 2, encrypting to obtain a second lottery ciphertext C, verifying whether the second lottery ciphertext C is stored in a block chain by the lottery center, specifically, inquiring the block chain according to the second lottery ciphertext C to determine whether a first lottery ciphertext matched with the second lottery ciphertext C is stored in the block chain, if not, determining that winning verification fails, if so, executing the next step, encrypting the first random data Rand (secret unpublished) by the lottery center by using a public key P to obtain an encryption result Cnew, returning the encryption result Cnew to a lottery purchaser, decrypting the Cnew by using a private key of the lottery purchaser to obtain second random data randNew, sending the second random data randNew to the lottery center, comparing whether the Rand and the randNew by the lottery center is consistent, and if so, determining that winning is passed; if not, the winning verification is determined to fail.
According to the method for verifying whether the lottery purchaser wins the lottery or not, the lottery purchaser can prove that the lottery purchaser wins the lottery without providing the lottery purchaser with the private key of the lottery center, so that the public and private keys are not required to be generated each time, the lottery plaintext purchased by one lottery purchaser at any time is bound with the pair of public and private keys of the lottery purchaser, the lottery purchaser is not required to keep a plurality of sets of public and private keys, and the defect of confusion of the public and private keys is avoided.
In an optional implementation mode of the invention, the situation that a plurality of groups of lottery drawing plaintext exist is possible, when the situation occurs, the public key provided by a lottery purchaser is used for respectively encrypting the plurality of groups of lottery drawing plaintext to obtain a plurality of groups of second lottery ciphertext, and the first lottery ciphertext is respectively matched with the plurality of groups of second lottery ciphertext; if the first lottery ciphertext is matched with any one group of second lottery ciphertexts in the plurality of groups of second lottery ciphertexts, the first lottery ciphertext is confirmed to pass the winning verification, so that the lottery purchaser can be confirmed to win, and a corresponding prize can be given to the lottery purchaser; if the first lottery ciphertext is not matched with the plurality of groups of second lottery ciphertexts, the winning verification is determined to fail, so that the lottery purchaser can be determined not to win, the lottery purchaser has a prize cheating behavior, and the lottery purchaser can be given a certain penalty.
In addition, if the lottery purchaser determines the winning group, the winning group can be provided to the lottery center, and the lottery center can determine the corresponding lottery drawing plaintext according to the winning group to carry out winning verification, thereby improving the verification efficiency.
In an optional implementation manner of the present invention, after invoking the preset intelligent contract to store the first lottery ciphertext into the blockchain, the method further includes: and determining the blocks of the lottery drawing in the block chain, and marking the blocks with drawing marks.
In this embodiment, the first lottery ciphertext is stored in the block chain, and the lottery center needs to determine the blocks of the block chain for the current lottery drawing in each drawing, for example, a drawing result is generated every 100 blocks, the number of the blocks may be set at will, which is only an example, where the current lottery generates the drawing result in blocks 12000 and 12100, and after determining the blocks of the current lottery drawing, the blocks are marked for drawing a prize, so as to avoid repeated drawing.
According to the method provided by the embodiment of the invention, a lottery purchaser encrypts a purchased lottery plaintext by using a public key of the lottery purchaser and provides a first lottery ciphertext for a lottery center, the lottery center stores the first lottery ciphertext into a block chain by calling a preset intelligent contract, and the lottery purchaser provides the first lottery ciphertext for the lottery center, so that the lottery center cannot acquire the lottery plaintext purchased by the lottery purchaser, and cannot count the lottery plaintext in a big data manner, thereby ensuring the fairness of prize exchange; because the lottery purchaser can prove that the lottery purchaser wins the prize without providing a private key to the lottery center, the public and private keys are not required to be generated every time, the clear text of the lottery purchased by one lottery purchaser at any time is bound with the pair of public and private keys of the lottery purchaser, the lottery purchaser is not required to store a plurality of sets of public and private keys, the defect of failure verification caused by confusion of the public and private keys is avoided, the public key is used as the identity certificate of the lottery purchaser, the fairness of prize exchange is ensured, and finally, the lottery purchaser does not need to participate in the fairness by a plurality of parties through the public and the square parties and the issuing party, and a large amount.
Fig. 2 is a flow chart illustrating a block chain-based lottery redemption method according to one embodiment of the present invention. Wherein each lottery purchaser possesses a pair of public and private keys, as shown in fig. 2, the method comprises the steps of:
step S200, a lottery purchase request carrying the first lottery ciphertext is obtained.
The first lottery ciphertext is obtained by encrypting a purchased lottery plaintext by a lottery purchaser by using a public key in a public and private key.
Step S201, according to the lottery purchasing request, a preset intelligent contract is called to store the first lottery ciphertext into the block chain.
Step S202, a public key provided by a lottery purchaser after lottery drawing is obtained, and the public key, the lottery drawing plaintext and the first lottery ciphertext are utilized to carry out winning verification.
Optionally, the performing of the winning verification by using the public key, the lottery drawing plaintext and the first lottery ciphertext further comprises:
encrypting a lottery plaintext by using the public key to obtain a second lottery ciphertext;
judging whether a first lottery ciphertext matched with the second lottery ciphertext is stored in the block chain;
if so, encrypting the first random data by using the public key, and returning an encryption result to the lottery purchaser so that the lottery purchaser can decrypt the encryption result by using a private key in the public and private keys;
acquiring second random data returned after the lottery purchaser decrypts the encrypted result by using a private key in the public and private keys;
and judging whether the first random data is the same as the second random data or not, and if so, determining that the winning verification is passed.
Optionally, the method further comprises: and if the block chain does not store the first lottery ciphertext matched with the second lottery ciphertext, determining that the winning verification fails.
Optionally, after the preset intelligent contract is invoked to store the first lottery ciphertext into the blockchain, the method further includes:
and determining the blocks of the lottery drawing in the block chain, and marking the blocks with drawing marks.
According to the method provided by the embodiment of the invention, the lottery center acquires the first lottery ciphertext and does not know the lottery plaintext specifically purchased by a lottery purchaser, and the lottery plaintext cannot be counted in a big data manner, so that the fairness of cashing is ensured; because the lottery purchaser can prove that the lottery purchaser wins the prize without providing a private key to the lottery center, the public and private keys are not required to be generated every time, the clear text of the lottery purchased by one lottery purchaser at any time is bound with the pair of public and private keys of the lottery purchaser, the lottery purchaser is not required to store a plurality of sets of public and private keys, the defect of failure verification caused by confusion of the public and private keys is avoided, the public key is used as the identity certificate of the lottery purchaser, the fairness of prize exchange is ensured, and finally, the lottery purchaser does not need to participate in the fairness by a plurality of parties through the public and the square parties and the issuing party, and a large amount.
Fig. 3 is a flow chart illustrating a block chain-based lottery redemption method according to one embodiment of the present invention. Wherein each lottery purchaser generates a pair of public and private keys, as shown in fig. 3, the method comprises the steps of:
step S300, encrypting the lottery plaintext purchased by the lottery purchaser by using the public key in the public and private keys to obtain a first lottery ciphertext.
Step S301, a lottery purchase request carrying the first lottery ciphertext is sent to the lottery center, so that the lottery center calls a preset intelligent contract to store the first lottery ciphertext into the block chain according to the lottery purchase request.
Step S302, after determining the lottery winning, providing the public key to the lottery center for the lottery center to check the winning by using the public key, the lottery drawing plaintext and the first lottery ciphertext.
According to the method provided by the embodiment of the invention, the lottery purchaser encrypts the purchased lottery plaintext by using the public key and provides the first lottery ciphertext to the lottery center, so that the lottery center can not acquire the lottery plaintext purchased by the lottery purchaser, and the lottery plaintext can not be counted in a big data mode, thereby ensuring the fairness of cashing The multiple parties of the publisher participate in justice, and a large amount of manpower and material resources are saved.
Fig. 4 shows a block chain-based lottery redemption apparatus according to one embodiment of the present invention. Wherein each lottery purchaser possesses a pair of public and private keys, as shown in fig. 4, the apparatus comprises: an acquisition module 400, a processing module 410, and a winning verification module 420.
The acquisition module 400 is adapted to acquire a lottery purchase request carrying a first lottery ciphertext, wherein the first lottery ciphertext is obtained by encrypting a purchased lottery plaintext by a lottery purchaser using a public key in a public and private key;
the processing module 410 is adapted to call a preset intelligent contract to store the first lottery ciphertext into the block chain according to the lottery purchase request;
the winning verification module 420 is adapted to obtain the public key provided by the lottery purchaser after the lottery is drawn, and perform winning verification by using the public key, the lottery drawing plaintext and the first lottery ciphertext.
Optionally, the winning validation module is further adapted to: encrypting a lottery plaintext by using the public key to obtain a second lottery ciphertext;
judging whether a first lottery ciphertext matched with the second lottery ciphertext is stored in the block chain;
if so, encrypting the first random data by using the public key, and returning an encryption result to the lottery purchaser so that the lottery purchaser can decrypt the encryption result by using a private key in the public and private keys;
acquiring second random data returned after the lottery purchaser decrypts the encrypted result by using a private key in the public and private keys;
and judging whether the first random data is the same as the second random data or not, and if so, determining that the winning verification is passed.
Optionally, the winning validation module is further adapted to: and if the block chain does not store the first lottery ciphertext matched with the second lottery ciphertext, determining that the winning verification fails.
Optionally, the apparatus further comprises: the determining module is suitable for determining the blocks of the lottery drawing in the block chain;
and the lottery drawing marking module is suitable for drawing the lottery drawing marks on the blocks.
According to the device provided by the embodiment of the invention, the lottery center acquires the first lottery ciphertext and does not know the lottery plaintext specifically purchased by a lottery purchaser, and the lottery plaintext cannot be counted in a big data manner, so that the fairness of cashing is ensured; because the lottery purchaser can prove that the lottery purchaser wins the prize without providing a private key to the lottery center, the public and private keys are not required to be generated every time, the clear text of the lottery purchased by one lottery purchaser at any time is bound with the pair of public and private keys of the lottery purchaser, the lottery purchaser is not required to store a plurality of sets of public and private keys, the defect of failure verification caused by confusion of the public and private keys is avoided, the public key is used as the identity certificate of the lottery purchaser, the fairness of prize exchange is ensured, and finally, the lottery purchaser does not need to participate in the fairness by a plurality of parties through the public and the square parties and the issuing party, and a large amount.
Fig. 5 shows a block chain-based lottery redemption apparatus according to one embodiment of the present invention. Wherein each lottery purchaser generates a pair of public and private keys, as shown in fig. 5, the apparatus comprising: encryption module 500, sending module 510, providing module 520.
The encryption module 500 is adapted to encrypt a lottery plaintext purchased by a lottery purchaser by using a public key in a public and private key to obtain a first lottery ciphertext;
the sending module 510 is adapted to send a lottery purchase request carrying a first lottery ciphertext to the lottery center, so that the lottery center calls a preset intelligent contract to store the first lottery ciphertext into the block chain according to the lottery purchase request;
the providing module 520 is adapted to provide the public key to the lottery center after determining that the lottery wins, so that the lottery center can check the winning by using the public key, the lottery drawing plaintext and the first lottery ciphertext.
According to the device provided by the embodiment of the invention, the lottery purchaser encrypts the purchased lottery plaintext by using the public key and provides the first lottery ciphertext to the lottery center, so that the lottery center can not acquire the lottery plaintext purchased by the lottery purchaser, and the lottery plaintext can not be counted in a big data mode, thereby ensuring the fairness of cashing The multiple parties of the publisher participate in justice, and a large amount of manpower and material resources are saved.
The embodiment of the application also provides a nonvolatile computer storage medium, and the computer storage medium stores at least one executable instruction, and the computer executable instruction can execute the lottery ticket cashing method based on the block chain in any method embodiment.
Fig. 6 is a schematic structural diagram of a computing device according to an embodiment of the present invention, and the specific embodiment of the present invention does not limit the specific implementation of the computing device.
As shown in fig. 6, the computing device may include: a processor (processor)602, a communication Interface 604, a memory 606, and a communication bus 608.
Wherein:
the processor 602, communication interface 604, and memory 606 communicate with one another via a communication bus 608.
A communication interface 604 for communicating with network elements of other devices, such as clients or other servers.
The processor 602 is configured to execute the program 610, and may specifically execute the relevant steps in the above embodiment of the block chain-based lottery redemption method.
In particular, program 610 may include program code comprising computer operating instructions.
The processor 602 may be a central processing unit CPU or an application Specific Integrated circuit asic or one or more Integrated circuits configured to implement embodiments of the present invention. The computing device includes one or more processors, which may be the same type of processor, such as one or more CPUs; or may be different types of processors such as one or more CPUs and one or more ASICs.
And a memory 606 for storing a program 610. Memory 606 may comprise high-speed RAM memory, and may also include non-volatile memory (non-volatile memory), such as at least one disk memory.
The program 610 may be specifically configured to cause the processor 602 to execute a block chain based lottery redemption method in any of the method embodiments described above. For specific implementation of each step in the program 610, reference may be made to corresponding steps and corresponding descriptions in units in the above block chain-based lottery ticket redemption embodiment, which are not described herein again. It can be clearly understood by those skilled in the art that, for convenience and brevity of description, the specific working processes of the above-described devices and modules may refer to the corresponding process descriptions in the foregoing method embodiments, and are not described herein again.
The algorithms and displays presented herein are not inherently related to any particular computer, virtual machine, or other apparatus. Various general purpose systems may also be used with the teachings herein. The required structure for constructing such a system will be apparent from the description above. Moreover, the present invention is not directed to any particular programming language. It is appreciated that a variety of programming languages may be used to implement the teachings of the present invention as described herein, and any descriptions of specific languages are provided above to disclose the best mode of the invention.
In the description provided herein, numerous specific details are set forth. It is understood, however, that embodiments of the invention may be practiced without these specific details. In some instances, well-known methods, structures and techniques have not been shown in detail in order not to obscure an understanding of this description.
Similarly, it should be appreciated that in the foregoing description of exemplary embodiments of the invention, various features of the invention are sometimes grouped together in a single embodiment, figure, or description thereof for the purpose of streamlining the disclosure and aiding in the understanding of one or more of the various inventive aspects. However, the disclosed method should not be interpreted as reflecting an intention that: that the invention as claimed requires more features than are expressly recited in each claim. Rather, as the following claims reflect, inventive aspects lie in less than all features of a single foregoing disclosed embodiment. Thus, the claims following the detailed description are hereby expressly incorporated into this detailed description, with each claim standing on its own as a separate embodiment of this invention.
Those skilled in the art will appreciate that the modules in the device in an embodiment may be adaptively changed and disposed in one or more devices different from the embodiment. The modules or units or components of the embodiments may be combined into one module or unit or component, and furthermore they may be divided into a plurality of sub-modules or sub-units or sub-components. All of the features disclosed in this specification (including any accompanying claims, abstract and drawings), and all of the processes or elements of any method or apparatus so disclosed, may be combined in any combination, except combinations where at least some of such features and/or processes or elements are mutually exclusive. Each feature disclosed in this specification (including any accompanying claims, abstract and drawings) may be replaced by alternative features serving the same, equivalent or similar purpose, unless expressly stated otherwise.
Furthermore, those skilled in the art will appreciate that while some embodiments described herein include some features included in other embodiments, rather than other features, combinations of features of different embodiments are meant to be within the scope of the invention and form different embodiments. For example, in the following claims, any of the claimed embodiments may be used in any combination.
The various component embodiments of the invention may be implemented in hardware, or in software modules running on one or more processors, or in a combination thereof. Those skilled in the art will appreciate that a microprocessor or Digital Signal Processor (DSP) may be used in practice to implement some or all of the functions of some or all of the components of a block chain based lottery redemption apparatus in accordance with embodiments of the present invention. The present invention may also be embodied as apparatus or device programs (e.g., computer programs and computer program products) for performing a portion or all of the methods described herein. Such programs implementing the present invention may be stored on computer-readable media or may be in the form of one or more signals. Such a signal may be downloaded from an internet website or provided on a carrier signal or in any other form.
It should be noted that the above-mentioned embodiments illustrate rather than limit the invention, and that those skilled in the art will be able to design alternative embodiments without departing from the scope of the appended claims. In the claims, any reference signs placed between parentheses shall not be construed as limiting the claim. The word "comprising" does not exclude the presence of elements or steps not listed in a claim. The word "a" or "an" preceding an element does not exclude the presence of a plurality of such elements. The invention may be implemented by means of hardware comprising several distinct elements, and by means of a suitably programmed computer. In the unit claims enumerating several means, several of these means may be embodied by one and the same item of hardware. The usage of the words first, second and third, etcetera do not indicate any ordering. These words may be interpreted as names.

Claims (8)

1. A block chain based lottery redemption method, wherein each lottery purchaser has a pair of public and private keys, the method comprising:
acquiring a lottery purchase request carrying a first lottery ciphertext, wherein the first lottery ciphertext is obtained by encrypting a purchased lottery plaintext by a lottery purchaser by using a public key in a public and private key;
calling a preset intelligent contract to store the first lottery ciphertext into a block chain according to the lottery purchasing request;
obtaining a public key provided by a lottery purchaser after lottery drawing, and performing winning verification by using the public key, a lottery drawing plaintext and a first lottery ciphertext;
wherein, the utilizing the public key, the lottery drawing plaintext and the first lottery ciphertext to carry out winning verification further comprises:
encrypting a lottery ticket plaintext by using the public key to obtain a second lottery ticket ciphertext;
judging whether a first lottery ciphertext matched with the second lottery ciphertext is stored in the block chain;
if so, encrypting the first random data by using the public key, and returning an encryption result to the lottery purchaser so that the lottery purchaser can decrypt the encryption result by using a private key in the public and private keys;
acquiring second random data returned after the lottery purchaser decrypts the encrypted result by using a private key in the public and private keys;
and judging whether the first random data is the same as the second random data or not, and if so, determining that the first random data passes the winning verification.
2. The method of claim 1, further comprising:
and if the block chain does not store the first lottery ciphertext matched with the second lottery ciphertext, determining that the winning verification fails.
3. The method of claim 1 or 2, wherein after invoking a preset intelligent contract to store the first lottery ticket cryptogram in a blockchain, the method further comprises:
and determining the blocks of the lottery drawing in the block chain, and marking the blocks with drawing marks.
4. A block chain based lottery redemption apparatus wherein each lottery purchaser has a pair of public and private keys, the apparatus comprising:
the acquisition module is suitable for acquiring a lottery purchase request carrying a first lottery ciphertext, wherein the first lottery ciphertext is obtained by encrypting a purchased lottery plaintext by a lottery purchaser by using a public key in a public and private key;
the processing module is suitable for calling a preset intelligent contract to store the first lottery ciphertext into a block chain according to the lottery purchasing request;
the prize winning verification module is suitable for acquiring a public key provided by a lottery purchaser after lottery drawing, and performing prize winning verification by using the public key, the lottery drawing plaintext and the first lottery ciphertext;
wherein the winning validation module is further adapted to: encrypting a lottery ticket plaintext by using the public key to obtain a second lottery ticket ciphertext;
judging whether a first lottery ciphertext matched with the second lottery ciphertext is stored in the block chain;
if so, encrypting the first random data by using the public key, and returning an encryption result to the lottery purchaser so that the lottery purchaser can decrypt the encryption result by using a private key in the public and private keys;
acquiring second random data returned after the lottery purchaser decrypts the encrypted result by using a private key in the public and private keys;
and judging whether the first random data is the same as the second random data or not, and if so, determining that the first random data passes the winning verification.
5. The apparatus of claim 4, wherein the winning validation module is further adapted to:
and if the block chain does not store the first lottery ciphertext matched with the second lottery ciphertext, determining that the winning verification fails.
6. The apparatus of claim 4 or 5, further comprising:
the determining module is suitable for determining the blocks of the lottery drawing in the block chain;
and the lottery drawing marking module is suitable for drawing the lottery drawing marks on the blocks.
7. A computing device, comprising: the system comprises a processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface complete mutual communication through the communication bus;
the memory is configured to store at least one executable instruction that causes the processor to perform operations corresponding to the block chain based lottery redemption method of any one of claims 1-3.
8. A computer storage medium having stored therein at least one executable instruction for causing a processor to perform operations corresponding to the block chain based lottery redemption method of any one of claims 1-3.
CN201910106736.XA 2019-02-02 2019-02-02 Lottery ticket prize exchanging method and device based on block chain Active CN109672693B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910106736.XA CN109672693B (en) 2019-02-02 2019-02-02 Lottery ticket prize exchanging method and device based on block chain

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910106736.XA CN109672693B (en) 2019-02-02 2019-02-02 Lottery ticket prize exchanging method and device based on block chain

Publications (2)

Publication Number Publication Date
CN109672693A CN109672693A (en) 2019-04-23
CN109672693B true CN109672693B (en) 2021-06-04

Family

ID=66151186

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910106736.XA Active CN109672693B (en) 2019-02-02 2019-02-02 Lottery ticket prize exchanging method and device based on block chain

Country Status (1)

Country Link
CN (1) CN109672693B (en)

Families Citing this family (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110245943B (en) * 2019-05-20 2021-04-23 创新先进技术有限公司 Receipt storage method and node based on judgment condition
CN110474918B (en) * 2019-08-22 2022-06-07 腾讯科技(深圳)有限公司 Resource allocation verification method and related device
CN110598462B (en) * 2019-09-29 2023-06-23 腾讯科技(深圳)有限公司 Data presentation method, device, system, electronic equipment and storage medium
CN112734455B (en) * 2019-10-29 2023-09-05 腾讯科技(深圳)有限公司 Method, device and equipment for generating prize exchanging result and readable storage medium
CN112767221B (en) * 2021-02-02 2023-12-19 深圳市易讯天空网络技术有限公司 Block chain lottery drawing method, terminal device and computer readable storage medium
CN112862477B (en) * 2021-02-07 2024-05-07 中国人民大学 Digital commodity atomic transaction method and system based on blockchain
CN113128850B (en) * 2021-04-02 2024-04-19 深圳市易讯天空网络技术有限公司 Lottery flow management method, system, terminal equipment and storage medium
CN113128849A (en) * 2021-04-02 2021-07-16 深圳市易讯天空网络技术有限公司 Lottery process management method, system, terminal device and storage medium

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103078731A (en) * 2013-01-05 2013-05-01 深圳市思乐数据技术有限公司 Lottery data encryption method and system

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102447699A (en) * 2011-11-29 2012-05-09 中福在线投资有限公司 Safe transaction method for mobile Internet lottery based on hardware information
US20170228975A1 (en) * 2014-08-06 2017-08-10 Mido Play Inc. Systems for multiple legal game providers and multiple jurisdictions that provide notifications of lottery ticket status
CN106504174A (en) * 2016-09-27 2017-03-15 布比(北京)网络技术有限公司 Lottery industry publishing system and device based on block chain
CN107169764A (en) * 2017-05-10 2017-09-15 山东大学 Fair data trade method based on block chain
CN108447014A (en) * 2018-03-19 2018-08-24 成都零光量子科技有限公司 A kind of block chain lottery industry method and system
CN108734584A (en) * 2018-05-27 2018-11-02 王刚 A kind of public welfare fund welfare lottery ticket distributing method based on block chain
CN108805664A (en) * 2018-05-28 2018-11-13 安徽磐众信息科技有限公司 A kind of responsibility lottery information published method based on block chain

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103078731A (en) * 2013-01-05 2013-05-01 深圳市思乐数据技术有限公司 Lottery data encryption method and system

Also Published As

Publication number Publication date
CN109672693A (en) 2019-04-23

Similar Documents

Publication Publication Date Title
CN109672693B (en) Lottery ticket prize exchanging method and device based on block chain
CN109347878B (en) Decentralized data verification and data security transaction system and method
JP5680115B2 (en) Transaction auditing for data security devices
US9258296B2 (en) System and method for generating a strong multi factor personalized server key from a simple user password
JP2746352B2 (en) Secure security communication system and method for communication by a remotely located computer
US20200021565A1 (en) Trusted communications between untrusting parties
CN107810617A (en) Secret certification and supply
CN1682204A (en) Certification processing hardware, certification processing system and use management hardware
CN108769057B (en) Identity recognition method and device based on block chain
CN101340294A (en) Cipher keyboard apparatus and implementing method thereof
CN104322003A (en) Cryptographic authentication and identification method using real-time encryption
JP2009272737A (en) Secret authentication system
RU2144695C1 (en) Method for claiming liability for card-related action by client and for accepting the claim by issuer
US7827596B2 (en) Authenticating computed results in a public distributed computing environment
CN107278357B (en) Cryptographic system and method
US9833710B2 (en) Method and system for providing a secure shuffle of game objects across multiple entities
JP2003198541A (en) Data verification system and device therefor
CN113949988B (en) Position protection method and system and storage medium
Kuacharoen Design and implementation of a secure online lottery system
RU2419156C2 (en) System and method to organise and draw lottery
JPH10108963A (en) Collation judgment information of game machine control substrate and enciphering communication system
JP3923229B2 (en) Authentication processing method and method
KR102118810B1 (en) Method for generating decentralized pseudo random number with cryptographic methods
CN116071071B (en) Block chain-based data element transaction method, system, storage medium and equipment
US20200351079A1 (en) Computer-implemented method of replacing a data string

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
TA01 Transfer of patent application right

Effective date of registration: 20210427

Address after: 210000 23 / F, Tower B, Tengfei building, No. 88, Jiangmiao Road, Jiangbei new district, Nanjing City, Jiangsu Province

Applicant after: Jiangsu tongfudun blockchain Technology Co., Ltd

Applicant after: JIANGSU PAY EGIS TECHNOLOGY Co.,Ltd.

Address before: Suzhou City, Jiangsu province 215021 East Road, Suzhou Industrial Park, No. 88 Suzhou 2.5 Industrial Park C2 building room 3F-301

Applicant before: JIANGSU PAY EGIS TECHNOLOGY Co.,Ltd.

TA01 Transfer of patent application right
GR01 Patent grant
GR01 Patent grant