CN110247773A - Packaging method and device on block chain - Google Patents

Packaging method and device on block chain Download PDF

Info

Publication number
CN110247773A
CN110247773A CN201910519289.0A CN201910519289A CN110247773A CN 110247773 A CN110247773 A CN 110247773A CN 201910519289 A CN201910519289 A CN 201910519289A CN 110247773 A CN110247773 A CN 110247773A
Authority
CN
China
Prior art keywords
block
node
block node
numerical value
cryptographic 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
CN201910519289.0A
Other languages
Chinese (zh)
Other versions
CN110247773B (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 CN201910519289.0A priority Critical patent/CN110247773B/en
Publication of CN110247773A publication Critical patent/CN110247773A/en
Application granted granted Critical
Publication of CN110247773B publication Critical patent/CN110247773B/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
    • 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/32Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials
    • H04L9/3236Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials using cryptographic hash functions
    • 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/32Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials
    • H04L9/3247Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials involving digital signatures
    • 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
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/104Peer-to-peer [P2P] networks

Abstract

The packaging method and device that the present embodiments relate to a kind of on block chain.If including: that the first block to be generated is greater than first threshold, first block is divided into the first sub-block and at least one second sub-block;The first Hash operation, which is carried out, according to first block obtains the first cryptographic Hash;Determine the first numerical value of the multiple block node out;According to the size of the multiple first numerical value of block node out, the first numerical value of specified quantity is selected;Second Hash operation is carried out to the first numerical value of the specified quantity, obtains the second cryptographic Hash;According to second cryptographic Hash and preset random rule, at least one second block node out for going out block node respectively as at least one second sub-block is selected in the multiple block node out.With this, block node can specify next block node out out, which has certain randomness and verifiability, and improve block chain meshed network goes out block efficiency.

Description

Packaging method and device on block chain
Technical field
The present invention relates to field of computer technology more particularly to a kind of packaging methods and device on 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 packaging method and device that the embodiment of the invention provides a kind of on block chain.
In a first aspect, the embodiment of the invention provides a kind of packaging methods on block chain.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
If the first block to be generated is greater than first threshold, first block is divided into the first sub-block and at least one A second sub-block, wherein described first, which goes out block node as the first sub-block, goes out block node;
The first Hash operation, which is carried out, according to first block obtains the first cryptographic Hash;
Other nodes into the multiple block node out send first cryptographic Hash;
Determine that the first numerical value of the multiple block node out, the first numerical value of each block node out are based on being somebody's turn to do block node pair out The signature of first cryptographic Hash determines;
According to the size of the multiple first numerical value of block node out, the first numerical value of specified quantity is selected;
Second Hash operation is carried out to the first numerical value of the specified quantity, obtains the second cryptographic Hash;
According to second cryptographic Hash and preset random rule, at least one is selected in the multiple block node out Second, which goes out block node, goes out block node respectively as at least one second sub-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 the first digital signature progress third Hash operation 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 third cryptographic Hash that third goes out the transmission of block node is received, the third 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 third cryptographic Hash, obtains the described first the second digital signature for going out block node;
The the second digital signature progress third Hash operation for going out block node to described first obtains described first and goes out block node Second value;
Go out described the first of the transmission of the block node second value for going out block node to the third.
In some embodiments, described that second Hash operation is carried out to the first numerical value of the specified quantity, obtain second Cryptographic Hash, comprising:
The first numerical value of the specified quantity and third value are subjected to the second Hash operation and obtain the second cryptographic Hash, it is described 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:
Second cryptographic Hash is converted into 10 systems, and takes the remainder of the 4th numerical value, the 4th numerical value is according to The quantity of multiple verifying nodes determines;
Determine that the corresponding verifying node of the remainder goes out block node for described second.
In some embodiments, which comprises
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, described 4th block is divided into third sub-block and at least one the 4th sub-block;
The third digital signature progress third Hash operation for going out block node to described first obtains described first and goes out block node The 4th numerical value;
According to the size of the multiple 4th numerical value of block node out, the 4th numerical value of specified quantity is selected;
Second Hash operation is carried out to the 4th numerical value of the specified quantity, obtains the 4th cryptographic Hash;
According to the 4th cryptographic Hash and preset random rule, judge described first go out block node whether be it is described extremely Few 4th sub-block goes out block node;
If so, being packaged to one at least one described the 4th sub-block.
In some embodiments, described according to the 4th cryptographic Hash and preset random rule, judge described first Whether block node is that the block node that goes out of at least one the 4th sub-block includes: out
According to the 4th cryptographic Hash and preset random rule, determine at least one the 4th sub-block goes out block The serial number of node;
Whether the serial number for going out block node for judging at least one the 4th sub-block includes described first going out block node Serial number.
Second aspect provides a kind of packing apparatus on 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:
Blocking unit, if the first block to be generated is greater than first threshold, for first block to be divided into first Sub-block and at least one second sub-block, wherein described first, which goes out block node as the first sub-block, goes out block node;
Hash units carry out the first Hash operation according to first block and obtain the first cryptographic Hash;
Transmission unit sends first cryptographic Hash for other nodes into the multiple block node out;
Determination unit, for determining the first numerical value of the multiple block node out, the first numerical value base of each block node out Go out signature determination of the block node to first cryptographic Hash in this;
First selecting unit selects specified quantity for the size according to the multiple first numerical value of block node out First numerical value;
The hash units are also used to, and are carried out the second Hash operation to the first numerical value of the specified quantity, are obtained second Cryptographic Hash;
Second selecting unit is used for according to second cryptographic Hash and preset random rule, in the multiple block out At least one second block node out for going out block node respectively as at least one second sub-block is selected in node.
In some embodiments, described device further include:
Signature unit obtains the described first the first number for going out block node for signing to first cryptographic Hash Signature;
Hash units, the first digital signature progress third Hash operation 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 third cryptographic Hash of block node transmission is gone out for receiving third, and the third 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 third cryptographic Hash Signature;
Hash units, the second digital signature progress third Hash operation for going out block node to described first obtain described First goes out the second value of block node;
Transmission unit, for going out described the first of the transmission of the block node second value for going out block node to the third.
In some embodiments, hash units are specifically used for:
The first numerical value of the specified quantity and third value are subjected to the second Hash operation and obtain the second cryptographic Hash, it is described 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:
Second cryptographic Hash is converted into 10 systems, and takes the remainder of the 4th numerical value, the 4th numerical value is according to The quantity of multiple verifying nodes determines;
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, the 4th block are divided into third sub-block and at least one the 4th sub-block;
Hash units, the third digital signature progress third Hash operation for going out block node to described first obtain described First goes out the 4th numerical value of block node;
Selecting unit selects specified quantity the 4th for the size according to the multiple 4th numerical value of block node out Numerical value;
Hash units obtain the 4th cryptographic Hash for carrying out the second Hash operation to the 4th numerical value of the specified quantity;
Judging unit, for judging that described first goes out block section according to the 4th cryptographic Hash and preset random rule Whether point is that at least one the 4th sub-block goes 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 4th cryptographic Hash and preset random rule, determine at least one the 4th sub-block goes out block node Serial number;
Whether the serial number for going out block node for judging at least one the 4th sub-block includes described first going out block node Serial number.
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 of the packaging method on 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 packaging method and device that the embodiment of the invention provides a kind of on 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 nodes 101 out and multiple block 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 of the packaging method on 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, if the first block to be packaged be greater than first threshold, by first block be divided into the first sub-block and At least one second sub-block, wherein described first, which goes out block node as the first sub-block, goes out block node.
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.
First goes out block node after determining the first block, if it is determined that the first block is greater than first threshold, it is determined that this One block is excessive, will affect out block efficiency, then first block can be divided into multiple sub-blocks, goes out block node by different The sub-block is packaged, to promote packaging efficiency.
Wherein, first threshold can be determine according to actual needs.
It, can determine according to actual needs, for example, it may be determined that the data of block are less than for the division rule of sub-block The maximum time interval of first threshold then divides sub-block according to the maximum time interval.For example, maximum time interval can be 1 minute, a block was 3 minutes, it is possible to be divided into three 1 minute sub-blocks.
S220 carries out the first Hash operation according to first block and obtains the first cryptographic Hash.
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..
S230, other nodes into multiple block nodes out send the first cryptographic Hash.
Multiple block node out can go out block node for whole.
S240 determines that the first numerical value of the multiple block node out, the first numerical value of each block node out are based on being somebody's turn to do block out Node determines the signature of first cryptographic Hash.
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 goes out block node and can sign to the first cryptographic Hash, obtains first and goes out block node First digital signature;First first digital signature that block node goes out block node to first out carries out third Hash operation and is somebody's turn to do First goes out the first numerical value of 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.
S250 selects the first numerical value of specified quantity according to the size of multiple first numerical value of block node out.
Wherein it is possible to be ranked up to the first numerical value of multiple block nodes out, the specified number for selecting numerical value larger or smaller Measure the first numerical value.The specified quantity can determine according to actual needs, for example, the specified quantity can be 2.
S260 carries out the second Hash operation to the first numerical value of specified quantity, obtains the second cryptographic Hash.
When determining block node, the second Hash operation can be carried out to specified quantity the first digital signature, obtain the Two cryptographic Hash.Wherein, block common recognition mechanism may include predefined second Hash operation out, which can basis Actual needs determines, for example, the second Hash operation can be SHA-256 etc..Wherein, the first Hash operation and the second Hash operation It can be able to be different Hash operations for identical Hash operation.
S270, according to second cryptographic Hash and preset random rule, it is the multiple go out block node in select to Few one second goes out block node and goes out block node respectively as at least one second sub-block.
In some embodiments, it can be determined according to the size relation of at least one the second serial number for going out block node and successively be closed System goes out block node respectively as at least one the second sub-block according to precedence relationship.For example, it is each go out block child node be according to What the time divided, the precedence relationship progress of block node can be gone out according to the time order and function relationship of block child node out and second Match, determines that the second of each block child node out goes out block node.
When determining block node, can be selected according to the second cryptographic Hash.Wherein, block common recognition mechanism may include out The preset random rule of selection gist, the preset random rule have certain randomness and verifiability.
In one example, which may include:
Second 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 block node out.For example, the quantity of block node can be out 100, the 4th numerical value can be 100.
Wherein, the second cryptographic Hash ensure that randomness, the determination of the second cryptographic Hash and preset random rule, ensure that This second go out block node verifiability.
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, above-mentioned steps S260 can be specifically achieved by the steps of:
First digital signature and third value are subjected to the second Hash operation and obtain the second 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, this method further includes following steps:
1) the third cryptographic Hash that third goes out the transmission of block node is received.
Wherein, which goes out block node for third and obtains to the first Hash operation of third block progress;The third Block can go out the newly-generated block of block node for second.
2) it signs to third cryptographic Hash, obtains the first the second digital signature for going out block node;
3) the second digital signature for going out block node to first carries out third Hash operation and obtains second that first goes out block node Numerical value;
4) go out described the first of the transmission of the block node second value for going out block node to third.
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, institute It states the 4th block and is divided into third sub-block and at least one the 4th sub-block;
2) to described first go out block node third digital signature carry out third Hash operation obtain described first go out block section 4th numerical value of point;
3) according to the size of the multiple 4th numerical value of block node out, the 4th numerical value of specified quantity is selected;
4) the second Hash operation is carried out to the 4th numerical value of the specified quantity, obtains the 4th cryptographic Hash;
5) according to the 4th cryptographic Hash and preset random rule, judge that described first goes out whether block node is described 5th block goes out block node, and the 5th block is next block of the 4th block;
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, public key and third digital signature that block node is sent.
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 it is available carrying with the public key in third block.
, can be according to the 4th cryptographic Hash and preset random rule in step 5), determine the 5th block goes out block section The serial number of point;Whether the serial number for going out block node for judging the 5th block is the first serial number for going out block node.
First goes out block node after receiving the 4th block, can verify the 4th identity for going out block node first, should go out block The identity of node can be realized by following step.
Step A goes out the third digital signature that public key described in block node goes out block node to the described 4th using the 4th and tests Card obtains the 4th the 5th cryptographic Hash for going out block node.
Step B carries out the first Hash operation to the 4th block and obtains the 6th cryptographic Hash;
First, which goes out block node, can compare the 5th cryptographic Hash and whether the 6th cryptographic Hash is identical, if identical, illustrate this Third digital signature goes out the digital signature of block node for the 4th, namely is verified.If it is different, then verifying does not pass through.
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 is a kind of packing apparatus structural schematic diagram on block chain provided in an embodiment of the present invention.The block chain link Spot net includes the block chain meshed network in multiple block nodes, such as exemplary architecture shown in FIG. 1 out, and described device is applicable in In current block node out, the current block node out is any one in the multiple block node out, and described device includes:
Blocking unit 301, if the first block to be generated is greater than first threshold, for first block to be divided into the One sub-block and at least one second sub-block, wherein described first, which goes out block node as the first sub-block, goes out block node;
Hash units 302 carry out the first Hash operation according to first block and obtain the first cryptographic Hash;
Transmission unit 303 sends first cryptographic Hash for other nodes into the multiple block node out;
Determination unit 304, for determining the first numerical value of the multiple block node out, the first numerical value of each block node out Go out block node based on this to determine the signature of first cryptographic Hash;
First selecting unit 305 selects specified quantity for the size according to the multiple first numerical value of block node out A first numerical value;
The hash units 302 are also used to, and carry out the second Hash operation to the specified quantity the first numerical value, obtain the Two cryptographic Hash;
Second selecting unit 306, for according to second cryptographic Hash and preset random rule, it is the multiple go out At least one second block node out for going out block node respectively as at least one second sub-block is selected in block node.
In some embodiments, described device further include:
Signature unit obtains the described first the first number for going out block node for signing to first cryptographic Hash Signature;
Hash units, the first digital signature progress third Hash operation 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 third cryptographic Hash of block node transmission is gone out for receiving third, and the third 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 third cryptographic Hash Signature;
Hash units, the second digital signature progress third Hash operation for going out block node to described first obtain described First goes out the second value of block node;
Transmission unit, for going out described the first of the transmission of the block node second value for going out block node to the third.
In some embodiments, hash units are specifically used for:
The first numerical value of the specified quantity and third value are subjected to the second Hash operation and obtain the second cryptographic Hash, it is described 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:
Second cryptographic Hash is converted into 10 systems, and takes the remainder of the 4th numerical value, the 4th numerical value is according to The quantity of multiple verifying nodes determines;
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, the 4th block are divided into third sub-block and at least one the 4th sub-block;
Hash units, the third digital signature progress third Hash operation for going out block node to described first obtain described First goes out the 4th numerical value of block node;
Selecting unit selects specified quantity the 4th for the size according to the multiple 4th numerical value of block node out Numerical value;
Hash units obtain the 4th cryptographic Hash for carrying out the second Hash operation to the 4th numerical value of the specified quantity;
Judging unit, for judging that described first goes out block section according to the 4th cryptographic Hash and preset random rule Whether point is that at least one the 4th sub-block goes 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 4th cryptographic Hash and preset random rule, determine at least one the 4th sub-block goes out block node Serial number;
Whether the serial number for going out block node for judging at least one the 4th sub-block includes described first going out block node Serial number.
It is appreciated that the packing apparatus on 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 packaging method on 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:
If the first block to be generated is greater than first threshold, by first block be divided into the first sub-block and at least one the Two sub-blocks, wherein described first, which goes out block node as the first sub-block, goes out block node;
The first Hash operation, which is carried out, according to first block obtains the first cryptographic Hash;
Other nodes into the multiple block node out send first cryptographic Hash;
Determine it is the multiple go out block node the first numerical value, it is each go out block node the first numerical value be based on to go out block node to described The signature of first cryptographic Hash determines;
According to the size of the multiple first numerical value of block node out, the first numerical value of specified quantity is selected;
Second Hash operation is carried out to the first numerical value of the specified quantity, obtains the second cryptographic Hash;
According to second cryptographic Hash and preset random rule, it is the multiple go out block node in select at least one second Block node goes out block node respectively as at least one second sub-block out.
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 third 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 third cryptographic Hash that third goes out the transmission of block node is received, the third 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 third 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 third Hash operation and obtains that described first goes out block node Two numerical value;
Go out described the first of the transmission of the block node second value for going out block node to the third.
4. the method according to claim 1, wherein described carry out second to the first numerical value of the specified quantity Hash operation obtains the second cryptographic Hash, comprising:
The first numerical value of the specified quantity and third value are subjected to the second Hash operation and obtain the second cryptographic Hash, the third Numerical value is 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:
Second cryptographic Hash is converted into 10 systems, and takes the remainder of the 4th numerical value, the 4th numerical value is according to the multiple The quantity for verifying node determines;
Determine that the corresponding verifying node of the remainder goes out block node for described second.
6. the method according to claim 1, wherein the described method includes:
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:
Receive the 4th go out block node send third digital signature, the third digital signature be directed to the 4th block, the described 4th Block is divided into third sub-block and at least one the 4th sub-block;
The third digital signature for going out block node to described first carries out third Hash operation and obtains that described first goes out block node Four numerical value;
According to the size of the multiple 4th numerical value of block node out, the 4th numerical value of specified quantity is selected;
Second Hash operation is carried out to the 4th numerical value of the specified quantity, obtains the 4th cryptographic Hash;
According to the 4th cryptographic Hash and preset random rule, judge that described first goes out whether block node is described at least one A 4th sub-block goes out block node;
If so, being packaged to one at least one described the 4th sub-block.
8. the method according to the description of claim 7 is characterized in that described according to the 4th cryptographic Hash and preset random Rule judges that described first goes out whether block node is that the block node that goes out of at least one the 4th sub-block includes:
According to the 4th cryptographic Hash and preset random rule, the sequence for going out block node of at least one the 4th sub-block is determined Number;
Whether the serial number for going out block node for judging at least one the 4th sub-block includes the described first serial number for going out block node.
9. a kind of packing apparatus on 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:
Blocking unit, if the first block to be generated is greater than first threshold, for first block to be divided into the first sub-district Block and at least one second sub-block, wherein described first, which goes out block node as the first sub-block, goes out block node;
Hash units carry out the first Hash operation according to first block and obtain the first cryptographic Hash;
Transmission unit sends first cryptographic Hash for other nodes into the multiple block node out;
Determination unit, for determining the first numerical value of the multiple block node out, the first numerical value of each block node out is based on should Block node determines the signature of first cryptographic Hash out;
First selecting unit selects specified quantity first for the size according to the multiple first numerical value of block node out Numerical value;
The hash units are also used to, and are carried out the second Hash operation to the first numerical value of the specified quantity, are obtained the second Hash Value;
Second selecting unit is used for according to second cryptographic Hash and preset random rule, in the multiple block node out It is middle to select at least one second block node out for going out block node respectively as at least one second sub-block.
10. device according to claim 9, which is characterized in that further include:
Transmission unit, for sending first digital signature to the multiple block node out.
CN201910519289.0A 2019-06-17 2019-06-17 Packing method and device on block chain Active CN110247773B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910519289.0A CN110247773B (en) 2019-06-17 2019-06-17 Packing method and device on block chain

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910519289.0A CN110247773B (en) 2019-06-17 2019-06-17 Packing method and device on block chain

Publications (2)

Publication Number Publication Date
CN110247773A true CN110247773A (en) 2019-09-17
CN110247773B CN110247773B (en) 2020-12-25

Family

ID=67887405

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910519289.0A Active CN110247773B (en) 2019-06-17 2019-06-17 Packing method and device on block chain

Country Status (1)

Country Link
CN (1) CN110247773B (en)

Citations (6)

* 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
CN108596621A (en) * 2018-04-28 2018-09-28 深圳市优学链科技有限公司 Block chain accounting nodes generation method, device, computer equipment and storage medium
CN108964879A (en) * 2018-07-20 2018-12-07 杭州复杂美科技有限公司 A kind of drawing method, common recognition method, equipment and storage medium
CN109039646A (en) * 2018-07-12 2018-12-18 北京链享未来科技有限公司 A kind of packing of block chain block and verification method and system based on node capacity
US10230530B2 (en) * 2017-08-05 2019-03-12 Proclus Technologies Limited Method and system for securing a blockchain with proof-of-transactions
CN109743173A (en) * 2018-12-20 2019-05-10 弗洛格(武汉)信息科技有限公司 Go out block node in block chain and determines method, block verification method and block catenary system

Patent Citations (6)

* 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
US10230530B2 (en) * 2017-08-05 2019-03-12 Proclus Technologies Limited Method and system for securing a blockchain with proof-of-transactions
CN108596621A (en) * 2018-04-28 2018-09-28 深圳市优学链科技有限公司 Block chain accounting nodes generation method, device, computer equipment and storage medium
CN109039646A (en) * 2018-07-12 2018-12-18 北京链享未来科技有限公司 A kind of packing of block chain block and verification method and system based on node capacity
CN108964879A (en) * 2018-07-20 2018-12-07 杭州复杂美科技有限公司 A kind of drawing method, common recognition method, equipment and storage medium
CN109743173A (en) * 2018-12-20 2019-05-10 弗洛格(武汉)信息科技有限公司 Go out block node in block chain and determines method, block verification method and block catenary system

Also Published As

Publication number Publication date
CN110247773B (en) 2020-12-25

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
CN110223070A (en) Verification method and device based on block chain meshed network
CN108804706A (en) A kind of block chain data processing method, device, equipment and storage medium
CN110417502A (en) A kind of block chain nodal clock common recognition method and device
CN109560939A (en) A kind of block method and the device out of block chain
CN108898440A (en) Flow exchanging method and device
CN111985007A (en) Contract signing and executing method and device based on block chain
CN110233722A (en) Go out block method and device on block chain
JP2019536398A (en) System architecture and method of processing data therein
CN109857810A (en) Data synchronization unit and method based on block chain
CN110225044A (en) Verification method and device on block chain
CN110222538A (en) It is related to the verification method and device of block chain
CN112487492A (en) Data verification method, system and equipment
CN111669434A (en) Method, system, device and equipment for establishing communication group
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
CN110247773A (en) Packaging method and device on block chain
CN110022327B (en) Short message authentication test method and device
CN110245950A (en) Be related to block chain goes out block method and device
CN110224840A (en) Packaging method and device based on block chain
CN110245949A (en) It is related to the packaging method and device of 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