CN108964878A - A kind of drawing method, common recognition method, equipment and storage medium - Google Patents

A kind of drawing method, common recognition method, equipment and storage medium Download PDF

Info

Publication number
CN108964878A
CN108964878A CN201810805421.XA CN201810805421A CN108964878A CN 108964878 A CN108964878 A CN 108964878A CN 201810805421 A CN201810805421 A CN 201810805421A CN 108964878 A CN108964878 A CN 108964878A
Authority
CN
China
Prior art keywords
random number
held
node
common recognition
block
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.)
Granted
Application number
CN201810805421.XA
Other languages
Chinese (zh)
Other versions
CN108964878B (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.)
Hangzhou Fuzamei Technology Co Ltd
Original Assignee
Hangzhou Fuzamei 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 Hangzhou Fuzamei Technology Co Ltd filed Critical Hangzhou Fuzamei Technology Co Ltd
Priority to CN201810805421.XA priority Critical patent/CN108964878B/en
Publication of CN108964878A publication Critical patent/CN108964878A/en
Application granted granted Critical
Publication of CN108964878B publication Critical patent/CN108964878B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/06Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols the encryption apparatus using shift registers or memories for block-wise or stream coding, e.g. DES systems or RC4; Hash functions; Pseudorandom sequence generators
    • H04L9/0643Hash functions, e.g. MD5, SHA, HMAC or f9 MAC
    • 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
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/38Payment protocols; Details thereof
    • G06Q20/382Payment protocols; Details thereof insuring higher security of transaction
    • G06Q20/3827Use of message hashing
    • 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
    • G06Q40/00Finance; Insurance; Tax strategies; Processing of corporate or income taxes
    • G06Q40/04Trading; Exchange, e.g. stocks, commodities, derivatives or currency exchange
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/12Applying verification of the received information
    • 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/0816Key establishment, i.e. cryptographic processes or cryptographic protocols whereby a shared secret becomes available to two or more parties, for subsequent use
    • H04L9/0819Key transport or distribution, i.e. key establishment techniques where one party creates or otherwise obtains a secret value, and securely transfers it to the other(s)
    • 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 present invention devises a kind of drawing method, freezes a certain number of assets first, to obtain the qualification with the first random number of assets respective numbers;Secondly, when becoming the accounting nodes of current block, the second generating random number seed information that several second random numbers and several present nodes held according to the accounting nodes of top n block are held;The first random number is generated further according to seed information;Judge whether present node is chosen for common recognition committeeman further according to the difficulty value of the first random number and pre-configuration held;Finally, broadcast the first held random number, and receive the first random number of other node broadcasts, after the sequence of the first random number of the first random number held and other node broadcasts, the method that the corresponding common recognition committeeman of the first random number each in ranking results is divided into accounting nodes and node of knowing together according to the rule of pre-configuration, when so that each round being known together, common recognition committeeman is made of different nodes, solves the problems, such as common recognition committeeman and conspires to obtain interests and damage other node interests.

Description

A kind of drawing method, common recognition method, equipment and storage medium
Technical field
The present invention relates to block chain technical field, it is related to a kind of drawing method, common recognition method, equipment and storage medium.
Background technique
In existing block chain network, since number of nodes is big, cause each block that can only be packaged less Transaction Information. In order to improve the block chain network performance per second for being packaged number of transaction, existing solution is to pick out fixed several Possess the super node composition common recognition committee of stronger public credibility.Super node is as common recognition committeeman, to Transaction Information It knows together, generates the operation such as block.Since super node is fixed and invariable, theoretically for, who has no idea to guarantee Super node will not be conspired for interests, damage the interests of other nodes.
Conspire and damage other in conclusion currently needing to provide one kind and can successfully prevent common recognition committeeman The method of node interests.
Summary of the invention
In view of this, the present invention provides a kind of a kind of drawing method solved or part solves the above problems.
In a first aspect, the present invention provides a kind of drawing method, comprising:
Freeze a certain number of assets, to obtain the qualification with the first random number of assets respective numbers;
When become current block accounting nodes when, according to the accounting nodes of top n block held several second with Several second generating random number seed informations that the accounting nodes of machine number and current block are held, wherein N is positive integer, one A accounting nodes generate a block, and node obtains and generates N+1 the after the qualification of the first random number of assets respective numbers Two random numbers, and the cryptographic Hash of the N+1 held the second random numbers is broadcast to block chain network, and be chosen as book keeping operation section After point, the second held random number is broadcasted according to the rule of pre-configuration;
The first random number is generated according to seed information;
Judge whether present node is chosen for common recognition committee according to the difficulty value of the first random number and pre-configuration held Member can member;
The first held random number is broadcasted, and receives the first random number of other node broadcasts, first will held It is random by ranking results each first according to the rule of pre-configuration after the sequence of first random number of random number and other node broadcasts The corresponding common recognition committeeman of number is divided into accounting nodes and common recognition node.
Second aspect, the present invention also provides a kind of common recognition methods, comprising:
Block is generated after carrying out two stages ballot operation using BFT common recognition algorithm.
The third aspect, the present invention also provides a kind of equipment, including one or more processors and memory, wherein memory Comprising can by instruction that the one or more processors execute so that the one or more processors execute it is each according to the present invention The drawing method and common recognition method that embodiment provides.
Fourth aspect, the present invention also provides a kind of storage medium for being stored with computer program, which makes to count Calculation machine executes the drawing method that each embodiment provides according to the present invention and common recognition method.
Beneficial achievement of the invention are as follows:
The present invention devises a kind of drawing method, freezes a certain number of assets first, to obtain and assets respective numbers The first random number qualification;Secondly, when becoming the accounting nodes of current block, according to the accounting nodes of top n block institute Several second generating random number seed informations that the accounting nodes of several second random numbers and current block held are held, In, N is positive integer, and an accounting nodes generate a block, and node obtains the money with the first random number of assets respective numbers N+1 the second random numbers are generated after lattice, and the cryptographic Hash of the N+1 held the second random numbers is broadcast to block chain network, And after being chosen as accounting nodes, the second held random number is broadcasted according to the rule of pre-configuration;It is raw further according to seed information At the first random number;Judge whether present node is chosen for further according to the difficulty value of the first random number and pre-configuration held Know together committeeman;Finally, the first random number that broadcast is held, and the first random number of other node broadcasts is received, it will After the first random number sequence of the first random number and other node broadcasts held, according to the regular by ranking results of pre-configuration In the corresponding common recognition committeeman of each first random number method that is divided into accounting nodes and node of knowing together so that each round is total When knowledge, common recognition committeeman is made of different nodes, solve common recognition committeeman in order to obtain interests into The problem of row conspires and damages other node interests.
The present invention devises a kind of common recognition method that can execute above-mentioned drawing method, carries out two using BFT common recognition algorithm Block is generated after stage ballot operation, improves the block chain network performance per second for being packaged number of transaction.
Detailed description of the invention
By reading a detailed description of non-restrictive embodiments in the light of the attached drawings below, the application's is other Feature, objects and advantages will become more apparent upon:
Fig. 1 is a kind of flow chart for drawing method that one embodiment of the invention provides.
Fig. 2 is the schematic diagram of a scenario of step S13 in a kind of preferred embodiment shown in FIG. 1.
Fig. 3 is the flow chart of step S13 in a kind of preferred embodiment shown in FIG. 1.
Fig. 4 is the flow chart of step S15 in a kind of preferred embodiment shown in FIG. 1.
Fig. 5 is a kind of flow chart of preferred embodiment shown in FIG. 1.
Fig. 6 is a kind of flow chart for common recognition method that one embodiment of the invention provides.
Fig. 7 is a kind of structural schematic diagram for equipment that one embodiment of the invention provides.
Specific implementation method
The application is described in further detail with reference to the accompanying drawings and examples.It is understood that this place is retouched The specific embodiment stated is used only for explaining related invention, rather than the restriction to the invention.It also should be noted that in order to Convenient for description, part relevant to invention is illustrated only in attached drawing.It should be noted that in the absence of conflict, the application In embodiment and embodiment in feature can be combined with each other.It is described in detail this below with reference to the accompanying drawings and in conjunction with the embodiments Application.
Fig. 1 is a kind of flow chart for drawing method that one embodiment of the invention provides.As shown in Figure 1, in the present embodiment, The present invention provides a kind of drawing method, comprising:
S11: freezing a certain number of assets, to obtain the qualification with the first random number of assets respective numbers;
S13: when becoming the accounting nodes of current block, held according to the accounting nodes of top n block several the Several second generating random number seed informations that the accounting nodes of two random numbers and current block are held, wherein N is positive whole Number, an accounting nodes generate a block, and node, which is obtained, generates N+1 with after the qualification of the first random number of assets respective numbers A second random number, and the cryptographic Hash of the N+1 held the second random numbers is broadcast to block chain network, and be chosen as remembering After account node, the second held random number is broadcasted according to the rule of pre-configuration;
S15: the first random number is generated according to seed information;
S17: judge whether present node is chosen for altogether according to the difficulty value of the first random number and pre-configuration held Know committeeman;
S19: the first held random number of broadcast, and the first random number of other node broadcasts is received, by what is held After the sequence of first random number of the first random number and other node broadcasts, according to the regular by ranking results each first of pre-configuration The corresponding common recognition committeeman of random number is divided into accounting nodes and common recognition node.
Specifically, in this example, it is assumed that assets be assets token, it is available often to freeze 10000 assets tokens Obtain the qualification of 1 the first random number;Assuming that node E has 10000 assets tokens, the first random number that node E is held is small In the difficulty value of pre-configuration;N+1 the second random numbers are generated after the qualification of node 1 the first random number of acquisition, and will be held The cryptographic Hash of corresponding second random numbers of N+1 the second random number be broadcast to block chain network, and be chosen as accounting nodes Afterwards, the second held random number is broadcasted according to the rule of pre-configuration, wherein N is positive integer;Node A, node B, node C, section Point D is each to have 10000 assets tokens by oneself, respectively obtains the qualification for obtaining 1 random number;Node A is the area that block height is H The accounting nodes of block, node B are the accounting nodes for the block that block height is H+1, and node C is the block that block height is H+2 Accounting nodes, node D is the accounting nodes for the block that block height is H+3, and node E is the block that block height is H+4 Accounting nodes.
Assuming that N is 4,5 the second random numbers, respectively A1, A2 are generated after the qualification of node A 1 the first random number of acquisition, A3, A4, A5, and by the corresponding second random number cryptographic Hash hash (A1) of this 5 second random numbers, hash (A2), hash (A3), Hash (A4), hash (A5) are broadcast to block chain network;Node B obtain 1 the first random number qualification after generate 5 second with Machine number, respectively B1, B2, B3, B4, B5, and by the corresponding second random number cryptographic Hash hash (B1) of this 5 second random numbers, Hash (B2), hash (B3), hash (B4), hash (B5) are broadcast to block chain network;Node C obtains 1 the first random number Generate 5 the second random numbers after qualification, respectively C1, C2, C3, C4, C5, and by this 5 second random number corresponding second with Machine number cryptographic Hash hash (C1), hash (C2), hash (C3), hash (C4), hash (C5) are broadcast to block chain network;Node D 5 the second random numbers, respectively D1, D2, D3, D4, D5 are generated after obtaining the qualification of 1 the first random number, and by this 5 second The corresponding second random number cryptographic Hash hash (D1) of random number, hash (D2), hash (D3), hash (D4), hash (D5) broadcast To block chain network;5 the second random numbers, respectively E1, E2, E3 are generated after the qualification of node E 1 the first random number of acquisition, E4, E5, and by the corresponding second random number cryptographic Hash hash (E1) of this 5 second random numbers, hash (E2), hash (E3), Hash (E4), hash (E5) are broadcast to block chain network.
In step s 11, node E freezes 10000 assets tokens, and node F obtains the qualification for obtaining 1 random number;
In step s 13, node E is held according to the accounting nodes of preceding 4 blocks several second random numbers and current Several second generating random number seed informations that the accounting nodes of block are held;
In step S15, node E generates the first random number according to seed information;
In step S17, node E judges that present node is according to the difficulty value of the first random number and pre-configuration held It is no to be chosen for common recognition committeeman;Since the first random number of node E held is less than the difficulty value being pre-configured, Node E is chosen for common recognition committeeman.
In step S19, node E broadcasts held the first random number, and receives the first random of other node broadcasts Number will row according to the rule of pre-configuration after the sequence of the first random number of the first random number held and other node broadcasts The corresponding common recognition committeeman of each first random number is divided into accounting nodes and common recognition node in sequence result.
Fig. 2 is the schematic diagram of a scenario of step S13 in a kind of preferred embodiment shown in FIG. 1.As shown in Fig. 2, excellent one It selects in embodiment, the accounting nodes for the block that block height is H are node A, and the accounting nodes for the block that block height is H+1 are Node B, the accounting nodes for the block that block height is H+2 are node C, and the accounting nodes for the block that block height is H+3 are section Point D;Current block height is H+4, and the accounting nodes for the block that block height is H+4 are node E;Node E is according to preceding 4 blocks Accounting nodes, i.e. the book keeping operation section of several second random numbers and current block that node A, node B, node C, node D are held Several second generating random number seed informations that point, i.e. node E are held.
Fig. 3 is the flow chart of step S13 in a kind of preferred embodiment shown in FIG. 1.As shown in figure 3, preferred real one It applies in example, step S13 includes:
S131: 1 the second random number is respectively obtained from the second random number that each accounting nodes of top n block are held;
S133: 1 the second random number is obtained from several second random numbers that current accounting nodes are held;
S135: Hash operation will be carried out after acquired N+1 the second random number combinatorial operations, obtains seed information.
Specifically, by taking application scenarios shown in Fig. 2 as an example, it is assumed that current block height is H+4, and node E is that block is high Degree is the accounting nodes of the block of H+4.
In step S131,1 is respectively obtained from the second random number that node A, node B, node C, node D are held Two random numbers, for example, taking tetra- the second random numbers of A5, B4, C3, D2;
In step S133,1 the second random number is obtained from several second random numbers that node E is held, for example, taking E1;
In step S135, Hash operation is carried out after A5, B4, C3, D2, E1 combinatorial operation that will acquire, obtains seed letter Cease seed, seed=sha256 (A5+B4+C3+D2+E1).
It should be noted that in the present example, Hash operation uses sha256 () algorithm, seed information is obtained Take method are as follows: respectively obtain 1 second from the second random number that node A, node B, node C, node D are held first at random Secondly number obtains 1 the second random number, example for example, taking A5, B4, C3, D2 from several second random numbers that node E is held E1 is such as taken, Hash operation is carried out after A5, B4, C3, D2, E1 combinatorial operation that finally will acquire, seed information seed is obtained, more In more embodiments, Hash operation can be the algorithm that MD5, sha1, sha2 or other calculate cryptographic Hash;The acquisition side of seed information Method may is that respectively to obtain several from the second random number that each accounting nodes of top n block are held first second random Number, such as A5, B2, C1, C3, D2, secondly obtained from several second random numbers that current accounting nodes are held several the Two random numbers finally will carry out Hash operation after acquired N+1 the second random number combinatorial operations, obtain for example, taking E3, E4 To seed information, identical technical effect can be achieved.
In a preferred embodiment, after being chosen as accounting nodes, according to the rule of pre-configuration broadcast held second with The step of machine number includes:
It is random that node broadcasts held the one the second to block chain network when becoming the accounting nodes of current block Number;;
In next block height of current block, held the two the second random number is broadcasted;
In lower two block height of current block, held the three the second random number is broadcasted;
Repeat the above steps, until under current block when N number of block height, broadcast held N+1 second with Machine number;
Specifically, by taking application scenarios shown in Fig. 2 as an example, N 4, while by taking node A as an example, node A is that block height is The accounting nodes of the block of H;
When block height is H, node A is chosen as accounting nodes, and node A broadcasts held first to block chain network Second random number A5;
When block height is H+1, node A broadcasts held the two the second random number A4 to block chain network;
When block height is H+2, node A broadcasts held the three the second random number A3 to block chain network;
When block height is H+3, node A broadcasts held the four the second random number A2 to block chain network;
When block height is H+4, node A broadcasts held the five the second random number A1 to block chain network.
Knowing together committeeman can be by comparing the second random number and node A mono- that block chain network interior joint A is broadcasted The corresponding cryptographic Hash of the second random number for starting broadcast judges the correctness of the second random number of node A broadcast.
Fig. 4 is the flow chart of step S15 in a kind of preferred embodiment shown in Fig. 2.As shown in figure 4, preferred real one It applies in example, step S15 includes:
S151: Hash operation is carried out to the public key of seed information and present node, obtains the first cryptographic Hash;
S153: signing to the first cryptographic Hash by the private key of present node, generates signing messages;
S155: Hash operation is carried out to signing messages, obtains the first random number.
Specifically, node E carries out Hash fortune to the public key Pub (E) of seed information seed and node E in step S151 It calculates, obtains the first cryptographic Hash, hash1=sha256 (Head (H-1)+Pub (E));
In step S153, node E signs to the first cryptographic Hash hash1 by the private key Priv (E) of node E, raw At signing messages, sign=Sign (Priv (E), hash1);
In step S137, node E carries out Hash operation to signing messages sign, obtains the first random number, R=sha256 (sign)。
The generation of random number has randomness and verifiability, can neither be predicted be faked.It needs to illustrate It is that in the present example, Hash operation uses sha256 () algorithm, and the public information of a upper block is upper one The block head information of block;In more embodiments, Hash operation can be MD5, sha1, sha2 or other and calculate cryptographic Hash Algorithm, the public information of a upper block can be a block Mei Keergen or other public informations, can be achieved phase Same technical effect.
In a preferred embodiment, the size judgement of the difficulty value of random number and pre-configuration that present node is held is compared Whether present node is chosen for common recognition committeeman, if the random number that present node is held is less than the difficulty being pre-configured Value, then present node is chosen for common recognition committeeman.
In a preferred embodiment, the first random number that broadcast present node is held, and receive other node broadcasts After the first random number sequence of first random number, the first random number that present node is held and other node broadcasts, according to The corresponding common recognition committeeman of first random number each in ranking results is divided into accounting nodes and common recognition by the rule of pre-configuration Node includes:
First random number of the first random number and the other node broadcasts of reception that present node is held is ranked up behaviour Make;
The accounting nodes that node corresponding to the smallest first random number of numerical value is current block are chosen, accounting nodes are removed Outer common recognition committeeman is the common recognition node of current block.
Fig. 5 is a kind of flow chart of preferred embodiment shown in FIG. 1.As shown in figure 5, in a preferred embodiment, root The first random number is generated according to seed information, comprising:
Overtime duration is set;
When become current block accounting nodes when, according to the accounting nodes of top n block held several second with Several second generating random number seed informations that the accounting nodes of machine number and current block are held,
The first random number is generated according to seed information;
Judge whether present node is chosen for common recognition committee according to the difficulty value of the first random number and pre-configuration held Member can member;
In overtime duration, according to the threshold decision of common recognition committeeman's number and the common recognition committeeman's number being pre-configured Whether common recognition committeeman's number forms the complete common recognition committee, if it is not, not forming the common recognition committee then, does not divide note Account node and common recognition node.
Specifically, setting a length of 15s when overtime, setting participates in the common recognition committee of common recognition by taking application scenarios shown in Fig. 2 as an example Member meeting member shares 33, and in overtime duration, common recognition committeeman does not reach 33, the not formed common recognition committee.
In the step s 21, overtime duration, a length of 15s when overtime are set;
In step S23, several second random numbers that node E is held according to the accounting nodes of top n block and current Several second generating random number seed informations that the accounting nodes of block are held;
In step s 25, node E generates the first random number according to seed information;
In step s 27, node E judges that present node is according to the difficulty value of the first random number and pre-configuration held No to be chosen for common recognition committeeman, since the random number of node E is less than the difficulty value being pre-configured, node E is selected For the committeeman that knows together;
In step S29, node E is in overtime duration, according to the common recognition committee member of common recognition committeeman's number and pre-configuration Whether threshold decision common recognition committeeman's number of meeting number of members forms the complete common recognition committee, since in 15s, common recognition is entrusted Member meeting member does not reach 33, and the not formed common recognition committee does not divide accounting nodes and common recognition node.
In a preferred embodiment, when the upper not formed common recognition committee of block height, block chain network is being worked as The difficulty value that preceding block height adjustment is pre-configured, comprising:
The difficulty value that adjustment is pre-configured in current block height, in overtime duration, there is enough nodes selected It is taken as common recognition committeeman;
The complete common recognition committee is formed in overtime duration.
Specifically, the common recognition committeeman that setting participates in common recognition shares 33.Assuming that a upper block height is H+5, And in 15s, the random number that only 30 nodes are held is less than the difficulty value being pre-configured, the not formed common recognition committee.In area When block height is H+6, the difficulty value that the adjustment of block chain network is pre-configured, so that having more than or equal to 33 node quilts in 15s It is chosen for common recognition committeeman, to form the complete common recognition committee.
In this example, it is assumed that adjusting the difficulty value of pre-configuration by the value for changing degree-of-difficulty factor.Assuming that being pre-configured Difficulty value D and degree-of-difficulty factor C relationship are as follows: D=33*C;Since a upper block height is H+5, and in 15s, only 30 The random number that a node is held is less than the difficulty value being pre-configured, the not formed common recognition committee, therefore is H+6 in block height When, degree-of-difficulty factor C should be increased, to increase difficulty value D;The numerical value of the difficulty value D of pre-configuration is higher, and node more readily satisfies institute The random number R held is less than the condition for the difficulty value D being pre-configured, and in overtime duration 15s, has enough nodes to be chosen for altogether Committeeman is known, so that block height be allow to be that the block of H+6 forms the complete common recognition committee.It should be noted that In more embodiments, the difficulty value being pre-configured can be changed by other algorithms such as addition, multiplication, identical skill can be achieved Art effect.
Fig. 6 is a kind of flow chart for common recognition method that one embodiment of the invention provides.As shown in fig. 6, in the present embodiment, The present invention provides a kind of common recognition method, comprising:
S31: block is generated after carrying out two stages ballot operation using BFT common recognition algorithm.
In a preferred embodiment, when accounting nodes generate correct block, accounting nodes will acquire certain number Assets are as reward.
In a preferred embodiment, it block is generated to accounting nodes when common recognition node makes two stages and correctly vote operation Afterwards, common recognition node will acquire the assets of certain number as reward.
Fig. 7 is a kind of structural schematic diagram for equipment that one embodiment of the invention provides.
As shown in fig. 7, present invention also provides a kind of equipment 700, including one or more centres as on the other hand Unit (CPU) 701 is managed, can be added according to the program being stored in read-only memory (ROM) 702 or from storage section 708 The program that is downloaded in random access storage device (RAM) 703 and execute various movements appropriate and processing.In RAM703, also deposit It contains equipment 800 and operates required various programs and data.CPU701, ROM702 and RAM703 pass through the phase each other of bus 704 Even.Input/output (I/O) interface 705 is also connected to bus 704.
I/O interface 705 is connected to lower component: the importation 706 including keyboard, mouse etc.;It is penetrated including such as cathode The output par, c 707 of spool (CRT), liquid crystal display (LCD) etc. and loudspeaker etc.;Storage section 708 including hard disk etc.; And the communications portion 709 of the network interface card including LAN card, modem etc..Communications portion 709 via such as because The network of spy's net executes communication process.Driver 710 is also connected to I/O interface 705 as needed.Detachable media 711, such as Disk, CD, magneto-optic disk, semiconductor memory etc. are mounted on as needed on driver 710, in order to read from thereon Computer program be mounted into storage section 708 as needed.
Particularly, in accordance with an embodiment of the present disclosure, the equity of any of the above-described embodiment description proves that common recognition method can be by It is embodied as computer software programs.For example, embodiment of the disclosure includes a kind of computer program product comprising visibly wrap Containing computer program on a machine-readable medium, the computer program includes for executing drawing method and method of knowing together Program code.In such embodiments, which can be downloaded and be pacified from network by communications portion 709 Dress, and/or be mounted from detachable media 711.
As another aspect, present invention also provides a kind of computer readable storage medium, the computer-readable storage mediums Matter can be computer readable storage medium included in the device of above-described embodiment;It is also possible to individualism, it is unassembled Enter the computer readable storage medium in equipment.Computer-readable recording medium storage has one or more than one program, should Program is used to execute the drawing method and common recognition method for being described in the application by one or more than one processor.
Flow chart and block diagram in attached drawing are illustrated according to the system of various embodiments of the invention, method and computer journey The architecture, function and operation in the cards of sequence product.In this regard, each box in flowchart or block diagram can generation A part of one module, program segment or code of table, a part of the module, program segment or code include one or more use The executable instruction of the logic function as defined in realizing.It should also be noted that in some implementations as replacements, being marked in box The function of note can also occur in a different order than that indicated in the drawings.For example, two boxes succeedingly indicated are actually It can be basically executed in parallel, they can also be executed in the opposite order sometimes, this is depending on related function.Also it wants It is noted that the combination of each box in block diagram and or flow chart and the box in block diagram and or flow chart, Ke Yitong The dedicated hardware based system of functions or operations as defined in executing is crossed to realize, or by specialized hardware and can be calculated The combination of machine instruction is realized.
The foregoing is merely the preferred embodiments of the invention, the claims that are not intended to limit the invention. Simultaneously it is described above, for those skilled in the technology concerned it would be appreciated that and implement, therefore other be based on institute of the present invention The equivalent change that disclosure is completed, should be included in the covering scope of the claims.

Claims (13)

1. a kind of drawing method characterized by comprising
Freeze a certain number of assets, to obtain the qualification with the first random number of assets respective numbers;
When becoming the accounting nodes of current block, several second random numbers for being held according to the accounting nodes of top n block And several second generating random number seed informations that the accounting nodes of current block are held, wherein N is positive integer, a note Account node generates a block, node obtain generate after the qualification with the first random number of assets respective numbers N+1 second with Machine number, and the cryptographic Hash of the N+1 held the second random numbers is broadcast to block chain network, and be chosen as accounting nodes Afterwards, the second held random number is broadcasted according to the rule of pre-configuration;
First random number is generated according to the seed information;
Judge whether present node is chosen for the common recognition committee according to the difficulty value of the first random number and pre-configuration held Member;
The first held random number is broadcasted, and receives the first random number of other node broadcasts, it is random by held first After several the first random number sequences with other node broadcasts, according to the regular by the first random number pair each in ranking results of pre-configuration The common recognition committeeman answered is divided into accounting nodes and common recognition node.
2. the method according to claim 1, wherein it is described when become current block accounting nodes when, according to Several second random numbers that the accounting nodes of several second random numbers and current block that top n accounting nodes are held are held Generate seed information, comprising:
1 the second random number is respectively obtained from the second random number that each accounting nodes of top n block are held;
1 the second random number is obtained from several second random numbers that current accounting nodes are held;
Hash operation will be carried out after acquired N+1 the second random number combinatorial operations, obtains seed information.
3. the method according to claim 1, wherein it is described be chosen as accounting nodes after, according to the rule of pre-configuration Then broadcast the second held random number, comprising:
When becoming the accounting nodes of current block, held the one the second random number is broadcasted to block chain network;
In next block height of the current block, held the two the second random number is broadcasted to block chain network;
In lower two block height of the current block, held the three the second random number is broadcasted to block chain network;
It repeats the above steps, until being held under the current block when N number of block height to the broadcast of block chain network The second random number of N+1.
4. the method according to claim 1, wherein described generate described first at random according to the seed information Number, comprising:
Hash operation is carried out to the public key of the seed information and present node, obtains the first cryptographic Hash;
It is signed by the private key of present node to first cryptographic Hash, generates signing messages;
Hash operation is carried out to the signing messages, obtains first random number.
5. the method according to claim 1, wherein described according to the first random number held and pre-configuration Difficulty value judges whether present node is chosen for common recognition committeeman, comprising:
The size of the difficulty value of held the first random number and pre-configuration is compared, if the first random number held is less than prewired The difficulty value set then is chosen for common recognition committeeman.
6. the method according to claim 1, wherein described broadcast the first held random number, and receiving it First random number of its node broadcasts, after the sequence of the first random number of the first random number held and other node broadcasts, Common recognition committeeman is divided into accounting nodes according to the rule of pre-configuration and common recognition node includes:
The first random number held and the first random number for receiving other node broadcasts are ranked up operation;
The accounting nodes that node corresponding to the smallest first random number of numerical value is current block are chosen, the accounting nodes are removed The outer common recognition committeeman is the common recognition node of current block.
7. the method according to claim 1, wherein described generate described first at random according to the seed information Number, comprising:
Overtime duration is set;
When becoming the accounting nodes of current block, several second random numbers for being held according to the accounting nodes of top n block And the second generating random number seed information that several present nodes are held;
The first random number is generated according to the seed information;
Judge whether present node is chosen for the common recognition committee according to the difficulty value of the first random number and pre-configuration held Member;
In overtime duration, according to the threshold decision of common recognition committeeman's number and the common recognition committeeman's number being pre-configured Whether common recognition committeeman's number forms the complete common recognition committee, if it is not, the then not formed common recognition committee, does not divide note Account node and common recognition node.
8. the method according to the description of claim 7 is characterized in that the not formed common recognition committee of upper block height When, difficulty value of the block chain network in the adjustment pre-configuration of current block height, comprising:
The difficulty value that adjustment is pre-configured in current block height, for thering are enough nodes to be chosen in overtime duration Know together committeeman;
The complete common recognition committee is formed in overtime duration.
9. a kind of common recognition method, which is characterized in that the common recognition method is by such as described in any item drawing methods of claim 1-8 Selected node executes, comprising:
Block is generated after carrying out two stages ballot operation using BFT common recognition algorithm.
10. according to the method described in claim 9, it is characterized in that, when the accounting nodes generate correct block when, it is described Accounting nodes will acquire the assets of certain number as reward.
11. according to the method described in claim 9, it is characterized in that, when the common recognition node is to the accounting nodes generation area Block makes two stages and correctly votes after operation, and the common recognition node will acquire the assets of certain number as reward.
12. a kind of equipment, which is characterized in that the equipment includes:
One or more processors;
Memory, for storing one or more programs,
When one or more of programs are executed by one or more of processors, so that one or more of processors Execute such as method of any of claims 1-11.
13. a kind of storage medium for being stored with computer program, which is characterized in that realize when the program is executed by processor as weighed Benefit requires method described in any one of 1-11.
CN201810805421.XA 2018-07-20 2018-07-20 Lottery drawing method, consensus method, device and storage medium Active CN108964878B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810805421.XA CN108964878B (en) 2018-07-20 2018-07-20 Lottery drawing method, consensus method, device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810805421.XA CN108964878B (en) 2018-07-20 2018-07-20 Lottery drawing method, consensus method, device and storage medium

Publications (2)

Publication Number Publication Date
CN108964878A true CN108964878A (en) 2018-12-07
CN108964878B CN108964878B (en) 2021-05-11

Family

ID=64482124

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810805421.XA Active CN108964878B (en) 2018-07-20 2018-07-20 Lottery drawing method, consensus method, device and storage medium

Country Status (1)

Country Link
CN (1) CN108964878B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20230059580A1 (en) * 2021-08-11 2023-02-23 International Business Machines Corporation Blockchain with random committee selection

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106850536A (en) * 2016-11-30 2017-06-13 北京瑞卓喜投科技发展有限公司 Block chain common recognition method and system
CN107464106A (en) * 2017-07-25 2017-12-12 北京果仁宝科技有限公司 The method and system merchandised between block chain main chain and side chain
CN107679857A (en) * 2017-10-10 2018-02-09 马晶瑶 Across the chain method of commerce and storage medium of block chain
CN108108487A (en) * 2018-01-10 2018-06-01 杭州复杂美科技有限公司 A kind of common recognition method of block chain
US20180181979A1 (en) * 2016-12-26 2018-06-28 International Business Machines Corporation Incentive-based crowdvoting using a blockchain

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106850536A (en) * 2016-11-30 2017-06-13 北京瑞卓喜投科技发展有限公司 Block chain common recognition method and system
US20180181979A1 (en) * 2016-12-26 2018-06-28 International Business Machines Corporation Incentive-based crowdvoting using a blockchain
CN107464106A (en) * 2017-07-25 2017-12-12 北京果仁宝科技有限公司 The method and system merchandised between block chain main chain and side chain
CN107679857A (en) * 2017-10-10 2018-02-09 马晶瑶 Across the chain method of commerce and storage medium of block chain
CN108108487A (en) * 2018-01-10 2018-06-01 杭州复杂美科技有限公司 A kind of common recognition method of block chain

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
翟社平 等: "区块链技术:应用及问题", 《西安邮电大学学报》 *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20230059580A1 (en) * 2021-08-11 2023-02-23 International Business Machines Corporation Blockchain with random committee selection

Also Published As

Publication number Publication date
CN108964878B (en) 2021-05-11

Similar Documents

Publication Publication Date Title
CN108964879A (en) A kind of drawing method, common recognition method, equipment and storage medium
CN109067516A (en) A kind of drawing method, common recognition method, equipment and storage medium
CN108984662A (en) A kind of block chain method of data synchronization
Ying et al. Bi-objective reentrant hybrid flowshop scheduling: an iterated Pareto greedy algorithm
CN109360091A (en) A kind of arbitrary object choosing method and device based on block chain
US20200311586A1 (en) Online Trained Object Property Estimator
CN109377225A (en) Transaction allocation method, common recognition method, equipment and storage medium
JP2013156763A (en) Diagram generating program, method for generating program, and diagram generating device
Lu et al. Show me the money: Dynamic recommendations for revenue maximization
CN110276060B (en) Data processing method and device
CN108418876B (en) Store proof of work method and system, motivational techniques and system
Liu Single machine scheduling to minimize maximum lateness subject to release dates and precedence constraints
CN110321738A (en) Information processing method and device
CN109889397A (en) Drawing method, block generation method, equipment and storage medium
CN109447639A (en) Privacy transactions balances scan method, equipment and storage medium
Zufferey Optimization by ant algorithms: possible roles for an individual ant
CN110149335A (en) Establish the method and apparatus of the home zone for the protection of block chain data-privacy
CN108964878A (en) A kind of drawing method, common recognition method, equipment and storage medium
Sun et al. The fast heuristic algorithms and post-processing techniques to design large and low-cost communication networks
CN109559176A (en) A kind of bookkeeping methods and device of electronic invoice
CN110059097A (en) Data processing method and device
Engau et al. On handling cutting planes in interior-point methods for solving semi-definite relaxations of binary quadratic optimization problems
CN115270923A (en) Scene-based visual intelligent decision method and system
CN106469173B (en) A kind of other Weight Determination of problem priority, device, system and server
CN107391533A (en) Generate the method and device of graphic data base Query Result

Legal Events

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