CN110245949A - It is related to the packaging method and device of block chain - Google Patents

It is related to the packaging method and device of block chain Download PDF

Info

Publication number
CN110245949A
CN110245949A CN201910519266.XA CN201910519266A CN110245949A CN 110245949 A CN110245949 A CN 110245949A CN 201910519266 A CN201910519266 A CN 201910519266A CN 110245949 A CN110245949 A CN 110245949A
Authority
CN
China
Prior art keywords
block
cryptographic hash
node
block node
hash
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
CN201910519266.XA
Other languages
Chinese (zh)
Other versions
CN110245949B (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.)
Beijing Ai Morui Strategic Technology Co Ltd
Original Assignee
Beijing Ai Morui Strategic 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 Beijing Ai Morui Strategic Technology Co Ltd filed Critical Beijing Ai Morui Strategic Technology Co Ltd
Priority to CN201910519266.XA priority Critical patent/CN110245949B/en
Publication of CN110245949A publication Critical patent/CN110245949A/en
Application granted granted Critical
Publication of CN110245949B publication Critical patent/CN110245949B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/22Indexing; Data structures therefor; Storage structures
    • G06F16/2228Indexing structures
    • G06F16/2255Hash tables
    • 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/3829Payment protocols; Details thereof insuring higher security of transaction involving key management
    • 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

Abstract

The present embodiments relate to a kind of packaging methods and device for being related to block chain.Include: to generate the first block, the first Hash operation is carried out according to first block and obtains the first cryptographic Hash;Other nodes into the multiple block node out send first cryptographic Hash;Determine the second cryptographic Hash of the multiple block node out;According to the size of the multiple second cryptographic Hash of block node out, the second cryptographic Hash of specified quantity is selected;4th Hash operation is carried out to the second cryptographic Hash of the specified quantity, obtains the 4th cryptographic Hash;According to the 4th cryptographic Hash and preset random rule, selects second to go out block node as the second block in the multiple block node out and go out block node.With this, block node can specify next block node out out, which has certain randomness and verifiability, can reduce block chain by the possibility of success attack, and improve the block efficiency out of block chain meshed network, and then improve book keeping operation efficiency.

Description

It is related to the packaging method and device of block chain
Technical field
The present invention relates to field of computer technology more particularly to a kind of packaging methods and device for being related to block chain.
Background technique
Each of block chain network node is equivalent to store each computer of all block datas or service Device terminal.The production of all new blocks, and the verifying and record keeping of transaction, and it is synchronous to be broadcasted to the whole network, all by node Lai It completes.
Node is exactly the miner that we are commonly called as.The different of each miner calculate power, determine it can be assigned to how many record keeping Power harvests how many rewards.
The block chain first generation knows together mechanism POW, is exactly proof of work common recognition mechanism, is commonly called as digging mine.It is new to produce Block, must just carry out the operation of thousands of secondary Hash collisions.And these operations, many electric power can be consumed, the energy is caused Waste, therefore also by dirty disease.Everybody is more allowed to worry, once most of power of calculating is monopolized, decentralization is just on the hazard.
The second generation knows together mechanism POS, is exactly that equity proves common recognition mechanism, it is to be determined according to quantity with cash in hand with the time Who possesses more billing rights.The advantages of this common recognition mechanism is can be to avoid energy consumption, but the disadvantage is that right of speech is all held Coin rich and influential family is controlled, and centralized feature is formed, and also the original intention with block chain decentralization runs in the opposite direction.
Third generation common recognition mechanism is exactly DPOS, maximum feature, is exactly to be added on the basis that POS equity proves Electoral system.The super node for the final acquisition billing right being born by all votes by ballot of user with cash in hand is kept accounts, can To significantly reduce the waste of the energy, still, on the super node all concentrated due to operation, to the calculation force request of super node It is higher, and the efficiency of super node directly affects the efficiency of book keeping operation, this is resulted in, this kind of mode copes with the ability of large-scale data Not strong, development is restricted.
Summary of the invention
Based on the above issues, the embodiment of the invention provides a kind of packaging methods and device for being related to block chain.
In a first aspect, being related to the packaging method of block chain the embodiment of the invention provides a kind of.The block chain node net Network includes multiple block nodes out, and the method is suitable for first and goes out block node, and described first goes out block node for the multiple block out Any one in node, which comprises
The first block is generated, the first Hash operation is carried out according to first block and obtains the first cryptographic Hash;
Other nodes into the multiple block node out send first cryptographic Hash;
Determine the second cryptographic Hash of the multiple block node out, the second cryptographic Hash of each block node out is by breathing out third Uncommon value and the first numerical value that should go out block node carry out the second Hash operation and obtain;The third cryptographic Hash by the second block into Row third Hash operation obtains;First numerical value of each block node out goes out block node to the signature of first cryptographic Hash according to this It determines;Second block is next block of first block;
According to the size of the multiple second cryptographic Hash of block node out, the second cryptographic Hash of specified quantity is selected;
4th Hash operation is carried out to the second cryptographic Hash of the specified quantity, obtains the 4th cryptographic Hash;
According to the 4th cryptographic Hash and preset random rule, selection second goes out block in the multiple block node out Node goes out block node as second block.
In some embodiments, the method also includes:
It signs to first cryptographic Hash, obtains the described first the first digital signature for going out block node;
The 5th Hash operation of the first digital signature progress for going out block node to described first obtains described first and goes out block node The first numerical value.
In some embodiments, further includes:
The 5th cryptographic Hash that third goes out the transmission of block node is received, the 5th cryptographic Hash is that the third goes out block node to the Three blocks carry out the first Hash operation and obtain;
It signs to the 5th cryptographic Hash, obtains the described first the second digital signature for going out block node;
The 5th Hash operation of the second digital signature progress for going out block node to described first obtains described first and goes out block node Second value;
Third Hash operation is carried out according to the 4th block and obtains the 6th cryptographic Hash, and the 4th block is the third block Next block;
The second Hash operation, which is carried out, according to the second value that the 6th cryptographic Hash and described first go out block node obtains institute State the first the 7th cryptographic Hash for going out block node;
Go out described the first of the transmission of block node the 7th cryptographic Hash for going out block node to described second.
In some embodiments, described that 4th Hash operation is carried out to the specified quantity the second cryptographic Hash, obtain the Four cryptographic Hash, comprising:
The second cryptographic Hash of the specified quantity and third value are subjected to the 4th Hash operation and obtain the 4th cryptographic Hash, institute Stating third value is the sequence number that 1-n or described first goes out block node, and the n is arbitrary value.
In some embodiments, the preset random rule includes:
4th cryptographic Hash is converted into 10 systems, and takes the remainder of the quantity of the multiple verifying node;
Determine that the corresponding verifying node of the remainder goes out block node for described second.
In some embodiments, further includes:
First digital signature is sent to the multiple block node out.
In some embodiments, further includes:
It receives the 4th and goes out the third digital signature that block node is sent, the third digital signature is directed to the 4th block;It uses 4th, which goes out the third digital signature that public key described in block node goes out block node to the described 4th, verifies, and obtains first and goes out block node The 8th cryptographic Hash;
First Hash operation is carried out to the 4th block and obtains the 9th cryptographic Hash;
If the 8th cryptographic Hash is identical with the 9th cryptographic Hash, according to the tenth Hash of the multiple block node out The size of value selects the tenth cryptographic Hash of specified quantity;Tenth cryptographic Hash of each block node out passes through to the 11st cryptographic Hash The second Hash operation is carried out with the 4th numerical value for going out block node to obtain;11st cryptographic Hash is by carrying out the 5th block Third Hash operation obtains;4th numerical value of each block node out is true to the signature of the 8th cryptographic Hash according to that should go out block node It is fixed;5th block is next block of the 4th block
4th Hash operation is carried out to the tenth cryptographic Hash of the specified quantity, obtains the 12nd cryptographic Hash;
According to the 12nd cryptographic Hash and preset random rule, judge that described first goes out whether block node is described 5th block goes out block node;
If so, being packaged to the 5th block.
In some embodiments, described according to the 12nd cryptographic Hash and preset random rule, judge described One go out block node whether be the 5th block go out block node include:
According to the 12nd cryptographic Hash and preset random rule, the serial number for going out block node of the 5th block is determined;
Judge the 5th block go out block node serial number whether be described first go out block node serial number described more In a block node out.
Second aspect provides and a kind of is related to the packing apparatus of block chain.The block chain meshed network include it is multiple go out Block node, described device be suitable for first go out block node, described first go out block node be it is the multiple go out block node in it is any One, described device includes:
Hash units carry out the first Hash operation according to first block and obtain the first Kazakhstan for generating the first block Uncommon value;
Transmission unit sends first cryptographic Hash for other nodes into the multiple block node out;
Determination unit, for determining the second cryptographic Hash of the multiple block node out, the second Hash of each block node out Value is obtained by carrying out the second Hash operation with the first numerical value that should go out block node to third cryptographic Hash;The third cryptographic Hash is logical It crosses and the second block progress third Hash operation is obtained;It is each go out block node the first numerical value according to should out block node to described the The signature of one cryptographic Hash determines;Second block is next block of first block;
Selecting unit, for according to it is the multiple go out block node the second cryptographic Hash size, select specified quantity the Two cryptographic Hash;
Hash units are also used to, and are carried out the 4th Hash operation to the second cryptographic Hash of the specified quantity, are obtained the 4th Kazakhstan Uncommon value;
Selecting unit is also used to, according to the 4th cryptographic Hash and preset random rule, in the multiple block section out It selects second to go out block node as second block in point and goes out block node in the multiple block node out.
In some embodiments, further includes:
Signature unit obtains the described first the first number for going out block node for signing to first cryptographic Hash Signature;
Hash units, the 5th Hash operation of the first digital signature progress for going out block node to described first obtain described First goes out the first numerical value of block node.
In some embodiments, further includes:
Receiving unit, the 5th cryptographic Hash of block node transmission is gone out for receiving third, and the 5th cryptographic Hash is described the Three, which go out block node, obtains the first Hash operation of third block progress;
Signature unit obtains the described first the second number for going out block node for signing to the 5th cryptographic Hash Signature;
Hash units, the 5th Hash operation of the second digital signature progress for going out block node to described first obtain described First goes out the second value of block node;
Hash units obtain the 6th cryptographic Hash, the 4th block for carrying out third Hash operation according to the 4th block For the lower block of the third block;
Hash units, the second value for going out block node according to the 6th cryptographic Hash and described first carry out second and breathe out Uncommon operation obtains the described first the 7th cryptographic Hash for going out block node;
Transmission unit, for going out described the first of the transmission of block node the 7th cryptographic Hash for going out block node to described second.
In some embodiments, hash units are specifically used for:
The second cryptographic Hash of the specified quantity and third value are subjected to the 4th Hash operation and obtain the 4th cryptographic Hash, institute Stating third value is the sequence number that 1-n or described first goes out block node, and the n is arbitrary value.
In some embodiments, the preset random rule includes:
4th cryptographic Hash is converted into 10 systems, and takes the remainder of the quantity of the multiple verifying node;
Determine that the corresponding verifying node of the remainder goes out block node for described second.
In some embodiments, further includes:
Transmission unit, for sending first digital signature to the multiple block node out.
In some embodiments, further includes:
Receiving unit goes out the third digital signature that block node is sent for receiving the 4th, and the third digital signature is directed to 4th block;
Authentication unit, for use the 4th go out block node described in public key to the described 4th go out block node third digital signature It is verified, obtains the first the 8th cryptographic Hash for going out block node;
Hash units obtain the 9th cryptographic Hash for carrying out the first Hash operation to the 4th block;
Selecting unit, if identical with the 9th cryptographic Hash for the 8th cryptographic Hash, according to the multiple block out The size of tenth cryptographic Hash of node selects the tenth cryptographic Hash of specified quantity;Tenth cryptographic Hash of each block node out passes through 11st cryptographic Hash and the second Hash operation of the 4th numerical value progress that should go out block node are obtained;11st cryptographic Hash passes through Third Hash operation is carried out to the 5th block to obtain;4th numerical value of each block node out goes out block node to the described 8th according to this The signature of cryptographic Hash determines;5th block is next block of the 4th block
Hash units obtain the 12nd Kazakhstan for carrying out the 4th Hash operation to the tenth cryptographic Hash of the specified quantity Uncommon value;
Judging unit, for judging that described first goes out block according to the 12nd cryptographic Hash and preset random rule Node whether be the 5th block go out block node;
Packaged unit, if so, for being packaged to the 5th block.
In some embodiments, judging unit is specifically used for:
According to the 12nd cryptographic Hash and preset random rule, the serial number for going out block node of the 5th block is determined;
Whether the serial number for going out block node for judging the 5th block is the described first serial number for going out block node.
The third aspect, this specification embodiment provide a kind of computer equipment, including memory, processor and are stored in On memory and the computer program that can run on a processor, which is characterized in that the processor executes real when described program Either side or various method and steps in existing aforementioned first aspect or second aspect.
Fourth aspect provides a kind of computer readable storage medium, and meter is stored on the computer readable storage medium Calculation machine program, the computer program realize either side or more in above-mentioned first aspect or second aspect when being executed by processor Method described in aspect.
5th aspect, provides a kind of computer program product comprising instruction, when described instruction is run on computers When, so that computer executes in above-mentioned first aspect or second aspect method described in either side or various aspects.
Through the embodiment of the present invention, out block node can specify it is next go out block node, the assignment procedure have it is certain with Machine and verifiability can reduce block chain by the possibility of success attack, and improve the block out of block chain meshed network Efficiency, and then book keeping operation efficiency is improved, allow block chain meshed network should the bigger service scenarios of data scale.
Detailed description of the invention
Fig. 1 applies the exemplary architecture of embodiment provided by the present application;
Fig. 2 is a kind of flow chart for the packaging method for being related to block chain provided in an embodiment of the present invention;
Fig. 3 is a kind of structural schematic diagram of the device of the release information based on block chain provided in an embodiment of the present invention;
Fig. 4 shows a kind of computer equipment structural schematic diagram provided by this specification embodiment.
Specific embodiment
In order to make the object, technical scheme and advantages of the embodiment of the invention clearer, below in conjunction with the embodiment of the present invention In attached drawing, technical scheme in the embodiment of the invention is clearly and completely described, it is clear that described embodiment is A part of the embodiment of the present invention, instead of all the embodiments.Based on the embodiments of the present invention, those of ordinary skill in the art Every other embodiment obtained without making creative work, shall fall within the protection scope of the present invention.
The embodiment of the invention provides a kind of packaging methods and device for being related to block chain.Fig. 1 is shown using the application The exemplary architecture of the embodiment of offer.
As shown in Figure 1, the exemplary architecture may include multiple block chain nodes, multiple block chain node may include Multiple block node 101 and multiple verifying nodes 102 out.In one example, should go out block node can be to be selected by election mechanism The quantity of the multiple super nodes selected, the super node can determine according to actual needs, and the quantity of the super node can be Odd number, such as 21.In another example, multiple verifying node can be alternate node, wherein the super node can Think and chosen from alternate node, the quantity of the alternate node can also determine according to actual needs, for example, can be 100, Wherein, alternate node can be selected according to preset random rule, for example, calculating the highest specified quantity node of power can be with Alternately node.In another example, verifying node can also be all or part of node in addition to block node out.Its In, block chain node can be realized in a software form, can also realize in the form of hardware.When implemented in hardware, it can be Laptop, desktop computer and mobile terminal etc..
Block node is mainly used for based on common recognition mechanism out, the data in system in designated time period is produced block, also It is primarily used for keeping accounts.Verifying node is mainly used for based on common recognition mechanism, and the block generated to block node out is verified, and passes through The block of verifying can be recorded in block chain.It is can communicate between node to synchronize the data such as block chain.For example, section It can be communicated based on D2D agreement between point.
In order to facilitate understanding of embodiments of the present invention, it is further explained below in conjunction with attached drawing with specific embodiment Bright, embodiment does not constitute the restriction to the embodiment of the present invention.
Fig. 2 is a kind of flow chart for the packaging method for being related to block chain provided by the invention.The block chain meshed network packet The block chain meshed network in multiple block nodes, such as exemplary architecture shown in FIG. 1 out is included, this method is suitable for first and goes out block Node, this first go out block node be it is multiple go out block nodes in any one.As shown in Fig. 2, this method specifically includes:
S210 generates the first block, carries out the first Hash operation according to first block and obtains the first cryptographic Hash.
Wherein, each node in block chain meshed network is run based on common recognition mechanism.The common recognition mechanism is predefined, The common recognition mechanism, which can wrap, includes block common recognition mechanism, verifying common recognition mechanism etc..
Block node out in block chain meshed network can determine that first goes out block node according to the common recognition mechanism of block out, this first The data in system in designated time period can be generated block by block node out.The designated time period can according to actual needs really It is fixed, such as can be 1 second, 10 seconds, 3 minutes or 10 minutes etc..The system can be corresponding whole for the block chain meshed network A block catenary system.Wherein, block chain has multiple blocks to constitute, and each block can carry the mark of a block The storage organization of chain type is formed.
Current block chain node is generating block it needs to be determined that next node for needing to generate block, the current block chain Node is properly termed as first and goes out block node, which is properly termed as second and goes out block node, deserve The block that preceding block chain link point generates is properly termed as the first block, and the block which generates can To be known as the second block.
In order to increase the efficiency for going out the selection of block node of node, reduce the burden of system, next block node out is being selected When, the first Hash operation can be carried out to the first block, obtain the first cryptographic Hash.Wherein, verifying common recognition mechanism may include pre- First Hash operation of definition, which can determine according to actual needs, for example, the first Hash operation can be SHA-256 etc..
S220, other nodes into the multiple block node out send first cryptographic Hash;
Multiple block node out can go out block node for whole.
S230 determines the second cryptographic Hash of the multiple block node out.
Wherein, the secondth cryptographic Hash for each going out block node passes through to third cryptographic Hash and the first numerical value for being somebody's turn to do block node The second Hash operation is carried out to obtain;Third cryptographic Hash carries out third Hash operation according to second block and obtains;Each go out block First numerical value of node is determining to the signature of first cryptographic Hash according to that should go out block node, and the second block is first block Next block.
Each go out block node to sign to the first cryptographic Hash, obtains first digital signature for block node;Block should be gone out First digital signature of node can be used as first numerical value for block node.Alternatively, each going out block node goes out block node to this The first digital signature carry out third Hash operation obtain first numerical value for block node.
In one example, first go out block node can sign to first cryptographic Hash, obtain described first and go out First digital signature of block node;The first digital signature that first, which goes out block node, can go out block node to described first carries out the 5th Hash operation obtains the described first the first numerical value for going out block node.
Each block chain node may include at least one secret key pair, and each secret key pair includes a public key and a private Key, the private key can store in local, which can be sent to other block chain nodes.
Currently go out block node after determining the first cryptographic Hash, can sign to first cryptographic Hash, obtains the first number Word signature.First signature for going out block node can be used the private key for block node and sign, corresponding using the private key Public key can verify first signature for block node.
This method can also comprise determining that third cryptographic Hash, third cryptographic Hash carry out third Hash fortune according to the second block It obtains.
The third cryptographic Hash can be calculated by each going out block node.Then, each going out block node can be by the third Cryptographic Hash and the first numerical value that should go out block node carry out the second Hash operation and obtain second cryptographic Hash for block node.
In one example, first go out block node sign to the first cryptographic Hash, obtain first go out block node first Digital signature;The first digital signature for going out block node to first carries out the 5th Hash operation and obtains that described first goes out block node One numerical value;Third Hash operation, which is carried out, according to the second block obtains third cryptographic Hash;Go out block section according to third cryptographic Hash and first First numerical value of point carries out the second Hash operation and obtains the described first the second cryptographic Hash for going out block node.
S240 selects the second cryptographic Hash of specified quantity according to the size of multiple second cryptographic Hash of block node out.
Wherein it is possible to be ranked up to the second cryptographic Hash of multiple block nodes out, select numerical value is larger or smaller to specify The second cryptographic Hash of quantity.The specified quantity can determine according to actual needs, for example, the specified quantity can be 2.
S250 carries out the 4th Hash operation to the second cryptographic Hash of the specified quantity, obtains the 4th cryptographic Hash.
When determining next block node out, the 4th Hash operation can be carried out to the second cryptographic Hash of specified quantity, obtained To the 4th cryptographic Hash.Wherein, block common recognition mechanism may include predefined 4th Hash operation out, which can be with Determine according to actual needs, for example, the 4th Hash operation can be SHA-256 etc..
S260, according to the 4th cryptographic Hash and preset random rule, it is the multiple go out block node in select the Two, which go out block node as second block, goes out block node.
When determining next block node out, can be selected according to the 4th cryptographic Hash.Wherein, block common recognition mechanism can out To include the preset random rule of selection gist, the preset random rule is with certain randomness and verifiability.
In one example, which may include:
4th cryptographic Hash is converted into 10 systems, and takes the remainder of the 4th numerical value;
Determine that the corresponding verifying node of the remainder goes out block node for second.
Wherein, the 4th numerical value can be determined according to the quantity of verifying node.For example, the quantity of verifying node can be 100, which can be 100.
Wherein, the 4th cryptographic Hash ensure that randomness, the determination of the 4th cryptographic Hash and preset random rule, ensure that This second go out block node verifiability.
In embodiments of the present invention, the first Hash operation, the second Hash operation, third Hash operation, the 4th Hash operation, Any two operation in 5th Hash operation can be identical or different Hash operation.In an example, the first Hash Operation, the second Hash operation, third Hash operation, the 4th Hash operation, the 5th Hash operation can be identical Hash operation, In another example, the first Hash operation, the second Hash operation, third Hash operation, the 4th Hash operation, the 5th Hash fortune Calculation can be different Hash operation.
First go out block node the first digital signature can be sent to second go out block node, so as to second go out block node continue Block out.For example, the first digital signature can be sent to multiple block nodes out by way of broadcast.
Block node the first block of transmission and first can also be gone out to second and go out the public key of block node.Wherein, the public key is sent Form may include a variety of.In one example, can be generated according to the public key should go out block address of node, which can be with Produce or be transferred to address as transaction, this second go out block node can be gone out according to this block address of node determine should go out block node Public key.In another example, which can carry is sent in the first block.
Second goes out block node after receiving the first digital signature, can verify the first identity for going out block node first, should The identity of block node can carry out verifying realization to the first digital signature by going out the public key of block node out.After being verified, Second go out block node can the verifying identity to itself verify, which can be based on preset random rule It is verified, whether includes its own to verify the block node out of the second block.After above-mentioned two verification process all passes through, the Two, which go out block node, is again packaged the second block, and the second block of packing is carried out the whole network and is synchronized.
In some embodiments, further includes:
1) the 5th cryptographic Hash that third goes out the transmission of block node is received, the 5th cryptographic Hash is that the third goes out block node pair Third block carries out the first Hash operation and obtains;
2) it signs to the 5th cryptographic Hash, obtains the described first the second digital signature for going out block node;
3) to described first go out block node the second digital signature carry out the 5th Hash operation obtain described first go out block section The second value of point;
4) third Hash operation is carried out according to the 4th block and obtains the 6th cryptographic Hash, the 4th block is the third area The next block of block;
5) it is obtained according to the second Hash operation of second value progress that the 6th cryptographic Hash and described first go out block node described First goes out the 7th cryptographic Hash of block node;
6) Xiang Suoshu second goes out the block node is sent described first the 7th cryptographic Hash for going out block node.
In some embodiments, above-mentioned steps S240 can be specifically achieved by the steps of:
The second cryptographic Hash of specified quantity and third value are subjected to the 4th Hash operation and obtain the 4th cryptographic Hash.
Wherein, third value is the predefined fixed values such as 1-n, which is arbitrary value.
The third value can also for first go out block node sequence number, or according to first go out block node sequence number it is true Fixed numerical value.By the third value, the randomness of block node selection can be further realized out.
In some embodiments, can also include the following steps:
1) it receives the 4th and goes out the third digital signature that block node is sent, the third digital signature is directed to the 4th block;Make Go out the third digital signature that public key described in block node goes out block node to the described 4th with the 4th to verify, obtains first and go out block section 8th cryptographic Hash of point;
2) the first Hash operation is carried out to the 4th block and obtains the 9th cryptographic Hash;
If 3) the 8th cryptographic Hash is identical with the 9th cryptographic Hash, breathed out according to the tenth of the multiple block node out the The size of uncommon value selects the tenth cryptographic Hash of specified quantity;Tenth cryptographic Hash of each block node out passes through to the 11st Hash Value and the 4th numerical value that should go out block node carry out the second Hash operation and obtain;11st cryptographic Hash by the 5th block into Row third Hash operation obtains;4th numerical value of each block node out goes out block node to the signature of the 8th cryptographic Hash according to this It determines;5th block is next block of the 4th block
4) the 4th Hash operation is carried out to the tenth cryptographic Hash of the specified quantity, obtains the 12nd cryptographic Hash;
5) according to the 12nd cryptographic Hash and preset random rule, judge that described first goes out whether block node is institute That states the 5th block goes out block node;
6) if so, being packaged to the 5th block;
7) if it is not, then terminating.In step 1), it can receive the 4th and go out the 4th block, the public key that block node is sent With third digital signature.
Wherein, the 4th block can go out the newly-generated block of block node for the 4th.The third digital signature can be according to this 4th block determines.It specifically may refer to the acquisition process of aforementioned first digital signature, details are not described herein again.
First, which goes out block node, can also determine that the 4th public key for going out block node, the public key can go out block node according to the 4th Address determine, also available public key of the carrying in the 4th block of band.
, can be according to the 12nd cryptographic Hash and preset random rule in step 5), determine the 5th block goes out block The serial number of node;Whether the serial number for going out block node for judging the 5th block is the first serial number for going out block node.
In step 3), the 8th cryptographic Hash can be compared and whether the 9th cryptographic Hash identical, if identical, this illustrate this Three digital signature are that this goes out the digital signature of block node, namely is verified.If it is different, then verifying does not pass through.
?
In addition, second block can also be the block before the first block.It can specifically be achieved by the steps of: A: At least one before determining the first block appointed interval has verified that block.The appointed interval can be according to the number of multiple block nodes out Amount determines;
B: having verified that each carry out third Hash operation in block at least one respectively, obtains at least one third Kazakhstan Uncommon value.
In one example, can determine a third cryptographic Hash, the third cryptographic Hash can according to first block it Preceding n-th of block determines that the n can be the integer greater than 0, which can be the appointed interval in abovementioned steps A.Example Such as, the value of the n can be the quantity of multiple block nodes out, for example, the quantity of block node is 21 out, which can be 21.
In another example, can determine multiple third cryptographic Hash, multiple third cryptographic Hash can according to this first N-th of block before block plays continuous multiple blocks and determines.The value of the n can be the quantity of multiple block nodes out, should The quantity of continuous multiple blocks can be preset value, the preset value can determine according to actual needs, such as 5.
In another example, can determine multiple third cryptographic Hash, multiple third cryptographic Hash can according to this first Multiple blocks at interval of n block before block determine that the value of interval n can be according to the quantity of multiple block nodes out It determines, for example, the quantity of block node is 21 out, which can be 20.
Wherein, verifying common recognition mechanism may include predefined third Hash operation, which can basis Actual needs determines, for example, third Hash operation can be SHA-256 etc..
Through the embodiment of the present invention, out block node can specify it is next go out block node, the assignment procedure have it is certain with Machine and verifiability can reduce block chain by the possibility of success attack, and improve the block out of block chain meshed network Efficiency, and then book keeping operation efficiency is improved, allow block chain meshed network should the bigger service scenarios of data scale.Fig. 3 For a kind of packing apparatus structural schematic diagram for being related to block chain provided in an embodiment of the present invention.The block chain meshed network includes more Block chain meshed network in a block node, such as exemplary architecture shown in FIG. 1 out, described device are suitable for currently going out block section Point, the current block node out are any one in the multiple block node out, and described device includes:
Hash units 301 carry out the first Hash operation according to first block and obtain first for generating the first block Cryptographic Hash;
Transmission unit 302 sends first cryptographic Hash for other nodes into the multiple block node out;
Determination unit 303, for determining the second cryptographic Hash of the multiple block node out, the second of each block node out is breathed out Uncommon value is obtained by carrying out the second Hash operation with the first numerical value that should go out block node to third cryptographic Hash;The third cryptographic Hash It is obtained by carrying out third Hash operation to the second block;First numerical value of each block node out goes out block node to described according to this The signature of first cryptographic Hash determines;Second block is next block of first block;
Selecting unit 304 selects specified quantity for the size according to the multiple second cryptographic Hash of block node out Second cryptographic Hash;
Hash units 301 are also used to, and are carried out the 4th Hash operation to the second cryptographic Hash of the specified quantity, are obtained the 4th Cryptographic Hash;
Selecting unit 304 is also used to, according to the 4th cryptographic Hash and preset random rule, in the multiple block out It selects second to go out block node as second block in node and goes out block node.
In some embodiments, further includes:
Signature unit obtains the described first the first number for going out block node for signing to first cryptographic Hash Signature;
Hash units, the 5th Hash operation of the first digital signature progress for going out block node to described first obtain described First goes out the first numerical value of block node.
In some embodiments, further includes:
Receiving unit, the 5th cryptographic Hash of block node transmission is gone out for receiving third, and the 5th cryptographic Hash is described the Three, which go out block node, obtains the first Hash operation of third block progress;
Signature unit obtains the described first the second number for going out block node for signing to the 5th cryptographic Hash Signature;
Hash units, the 5th Hash operation of the second digital signature progress for going out block node to described first obtain described First goes out the second value of block node;
Hash units obtain the 6th cryptographic Hash, the 4th block for carrying out third Hash operation according to the 4th block For the lower block of the third block;
Hash units, the second value for going out block node according to the 6th cryptographic Hash and described first carry out second and breathe out Uncommon operation obtains the described first the 7th cryptographic Hash for going out block node;
Transmission unit, for going out described the first of the transmission of block node the 7th cryptographic Hash for going out block node to described second.
In some embodiments, hash units are specifically used for:
The second cryptographic Hash of the specified quantity and third value are subjected to the 4th Hash operation and obtain the 4th cryptographic Hash, institute Stating third value is the sequence number that 1-n or described first goes out block node, and the n is arbitrary value.
In some embodiments, the preset random rule includes:
4th cryptographic Hash is converted into 10 systems, and takes the remainder of the quantity of the multiple verifying node;
Determine that the corresponding verifying node of the remainder goes out block node for described second.
In some embodiments, further includes:
Transmission unit, for sending first digital signature to the multiple block node out.
In some embodiments, further includes:
Receiving unit goes out the third digital signature that block node is sent for receiving the 4th, and the third digital signature is directed to 4th block;
Authentication unit, for use the 4th go out block node described in public key to the described 4th go out block node third digital signature It is verified, obtains the first the 8th cryptographic Hash for going out block node;
Hash units obtain the 9th cryptographic Hash for carrying out the first Hash operation to the 4th block;
Selecting unit, if identical with the 9th cryptographic Hash for the 8th cryptographic Hash, according to the multiple block out The size of tenth cryptographic Hash of node selects the tenth cryptographic Hash of specified quantity;Tenth cryptographic Hash of each block node out passes through 11st cryptographic Hash and the second Hash operation of the 4th numerical value progress that should go out block node are obtained;11st cryptographic Hash passes through Third Hash operation is carried out to the 5th block to obtain;4th numerical value of each block node out goes out block node to the described 8th according to this The signature of cryptographic Hash determines;5th block is next block of the 4th block
Hash units obtain the 12nd Kazakhstan for carrying out the 4th Hash operation to the tenth cryptographic Hash of the specified quantity Uncommon value;
Judging unit, for judging that described first goes out block according to the 12nd cryptographic Hash and preset random rule Node whether be the 5th block go out block node;
Packaged unit, if so, for being packaged to the 5th block.
In some embodiments, judging unit is specifically used for:
According to the 12nd cryptographic Hash and preset random rule, the serial number for going out block node of the 5th block is determined;
Judge the 5th block go out block node serial number whether be described first go out block node serial number described more In a block node out.
It is appreciated that the packing apparatus for being related to block chain of the present embodiment is corresponding with embodiment of the method shown in Fig. 2, because This is equally applicable to the device of the present embodiment above with respect to the description of embodiment of the method shown in Fig. 2, and details are not described herein.
Fig. 4 shows a kind of computer equipment structural schematic diagram, the computer equipment provided by this specification embodiment It may include: processor 410, memory 420, input/output interface 430, communication interface 440 and bus 450.Wherein processor 440, memory 420, input/output interface 430 and communication interface 440 by bus 450 realize between inside equipment Communication connection.
Processor 410 can use general CPU (Central Processing Unit, central processing unit), micro process Device, application specific integrated circuit (Application Specific Integrated Circuit, ASIC) or one or The modes such as multiple integrated circuits are realized, for executing relative program, to realize technical solution provided by this specification embodiment.
Memory 420 can use ROM (Read Only Memory, read-only memory), RAM (Random Access Memory, random access memory), static storage device, the forms such as dynamic memory realize.Memory 420 can store Operating system and other applications are realizing technical solution provided by this specification embodiment by software or firmware When, relevant program code is stored in memory 420, and execution is called by processor 410.
Input/output interface 430 is for connecting input/output module, to realize information input and output.Input and output/ Module can be used as component Configuration (not shown) in a device, can also be external in equipment to provide corresponding function.Wherein Input equipment may include keyboard, mouse, touch screen, microphone, various kinds of sensors etc., output equipment may include display, Loudspeaker, vibrator, indicator light etc..
Communication interface 440 is used for connection communication module (not shown), to realize the communication of this equipment and other equipment Interaction.Wherein communication module can be realized by wired mode (such as USB, cable etc.) and be communicated, can also be wirelessly (such as mobile network, WIFI, bluetooth etc.) realizes communication.
Bus 450 includes an access, in various components (such as the processor 410, memory 420, input/output of equipment Interface 430 and communication interface 440) between transmit information.
It should be noted that although above equipment illustrates only processor 410, memory 420, input/output interface 430, communication interface 440 and bus 450, but in the specific implementation process, which can also include realizing to operate normally Necessary other assemblies.In addition, it will be appreciated by those skilled in the art that, it can also be only comprising realizing in above equipment Component necessary to this specification example scheme, without including all components shown in figure.
Professional should further appreciate that, described in conjunction with the examples disclosed in the embodiments of the present disclosure Unit and algorithm steps, can be realized with electronic hardware, computer software, or a combination of the two, hard in order to clearly demonstrate The interchangeability of part and software generally describes each exemplary composition and step according to function in the above description. These functions are implemented in hardware or software actually, the specific application and design constraint depending on technical solution. Professional technician can use different methods to achieve the described function each specific application, but this realization It should not be considered as beyond the scope of the present invention.
The step of method described in conjunction with the examples disclosed in this document or algorithm, can be executed with hardware, processor The combination of software module or the two is implemented.Software module can be placed in random access memory (RAM), memory, read-only memory (ROM), electrically programmable ROM, electrically erasable ROM, register, hard disk, moveable magnetic disc, CD-ROM or technical field In any other form of storage medium well known to interior.
Above-described specific embodiment has carried out further the purpose of the present invention, technical scheme and beneficial effects It is described in detail, it should be understood that being not intended to limit the present invention the foregoing is merely a specific embodiment of the invention Protection scope, all any modification, equivalent substitution, improvement and etc. within the scope of the present invention, done should be included in this hair Within bright protection scope.

Claims (10)

1. a kind of be related to the packaging method of block chain, which is characterized in that block chain meshed network includes multiple block nodes out, described Method is suitable for first and goes out block node, and described first goes out block node for any one in the multiple block node out, the side Method includes:
The first block is generated, the first Hash operation is carried out according to first block and obtains the first cryptographic Hash;
Other nodes into the multiple block node out send first cryptographic Hash;
Determine that the second cryptographic Hash of the multiple block node out, the second cryptographic Hash of each block node out pass through to third cryptographic Hash The second Hash operation is carried out with first numerical value for going out block node to obtain;The third cryptographic Hash is by carrying out the to the second block Three Hash operations obtain;First numerical value of each block node out is true to the signature of first cryptographic Hash according to that should go out block node It is fixed;Second block is next block of first block;
According to the size of the multiple second cryptographic Hash of block node out, the second cryptographic Hash of specified quantity is selected;
4th Hash operation is carried out to the second cryptographic Hash of the specified quantity, obtains the 4th cryptographic Hash;
According to the 4th cryptographic Hash and preset random rule, selection second goes out block node in the multiple block node out Go out block node as second block.
2. the method according to claim 1, wherein the method also includes:
It signs to first cryptographic Hash, obtains the described first the first digital signature for going out block node;
The first digital signature for going out block node to described first carries out the 5th Hash operation and obtains that described first goes out block node One numerical value.
3. according to the method described in claim 2, it is characterized by further comprising:
The 5th cryptographic Hash that third goes out the transmission of block node is received, the 5th cryptographic Hash is that the third goes out block node to third area Block carries out the first Hash operation and obtains;
It signs to the 5th cryptographic Hash, obtains the described first the second digital signature for going out block node;
The second digital signature for going out block node to described first carries out the 5th Hash operation and obtains that described first goes out block node Two numerical value;
Third Hash operation is carried out according to the 4th block and obtains the 6th cryptographic Hash, and the 4th block is one under the third block Block;
The second Hash operation, which is carried out, according to the second value that the 6th cryptographic Hash and described first go out block node obtains described the One goes out the 7th cryptographic Hash of block node;
Go out described the first of the transmission of block node the 7th cryptographic Hash for going out block node to described second.
4. the method according to claim 1, wherein described carry out the to the specified quantity the second cryptographic Hash Four Hash operations obtain the 4th cryptographic Hash, comprising:
The specified quantity the second cryptographic Hash and third value are subjected to the 4th Hash operation and obtain the 4th cryptographic Hash, described the Three numerical value are the sequence number that 1-n or described first goes out block node, and the n is arbitrary value.
5. the method according to claim 1, wherein the preset random rule includes:
4th cryptographic Hash is converted into 10 systems, and takes the remainder of the quantity of the multiple verifying node;
Determine that the corresponding verifying node of the remainder goes out block node for described second.
6. the method according to claim 1, wherein further include:
First digital signature is sent to the multiple block node out.
7. according to the method described in claim 6, it is characterized by further comprising:
It receives the 4th and goes out the third digital signature that block node is sent, the third digital signature is directed to the 4th block;Use the 4th Out the public key of block node to the described 4th go out block node third digital signature verify, obtain first go out block node the 8th Cryptographic Hash;
First Hash operation is carried out to the 4th block and obtains the 9th cryptographic Hash;
If the 8th cryptographic Hash is identical with the 9th cryptographic Hash, according to the multiple tenth cryptographic Hash of block node out Size selects the tenth cryptographic Hash of specified quantity;Tenth cryptographic Hash of each block node out passes through to the 11st cryptographic Hash and this The second Hash operation of the 4th numerical value progress of block node obtains out;11st cryptographic Hash is by carrying out third to the 5th block Hash operation obtains;4th numerical value of each block node out is determining to the signature of the 8th cryptographic Hash according to that should go out block node; 5th block is next block of the 4th block
4th Hash operation is carried out to the tenth cryptographic Hash of the specified quantity, obtains the 12nd cryptographic Hash;
According to the 12nd cryptographic Hash and preset random rule, judge that described first goes out whether block node is the described 5th Block goes out block node;
If so, being packaged to the 5th block.
8. the method according to the description of claim 7 is characterized in that it is described according to the 12nd cryptographic Hash and it is preset with Machine rule, judge described first go out block node whether be the 5th block out block node include:
According to the 12nd cryptographic Hash and preset random rule, the serial number for going out block node of the 5th block is determined;
Whether the serial number for going out block node for judging the 5th block is the described first serial number for going out block node.
9. a kind of be related to the packing apparatus of block chain, which is characterized in that the block chain meshed network includes multiple block nodes out, Described device is suitable for first and goes out block node, and described first goes out block node for any one in the multiple block node out, institute Stating device includes:
Hash units carry out the first Hash operation according to first block and obtain the first cryptographic Hash for generating the first block;
Transmission unit sends first cryptographic Hash for other nodes into the multiple block node out;
Determination unit, for determining that the second cryptographic Hash of the multiple block node out, the second cryptographic Hash of each block node out are logical It crosses and third cryptographic Hash is obtained with the second Hash operation of the first numerical value progress that should go out block node;The third cryptographic Hash by pair Second block carries out third Hash operation and obtains;First numerical value of each block node out is breathed out according to that should go out block node to described first The signature of uncommon value determines;Second block is next block of first block;
Selecting unit selects specified quantity second to breathe out for the size according to the multiple second cryptographic Hash of block node out Uncommon value;
Hash units are also used to, and are carried out the 4th Hash operation to the second cryptographic Hash of the specified quantity, are obtained the 4th cryptographic Hash;
Selecting unit is also used to, according to the 4th cryptographic Hash and preset random rule, in the multiple block node out It selects second to go out block node as second block and goes out block node in the multiple block node out.
10. a kind of machine readable storage medium, which is characterized in that the machine readable storage medium is stored with the executable finger of machine It enables, for the machine-executable instruction when being called and being executed by processor, the machine-executable instruction promotes the processor Realize the described in any item methods of claim 1 to 8.
CN201910519266.XA 2019-06-17 2019-06-17 Packing method and device related to block chain Active CN110245949B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910519266.XA CN110245949B (en) 2019-06-17 2019-06-17 Packing method and device related to block chain

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910519266.XA CN110245949B (en) 2019-06-17 2019-06-17 Packing method and device related to block chain

Publications (2)

Publication Number Publication Date
CN110245949A true CN110245949A (en) 2019-09-17
CN110245949B CN110245949B (en) 2021-05-28

Family

ID=67887451

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910519266.XA Active CN110245949B (en) 2019-06-17 2019-06-17 Packing method and device related to block chain

Country Status (1)

Country Link
CN (1) CN110245949B (en)

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107005574A (en) * 2016-12-23 2017-08-01 深圳前海达闼云端智能科技有限公司 Block generation method and device and block chain network
JP2017207979A (en) * 2016-05-19 2017-11-24 株式会社野村総合研究所 Alteration detection system and alteration detection method
CN108269090A (en) * 2018-01-19 2018-07-10 中国科学院软件研究所 Based on the common recognition method and apparatus for block catenary system drawn lots at random without negotiation
CN108665271A (en) * 2018-05-02 2018-10-16 百度在线网络技术(北京)有限公司 Block chain data processing method, device, equipment and storage medium
CN108964879A (en) * 2018-07-20 2018-12-07 杭州复杂美科技有限公司 A kind of drawing method, common recognition method, equipment and storage medium
CN109559122A (en) * 2018-12-07 2019-04-02 北京瑞卓喜投科技发展有限公司 Block chain data transmission method and block chain data transmission system
CN109583903A (en) * 2018-11-28 2019-04-05 杭州复杂美科技有限公司 Block confirmation method, equipment and storage medium
CN109684798A (en) * 2019-01-04 2019-04-26 深圳银链科技有限公司 A kind of common recognition algorithm, equipment and storage medium based on publicly-owned block chain

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2017207979A (en) * 2016-05-19 2017-11-24 株式会社野村総合研究所 Alteration detection system and alteration detection method
CN107005574A (en) * 2016-12-23 2017-08-01 深圳前海达闼云端智能科技有限公司 Block generation method and device and block chain network
CN108269090A (en) * 2018-01-19 2018-07-10 中国科学院软件研究所 Based on the common recognition method and apparatus for block catenary system drawn lots at random without negotiation
CN108665271A (en) * 2018-05-02 2018-10-16 百度在线网络技术(北京)有限公司 Block chain data processing method, device, equipment and storage medium
CN108964879A (en) * 2018-07-20 2018-12-07 杭州复杂美科技有限公司 A kind of drawing method, common recognition method, equipment and storage medium
CN109583903A (en) * 2018-11-28 2019-04-05 杭州复杂美科技有限公司 Block confirmation method, equipment and storage medium
CN109559122A (en) * 2018-12-07 2019-04-02 北京瑞卓喜投科技发展有限公司 Block chain data transmission method and block chain data transmission system
CN109684798A (en) * 2019-01-04 2019-04-26 深圳银链科技有限公司 A kind of common recognition algorithm, equipment and storage medium based on publicly-owned block chain

Also Published As

Publication number Publication date
CN110245949B (en) 2021-05-28

Similar Documents

Publication Publication Date Title
CN110210865A (en) Packaging method and device based on block chain
CN110247753A (en) Go out block method and device based on block chain meshed network
CN110222537A (en) Verification method and device applied to block chain link
CN110198233B (en) Block chain consensus method and system based on trusted execution environment and directed acyclic graph
CN108804706A (en) A kind of block chain data processing method, device, equipment and storage medium
CN110223070A (en) Verification method and device based on block chain meshed network
CN108848148B (en) Transaction information confirmation method and device based on block chain
CN110399735A (en) Encryption data size relation method of proof, device, equipment and storage medium
CN110417502A (en) A kind of block chain nodal clock common recognition method and device
CN111985007A (en) Contract signing and executing method and device based on block chain
JP2019536398A (en) System architecture and method of processing data therein
CN108898440A (en) Flow exchanging method and device
CN109857810A (en) Data synchronization unit and method based on block chain
CN110233722A (en) Go out block method and device on block chain
CN110222538A (en) It is related to the verification method and device of block chain
CN110225044A (en) Verification method and device on block chain
CN110223069A (en) Packaging method and device based on block chain meshed network
CN110224813A (en) Go out block method and device based on block chain
CN110224839A (en) Applied to the verification method and device on block chain
CN110298757B (en) Consensus method and device relating to DPoS
CN110245949A (en) It is related to the packaging method and device of block chain
CN110022327B (en) Short message authentication test method and device
CN110245950A (en) Be related to block chain goes out block method and device
CN109391643A (en) Block chain light-weight technologg method, block chain node and storage medium
CN110247773A (en) Packaging method and device on block chain

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
CB02 Change of applicant information

Address after: 100085 No. 108, 1st Floor, No. 9, Shangdi Jiujie, Haidian District, Beijing

Applicant after: Beijing ruice Technology Co.,Ltd.

Address before: 100085 No. 108, 1st Floor, No. 9, Shangdi Jiujie, Haidian District, Beijing

Applicant before: BEIJING AIMO RUICE TECHNOLOGY Co.,Ltd.

CB02 Change of applicant information
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant