CN110365479A - Random digit generation method and device based on block chain - Google Patents

Random digit generation method and device based on block chain Download PDF

Info

Publication number
CN110365479A
CN110365479A CN201910622983.5A CN201910622983A CN110365479A CN 110365479 A CN110365479 A CN 110365479A CN 201910622983 A CN201910622983 A CN 201910622983A CN 110365479 A CN110365479 A CN 110365479A
Authority
CN
China
Prior art keywords
seed
participant
event
time period
issued
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201910622983.5A
Other languages
Chinese (zh)
Inventor
谭林
李文宙
杨征
姜载乐
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hunan Tianhe Guoyun Technology Co Ltd
Original Assignee
Hunan Tianhe Guoyun 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 Hunan Tianhe Guoyun Technology Co Ltd filed Critical Hunan Tianhe Guoyun Technology Co Ltd
Priority to CN201910622983.5A priority Critical patent/CN110365479A/en
Publication of CN110365479A publication Critical patent/CN110365479A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/602Providing cryptographic facilities or services
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F7/00Methods or arrangements for processing data by operating upon the order or content of the data handled
    • G06F7/58Random or pseudo-random number generators
    • G06F7/582Pseudo-random number generators
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/08Key distribution or management, e.g. generation, sharing or updating, of cryptographic keys or passwords
    • H04L9/0861Generation of secret information including derivation or calculation of cryptographic keys or passwords
    • H04L9/0869Generation of secret information including derivation or calculation of cryptographic keys or passwords involving random numbers or seeds

Abstract

The embodiment of the invention provides a kind of generating random number and device based on block chain, which comprises receive the seed show value that each participant of event is issued in the first time period after event generation to block chain;The seed show value is to be worth obtained from carrying out operation to seed selected by the participant as Encryption Algorithm;Receive the seed that each participant of the event is issued in the second time period after event generation on the block chain;Whether the corresponding seed of seed show value issued in the first time period by each participant that the Encryption Algorithm detects the event respectively and the seed issued in the second time period are consistent, are verified with each participant to the event;Operation, which is carried out, in the seed that the second time period is issued using all participants by verifying of the random algorithm to the event obtains random number.Through the embodiment of the present invention, it can guarantee the fairness of the random number generated.

Description

Random digit generation method and device based on block chain
Technical field
The invention belongs to block chain technical field, be specifically related to a kind of random digit generation method based on block chain, Device, terminal device and computer-readable medium.
Background technique
Block chain is the novel of the computer technologies such as Distributed Storage, point-to-point transmission, common recognition mechanism, Encryption Algorithm Application model.It is substantially the database of a decentralization, is a string using the associated data generated of cryptography method Block contains the information of a batch network trading in each data block, for verifying the validity (anti-fake) of its information and raw At next block.For narrow sense, block chain is that one kind sequentially in time combines data block in such a way that sequence is connected At a kind of linked data structure, and the distributed account book that can not be distorted He can not forge guaranteed in a manner of cryptography.Broad sense For, block chain technology be verified using block linked data structure with storing data, using distributed node know together algorithm come It generates and guarantees the safety of data transmission and access with more new data, in the way of cryptography, using by automatized script code The intelligent contract of composition programs the completely new distributed basis framework and calculation of one kind with operation data.
Random number is applied in guess, the license plate number of shaking, and the numerous areas such as assembly occupancy distribution, the private key for encrypting currency are answered With.The development of internet allows people to be increasingly dependent on centralized system to the utilization of random number, but most centralizations system It unites, the random number of generation is all pseudo random number, and there is the risk of cheating, for example, it is inner in guess application, when the huge benefit of appearance When benefit temptation, the system of centralization may practise fraud, and allow and oneself therefrom get profit.Therefore, the public affairs of the random number of generation how to be ensured Levelling is a problem to be solved.
Summary of the invention
In view of this, the embodiment of the present invention provides a kind of random digit generation method based on block chain, device, terminal device And computer-readable medium, it can guarantee the fairness of the random number generated.
The first aspect of the embodiment of the present invention provides a kind of random digit generation method based on block chain, comprising:
The seed that each participant of reception event is issued in the first time period after event generation to block chain Show value;The seed show value is obtained from carrying out operation to seed selected by the participant as Encryption Algorithm Value;
Each participant of the event is received in the second time period after event generation on the block chain The seed of publication;
It is issued in the first time period by each participant that the Encryption Algorithm detects the event respectively Whether the corresponding seed of seed show value and the seed issued in the second time period are consistent, to each of the event Participant is verified;
The kind issued using all participants by verifying of the random algorithm to the event in the second time period Son carries out operation and obtains random number.
The second aspect of the embodiment of the present invention provides a kind of generating random number device based on block chain, comprising:
First receiving module, for receive each participant of event in the first time period after event generation to The seed show value of block chain publication;The seed show value be by Encryption Algorithm to seed selected by the participant into It is worth obtained from row operation;
Second receiving module, for receiving second time period of each participant of the event after event generation The seed issued on the introversive block chain;
Authentication module, for detecting each participant of the event respectively by the Encryption Algorithm at described first Between the corresponding seed of seed show value issued in section and the seed issued in the second time period it is whether consistent, to institute The each participant for stating event is verified;
Generation module, for using random algorithm to all participants by verifying of the event at described second Between section issue seed carry out operation obtain random number.
The third method of the embodiment of the present invention provides a kind of terminal device, including memory, processor and is stored in In the memory and the computer program that can run on the processor, when the processor executes the computer program The step of realizing the above-mentioned random digit generation method based on block chain.
The fourth aspect of the embodiment of the present invention provides a kind of computer-readable medium, the computer-readable medium storage There is a computer program, when computer program execution processed realizes the step of the above-mentioned random digit generation method based on block chain Suddenly.
Random digit generation method provided in an embodiment of the present invention based on block chain, can be by Encryption Algorithm to detecting respectively The corresponding seed of seed show value that each participant of the event is issued in the first time period with described second Whether the seed issued in the period is consistent, is verified with each participant to the event, and utilizes random algorithm pair All participants by verifying of the event carry out operation in the seed that the second time period is issued and obtain random number, from And it can guarantee the fairness of the random number generated.
Detailed description of the invention
It to describe the technical solutions in the embodiments of the present invention more clearly, below will be to embodiment or description of the prior art Needed in attached drawing be briefly described, it should be apparent that, the accompanying drawings in the following description is only of the invention some Embodiment for those of ordinary skill in the art without any creative labor, can also be according to these Attached drawing obtains other attached drawings.
Fig. 1 is a kind of flow chart of random digit generation method based on block chain provided in an embodiment of the present invention;
Fig. 2 is a kind of structural schematic diagram of generating random number device based on block chain provided in an embodiment of the present invention;
Fig. 3 is the refinement structure chart of the authentication module in the generating random number device based on block chain that Fig. 2 is provided;
Fig. 4 is the refinement structure chart of the generation module in the generating random number device based on block chain that Fig. 2 is provided;
Fig. 5 is the structural schematic diagram of another generating random number device based on block chain provided in an embodiment of the present invention;
Fig. 6 is the schematic diagram of terminal device provided in an embodiment of the present invention.
Specific embodiment
In being described below, for illustration and not for limitation, the tool of such as particular system structure, technology etc is proposed Body details, to understand thoroughly the embodiment of the present invention.However, it will be clear to one skilled in the art that there is no these specific The present invention also may be implemented in the other embodiments of details.In other situations, it omits to well-known system, device, electricity The detailed description of road and method, in case unnecessary details interferes description of the invention.
In order to illustrate technical solutions according to the invention, the following is a description of specific embodiments.
Referring to Fig. 1, Fig. 1 is a kind of random digit generation method based on block chain provided in an embodiment of the present invention.Such as Fig. 1 It is shown, the random digit generation method based on block chain of the present embodiment the following steps are included:
S101: each participant for receiving event is issued in the first time period after event generation on block chain Seed show value.
In embodiments of the present invention, it can receive each participant of event in the first time period after event generation The seed show value issued to the distributed data base of the block chain.The seed show value is by Encryption Algorithm to described Seed selected by participant be worth obtained from operation.Seed selected by each participant can be set to seed1, seed2,seed3,., seedn, the Encryption Algorithm may be configured as F1, and encryption algorithm F 1 can be SHA256 algorithm or ellipse The Encryption Algorithm such as circle algorithm, and F1 need to be disclosed in the first time period to the block chain.The seed show value can be set For displayseed1, displayseed2,., displayseedn, then it is available: displayseedn=F1 (seedn).It should be pointed out that due to the guarantee of encryption algorithm F 1, by seed show value displayseedn and Encryption Algorithm F1 counter cannot release seed seedn, therefore seed seedn will not be revealed, and the minor alteration of seed seedn will lead to The difference of displayseedn, user cannot find two different seed and calculate the same displayseed using F1, i.e., Under existence conditions, method cannot crack seed seedn corresponding to seed show value displayseedn by force.In addition, Assuming that the event is related to guess, then the first time period can correspond to time of the user from buying lottery ticket to system and announcing the winners in a lottery Section.
S102: each participant of the event is received in the second time period after event generation to the block The seed issued on chain.
In embodiments of the present invention, after the first time period, it can receive each participant of the event described Event occur after second time period in the seed issued on the block chain, each participant of the event is described the The seed show value that the seed issued in two periods on the block chain can be and issue in the first time period Corresponding seed is identical, it is also possible to different.It can set what each participant of the event was issued in the second time period Seed may be seed1 ', seed2 ', seed3 ',., seedn ', each participant of the event is in the first time Section in issue seed show value corresponding to seed seed1, seed2, seed3,., one or more seeds in seedn The seed seed1 ' that may be issued in the second time period with each participant of the event, seed2 ', seed3',., seedn ' it is different.Moreover, it is assumed that the event is related to guess, then the second time period can correspond to described After first time period to system announce the winners in a lottery between one prepare the period announced the winners in a lottery.It should be pointed out that the ginseng of the event The seed show value submitted in the first time period with side cannot be changed after the second time period starts, so as to Each participant of the event is verified.
S103: it is sent out in the first time period by each participant that the Encryption Algorithm detects the event respectively Whether the corresponding seed of seed show value of cloth and the seed issued in the second time period are consistent, to the event Each participant is verified.
In embodiments of the present invention, pass through the participant in addition to participant to be verified in each participant, benefit Encryption fortune is carried out with the seed that be verified participant of the Encryption Algorithm to the event is issued in the second time period It calculates, obtains seed encrypted value, then the kind that the seed encrypted value and the participant to be verified are issued in first time period Sub- show value is compared, if unanimously, illustrating that the seed that the participant to be verified is issued in the first time period is aobvious The corresponding seed of indicating value is consistent with the seed that the participant to be verified is issued in the second time period, the ginseng to be verified Pass through verifying with side;If the seed show value that the seed encrypted value and the participant to be verified are issued in first time period Inconsistent, then the seed for illustrating that the participant to be verified has submitted mistake to the block chain in the first time period is aobvious Indicating value or the participant to be verified have submitted the seed of mistake in the second time period to the block chain, it is described to The verifying of verifying participant does not pass through, and the qualification that the participant to be verified participates in the affairs is cancelled.For example, it is assumed that described There are three participant UserA, UserB and UserC for event.UserA has submitted seed seed1 ' in the second event section, then The seed1 ' that UserB and UserC can submit UserA is verified using F1 (seed1 ')=displayseed1 ', if Displayseed1 ' is equal to the seed show value displayseed1 that UserA is submitted in first time period, then illustrates UserA Seed corresponding to the seed submitted in second time period and the seed show value submitted in first time period is identical, then UserA passes through verifying.UserB has submitted seed seed2 ' in the second event section, then UserA and UserC can be right The seed2 ' that UserB is submitted is verified using F1 (seed2 ')=displayseed2 ', if displayseed2 ' etc. In the seed show value displayseed2 that UserB is submitted in first time period, then illustrate that UserB is mentioned in second time period The seed of friendship and seed corresponding to the seed show value submitted in first time period be not identical, then UserB authentication failed, cancels UserB participates in the qualification of the event.
S104: it is issued using all participants by verifying of the random algorithm to the event in the second time period Seed carry out operation obtain random number.
In one embodiment of the invention, own using random number algorithm (for example, SHA256) to the event Operation, which is carried out, in the seed that the second time period is issued by the participant of verifying obtains random number.The random number algorithm needs It is disclosed in the second time period to the block chain.The random number algorithm can be set as F, if the event is all logical The participant for crossing verifying is UserA, UserB and UserC, the seed that UserA, UserB and UserC are submitted in second time period Seed1 ', seed2 ', seed3 ' and seed seed1, seed2 corresponding to the seed show value submitted in first time period, Seed3 is identical, then random number random=F (seed1, seed2, seed3) generated.In another embodiment of the invention In, it is carried out by all participants by verifying of the aggregating algorithm to the event in the seed that the second time period is issued Polymerization processing obtains polymerization processing result, recycles SHA256 algorithm to carry out operation to the polymerization processing result and obtains at random Number.After generating the random number, the event is handled using the random number.For example, using the random number into Row lottery ticket is announced the winners in a lottery.Optionally, it can be numbered to by the participant verified, make the random number to the participation by verifying The quantity of side carries out modulus, and the result of modulus is the number of award-winner.In another example generating using the random number about institute The private key of event is stated, in this case, what each participant of the event was submitted in first time period is each participant Public key (i.e. seed show value in S101), the public key is by Encryption Algorithm (for example, oval algorithm) to described each The private key (i.e. seed corresponding to the seed show value announced in the first time period in S101) of participant is added Obtained from close operation.It should be noted that due to the seed of all participants by verifying of the event be it is fair, And the Encryption Algorithm and random number algorithm are transparent, so the random number generated is effective and fair.
It, can be by Encryption Algorithm to described in detection respectively in the random digit generation method based on block chain that Fig. 1 is provided The corresponding seed of seed show value that each participant of event is issued in the first time period in second time Whether the seed issued in section is consistent, is verified with each participant to the event, and using random algorithm to described All participants by verifying of event carry out operation in the seed that the second time period is issued and obtain random number, so as to The fairness of enough random numbers for guaranteeing to generate.
Referring to Fig. 2, Fig. 2 is a kind of structure of generating random number device based on block chain provided in an embodiment of the present invention Block diagram.As shown in Fig. 2, the generating random number device 20 based on block chain of the present embodiment includes the first receiving module 201, second Receiving module 202, authentication module 203 and generation module 204.First receiving module 201, the second receiving module 202, authentication module 203 and generation module 204 be respectively used to execute the specific method in S101, S102, S103 and S104 in Fig. 1, details can join The related introduction for seeing Fig. 1, is only briefly described herein:
First receiving module 201, for receiving first time period of each participant of event after event generation The interior seed show value issued to block chain;The seed show value is by Encryption Algorithm to kind selected by the participant Son be worth obtained from operation.
Second receiving module 202, when for receiving second of each participant of the event after event generation Between the seed issued on the introversive block chain of section.
Authentication module 203, for detecting each participant of the event respectively by the Encryption Algorithm described Whether the corresponding seed of seed show value issued in one period and the seed issued in the second time period are consistent, with Each participant of the event is verified.
Generation module 204, for using random algorithm to all participants by verifying of the event described the The seed of two periods publication carries out operation and obtains random number.
Further, reference can be made to Fig. 3, authentication module 203 may particularly include encryption unit 2031, comparing unit 2032 and lead to Cross unit 2032:
Encryption unit 2031, for passing through the participant in addition to participant to be verified in each participant, benefit Encryption fortune is carried out with the seed that be verified participant of the Encryption Algorithm to the event is issued in the second time period It calculates, obtains seed encrypted value.
Comparing unit 2032, for issuing the seed encrypted value and the participant to be verified in first time period Seed show value be compared.
By unit 2033, for comparing the seed encrypted value and the ginseng to be verified in the comparing unit 2032 When consistent with the seed show value that side issues in first time period, then pass through the verifying of the participant to be verified.
Further, reference can be made to Fig. 4, generation module 204 may particularly include polymerized unit 2041 and generation unit 2042:
Polymerized unit 2041, for by aggregating algorithm to all participants by verifying of the event described the The two periods seed of publication carries out polymerization processing, obtains polymerization processing result.
Generation unit 2042, for being transported using random number algorithm (for example, SHA256) to the polymerization processing result Calculation obtains random number.
Referring to Fig. 5, Fig. 5 is the knot of another generating random number device based on block chain provided in an embodiment of the present invention Structure block diagram.As shown in figure 5, as shown in figure 5, the generating random number device 50 based on block chain of the present embodiment is shown in Fig. 2 Generating random number device 20 based on block chain on the basis of get into crossing optimization.Generating random number dress based on block chain 50 are set other than including the first receiving module 201, the second receiving module 202, authentication module 203 and generation module 204, may be used also Including processing module 501:
Processing module 501, for being handled using the random number of generation the event.For example, described in utilizing Random number carries out announcing the winners in a lottery for lottery ticket.Optionally, it can be numbered to by the participant verified, make the random number to by testing The quantity of the participant of card carries out modulus, and the result of modulus is the number of award-winner.In another example being produced using the random number The raw private key about the event, in this case, what each participant of the event was submitted in first time period is each The public key (i.e. seed show value in S101) of a participant, the public key are right by Encryption Algorithm (for example, oval algorithm) Private key (the i.e. kind corresponding to the seed show value announced in the first time period in S101 of each participant Son) it carries out obtained from cryptographic calculation.
The generating random number device based on block chain that Fig. 2 or Fig. 5 is provided, can be by Encryption Algorithm to described in detection respectively The corresponding seed of seed show value that each participant of event is issued in the first time period in second time Whether the seed issued in section is consistent, is verified with each participant to the event, and using random algorithm to described All participants by verifying of event carry out operation in the seed that the second time period is issued and obtain random number, so as to The fairness of enough random numbers for guaranteeing to generate.
Fig. 6 is the schematic diagram for the terminal device that one embodiment of the invention provides.As shown in fig. 6, the terminal of the embodiment is set Standby 6 include: processor 60, memory 61 and are stored in the meter that can be run in the memory 61 and on the processor 60 Calculation machine program 62, for example, carrying out the program of the generating random number based on block chain.The processor 60 executes the computer journey The step in above method embodiment is realized when sequence 62, for example, S101 shown in FIG. 1 to S104.Alternatively, the processor 60 is held The function of each module/unit in above-mentioned each Installation practice, such as module shown in Fig. 2 are realized when the row computer program 62 201 to 204 function.
Illustratively, the computer program 62 can be divided into one or more module/units, it is one or Multiple module/units are stored in the memory 61, and are executed by the processor 60, to complete the present invention.Described one A or multiple module/units can be the series of computation machine program instruction section that can complete specific function, which is used for Implementation procedure of the computer program 62 in terminal device 6 is described.For example, the computer program 62 can be divided into First receiving module 201, the second receiving module 202, authentication module 203 and generation module 204.(module in virtual bench), Each module concrete function is as follows:
First receiving module 201, for receiving first time period of each participant of event after event generation The interior seed show value issued to block chain;The seed show value is by Encryption Algorithm to kind selected by the participant Son be worth obtained from operation.
Second receiving module 202, when for receiving second of each participant of the event after event generation Between the seed issued on the introversive block chain of section.
Authentication module 203, for detecting each participant of the event respectively by the Encryption Algorithm described Whether the corresponding seed of seed show value issued in one period and the seed issued in the second time period are consistent, with Each participant of the event is verified.
Generation module 204, for using random algorithm to all participants by verifying of the event described the The seed of two periods publication carries out operation and obtains random number.
The terminal device 6 can be the calculating such as desktop PC, notebook, palm PC and cloud server and set It is standby.Terminal device 6 may include, but be not limited only to, processor 60, memory 61.It will be understood by those skilled in the art that Fig. 6 is only It is only the example of terminal device 6, does not constitute the restriction to terminal device 6, may include components more more or fewer than diagram, Perhaps certain components or different components are combined, such as the terminal device can also connect including input-output equipment, network Enter equipment, bus etc..
The processor 60 can be central processing unit (Central Processing Unit, CPU), can also be Other general processors, digital signal processor (Digital Signal Processor, DSP), specific integrated circuit (Application Specific Integrated Circuit, ASIC), ready-made programmable gate array (Field- Programmable Gate Array, FPGA) either other programmable logic device, discrete gate or transistor logic, Discrete hardware components etc..General processor can be microprocessor or the processor is also possible to any conventional processor Deng.
The memory 61 can be the internal storage unit of terminal device 6, such as the hard disk or memory of terminal device 6. It is hard that the memory 61 is also possible to the plug-in type being equipped on the External memory equipment of terminal device 6, such as the terminal device 6 Disk, intelligent memory card (Smart Media Card, SMC), secure digital (Secure Digital, SD) card, flash card (Flash Card) etc..Further, the memory 61 can also both including terminal device 6 internal storage unit and also including External memory equipment.The memory 61 for other programs needed for storing the computer program and terminal device 6 and Data.The memory 61 can be also used for temporarily storing the data that has exported or will export.
It is apparent to those skilled in the art that for convenience of description and succinctly, only with above-mentioned each function Can unit, module division progress for example, in practical application, can according to need and by above-mentioned function distribution by different Functional unit, module are completed, i.e., the internal structure of described device is divided into different functional unit or module, more than completing The all or part of function of description.Each functional unit in embodiment, module can integrate in one processing unit, can also To be that each unit physically exists alone, can also be integrated in one unit with two or more units, it is above-mentioned integrated Unit both can take the form of hardware realization, can also realize in the form of software functional units.In addition, each function list Member, the specific name of module are also only for convenience of distinguishing each other, the protection scope being not intended to limit this application.Above system The specific work process of middle unit, module, can refer to corresponding processes in the foregoing method embodiment, and details are not described herein.
In the above-described embodiments, it all emphasizes particularly on different fields to the description of each embodiment, is not described in detail or remembers in some embodiment The part of load may refer to the associated description of other embodiments.
Those of ordinary skill in the art may be aware that list described in conjunction with the examples disclosed in the embodiments of the present disclosure Member and algorithm steps can be realized with the combination of electronic hardware or computer software and electronic hardware.These functions are actually It is implemented in hardware or software, the specific application and design constraint depending on technical solution.Professional technician Each specific application can be used different methods to achieve the described function, but this realization is it is not considered that exceed The scope of the present invention.
In embodiment provided by the present invention, it should be understood that disclosed device/terminal device and method, it can be with It realizes by another way.For example, device described above/terminal device embodiment is only schematical, for example, institute The division of module or unit is stated, only a kind of logical function partition, there may be another division manner in actual implementation, such as Multiple units or components can be combined or can be integrated into another system, or some features can be ignored or not executed.Separately A bit, shown or discussed mutual coupling or direct-coupling or communication connection can be through some interfaces, device Or the INDIRECT COUPLING or communication connection of unit, it can be electrical property, mechanical or other forms.
The unit as illustrated by the separation member may or may not be physically separated, aobvious as unit The component shown may or may not be physical unit, it can and it is in one place, or may be distributed over multiple In network unit.It can select some or all of unit therein according to the actual needs to realize the mesh of this embodiment scheme 's.
It, can also be in addition, the functional units in various embodiments of the present invention may be integrated into one processing unit It is that each unit physically exists alone, can also be integrated in one unit with two or more units.Above-mentioned integrated list Member both can take the form of hardware realization, can also realize in the form of software functional units.
If the integrated module/unit be realized in the form of SFU software functional unit and as independent product sale or In use, can store in a computer readable storage medium.Based on this understanding, the present invention realizes above-mentioned implementation All or part of the process in example method, can also instruct relevant hardware to complete, the meter by computer program Calculation machine program can be stored in a computer readable storage medium, the computer program when being executed by processor, it can be achieved that on The step of stating each embodiment of the method.Wherein, the computer program includes computer program code, the computer program generation Code can be source code form, object identification code form, executable file or certain intermediate forms etc..The computer-readable medium It may include: any entity or device, recording medium, USB flash disk, mobile hard disk, magnetic that can carry the computer program code Dish, CD, computer storage, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), electric carrier signal, telecommunication signal and software distribution medium etc..It should be noted that described The content that computer-readable medium includes can carry out increasing appropriate according to the requirement made laws in jurisdiction with patent practice Subtract, such as does not include electric carrier signal and electricity according to legislation and patent practice, computer-readable medium in certain jurisdictions Believe signal.
Embodiment described above is merely illustrative of the technical solution of the present invention, rather than its limitations;Although referring to aforementioned reality Applying example, invention is explained in detail, those skilled in the art should understand that: it still can be to aforementioned each Technical solution documented by embodiment is modified or equivalent replacement of some of the technical features;And these are modified Or replacement, the spirit and scope for technical solution of various embodiments of the present invention that it does not separate the essence of the corresponding technical solution should all It is included within protection scope of the present invention.

Claims (10)

1. a kind of random digit generation method based on block chain characterized by comprising
Each participant of reception event is shown in the first time period after event generation to the seed that block chain is issued Value;The seed show value is to be worth obtained from carrying out operation to seed selected by the participant as Encryption Algorithm;
The each participant for receiving the event is issued in the second time period after event generation on the block chain Seed;
The seed issued in the first time period by each participant that the Encryption Algorithm detects the event respectively Whether the corresponding seed of show value and the seed issued in the second time period are consistent, with each participation to the event Fang Jinhang verifying;
The seed all participants by verifying of the event issued in the second time period using random algorithm into Row operation obtains random number.
2. the random digit generation method according to claim 1 based on block chain, which is characterized in that described to be added by described Issued in the first time period corresponding kind of seed show value of each participant that close algorithm detects the event respectively Whether son and the seed issued in the second time period are consistent, are verified with each participant to the event, wrap It includes:
By the participant in addition to participant to be verified in each participant, using the Encryption Algorithm to the thing The seed that the participant to be verified of part is issued in the second time period carries out cryptographic calculation, obtains seed encrypted value;
The seed encrypted value is compared with the seed show value that the participant to be verified is issued in first time period;
If consistent, the participant to be verified passes through verifying.
3. the random digit generation method according to claim 1 based on block chain, which is characterized in that described to be calculated using random Method carries out operation in the seed that the second time period is issued to all participants by verifying of the event and obtains at random Number, comprising:
The seed all participants by verifying of the event issued in the second time period by aggregating algorithm into Row polymerization processing obtains polymerization processing result;
Operation is carried out to the polymerization processing result using SHA256 and obtains random number.
4. the random digit generation method described in any one of claim 1 to 3 based on block chain, which is characterized in that institute It states and is carried out using all participants by verifying of the random algorithm to the event in the seed that the second time period is issued Operation obtains after random number, further includes:
The event is handled using the random number.
5. a kind of generating random number device based on block chain characterized by comprising
First receiving module, for receiving each participant of event in the first time period after event generation to block The seed show value of chain publication;The seed show value is to be transported by Encryption Algorithm to seed selected by the participant It is worth obtained from calculation;
Second receiving module, for receive each participant of the event in the second time period after event generation to The seed issued on the block chain;
Authentication module, for detecting each participant of the event respectively by the Encryption Algorithm in the first time period Whether the corresponding seed of seed show value of interior publication and the seed issued in the second time period are consistent, to the thing Each participant of part is verified;
Generation module, for utilizing random algorithm to all participants by verifying of the event in the second time period The seed of publication carries out operation and obtains random number.
6. the generating random number device according to claim 5 based on block chain, which is characterized in that the authentication module packet It includes:
Encryption unit, for being added using described by the participant in addition to participant to be verified in each participant Close algorithm carries out cryptographic calculation to the seed that the participant to be verified of the event is issued in the second time period, is planted Sub- secret value;
Comparing unit, the seed for issuing the seed encrypted value in first time period with the participant to be verified are shown Indicating value is compared;
By unit, for when the comparing unit compares the seed encrypted value and the participant to be verified first Between the seed show value issued in section it is consistent when, then pass through the verifying of the participant to be verified.
7. the generating random number device according to claim 5 based on block chain, which is characterized in that the generation module packet It includes:
Polymerized unit, for passing through aggregating algorithm to all participants by verifying of the event in the second time period The seed of publication carries out polymerization processing, obtains polymerization processing result;
Generation unit obtains random number for carrying out operation to the polymerization processing result using SHA256.
8. based on the generating random number device of block chain according to any one of claim 5~7, which is characterized in that also Include:
Processing module, for being handled using the random number of generation the event.
9. a kind of terminal device, including memory, processor and storage are in the memory and can be on the processor The computer program of operation, which is characterized in that the processor is realized when executing the computer program as in claim 1-4 The step of any one the method.
10. a kind of computer-readable medium, the computer-readable medium storage has computer program, which is characterized in that described It is realized when computer program execution processed such as the step of any one of claim 1-4 the method.
CN201910622983.5A 2019-07-11 2019-07-11 Random digit generation method and device based on block chain Pending CN110365479A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910622983.5A CN110365479A (en) 2019-07-11 2019-07-11 Random digit generation method and device based on block chain

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910622983.5A CN110365479A (en) 2019-07-11 2019-07-11 Random digit generation method and device based on block chain

Publications (1)

Publication Number Publication Date
CN110365479A true CN110365479A (en) 2019-10-22

Family

ID=68218817

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910622983.5A Pending CN110365479A (en) 2019-07-11 2019-07-11 Random digit generation method and device based on block chain

Country Status (1)

Country Link
CN (1) CN110365479A (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110955407A (en) * 2019-11-21 2020-04-03 杭州趣链科技有限公司 Random number taking method based on block chain
CN111061456A (en) * 2019-12-10 2020-04-24 重庆锐云科技有限公司 Intelligent pseudo-random number generation mechanism based on distributed architecture
CN111311386A (en) * 2020-01-19 2020-06-19 深圳壹账通智能科技有限公司 Block chain-based bead shaking method and system, electronic device and storage medium
CN111628862A (en) * 2020-05-22 2020-09-04 杭州溪塔科技有限公司 Multi-party participating random number generation method and device
WO2021115290A1 (en) * 2019-12-13 2021-06-17 杭州复杂美科技有限公司 Off-chain random number application method and device for blockchain game, and storage medium
CN114553505A (en) * 2022-02-09 2022-05-27 蚂蚁区块链科技(上海)有限公司 Method and device for generating random number by cooperation of multiple parties

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108182581A (en) * 2017-12-29 2018-06-19 北京欧链科技有限公司 A kind of bookkeeping methods and device of block chain
CN109360091A (en) * 2018-08-30 2019-02-19 阿里巴巴集团控股有限公司 A kind of arbitrary object choosing method and device based on block chain
CN109783057A (en) * 2018-12-03 2019-05-21 北京建筑大学 Random digit generation method and device on a kind of block chain

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108182581A (en) * 2017-12-29 2018-06-19 北京欧链科技有限公司 A kind of bookkeeping methods and device of block chain
CN109360091A (en) * 2018-08-30 2019-02-19 阿里巴巴集团控股有限公司 A kind of arbitrary object choosing method and device based on block chain
CN109783057A (en) * 2018-12-03 2019-05-21 北京建筑大学 Random digit generation method and device on a kind of block chain

Cited By (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110955407A (en) * 2019-11-21 2020-04-03 杭州趣链科技有限公司 Random number taking method based on block chain
CN110955407B (en) * 2019-11-21 2022-04-01 杭州趣链科技有限公司 Random number taking method based on block chain
CN111061456A (en) * 2019-12-10 2020-04-24 重庆锐云科技有限公司 Intelligent pseudo-random number generation mechanism based on distributed architecture
CN111061456B (en) * 2019-12-10 2022-02-11 重庆锐云科技有限公司 Intelligent pseudo-random number generation method based on distributed architecture
WO2021115290A1 (en) * 2019-12-13 2021-06-17 杭州复杂美科技有限公司 Off-chain random number application method and device for blockchain game, and storage medium
CN111311386A (en) * 2020-01-19 2020-06-19 深圳壹账通智能科技有限公司 Block chain-based bead shaking method and system, electronic device and storage medium
WO2021142972A1 (en) * 2020-01-19 2021-07-22 深圳壹账通智能科技有限公司 Blockchain-based rolling-ball lottery method and system, electronic device, and storage medium
CN111628862A (en) * 2020-05-22 2020-09-04 杭州溪塔科技有限公司 Multi-party participating random number generation method and device
CN114553505A (en) * 2022-02-09 2022-05-27 蚂蚁区块链科技(上海)有限公司 Method and device for generating random number by cooperation of multiple parties
CN114553505B (en) * 2022-02-09 2023-08-04 蚂蚁区块链科技(上海)有限公司 Method, device, storage medium and computing equipment for generating random numbers cooperatively by multiple parties

Similar Documents

Publication Publication Date Title
CN110365479A (en) Random digit generation method and device based on block chain
EP3449450B1 (en) Implementing logic gate functionality using a blockchain
CN109544331A (en) Supply chain financial application method, apparatus and terminal device based on block chain
CN107454114A (en) A kind of auction bidding method, server and readable storage medium storing program for executing
CN107862216A (en) Method for secret protection, device and the storage medium merchandised for anonymity across chain
CN113989047A (en) Asset publishing method and device based on block chain and electronic equipment
CN108737403A (en) A kind of block chain data processing method, device, processing equipment and system
CN109493204A (en) Business bookkeeping methods and terminal device based on block chain
CN110222529A (en) Assets management method, electronic equipment and computer storage medium based on alliance's chain
CN108365950A (en) The generation method and device of financial self-service equipment key
CN111612600B (en) Block chain auction method, equipment, storage medium and block chain system
CN106161415B (en) A kind of information processing method and mobile gunz perception application platform
CN109064146A (en) A kind of digital cash method of commerce, equipment, system, terminal and client wallet
CN109493047A (en) A kind of commission settlement method, device and terminal device based on block chain
CN111008863A (en) Lottery drawing method and system based on block chain
CN109361697A (en) The method for realizing trusted identity certification based on SIM card load PKI
CN111985007A (en) Contract signing and executing method and device based on block chain
CN107944285A (en) The method of commerce and device of a kind of unique right to use of data message
CN110263025A (en) Data liquidation method, electronic equipment and computer storage medium based on alliance's chain
CN108615152A (en) A kind of transaction system based on block chain
CN114049096A (en) Personalized customization system and method based on block chain
CN113409078A (en) Point issuing method, device, equipment and storage medium
CN108596764A (en) A kind of method of commerce, system and terminal device based on block chain
CN111444090A (en) Contract testing method and device in block chain, electronic equipment and storage medium
CN104751364B (en) A kind of trans-regional direct selling bank federation method of commerce and system by safety certification

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
RJ01 Rejection of invention patent application after publication

Application publication date: 20191022

RJ01 Rejection of invention patent application after publication