Disclosure of Invention
In order to solve the technical problems described above or at least partially solve the technical problems, the present invention provides a lottery method based on a blockchain, an apparatus, an electronic device, and a storage medium.
In a first aspect, the present invention provides a lottery method based on a blockchain, which is applied to a node of the blockchain, and includes:
if the intelligent contract to be executed exists, calling the intelligent contract to generate a node lottery drawing result aiming at the lottery drawing;
determining lottery drawing information of the lottery drawing, and adding node lottery drawing results and signature information of the node lottery drawing results in the lottery drawing information;
summarizing the node lottery drawing results of all nodes of the block chain to obtain a summarized result;
broadcasting a broadcast message containing summary information of the summary results and lottery information to other nodes in the blockchain so as to summarize the lottery results with the nodes of the other nodes in the blockchain;
and processing the summarized broadcast messages according to a consensus mechanism to obtain a consensus lottery result.
Optionally, the method further comprises:
determining whether the node is a lottery drawing node participating in the lottery drawing according to preset node weight information;
and if the self is the lottery node, executing the step of calling the intelligent contract.
Optionally, the method further comprises:
detecting whether the current time reaches the execution time of the intelligent contract or not at fixed time by using a timer;
and if the current time reaches the execution time of the intelligent contract, determining that the intelligent contract to be executed exists.
Optionally, the method further comprises:
if the node is a non-lottery node which does not participate in lottery, receiving broadcast messages sent by other nodes;
verifying the broadcast message;
if the broadcast message fails to be verified, discarding the broadcast message;
if the broadcast message is successfully verified, determining whether the node lottery drawing results of all the nodes of the block chain are collected according to the broadcast message;
if the node lottery drawing result summarization of all the nodes of the block chain is not finished, broadcasting a broadcast message;
and if the node lottery drawing results of all the nodes of the block chain are collected, broadcasting the broadcast message, storing the broadcast message into a local transaction buffer pool, and waiting for the consensus with other nodes.
Optionally, verifying the broadcast message includes:
extracting lottery contents and lottery marks from the received lottery information of the broadcast message;
generating a lottery drawing identifier according to the contract address, the lottery drawing time and the lottery drawing times in the lottery drawing content;
if the generated lottery drawing identification is different from the extracted lottery drawing identification, determining that the verification fails;
alternatively, the first and second electrodes may be,
determining whether the extracted lottery drawing identification is written into a transaction buffer pool or an account book;
if the extracted lottery drawing identification is written into a transaction buffer pool or an account book, determining that the verification fails;
alternatively, the first and second electrodes may be,
acquiring signature information in the broadcast message;
determining whether the signature information is correct according to a preset public key;
if the signature information is wrong, determining that the verification fails;
alternatively, the first and second electrodes may be,
acquiring weight information of other nodes sending broadcast messages;
determining whether the other nodes are lottery drawing nodes participating in the lottery drawing according to the weight information;
if the other nodes are not lottery drawing nodes participating in the lottery drawing, determining that the verification fails;
alternatively, the first and second electrodes may be,
summarizing the node lottery drawing results of all nodes of the block chain to obtain a summarized result;
comparing the summary result obtained by summarizing with the summary result in the received broadcast message;
and if the summarized result obtained by the summarization is different from the summarized result in the received broadcast message, determining that the verification fails.
Optionally, verifying the broadcast message includes:
and if the generated lottery drawing identification is the same as the extracted lottery drawing identification, the extracted lottery drawing identification is written into a transaction buffer pool or an account book, if the signature information is correct, if the other nodes are the lottery drawing nodes participating in the lottery drawing, and the summarized result obtained by summarizing is the same as the summarized result in the received broadcast message, the verification is determined to be successful.
Optionally, before invoking the intelligent contract and generating the node lottery result for the current lottery, the method further comprises:
if receiving the broadcast message sent by other nodes, verifying the broadcast message;
if the broadcast message fails to be verified, discarding the received broadcast message;
if the broadcast message is successfully verified, executing a step of calling an intelligent contract to generate a node lottery result aiming at the lottery;
adding the lottery drawing information and the summary result of the lottery drawing to the broadcast message;
determining whether the node lottery drawing results of all nodes of the block chain are collected;
if the node lottery drawing results of all nodes of the block chain are not completely summarized, broadcasting additional lottery drawing information and a broadcast message after the result is summarized;
if the node lottery drawing results of all the nodes of the block chain are collected, broadcasting additional lottery drawing information and the broadcast information after the results are collected, storing the broadcast information into a local transaction buffer pool, and waiting for consensus with other nodes.
Optionally, after invoking the intelligent contract to generate the node lottery result for the current lottery, the method further includes:
if receiving the broadcast message sent by other nodes, verifying the broadcast message;
if the broadcast message fails to be verified, discarding the received broadcast message;
if the broadcast message is successfully verified, determining whether the node lottery drawing result is located in the received broadcast message;
if the node lottery drawing result is not located in the broadcast message, adding the lottery drawing information and the summary result of the lottery drawing to the broadcast message;
determining whether the node lottery drawing results of all nodes of the block chain are collected;
if the node lottery drawing results of all nodes of the block chain are not completely summarized, broadcasting additional lottery drawing information and a broadcast message after the result is summarized;
if the node lottery drawing results of all the nodes of the block chain are collected, broadcasting additional lottery drawing information and the broadcast information after the results are collected, storing the broadcast information into a local transaction buffer pool, and waiting for consensus with other nodes.
Optionally, the processing the summarized broadcast message according to a consensus mechanism to obtain a consensus lottery result, including:
acquiring node lottery drawing results of each node in the broadcast message of the transaction buffer pool;
counting the number of nodes with the same number extracted aiming at each digital bit in the node lottery result of each node;
determining the number extracted from the maximum number of nodes as the common identification number of the digital bit;
and obtaining the consensus lottery result based on the consensus numbers of the digital bits.
In a second aspect, the present invention provides a lottery device based on a blockchain, applied to a node of the blockchain, including:
the calling module is used for calling the intelligent contract if the intelligent contract to be executed exists, and generating a node lottery drawing result aiming at the lottery drawing;
the determining module is used for determining the lottery drawing information of the lottery drawing, and adding node lottery drawing results and signature information of the node lottery drawing results in the lottery drawing information;
the summarizing module is used for summarizing the node lottery drawing results of all the nodes of the block chain to obtain a summarizing result;
the broadcasting module is used for broadcasting a broadcasting message containing the summary information of the summary results and the lottery drawing information to other nodes in the blockchain so as to summarize the lottery drawing results of the nodes of the blockchain;
and the consensus processing module is used for processing the summarized broadcast message according to a consensus mechanism to obtain a consensus lottery result.
In a third aspect, the present invention provides an electronic device, including a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory complete mutual communication through the communication bus;
a memory for storing a computer program;
and a processor configured to implement the block chain-based lottery method according to any one of the first aspect when executing the program stored in the memory.
In a fourth aspect, the present invention provides a computer-readable storage medium having stored thereon a program for a blockchain-based lottery method, the program for a blockchain-based lottery method implementing the steps of the blockchain-based lottery method of any one of the first aspect when executed by a processor.
Compared with the prior art, the technical scheme provided by the embodiment of the invention has the following advantages:
the method comprises the steps of firstly calling the intelligent contract when the intelligent contract to be executed exists, generating a node lottery result aiming at the lottery, then determining the lottery information of the lottery, adding the node lottery result and signature information of the node lottery result in the lottery information, summarizing the node lottery results of all nodes in a block chain to obtain a summarized result, broadcasting the summarized information containing the summarized result and the broadcast message of the lottery information to other nodes in the block chain so as to summarize the node lottery results of other nodes in the block chain, and finally processing the summarized broadcast message according to a consensus mechanism to obtain a consensus result.
According to the embodiment of the invention, through a decentralized mechanism of the blockchain system, each lottery is participated by a plurality of nodes, and finally the lottery results of the nodes are collected; moreover, the lottery result of the plurality of nodes in the blockchain is collected to obtain the consensus lottery result, so that when any node is abnormal, the lottery result can be still obtained by collecting the lottery results of the other nodes, and the embodiment of the invention can also avoid the problem that the lottery cannot be drawn when the server is abnormal, such as restarting and the like, during centralized lottery.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention. All other embodiments, which can be obtained by a person skilled in the art without any inventive step based on the embodiments of the present invention, are within the scope of the present invention.
The invention provides a lottery method, a device, an electronic device and a storage medium based on a block chain, the lottery method based on the block chain is applied to nodes of the block chain, all the nodes contained in the block chain are lottery nodes, but each lottery node has own preset weight information, and the preset weight information is used for distinguishing the roles of different nodes in the lottery process, such as: which nodes participate in the lottery at a certain lottery time point, which nodes do not participate in the lottery, and so on.
One possible lottery drawing method is that eight points in the morning and eight points in the evening each day perform a lottery drawing task, and the lottery drawing tasks are mapped to the blockchain deployment diagram shown in fig. 1, wherein the nodes at the upper right corner and the lower left corner perform the lottery drawing tasks at eight points in the morning, and the nodes at the upper left corner and the lower right corner perform the lottery drawing tasks at eight points in the evening. How to set the specific preset weight information can be independently defined by the service party, and the weight can be stored by adopting various schemes, such as: the weight of each node is hard coded into the node (meaning that the weight of the node is fixed after it is created); or writing the weights of the nodes into the blockchain network.
As shown in fig. 2, the lottery method based on the blockchain may include the steps of:
step S101, if an intelligent contract to be executed exists, the intelligent contract is called, and a node lottery result aiming at the lottery is generated;
in the embodiment of the invention, the intelligent contract refers to a lottery drawing rule realized by using codes, for example, 6 numbers are randomly selected from 1 to 33, and 1 number is randomly selected from 1 to 16.
The intelligent contract is public, can be effectively judged by a third party mechanism or an experienced person, and the whole lottery drawing process is transparent, so that the question of the public on the lottery drawing activity is reduced.
Before the step, a timer can be used for detecting whether the current time reaches the execution time of the intelligent contract or not; and if the current time reaches the execution time of the intelligent contract, determining that the intelligent contract to be executed exists.
In the embodiment of the invention, each node is correspondingly provided with a timer which is used for checking when the contract stored in the account book is executed or whether the contract needs to be executed, the service system is simpler through the timed execution of the intelligent contract, the maintenance is basically not needed after the contract is issued once, the execution is fully automatic, and the operation cost is effectively reduced.
Before the intelligent contract is called, whether the intelligent contract is a lottery drawing node participating in the lottery drawing can be determined according to preset node weight information; and if the intelligent contract is the lottery drawing node, executing the step of calling the intelligent contract. Whether different nodes participate in lottery or not is distinguished by utilizing preset weight information, so that the problem that final results are too average to reflect lottery results due to too many participating nodes can be solved.
Step S102, determining lottery drawing information of the lottery drawing, and adding the node lottery drawing result and signature information of the node lottery drawing result in the lottery drawing information;
the node automatically calculates a lottery identifier in each lottery, which may be, for example, a lottery ID, and the lottery ID is generated by calculating (e.g., hash algorithm) the intelligent contract address, the lottery time, and the number of lottery performed by the node, and the lottery IDs generated by all the lottery nodes at the same time are consistent in order to distinguish different rounds of lottery, so that the lottery IDs of different rounds of lottery are different, and the problem of repeated execution of lottery can be effectively handled by the lottery ID.
As shown in fig. 3, the lottery information may include lottery contents, lottery ID, etc., and the lottery contents may refer to lottery names, lottery period numbers, etc., for example: SS ball, phase 062, etc.
The addition of the node lottery result and the signature information of the result in the lottery information means that the lottery result, the lottery signature and the lottery information are broadcasted together, and the lottery result and the lottery signature contained in fig. 3 are accumulated in the continuous broadcasting process of each node in a block chain, so that the subsequent collection is more convenient.
Step S103, summarizing the node lottery drawing results of all the nodes of the block chain to obtain a summarized result;
in the embodiment of the present invention, the summarizing refers to adding together the number of certain values extracted by all nodes for a certain bit to generate a Map result, that is, a Map (lottery result, which corresponds to the number of nodes), where Key of the Map is a lottery result (often a number, such as the lottery result X or the lottery result Y in fig. 4), and Value is the number extracted to the Value (such as the number of nodes corresponding to X or the number of nodes corresponding to Y in fig. 4).
The lottery results are then aggregated for easier aggregation by other nodes in the future. The following is a data structure of the lottery result with a plurality of signature nodes attached:
when the contract draw is first generated, whether it is done collectively is no (we need multiple nodes to be summed to collect the final result).
Step S104, broadcasting the summary information containing the summary results and the broadcast information of the lottery drawing information to other nodes in the block chain so as to summarize the lottery drawing results of the nodes of other nodes in the block chain;
the summary information is shown in fig. 5, and includes a summary result, a summary time, a summary node signature, and a field of whether to complete summary, where when a contract lottery is first generated, since it is necessary that lottery results of a plurality of nodes are summarized before a final consensus lottery result is collected, whether to complete summary field is default to no, and only after summary is completed, it is modified to yes.
The transmission process of the broadcast message among different nodes participating in the lottery is accompanied by the summary of the lottery results.
And step S105, processing the summarized broadcast messages according to a consensus mechanism to obtain a consensus lottery result.
In this step, the nodes may agree with the lottery drawing results of the plurality of nodes participating in the lottery drawing according to an agreement mechanism, and after the agreement is completed, each node writes the agreement lottery drawing results into the local account book of its own node, so far, the lottery drawing process of this round is finished.
In the embodiment of the invention, when an intelligent contract to be executed exists, the intelligent contract is called first to generate a node lottery result for the lottery, then the lottery information for the lottery is determined, the node lottery result and signature information of the node lottery result are added to the lottery information, then the node lottery results of all nodes of the block chain are summarized to obtain a summarized result, the summarized information containing the summarized result and the broadcast message of the lottery information are broadcast to other nodes in the block chain so as to be summarized with the node lottery results of other nodes of the block chain, and finally the summarized broadcast message can be processed according to a consensus mechanism to obtain a consensus result.
According to the embodiment of the invention, through a decentralized mechanism of the blockchain system, each lottery is participated by a plurality of nodes, and finally the lottery results of the nodes are collected; moreover, the lottery result of the plurality of nodes in the blockchain is collected to obtain the consensus lottery result, so that when any node is abnormal, the lottery result can be still obtained by collecting the lottery results of the other nodes, and the embodiment of the invention can also avoid the problem that the lottery cannot be drawn when the server is abnormal, such as restarting and the like, during centralized lottery.
In yet another embodiment of the present invention, as shown in fig. 6, the method further includes:
step S301, if the node itself is a non-lottery node which does not participate in lottery, receiving broadcast messages sent by other nodes;
in the embodiment of the present invention, the non-lottery node which is not involved in the lottery by itself means a node which does not participate in the lottery according to the preset weight information for the lottery in this round.
Step S302, verifying the broadcast message;
in one embodiment of the present invention, the lottery contents and the lottery identifiers are extracted from the received lottery information of the broadcast message; generating a lottery drawing identifier according to the contract address, the lottery drawing time and the lottery drawing times in the lottery drawing content; if the generated lottery drawing identification is different from the extracted lottery drawing identification, determining that the verification fails;
alternatively, the first and second electrodes may be,
in yet another embodiment of the present invention, it is determined whether the extracted lottery ticket identifier is written into a transaction buffer pool or an account book; if the extracted lottery drawing identification is written into a transaction buffer pool or an account book, determining that the verification fails;
alternatively, the first and second electrodes may be,
in yet another embodiment of the present invention, signature information in the broadcast message is obtained; determining whether the signature information is correct according to a preset public key; if the signature information is wrong, determining that the verification fails;
alternatively, the first and second electrodes may be,
in another embodiment of the present invention, weight information of other nodes that transmit the broadcast message is obtained; determining whether the other nodes are lottery drawing nodes participating in the lottery drawing according to the weight information; if the other nodes are not lottery drawing nodes participating in the lottery drawing, determining that the verification fails;
alternatively, the first and second electrodes may be,
in another embodiment of the present invention, the node lottery results of all nodes of the blockchain are summarized to obtain a summarized result; comparing the summarized result obtained by summarizing with the summarized result in the received broadcast message; and if the summarized result obtained by the summarization is different from the summarized result in the received broadcast message, determining that the verification fails.
The above are all cases of verification failure, and only when the above procedures are all verified, that is: and if the generated lottery drawing identification is the same as the extracted lottery drawing identification, writing the extracted lottery drawing identification into a transaction buffer pool or an account book, and if the signature information is correct, if the other nodes are lottery drawing nodes participating in the lottery drawing, and the summarized result obtained by summarizing is the same as the summarized result in the received broadcast message, determining that the verification is successful.
Step S303, if the broadcast message fails to be verified, discarding the broadcast message;
step S304, if the broadcast message is successfully verified, determining whether the node lottery drawing results of all the nodes of the block chain are collected according to the broadcast message;
in this step, whether the summary is completed may be determined according to a whether summary completion field of the summary information in the broadcast message.
Step S305, if the node lottery drawing result summarization of all the nodes of the block chain is not finished, broadcasting the broadcast message;
step S306, if the node lottery drawing results of all the nodes of the block chain are collected, broadcasting the broadcast message, storing the broadcast message into a local transaction buffer pool, and waiting for the agreement with other nodes.
The embodiment of the invention can receive the broadcast message when the node is a non-lottery node which does not participate in lottery in the current round, verify the broadcast message, discard the broadcast message when the verification fails, store the broadcast message into the transaction buffer pool if the collection is completed when the verification succeeds, wait for consensus, and broadcast the received broadcast message if the collection is not completed, which is equivalent to the function of a transfer node, thereby helping to realize the collection of lottery results among a plurality of lottery-participating nodes.
In another embodiment of the present invention, before invoking the intelligent contract to generate the node lottery result for the current lottery in step S101, as shown in fig. 7, the method further includes:
step S401, if receiving broadcast messages sent by other nodes, verifying the broadcast messages;
step S402, if the broadcast message fails to be verified, discarding the received broadcast message;
step S403, if the broadcast message is successfully verified, executing the step of calling the intelligent contract to generate a node lottery result aiming at the lottery;
step S404, adding the lottery drawing information and the summary result of the lottery drawing to the broadcast message;
step S405, determining whether the node lottery drawing results of all the nodes of the block chain are collected;
step S406, if the node lottery result summarization of all the nodes of the block chain is not finished, broadcasting additional lottery information and the broadcast message after summarizing the result;
step S407, if the node lottery drawing results of all the nodes of the block chain are collected, broadcasting additional lottery drawing information and the broadcast message after the result is collected, storing the broadcast message into a local transaction buffer pool, and waiting for consensus with other nodes.
For each lottery node, the broadcast message sent by other nodes for many times is received, when the lottery node receives the broadcast message (the second stage of the lottery node in the flow chart), the condition of finishing summarizing the result is judged in addition to partial verification, if the condition is finished, the summarizing result is summarized, the state of the summarizing result is modified to be finished, and the transaction is written into a transaction pool; and if the condition judgment of the summary result is not met, directly broadcasting the broadcast message.
In another embodiment of the present invention, after invoking the intelligent contract to generate the node lottery result for the current lottery, as shown in fig. 8, the method further comprises:
step S501, if receiving broadcast messages sent by other nodes, verifying the broadcast messages;
step S502, if the broadcast message fails to be verified, discarding the received broadcast message;
step S503, if the broadcast message is successfully verified, determining whether the node lottery drawing result is located in the received broadcast message;
step S504, if the node lottery drawing result is not located in the broadcast message, adding the lottery drawing information and the summary result of the lottery drawing to the broadcast message;
step S505, determining whether the node lottery drawing results of all the nodes of the block chain are collected;
step S506, if the node lottery result summarization of all the nodes of the block chain is not finished, broadcasting additional lottery information and the broadcast message after summarizing the result;
step S507, if the node lottery drawing results of all nodes in the block chain are collected, broadcasting the additional lottery drawing information and the broadcast message after collecting the results, storing the broadcast message in a local transaction buffer pool, and waiting for consensus with other nodes.
For each lottery node, the broadcast message sent by other nodes for many times is received, when the lottery node receives the broadcast message (the second stage of the lottery node in the flow chart), the condition of finishing summarizing the result is judged in addition to partial verification, if the condition is finished, the summarizing result is summarized, the state of the summarizing result is modified to be finished, and the transaction is written into a transaction pool; and if the condition judgment of the summary result is not met, directly broadcasting the broadcast message.
As shown in fig. 9, the step S105 may include the steps of:
step S601, obtaining node lottery drawing results of each node in the broadcast message of the transaction buffer pool;
step S602, counting the number of nodes with the same number extracted according to each digital bit in the node lottery result of each node;
step S603, determining the extracted number with the largest number of nodes as the consensus number of the digital bit;
in step S604, a consensus drawing result is obtained based on the consensus numbers of the respective number bits.
According to the embodiment of the invention, through a consensus mechanism, the result of the lottery drawing based on a plurality of nodes can be obtained, so that a decentralized lottery drawing mode can be realized, each lottery drawing is participated by a plurality of nodes, and the lottery drawing results of each node are finally summarized; moreover, the lottery result of the plurality of nodes in the blockchain is collected to obtain the consensus lottery result, so that when any node is abnormal, the lottery result can be still obtained by collecting the lottery results of the other nodes, and the embodiment of the invention can also avoid the problem that the lottery cannot be drawn when the server is abnormal, such as restarting and the like, during centralized lottery.
In another embodiment of the present invention, there is also provided a lottery device based on a blockchain, applied to a node of the blockchain, as shown in fig. 10, including:
the calling module 11 is configured to call the intelligent contract if an intelligent contract to be executed exists, and generate a node lottery result for the current lottery;
a determining module 12, configured to determine lottery drawing information of the lottery drawing, and add the node lottery drawing result and signature information of the node lottery drawing result to the lottery drawing information;
the summarizing module 13 is configured to summarize node lottery results of all nodes of the blockchain to obtain a summarizing result;
a broadcasting module 14, configured to broadcast a broadcast message including the summary information of the summary results and the lottery information to other nodes in the blockchain so as to summarize the lottery results of the nodes in the blockchain;
and the consensus processing module 15 is configured to process the summarized broadcast message according to a consensus mechanism to obtain a consensus lottery result.
In another embodiment of the present invention, an electronic device is further provided, which includes a processor, a communication interface, a memory, and a communication bus, where the processor, the communication interface, and the memory complete communication with each other through the communication bus;
a memory for storing a computer program;
and the processor is used for realizing the lottery method based on the block chain in the embodiment of the method when executing the program stored in the memory.
In the electronic device provided by the embodiment of the invention, the processor executes the program stored in the memory to realize that if the intelligent contract to be executed exists, the intelligent contract is called to generate a node lottery result aiming at the lottery; determining lottery drawing information of the lottery drawing, and adding the node lottery drawing result and signature information of the node lottery drawing result in the lottery drawing information; summarizing the node lottery drawing results of all the nodes of the block chain to obtain a summarized result; broadcasting a broadcast message containing the summary information of the summary results and the lottery information to other nodes in the blockchain so as to summarize the lottery results with the nodes of other nodes in the blockchain; and processing the summarized broadcast messages according to a consensus mechanism to obtain a consensus lottery result. Through a decentralized mechanism of a blockchain system, each lottery is participated by a plurality of nodes, and finally the lottery results of the nodes are collected; moreover, the lottery result of the plurality of nodes in the blockchain is collected to obtain the consensus lottery result, so that when any node is abnormal, the lottery result can be still obtained by collecting the lottery results of the other nodes, and the embodiment of the invention can also avoid the problem that the lottery cannot be drawn when the server is abnormal, such as restarting and the like, during centralized lottery.
The communication bus 1140 mentioned in the above electronic device may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The communication bus 1140 may be divided into an address bus, a data bus, a control bus, and the like. For ease of illustration, only one thick line is shown in FIG. 11, but this is not intended to represent only one bus or type of bus.
The communication interface 1120 is used for communication between the electronic device and other devices.
The memory 1130 may include a Random Access Memory (RAM), and may also include a non-volatile memory (non-volatile memory), such as at least one disk memory. Optionally, the memory may also be at least one memory device located remotely from the processor.
The processor 1110 may be a general-purpose processor, and includes a Central Processing Unit (CPU), a Network Processor (NP), and the like; the integrated circuit may also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other programmable logic device, discrete gate or transistor logic device, or discrete hardware components.
In still another embodiment of the present invention, there is also provided a computer-readable storage medium having stored thereon a program for a blockchain-based lottery method, the program for a blockchain-based lottery method being executed by a processor to implement the steps of the blockchain-based lottery method described in the aforementioned method embodiments.
In the above embodiments, the implementation may be wholly or partially realized by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. The procedures or functions according to the embodiments of the invention are brought about in whole or in part when the computer program instructions are loaded and executed on a computer. The computer may be a general purpose computer, a special purpose computer, a network of computers, or other programmable device. The computer instructions may be stored in a computer readable storage medium or transmitted from one computer readable storage medium to another, for example, the computer instructions may be transmitted from one website, computer, server, or data center to another website, computer, server, or data center by wire (e.g., coaxial cable, fiber optic, Digital Subscriber Line (DSL)) or wirelessly (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device, such as a server, a data center, etc., that incorporates one or more of the available media. The usable medium may be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid state disk (ssd)), among others.
Finally, it should be noted that: the above examples are only intended to illustrate the technical solution of the present invention, but not to limit it; although the present invention 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 solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present invention.