CN109255614A - Digging mine method and device, digging mine machine and block catenary system based on block chain - Google Patents

Digging mine method and device, digging mine machine and block catenary system based on block chain Download PDF

Info

Publication number
CN109255614A
CN109255614A CN201811013770.4A CN201811013770A CN109255614A CN 109255614 A CN109255614 A CN 109255614A CN 201811013770 A CN201811013770 A CN 201811013770A CN 109255614 A CN109255614 A CN 109255614A
Authority
CN
China
Prior art keywords
verified
block
cryptographic hash
node
miner
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201811013770.4A
Other languages
Chinese (zh)
Inventor
李成龙
蒋义新
刘强
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Bei Bei Technology Co Ltd
Original Assignee
Shenzhen Bei Bei 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 Shenzhen Bei Bei Technology Co Ltd filed Critical Shenzhen Bei Bei Technology Co Ltd
Priority to CN201811013770.4A priority Critical patent/CN109255614A/en
Publication of CN109255614A publication Critical patent/CN109255614A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/38Payment protocols; Details thereof
    • G06Q20/382Payment protocols; Details thereof insuring higher security of transaction
    • G06Q20/3827Use of message hashing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/38Payment protocols; Details thereof
    • G06Q20/382Payment protocols; Details thereof insuring higher security of transaction
    • G06Q20/3825Use of electronic 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
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/38Payment protocols; Details thereof
    • G06Q20/40Authorisation, e.g. identification of payer or payee, verification of customer or shop credentials; Review and approval of payers, e.g. check credit lines or negative lists
    • G06Q20/401Transaction verification

Abstract

The present invention relates to block chain technical fields, more particularly to a kind of digging mine method and device based on block chain, dig mine machine and block catenary system.Mine task requests are dug this method comprises: sending to each miner's node, wherein, it digs mine task requests and carries search number, search number is used to indicate each miner's node and searches out cryptographic Hash to be verified corresponding with search number in the search space of each random number, all there is same search number between the search space of any two random number, it is all different that same search numbers corresponding cryptographic Hash to be verified;Receive the cryptographic Hash to be verified corresponding with described search number that each miner's node uploads;According to cryptographic Hash to be verified, current block is verified.On the one hand, since the corresponding cryptographic Hash to be verified of same search number is all different, agent node can be to avoid same verifying work be repeated, to relatively save energy consumption.

Description

Digging mine method and device, digging mine machine and block catenary system based on block chain
Technical field
The present invention relates to block chain technical fields, more particularly to a kind of digging mine method and device based on block chain, dig Mine machine and block catenary system.
Background technique
Some block catenary systems support proof of work mechanism ((Proof of Work, POW), according to proof of work machine System, each miner's node disjoint are completed proof of work and are calculated, when finding the random number for meeting preset condition, be just packaged The right of book keeping operation.
Inventor in the implementation of the present invention, has found traditional technology the prior art has at least the following problems: due to each miner Node disjoint completes proof of work, therefore each miner's node is easy to compute repeatedly same workload, to cause the energy unrestrained Take.
Summary of the invention
One purpose of the embodiment of the present invention is intended to provide a kind of digging mine method and device based on block chain, the area Wa Kuangjiji Block catenary system, can be energy saving.
In order to solve the above technical problems, the embodiment of the present invention the following technical schemes are provided:
In a first aspect, the embodiment of the present invention provides a kind of digging mine method based on block chain, applied to agent node, institute The method of stating includes:
It is sent to each miner's node and digs mine task requests, wherein the digging mine task requests carry search number, institute State search number be used to indicate each miner's node searched out in the search space of each random number and described search compile All there is same search number, same search between the search space of any two random number in number corresponding cryptographic Hash to be verified It is all different to number corresponding cryptographic Hash to be verified;
Receive the cryptographic Hash to be verified corresponding with described search number that each miner's node uploads;
According to the cryptographic Hash to be verified, current block is verified.
Optionally, a random number corresponds to N number of difference cryptographic Hash to be verified, and N is positive integer;
Described search is numbered as obtained from known constant M is made the modulo operation of N, and M is positive integer.
Optionally, the known constant M will combine block information and obtain as Hash operation, wherein the combination region The block elevation information of block information and the current block that block message is recorded by block head in current block is combined into.
Optionally, the block head of each block records following any one or more block informations: random number, difficulty Value, target value, miner's wallet address, generates signature and block signature at target cryptographic Hash, wherein the generation signature is will be upper Obtained from Hash operation is made in the generation signature of one block and miner's wallet address, the block signature is that agent node uses certainly Body private key makees what signature operation obtained to the Hash content of current block.
Optionally, described according to the cryptographic Hash to be verified, verify current block, comprising:
The cryptographic Hash to be verified and generation signature are made into Hash operation, obtain expectation cryptographic Hash;
Judge whether the expectation cryptographic Hash is less than or equal to the target cryptographic Hash;
If being less than or equal to, determine that the corresponding random number of the cryptographic Hash to be verified is effective, and be packaged block;
If more than determining that the corresponding random number of the cryptographic Hash to be verified is invalid.
Optionally, after being verified the current block, the method also includes:
Count this dig mine when, each miner's node upload cryptographic Hash to be verified quantity and each miner Node uploads the total amount of cryptographic Hash to be verified;
The proportionate relationship between the quantity of cryptographic Hash to be verified and the total amount is uploaded according to each miner's node, point With the reward for being verified the current block generation.
In second aspect, the embodiment of the present invention provides a kind of digging mine device based on block chain, is applied to agent node, institute Stating device includes:
Sending module digs mine task requests for sending to each miner's node, wherein the digging mine task requests carry There is search to number, each miner's node is all stored with same search number and random number corresponding with described search number And cryptographic Hash to be verified, also, the corresponding cryptographic Hash to be verified of different miner's node same search numbers is all different;
Receiving module, the Hash to be verified corresponding with described search number uploaded for receiving each miner's node Value;
Authentication module, for knowing verifying current block according to the cryptographic Hash to be verified.
Optionally, a random number corresponds to N number of difference cryptographic Hash to be verified, and N is positive integer;
Described search is numbered as obtained from known constant M is made the modulo operation of N, and M is positive integer.
Optionally, the known constant M will combine block information and obtain as Hash operation, wherein the combination region The block elevation information of block information and the current block that block message is recorded by block head in current block is combined into.
Optionally, the block head of each block records following any one or more block informations: random number, difficulty Value, target value, miner's wallet address, generates signature and block signature at target cryptographic Hash, wherein the generation signature is will be upper Obtained from Hash operation is made in the generation signature of one block and miner's wallet address, the block signature is that agent node uses certainly Body private key makees what signature operation obtained to the Hash content of current block.
Optionally, the authentication module includes:
Arithmetic element obtains expectation Hash for the cryptographic Hash to be verified and generation signature to be made Hash operation Value;
Judging unit, for judging whether the expectation cryptographic Hash is less than or equal to the target cryptographic Hash;
Packaged unit, if determine that the corresponding random number of the cryptographic Hash to be verified is effective for being less than or equal to, and It is packaged block;
Determination unit is used for if more than determining that the corresponding random number of the cryptographic Hash to be verified is invalid.
Optionally, described device further include:
Statistical module, for count this dig mine when, each miner's node upload the quantity of cryptographic Hash to be verified with And each miner's node uploads the total amount of cryptographic Hash to be verified;
Distribution module, for being uploaded between the quantity of cryptographic Hash to be verified and the total amount according to each miner's node Proportionate relationship, distribution is verified the reward that the current block generates.
In the third aspect, the embodiment of the present invention provides a kind of non-transient computer readable storage medium, the non-transient meter Calculation machine readable storage medium storing program for executing is stored with computer executable instructions, and the computer executable instructions are for executing agent node Described in any item digging mine methods based on block chain.
In fourth aspect, the embodiment of the present invention provides a kind of digging mine machine, comprising:
At least one processor;And
The memory being connect at least one described processor communication;Wherein, the memory be stored with can by it is described extremely The instruction that a few processor executes, described instruction are executed by least one described processor, so that at least one described processing Device can be used in executing described in any item digging mine methods based on block chain.
At the 5th aspect, the embodiment of the present invention provides a kind of block catenary system, comprising:
Miner's node;
Agent node, the agent node and miner's node communication;
Wherein, the agent node includes:
At least one processor;And
The memory being connect at least one described processor communication;Wherein, the memory be stored with can by it is described extremely The instruction that a few processor executes, described instruction are executed by least one described processor, so that at least one described processing Device can be used in executing described in any item digging mine methods based on block chain.
At the 6th aspect, the embodiment of the present invention provides a kind of computer program product, and the computer program product includes The computer program being stored on non-volatile computer readable storage medium storing program for executing, the computer program include program instruction, when When described program instructs proxied node to execute, the agent node is made to execute described in any item digging mine sides based on block chain Method.
In the digging mine method and device based on block chain, digging mine machine and the block catenary system that each embodiment of the present invention provides In, mine task requests are dug firstly, sending to each miner's node, wherein are dug mine task requests and carried search number, search is compiled It number is used to indicate each miner's node and searches out Kazakhstan to be verified corresponding with search number in the search space of each random number It is uncommon to be worth, all there is same search number between the search space of any two random number, same search number is corresponding to be verified Cryptographic Hash is all different.Secondly, receiving the cryptographic Hash to be verified corresponding with search number that each miner's node uploads.Again, root According to cryptographic Hash to be verified, current block is verified.On the one hand, since the corresponding cryptographic Hash to be verified of same search number is all different, Therefore, agent node can be to avoid same verifying work be repeated, to relatively save energy consumption.On the other hand, by The cryptographic Hash to be verified of each random number is prestored in miner's node, agent node is each random without expending a large amount of calculation power calculating Several cryptographic Hash to be verified, it is only necessary to which lower calculation power, which can be completed to dig miner, to be made, and therefore, can satisfy calculation, power is low sets It is standby to participate in digging mine, universality is improved, makees to become more fair so that digging miner.
Detailed description of the invention
One or more embodiments are illustrated by the picture in corresponding attached drawing, these exemplary theorys The bright restriction not constituted to embodiment, the element in attached drawing with same reference numbers label are expressed as similar element, remove Non- to have special statement, composition does not limit the figure in attached drawing.
Fig. 1 is the configuration diagram of traditional virtual encryption money-system;
Fig. 2 is that the embodiment of the present invention provides a kind of configuration diagram of block catenary system;
Fig. 3 is that the embodiment of the present invention provides a kind of flow diagram of digging mine method based on block chain;
Fig. 4 a is the Hash operation process schematic of the 1st Hash seed provided in an embodiment of the present invention;
Fig. 4 b is the Hash operation process schematic of the 2nd Hash seed provided in an embodiment of the present invention;
Fig. 4 c is the Hash operation process schematic of the 3rd Hash seed provided in an embodiment of the present invention;
Fig. 4 d is the search space schematic diagram of random number A provided in an embodiment of the present invention;
Fig. 4 e is the search file schematic diagram that search number provided in an embodiment of the present invention is Scoop#403;
Fig. 4 f is the search file schematic diagram that search number provided in an embodiment of the present invention is Scoop#404;
Fig. 4 g is that provided in an embodiment of the present invention 32byte generation is signed is combined with 8byte block elevation information Make Hash operation schematic diagram;
Fig. 4 h be it is provided in an embodiment of the present invention by 32byte GenHash progress modulo 4096 calculate, specified Search for number schematic diagram;
Fig. 4 i is that the cryptographic Hash to be verified provided in an embodiment of the present invention by 64byte is combined with the generation of 32byte signature Hash operation is carried out together, obtains Hash result schematic diagram;
Fig. 5 is that the embodiment of the present invention provides a kind of structural schematic diagram of digging mine device based on block chain;
Fig. 6 is the structural schematic diagram of authentication module in Fig. 5;
The structural schematic diagram of Fig. 7 is that another embodiment of the present invention provides a kind of digging mine device based on block chain;
Fig. 8 is that the embodiment of the present invention provides a kind of structural schematic diagram for digging mine machine.
Specific embodiment
In order to make the objectives, technical solutions, and advantages of the present invention clearer, with reference to the accompanying drawings and embodiments, right The present invention is further elaborated.It should be appreciated that described herein, the specific embodiments are only for explaining the present invention, not For limiting the present invention.
Block catenary system has the characteristics that decentralization, is different from conventional center server, since block catenary system does not have There is centralization node, the mechanism that needs to know together maintains normal operation, for example, common recognition mechanism includes POW algorithm, it is based on POW algorithm, Block catenary system can be realized the common recognition verifying of block.
POW algorithm is a kind of strategy of a kind of reply Denial of Service attack and other service abuses, a proof of work Refer to that a data for meeting specified conditions calculate, it is relatively difficult to generate correct result, but it is simpler to verify correct result It is single.The generation of correct result can only carry out verifying trial and error by constantly enumerating random number, to eventually find correct option. Wherein, which realized using Hash (hash) algorithm.Hash algorithm is a kind of one-way Hash algorithm, calculates Kazakhstan The process of uncommon value is fairly simple, but inversely to obtain initial data according to fixed cryptographic Hash, then can only by enumerate trial and error come It carries out.
In some virtual encryption money-systems, when carrying out random hash operation, POW algorithm is introduced to some spy The scanning work of definite value, for example, at SHA-256, random hash value with one or more 0 start, with 0 quantity gradually Increase, traversing out workload required for solution corresponding with the random hash value in the case of this will be exponentially increased, and to result It tests, only needs a random hash operation.
A random number (Nonce) is augmented in the block of some virtual encryption money-systems, which needs to meet So that there is the condition of required specified quantity 0 in the cryptographic Hash of given block.It, can only due to the irreversible property of Hash operation The random number of the condition of satisfaction is traversed out by making repeated attempts.
As long as block chain node traverses go out to meet the random number of condition, which just completes the card of workload It is bright, to obtain the packing book keeping operation power of block.
In the following, the embodiment of the present invention elaborates the common recognition verifying process of traditional virtual encryption money-system.It is as described below:
1, Transaction Information is collected and selected to block chain link point, and calculates Merkel (Merkle) root Hash of transaction List Table Value.
2, block chain node tectonic province build, wherein block head includes version, the cryptographic Hash of upper block head, Merkel Root cryptographic Hash, timestamp (timestamp), difficulty value (difficulty) and random number.
3, block chain node calculates the block head cryptographic Hash of construction, and whether test zone build cryptographic Hash is less than or equal to target Value.If so, completing proof of work, the block of packing is broadcasted into the whole network, other block chain nodes in block chain will be examined Survey the legitimacy of the block.If it is not, then returning to step 2, continue workload computing.
The block chain node for executing above-mentioned process can also be known as miner's node.
Firstly, since each block chain node in the whole network needs to obtain the packing book keeping operation of block by proof of work Power, therefore when using POW common recognition mechanism, each miner's node requires to constantly generate random number to be examined with trial and error, with this time Suitable random number is gone through out, which needs a large amount of electric power support, to cause a large amount of energy waste.
Secondly as independently carrying out proof of work calculating between each miner's node, there are biggish for working space It repeats, so as to cause in the identical situation of difficulty value, the time needed for miner's node completes workload is long, out block low efficiency Under.
In fact, riseing with the encryption money price in virtual encryption money-system, people dig mine by improvement and set It is standby, to realize the block out of higher efficiency, for example, from using CPU (Central Processing Unit, central processing unit) to dig Mine digs mine to using GPU (Graphics Processing Unit, graphics processor), then arrives FPGA (Field Programmable Gate Array, field programmable gate array) dig mine, the ASIC of the customization finally occurred (Application Specific Integrated Circuit, specific integrated circuit) digs mine.
It digs mine calculation power exponentially to increase every year, since some virtual encryption money-systems can be adjusted according to power dynamic is calculated Therefore whole digging mine disaster angle value increases, difficulty value is also increased with exponential with power is calculated.It is such to increase so that independent miner digs Mine can not obtain income, therefore there has been the appearance in mine pond.Miner's node is combined together by mine pond by certain agreement, It concentrates and calculates power progress workload computing, obtain and the miner to work in mine pond is given into reward after rewarding.
There are mine pond administrator, mine pond administrator is responsible for coordinating and managing all miner's work in mine pond.Therefore, mine pond administrator Customized related protocol is needed, is communicated with miner.At the same time, miner administrator is responsible for being packaged transaction, distributes for miner Related work amount, therefore, the relevant reward of system also can all be sent to mine pond administrator, and mine pond administrator is responsible for mine Work sends the reward of related work amount.It is also easier to complete for independent miner since mine pond summarizes a large amount of power of calculating Proof of work and obtain system award, this makes the income of miner that can become relatively stable, and mine pond administrator can be with Obtain its certain mine pond management return.
In the following, combination of embodiment of the present invention Fig. 1 elaborates the common recognition verifying process of traditional virtual encryption money-system.Such as It is lower described:
1, miner's client 11 sends common recognition instruction to management server 12, wherein common recognition instruction includes miner's client 11 identity information, operation information and relevant parameter information, parameter information specify dbase and the version number of miner's client.
2, after management server 12 receives this information, information can be confirmed, after confirming successfully, returns to relevant information.
3, miner's client 11 sends authentication information, and authentication information includes the wallet address of miner's client 11.
4, the legitimacy of 12 authentication verification information of management server, after being verified, it is logical that management server 12 returns to verifying Cross information.
5, management server 12 sends difficulty setting information to miner's client 11.
6, management server 12 is by sending the block information that carry out proof of work to miner's client 11.
7, the common recognition of miner's client 11 verifying block will when miner's client 11 traverses out the random number of the condition of satisfaction The random number is sent to management server 12.
8, management server 12 verifies the random number that miner's client 11 provides, and transmits verification result to miner client End 11.
As previously mentioned, all rewards are distributed on mine pond manager, in the online lower mine pond formed for the miner of its work Reward is distributed by mine pond manager, therefore mine pond manager possesses absolute right.Also, the formation in the pond line Xia Kuang, it is fixed to need Adopted relevant communication protocol and mechanism, it is comparatively laborious.
Based on this, the embodiment of the present invention provides a kind of block catenary system.Referring to Fig. 2, block catenary system 200 includes agency Node 21, miner's node 22 and wallet node 23, agent node 21 and miner's node 22 communicate, agent node 21 also with wallet section 23 communication of point, wherein, point-to- point communication (Point to point is supported in each block chain node between any two node Communication, P2P), also, agent node 21, miner's node 22 and wallet node 23 all can be used as block catenary system In block chain node, undertake different responsibilities in each leisure block catenary system, the common work for safeguarding block catenary system, stabilization And safety.
Agent node 21 is mainly used for the generation and broadcast of new block, for example, agent node 21 is needed to miner's node body Part certification, issue dig mine task, reception and verify miner's node upload cryptographic Hash to be verified, record miner's node workload, It is packaged and is generated block, new coin reward is distributed to miner's node according to workload and broadcasts newly-generated block to block chain In system.
Miner's node 22 needs that mine can be dug in 21 successful registration of agent node.Wherein, register flow path is as follows:
1, miner's node 22 submits registration information to agent node 21.
Wherein, which includes one or more of information: dig the equipment Serial Number SN of mine machine, user information and Miner's wallet address.
2, agent node 21 checks registration information.
Checking process includes: that whether correct, SN whether there is in database detection SN number format, whether SN has been bound Other users etc..
3, agent node 21 records registration information.
4, registering result is returned to miner's node 22 by agent node 21.
5, agent node 21 broadcasts new log-on data to block catenary system 200.
6, all wallet nodes 23 store and synchronize the log-on data of newest miner's node in block catenary system 200.
In the present embodiment, miner's node 22 needs to carry out following initialization operation before starting to dig mine for the first time:
1, it registers.It obtains and equipment Serial Number SN one-to-one miner's wallet address.
2, according to equipment of itself memory capacity size, a special memory space is opened up, is dug for storing stand-by when mine Cryptographic Hash to be verified.
3, suitable dedicated memory space is selected.
In general, memory space cannot be too small, also no more than the 80% of total memory space.
4, according to the miner's wallet address of itself, a large amount of cryptographic Hash to be verified are generated, and all cryptographic Hash to be verified are deposited It is stored in dedicated memory space, waits and being used when digging mine.
In the present embodiment, when starting the digging mine movement an of new block every time, miner's node 22 is according to agent node 21 Instruction, pre-stored cryptographic Hash to be verified is reported to agent node 21 one by one, until new block generate.Agent node 21 According to the data volume statistical work amount for the cryptographic Hash to be verified that miner's node 22 uploads, and divided according to workload to miner's node 22 It is rewarded with new coin.
Wallet node 23 for recording, inquire account balance, transaction record, initiate it is new transfer accounts, and in block catenary system Middle synchronization, verifying block data.
It is understood that above-mentioned agent node 21, miner's node 22 and wallet node 23 can be a physical services A logical server made of device or multiple physical servers are virtual.Server be also possible to it is multiple can interconnected communication clothes The server zone of business device composition, and each functional module can be respectively distributed on each server in server zone.
It is understood that the block chain work that above-mentioned agent node 21, miner's node 22 and wallet node 23 are responsible for Be not it is fixed, above-described embodiment only show block catenary system 200 in application scenes, answered there may also be other Use scene.
It is understood that agent node 21 or miner's node 22 can all be taken as digging mine machine, wherein digging mine machine can be with Including POS machine (point of sales terminal) mobile terminal, smart phone, computer, palm PC (Personal Digital Assistant, PDA), tablet computer, smartwatch or desktop computer etc..
Referring to Fig. 3, Fig. 3 is that the embodiment of the present invention provides a kind of flow diagram of digging mine method based on block chain. As shown in figure 3, the digging mine method 300 based on block chain includes:
S31, it is sent to each miner's node and digs mine task requests;
In the present embodiment, agent node 21 is sent before digging mine task requests to each miner's node, miner's node 22 It is sent to agent node 21 and digs mine request, digging mine request carries miner's identity information, wherein miner's identity information includes The equipment Serial Number SN or block catenary system for digging mine machine are that the distribution of each miner's node has unique identification information, mine Work identity information is made of character string, can also be other representations.
Agent node 21 detects whether miner's identity information matches default identity information, if not matching, forbids miner's node 22 are added miner's list;If matching sends to miner's node 22 and digs mine task requests.When each 22 successful registration of miner's node Afterwards, miner's identity information of miner's node 22 of successful registration etc. information is recorded in miner's list by agent node 21, generation Reason node 21 runs and maintains miner's list.When miner's node changes in block catenary system, agent node 21 is again Update miner's list.
Default identity information is customized by the manager of block catenary system, can be equipment Serial Number SN or block chain System is that the distribution of each miner's node has unique identification information.For example, presetting identity information is POS machine sequence Number SN.When mobile phone needs to be added block chain network as miner's node, since the equipment Serial Number of mobile phone is not belonging to POS machine sequence Row number SN, then, the mobile phone have not been able to be successfully joined in block chain network as miner's node.
In the present embodiment, by verifying the legitimacy of miner's node, be conducive to facilitate management block catenary system.
After miner's node 22 passes through the verifying of agent node, agent node 21 sends to each miner's node 22 and digs mine times Business request, wherein the digging mine task requests carry search number.
Miner's node 22, which receives, digs mine task requests, according to digging mine task requests in the search space of random number (nonce) In search out and the corresponding cryptographic Hash to be verified of search number.The search space of random number is by complete based on generating random number Portion's cryptographic Hash to be verified is constituted, and cryptographic Hash to be verified can be composed of multibyte data, for example, cryptographic Hash to be verified can be with It can also be 64 byte cryptographic Hash for 32 bytes (byte) cryptographic Hash, wherein 64 byte cryptographic Hash can be breathed out by 2 32 bytes Uncommon value is composed.
After searching out, miner's node 22 uploads cryptographic Hash to be verified corresponding with search number to agent node 22.Its In, all there is same search number between the search space of any two random number, same search numbers corresponding Kazakhstan to be verified Uncommon value is all different.
S32, the cryptographic Hash to be verified corresponding with search number that each miner's node uploads is received.
S33, according to cryptographic Hash to be verified, verify current block.
In the present embodiment, the verification mode for verifying current block is varied, for example: the verifying of agent node 21 is worked as When preceding block, firstly, cryptographic Hash to be verified and generation signature are made Hash operation, expectation cryptographic Hash is obtained.It signs due to generating There is uniqueness and consistency in block catenary system, the randomness of cryptographic Hash to be verified is relatively high originally, subsequent recycling life Make Hash operation with cryptographic Hash to be verified at signature, to improve randomness again, reduces agent node 21 and make repeated verifying The probability of work.Secondly, agent node 21 judges it is expected that whether cryptographic Hash is less than or equal to the target cryptographic Hash;If be less than or It is equal to, determines that the corresponding random number of cryptographic Hash to be verified is effective, and be packaged block;If more than determining cryptographic Hash to be verified Corresponding random number is invalid.
In summary, on the one hand, since the corresponding cryptographic Hash to be verified of same search number is all different, Dai Lijie Point can be to avoid same verifying work be repeated, to relatively save energy consumption.On the other hand, since miner's node is pre- There is the cryptographic Hash to be verified of each random number, agent node is without expending a large amount of Kazakhstan to be verified calculated power and calculate each random number Uncommon value, it is only necessary to lower calculation power can be completed to dig miner's work, therefore, can satisfy the low equipment of calculation power and participate in digging mine, Universality is improved, makees to become more fair so that digging miner.
In some embodiments, after being verified current block, when agent node 21 counts this digging mine, each miner Node 22 uploads the quantity of cryptographic Hash to be verified and each miner's node uploads the total amount of cryptographic Hash to be verified.Secondly, agency Node 21 uploads the proportionate relationship between the quantity and total amount of cryptographic Hash to be verified according to each miner's node, and distribution is verified The reward that current block generates.In this manner, the income of miner's node 22 can be stablized, to preferably safeguard area The stabilization and normal operation of block catenary system.
In above-mentioned each embodiment, the value range of random number is 0-264Between integer, institute's cryptographic Hash still to be tested It is all based on generating random number.Each random number will generate 256KB cryptographic Hash to be verified, and each cryptographic Hash to be verified is in local It is uniquely to exist in data.
It is understood that user setting and for store cryptographic Hash to be verified miner's node memory space Size determines that the quantity of cryptographic Hash to be verified can be stored.
In some embodiments, the data of each generating random number can be divided into the data space of preset quantity, in advance If the data space of quantity collectively forms the search space of a random number.For example, the data of each generating random number are drawn It is divided into 4096 data spaces, each data space size is 64byte, to be tested in each data space Card cryptographic Hash is made of two 32byte cryptographic Hash.Herein, each data space is known as a scoop.Each Scoop is all matched with search number, and the value range for searching for number is customized by the user, for example, accepting upper example, searches for number Value range is 0-4095.
Therefore, in general, a random number corresponds to N number of difference cryptographic Hash to be verified, and N is positive integer.Example in undertaking, N is 4096.
Search number is as obtained from making the modulo operation of N for known constant M, and M is positive integer, also that is, M is carried out The calculating of modulo N, to obtain search number.It is obtained it is known that constant M will combine block information as Hash operation, Wherein, combination block information is combined by the block information that block head in current block records with the block elevation information of current block At.
In some embodiments, Hash operation use hash algorithm include: SHA3, SHA1, SHA224, SHA256, SHA384 or SHA512.
In general, each block includes block head and block body, the block head record of each block is following any or two Kind or more block information:
1, random number;
2, difficulty value (Difficulty): difficulty value is for adjusting block formation speed, for example, every 24 blocks can be adjusted It is whole primary, it is ensured that block increases according to the speed of average 5 minutes blocks;
3, target cryptographic Hash (Base Target): target cryptographic Hash is calculated according to difficulty value, is used for test zone Whether the random number submitted in block meets the requirements;
4, digit (Bits): the integer type that target cryptographic Hash be compressed into one 64 is stored;
5, miner's wallet address;
6, it generates signature (Generate Singature): the generation signature of a upper block and miner's wallet address is breathed out Obtained from uncommon operation, for digging the calculating during mine;
7, block signature (Block Signature): agent node is using own private key to the Hash content of current block Make what signature operation obtained, whether is created by legal agent node for wallet node verification block.
Block information is combined as previously mentioned, generating signature and being combined into the block elevation information of current block, by combination region Block message obtains known constant M as Hash operation, for example, generating signature is 32byte, block elevation information is 8byte, combination Block information is 32byte, it is known that constant M is 32byte.Above-mentioned example is held, the known constant M of 32byte is carried out Modulo4096 is calculated, and obtains specified search number, for example, obtained search number is scoop11 or scoop403 etc.. Then, as previously mentioned, agent node 21 is sent to each miner's node digs mine task requests, wherein the digging mine task requests are taken Band search number scoop11, it is scoop11 that each miner's node, which searches out search number in the search space of each random number, Corresponding cryptographic Hash to be verified, such as: for miner node a, search number is scoop11 in the search space of random number A1 Corresponding cryptographic Hash to be verified is X1, and search number is to be verified corresponding to scoop11 in the search space of random number A2 Cryptographic Hash is X2, and it is X3 ... that search number, which is cryptographic Hash to be verified corresponding to scoop11, in the search space of random number A3. It is Y1 that for miner node b, in the search space of random number B1, search number, which is cryptographic Hash to be verified corresponding to scoop11, It is Y2, the search of random number B3 that search number, which is cryptographic Hash to be verified corresponding to scoop11, in the search space of random number B2 It is Y3 ... that search number, which is cryptographic Hash to be verified corresponding to scoop11, in space.
As previously mentioned, when digging mine, what the search space of each random number can be pre-generated, miner can be based on The search space of wallet address and each random number of generating random number.In some embodiments, each miner's node is all corresponding with Miner's wallet address, also, each miner's wallet address is all different.Therefore, first when generating the search space of each random number First, miner's node 22 determines the corresponding Hash seed of each cryptographic Hash to be verified, wherein any two cryptographic Hash to be verified is corresponding Hash seed it is all different, each Hash seed includes the component values being at least combined by miner's wallet address and random number. Secondly, miner's node 22 generates the cryptographic Hash to be verified of random number according to each Hash seed.As previously mentioned, each random number The data of generation are divided into 4096 data spaces, and each data space size is 64byte, each data storage Cryptographic Hash to be verified in space is made of two 32byte cryptographic Hash, and therefore, each random number can correspond to 8192 32byte Cryptographic Hash.If each cryptographic Hash to be verified is 32byte, one shares 8192 cryptographic Hash to be verified.If each Hash to be verified When value is 64byte, one shares 4096 cryptographic Hash to be verified.Again, miner's node 22 is each Hash values match pair to be verified The search number answered, to generate the search space of random number, for example, being for first Hash values match search number to be verified Scoop0, is Scoop1 for second Hash values match search number to be verified, and third Hash values match search to be verified is compiled Number be Scoop2 ....And so on, obtain 4096 or 8192 cryptographic Hash to be verified.
When miner's node 22 generates the cryptographic Hash to be verified of random number according to each Hash seed, firstly, it is according to following Syntagmatic: Hm-2Hm-3Hm-4......H2H1H0Z is combined into m-th of Hash seed, wherein m is positive integer, Hm-1It is m-th Cryptographic Hash, Z are the 1st Hash seed, and Z is combined by miner's wallet address and random number.Secondly, miner's node 22 is by Hash Seed makees Hash operation, generates cryptographic Hash Hm-1.Again, any two cryptographic Hash is combined into the random number by miner's node 22 Cryptographic Hash to be verified.
For example, Fig. 4 a is please referred to, the 1st Hash seed is combined by miner's wallet address+random number (Z), by the 1st A Hash seed Z makees Hash operation, obtains the 1st cryptographic Hash H0, remember the 1st cryptographic Hash H0For Hash#8191.
Fig. 4 b is please referred to, the 2nd Hash seed is by the 1st cryptographic Hash+miner's wallet address+random number (H0+ Z) combination At the 2nd Hash seed is made Hash operation, obtains the 2nd cryptographic Hash H1, remember the 2nd cryptographic Hash H1For Hash#8190.
Fig. 4 c is please referred to, the 3rd Hash seed is by 1 cryptographic Hash of the 2nd cryptographic Hash+the+miner's wallet address+random number (H1+H0+ Z) it is combined into, the 3rd Hash seed is made into Hash operation, obtains the 3rd cryptographic Hash H2, remember the 3rd cryptographic Hash H2For Hash#8189。
……
And so on, obtain the cryptographic Hash of preset quantity.
As previously mentioned, if one shares 8192 cryptographic Hash to be verified when each cryptographic Hash to be verified is 32byte.If each When cryptographic Hash to be verified is 64byte, one shares 4096 cryptographic Hash to be verified.When cryptographic Hash to be verified is 64byte, have Help improve fairness, relatively weaken and calculate absolute predominance brought by the strong digging mine machine of power, it is weaker to relatively improve calculation power Dig the chance that mine machine participates in digging mine.Cause are as follows: to be verified cryptographic Hash of the cryptographic Hash to be verified of 64byte relative to 32byte, rear When continuous common recognition verifying, the complexity of data calculation amount is improved.Since the existing calculation power for digging mine machine is more and more stronger, according to 32byte Cryptographic Hash to be verified, mine can be dug to real-time by calculating the strong digging mine machine of power, and calculate the weak digging mine machine such as POS machine of power, but not Mine rapidly can be dug and be exceeded or eliminate.However, it is real to calculate the strong digging mine machine of power when the cryptographic Hash to be verified using 64byte When property cannot effectively be met the requirements, then, before digging mine, calculate power by force with calculate the weak digging mine machine of power and all construct random number in advance Search space, at this point, due to not starting also to dig mine, calculate power by force with calculate the weak digging mine machine of power and do not embody significant difference also.Deng When digging mine, since cryptographic Hash to be verified in the search space of random number is all ready for, calculate power by force with calculate the weak digging mine machine of power all Difference can be reached and insignificantly dig mine efficiency, so that relatively, digging mine can be participated in by calculating the weak digging mine machine of power.
As previously mentioned, next Hash seed is that constantly group closes a Hash to be verified on the basis of upper Hash seed Value, then, the data volume of Hash seed the more is rolled the more big.When the data volume of Hash seed is excessive, the meter of miner's node can be reduced Calculate efficiency.In order to improve the computational efficiency of miner's node, in some embodiments, miner's node 22 is according to following syntagmatic:
Hm-2Hm-3Hm-4......H2H1H0Z, during being combined into m-th of Hash seed, miner's node 22 judges Hm- 2Hm-3Hm-4......H2H1H0Whether the data bits of Z is greater than presetting digit capacity threshold value;If more than selection is in Hm-2Hm- 3Hm-4......H2H1H0Sequence is in the data of the presetting digit capacity of forefront as m-th of Hash seed in Z;If being less than, selection Hm-2Hm-3Hm-4......H2H1H0Z is as m-th of Hash seed.
For example: when the data bits of Hash seed has been over 4096byte, later step is adopted when calculating Hash seed is selected at Hm-2Hm-3Hm-4......H2H1H0It is sorted in Z in the data of the presetting digit capacity of forefront, wherein The presetting digit capacity is 4096byte.Therefore, the maximum data digit of each Hash seed is not exceed 4096byte.
In some embodiments, any two cryptographic Hash is combined into the cryptographic Hash to be verified of random number by miner's node 22 When, according to following syntagmatic:
[H0Hm-1,H2Hm-3,H4Hm-5,......Hm-6H5,Hm-4H3,Hm-2H1],
Every two cryptographic Hash to be verified is combined, to form the cryptographic Hash to be verified of random number, wherein m is even number.Also, Miner's node 22 is the corresponding search number of each Hash values match to be verified, to generate the search space of random number.
For example: please refer to Fig. 4 d, miner's node 22 by " Hash#0 " and " Hash#8191 " be combined into first it is to be tested It demonstrate,proves cryptographic Hash and searches for number Scoop0 for first Hash values match to be verified, combine " Hash#2 " with " Hash#8189 " Search for number Scoop1 at second cryptographic Hash to be verified and for second Hash values match to be verified, by " Hash#4 " and " Hash#8187 " is combined into third cryptographic Hash to be verified and numbers for third Hash values match search to be verified " Hash#8188 " and " Hash#3 " are combined into the 4095th cryptographic Hash to be verified and are the 4095th to be tested by Scoop2 ... It demonstrate,proves Hash values match and searches for number Scoop4094, " Hash#8190 " and " Hash#1 " is combined into the 4096th Hash to be verified It is worth and is the 4096th Hash values match search number Scoop4095 ... to be verified, and so on, this will not be repeated here.
In above-mentioned each embodiment, when miner's node 22 is the corresponding search number of each Hash values match to be verified Afterwards, when digging mine, the search that miner's node 22 is issued according to agent node 21 is numbered, successively time from the search space of each random number It goes through out same search and numbers corresponding cryptographic Hash to be verified, and same search is numbered into corresponding cryptographic Hash to be verified and is uploaded to generation Manage node 21.In this process, miner's node 22 needs to make traversal work.
In some embodiments, corresponding cryptographic Hash to be verified is numbered in order to improve the traversal same search of miner's node 22 Operation efficiency, firstly, miner's node 22 can go out from the search space coverage of each random number same search number it is corresponding to Verify cryptographic Hash.Secondly, miner's node 22 by same search number corresponding cryptographic Hash to be verified and random number be clustered into it is identical Search for the search file of number.It is subsequent, when agent node 21 issues search number to miner's node 22,22 basis of miner's node Search number, searches for search file corresponding with search number, then search file is uploaded to agent node 21.Therefore, Its data memory format by optimizing cryptographic Hash and random number to be verified, when digging mine, miner's node 22 can pass through search text Part quickly uploads cryptographic Hash and random number to be verified to agent node 21, to improve operation effect when miner's node 22 digs mine Rate.
Each search file name is put into name format are as follows:
WalletAddress_ScoopNumber_StartingNonceNumber_NumberOfNonces。
Fig. 4 e is please referred to, the search number of search file is Scoop#403, which includes that each random number is corresponding The cryptographic Hash to be verified of same search number.
Fig. 4 f is please referred to, the search number of search file is Scoop#404.
In order to illustrate the embodiment of the present invention in further detail, digging mine main flow provided in an embodiment of the present invention is hereafter summarized. It is understood that the protection scope that digging mine main flow hereafter is not intended to restrict the invention, is only intended to aid in illustrating The embodiment of the present invention.It is as described below:
1, miner's node 22 is sent to agent node 21 digs mine request.
It digs mine request and is used to indicate addition digging mine.Dig mine request with carrying the equipment Serial Number for digging mine machine and miner's wallet Location.
2, mine request is dug in the verifying of agent node 21, and issues verification result to miner's node 22.
After being verified, miner's node 22 can be added in current mine pond by agent node 21 automatically.
3, when starting a new block digging mine, transaction record is first packaged into block by agent node 21, and according to area Block number includes: that target cryptographic Hash and search are numbered according to necessary parameter, necessary parameter is calculated.
Herein, when agent node 21 calculates search number, process specific as follows:
A, 32byte is generated signature by agent node 21 and 8byte block elevation information is combined and does Hash operation, 32byte GenHash is obtained, as shown in figure 4g.
B, 32byte GenHash progress modulo 4096 is calculated, obtains specifying search for numbering, as shown in figure 4h.
4, agent node 21 by new block essential information and specify search for number be assembled into dig mine task requests, be broadcast to All miner's nodes 22 in mine pond.
5, miner is according to specifying search for numbering, by the cryptographic Hash to be verified stored in search space (by two 32byte groups The 64byte data of synthesis) it is combined into pair with random number, it is uploaded to agent node 21 one by one.
6, agent node 21 often receives the cryptographic Hash to be verified of miner's node 22 upload, can be first to miner's node 22 Workload (this digs the quantity that mine uploads cryptographic Hash to be verified) adds up, and verifies to cryptographic Hash to be verified.
Herein, verification process is as follows:
A, after agent node 21 receives the cryptographic Hash to be verified of 64byte, by the cryptographic Hash to be verified and 32byte of 64byte Generation signature combine carry out Hash operation, obtain Hash result (Target), as shown in figure 4i.
B, Hash result (Target) and target cryptographic Hash (Base Target) are compared, if Hash result is small In or equal to target cryptographic Hash, indicate that the random number uploaded is effective, agent node 21 stops this wheel and digs mine, and starts packing area Block.
When verifying block, agent node 21 can also complete following processes:
C, check that upper a block for reference whether there is and effectively.
D, check whether the timestamp of block is later than the timestamp of a block, and earlier than following 2 hours.
E, check whether each transaction in block below transaction List Table is effective.
F, check whether the signature of block is effective using fixed public key.
G, check whether common recognition mechanism is effective.
If after 7, being verified, agent node 21 can first notify all miner's nodes 22 to stop uploading data, then completion Block information, comprising: wallet address, Nonce, Timestamp, block signature etc..
8, generated block data is broadcast in block catenary system by agent node 21.
9, agent node 21 is divided in portion new block and obtains according to amount of work and the workload of every miner's node Reward.
10, agent node 21 begins preparing the digging mine of next block.
In above-mentioned each embodiment, as previously mentioned, the mode that agent node 21 verifies current block is varied, and And a random number corresponds to N number of difference cryptographic Hash to be verified, search number is obtained by known constant M to be made to the modulo operation of N It arrives.Be with verification mode difference described in above-mentioned each embodiment: known constant M is that will combine block information to make Hash What operation obtained, wherein the block of block information, current block that combination block information is recorded by block head in current block is high Degree information and start dig mine ageing at.Relative to the combination block information in above-mentioned each embodiment, the present embodiment Combination block information, which has increased newly, to be started to dig the mine time.
Agent node 21 is according to cryptographic Hash to be verified, current when having not been able to be verified during verifying current block When block, block catenary system is the failure to enough smoothly go out block.In order to guarantee that block catenary system can smoothly go out block, pass through utilization The changeability for starting to dig the mine time abandons current block when having not been able to output block according to currently assigned search number, and Again mine is dug, is redefined with this and starts to dig the mine time.It is associated with due to specifying search for number with block information is combined, combines block Information by block information, current block block elevation information and dig mine ageing at, agent node 21 is dug again When mine, block information, the block elevation information of current block are all identical as the block of last time digging mine failure, but the beginning of the two The digging mine time is different, and then, when digging mine again, the calculated number that specifies search for of agent node 21 is lost with last digging mine The number that specifies search for lost is different, and in this manner, can guarantee smoothly to go out block.
For example: agent node 21 is according to cryptographic Hash to be verified, during verifying current block, firstly, agency's section Cryptographic Hash to be verified and generation signature are made Hash operation by point 21, obtain expectation cryptographic Hash.Secondly, the judgement expectation of agent node 21 Whether cryptographic Hash is less than or equal to target cryptographic Hash;If being less than or equal to, determine that the corresponding random number of cryptographic Hash to be verified is to have Effect, and it is packaged block;If more than, determine the corresponding random number of cryptographic Hash to be verified be it is invalid, dig mine again, and update Start to dig the mine time, so as to reconfigure out new combination block information.Then, agent node 21 is by new combination block information New known constant M is obtained as Hash operation, then new known constant M is made newly to specify search for obtained from the modulo operation of N Number.
In general, in this manner, it can guarantee that block catenary system smoothly goes out block.
Be with the difference of above-mentioned each embodiment verification mode: agent node 21 is according to cryptographic Hash to be verified, verifying During current block, firstly, agent node 21 by each cryptographic Hash to be verified divided by target cryptographic Hash, obtain with each to Verify the corresponding deadline (deadline) of cryptographic Hash.Secondly, agent node 21 obtains generation time of a upper block and works as The preceding current time difference dug between the mine time.Again, agent node 21 is worked as according to deadline and time difference, common recognition verifying Preceding block, for example, agent node 21 traverse out most from several deadlines corresponding with each cryptographic Hash to be verified Small deadline, judge whether current time difference is greater than minimum deadline;If it is not, determine cryptographic Hash to be verified it is corresponding with Machine number is invalid, and waits current block to be verified, until being packaged current when current time difference is greater than minimum deadline Block;If so, determining that the corresponding random number of cryptographic Hash to be verified is effective, and it is packaged current block.
For example: cryptographic Hash A to be verified corresponds to deadline t1, and cryptographic Hash b to be verified corresponds to deadline t2, to be tested Card cryptographic Hash c corresponds to deadline t3, wherein t1 is less than t2, and t2 is less than t3.At this point, agent node 21 records Hash to be verified Value A corresponding deadline is minimum deadline t1.Herein, a upper block is to sort to correspond to block height in currently digging mine Front, a upper block are known together, it is assumed that the current block height for digging the corresponding block of mine is the 10000th, then a upper area The block height of block is the 9999th.The generation time for enabling a upper block is ts.When agent node digs mine every time, all detection is current Dig the mine time, wherein the current digging mine time is variable.Enabling the current digging mine time is tp1, then current time difference Δ t0= tp1-ts.If Δ t0 is less than t1, agent node 21 switches to standby mode, that is, waits current block to be verified, the time of waiting It is continued until that the new current new current time difference Δ t1 for digging mine time tp2 and ts is greater than t1, is just verified and is packaged and work as Preceding block.If Δ t0 is greater than t1, it is verified and is packaged current block.
In some embodiments, agent node continues to update minimum deadline, for example, with the progress of verification process, If agent node is found compared to smaller deadline minimum deadline has been recorded, agent node updates and prestores the phase Than in having recorded smaller deadline minimum deadline and as new minimum deadline.Specifically, agency's section Point is during verifying cryptographic Hash to be verified, firstly, agent node verifies whether the deadline that current Hash calculation goes out meets Block requirement out, if satisfied, going out block immediately;If not meeting, the deadline that current Hash calculation goes out and the minimum prestored are judged The size of both deadlines acts on behalf of section if the deadline that current Hash calculation goes out is less than the minimum deadline prestored Point continues to update and prestore this compared to having recorded minimum deadline smaller deadline and cut as new minimum The only time.
Secondly, agent node judges whether current time difference is greater than the minimum deadline prestored, if more than then going out Block;If being less than, continue to verify subsequent cryptographic Hash to be verified.After institute's cryptographic Hash still to be tested has been verified, block catenary system Also fail to enough go out block, then block catenary system cuts standby mode, etc. after current times difference is greater than minimum deadline, start to beat Wrap out block.
In this manner, on the one hand, it can guarantee that block catenary system smoothly goes out block.On the other hand, it can adjust Block catenary system goes out the speed of block.
In above-mentioned each embodiment, the block body of each block all includes Transaction Information, and every transaction is all stored in friendship Yi Chizhong.Whether the exchange hour that each block chain node all monitors every transaction in trading pit is in term of validity, wherein The wallet address for having the initiator that transfers accounts all is directed toward in every transaction, if it is not, trading to the wallet address withdraw for the initiator that transfers accounts;If It is that transaction is packaged into current block, for example, miner's node can select more service charges according to the service charge height of transaction High transaction is packaged.
Relative to traditional technology, when the transaction procedure of user takes relatively low, due to economic cause, miner's node is often selected It chooses friends the high transaction of easy service charge to be packaged, without selecting transaction procedure expense is relatively low to be packaged.Therefore, transaction procedure takes Relatively low transaction will appear the too long time and be stored in trading pit, cause trading efficiency low.For this purpose, the embodiment of the present invention passes through For every transaction set term of validity, when transaction exchange hour be more than term of validity, recalled automatically to the money for the initiator that transfers accounts Packet address to reduce the probability of Fail Transaction, and reduces the storage load of trading pit.
It should be noted that not necessarily there is centainly successive between above steps in above-mentioned each embodiment Sequentially, those of ordinary skill in the art, according to an embodiment of the present invention to describe to be appreciated that in different embodiments, above-mentioned each step Suddenly there can be the different sequences that executes, also i.e., it is possible to execute parallel, execution etc. can also be exchanged.
As the another aspect of the embodiment of the present invention, the embodiment of the present invention provides a kind of digging mine device based on block chain, Applied to agent node.The digging mine device based on block chain of the embodiment of the present invention can be used as one of software function list Member, the digging mine device based on block chain includes some instructions, which is stored in memory, and processor is accessible should Memory, call instruction are executed, to complete the above-mentioned digging mine method based on block chain.
Referring to Fig. 5, the digging mine device 500 based on block chain includes: sending module 51, receiving module 52 and authentication module 53。
Sending module 51, which is used to send to each miner's node, digs mine task requests, wherein the digging mine task requests are taken With search number, each miner's node be all stored with same search number and it is corresponding with described search number at random Cryptographic Hash several and to be verified, also, the corresponding cryptographic Hash to be verified of different miner's node same search numbers is all different;
Receiving module 52 is used to receive the Kazakhstan to be verified corresponding with described search number that each miner's node uploads Uncommon value;
Authentication module 53 is used to know verifying current block according to the cryptographic Hash to be verified.
In summary, on the one hand, since the corresponding cryptographic Hash to be verified of same search number is all different, Dai Lijie Point can be to avoid same verifying work be repeated, to relatively save energy consumption.On the other hand, since miner's node is pre- There is the cryptographic Hash to be verified of each random number, agent node is without expending a large amount of Kazakhstan to be verified calculated power and calculate each random number Uncommon value, it is only necessary to lower calculation power can be completed to dig miner's work, therefore, can satisfy the low equipment of calculation power and participate in digging mine, Universality is improved, makees to become more fair so that digging miner.
In some embodiments, a random number corresponds to N number of difference cryptographic Hash to be verified, and N is positive integer;It is described For search number as obtained from known constant M is made the modulo operation of N, M is positive integer.
In some embodiments, the known constant M will combine block information and obtain as Hash operation, wherein institute State the block elevation information group of block information and the current block that combination block information is recorded by block head in current block Synthesis.
In some embodiments, the block head of each block records following any one or more block informations: random Number, target cryptographic Hash, target value, miner's wallet address, generates signature and block signature at difficulty value, wherein the generation signature Obtained from the generation signature of a upper block and miner's wallet address are made Hash operation, the block signature is agent node Make what signature operation obtained using Hash content of the own private key to current block.
In some embodiments, referring to Fig. 6, authentication module 33 includes: arithmetic element 331, judging unit 332, is packaged Unit 333 and determination unit 334.
Arithmetic element 331 is used to the cryptographic Hash to be verified and generation signature making Hash operation, obtains expectation and breathes out Uncommon value;
Judging unit 332 is for judging whether the expectation cryptographic Hash is less than or equal to the target cryptographic Hash;
If packaged unit 333 for being less than or equal to, determine the corresponding random number of the cryptographic Hash to be verified be it is effective, And it is packaged block;
Determination unit 334 is used to determine that the corresponding random number of the cryptographic Hash to be verified is invalid.
In some embodiments, referring to Fig. 7, the digging mine device 500 based on block chain further include: statistical module 54 with point With module 55.
Statistical module 54 for count this dig mine when, each miner's node upload the quantity of cryptographic Hash to be verified with And each miner's node uploads the total amount of cryptographic Hash to be verified;
Distribution module 55 be used for according to each miner's node upload cryptographic Hash to be verified quantity and the total amount it Between proportionate relationship, distribution is verified the reward that the current block generates.
It should be noted that the above-mentioned digging mine device based on block chain, which can be performed, is based on area provided by the embodiment of the present invention The digging mine method of block chain, has the corresponding functional module of execution method and beneficial effect.Not in the collaboration based on proof of work The technical detail of detailed description in equipment embodiment, reference can be made to the digging mine based on block chain provided by the embodiment of the present invention Method.
As the another aspect of the embodiment of the present invention, the embodiment of the present invention provides a kind of digging mine machine, which can be Agent node can also be miner's node.Referring to Fig. 8, the digging mine machine 800 includes: one or more processors 81 and deposits Reservoir 82.Wherein, in Fig. 8 by taking a processor 81 as an example.
Processor 81 can be connected with memory 82 by bus or other modes, to be connected as by bus in Fig. 8 Example.
Memory 82 is used as a kind of non-volatile computer readable storage medium storing program for executing, can be used for storing non-volatile software journey Sequence, non-volatile computer executable program and module, such as the proof of work collaboration working method in the embodiment of the present invention Corresponding program instruction/module.Processor 81 by operation be stored in memory 82 non-volatile software program, instruction with And module, digging mine method or above-mentioned each embodiment thereby executing above-mentioned each embodiment based on block chain based on The various function application and data processing of the digging mine device of block chain.
Memory 82 may include high-speed random access memory, can also include nonvolatile memory, for example, at least One disk memory, flush memory device or other non-volatile solid state memory parts.In some embodiments, memory 82 Optional includes the memory remotely located relative to processor 81, these remote memories can pass through network connection to processor 81.The example of above-mentioned network includes but is not limited to internet, intranet, local area network, mobile radio communication and combinations thereof.
Described program instruction/module is stored in the memory 82, is held when by one or more of processors 81 When row, the digging mine method based on block chain in above-mentioned any means embodiment is executed, for example, thereby executing above-mentioned each implementation The various functions of the digging mine device based on block chain of the digging mine method or above-mentioned each embodiment based on block chain of example are answered With and data processing.
The embodiment of the invention also provides a kind of non-transient computer readable storage medium, the non-transient computer is readable Storage medium is stored with computer executable instructions, and the computer executable instructions are as above any for executing agent node The digging mine method based on block chain described in.
The embodiment of the invention provides a kind of computer program product, the computer program product is non-easy including being stored in Computer program on the property lost computer readable storage medium, the computer program includes program instruction, when described program refers to When proxied node being enabled to execute, the agent node is made to execute described in any item digging mine methods based on block chain.
In summary, on the one hand, since the corresponding cryptographic Hash to be verified of same search number is all different, Dai Lijie Point can be to avoid same verifying work be repeated, to relatively save energy consumption.On the other hand, since miner's node is pre- There is the cryptographic Hash to be verified of each random number, agent node is without expending a large amount of Kazakhstan to be verified calculated power and calculate each random number Uncommon value, it is only necessary to lower calculation power can be completed to dig miner's work, therefore, can satisfy the low equipment of calculation power and participate in digging mine, Universality is improved, makees to become more fair so that digging miner.
Device or apparatus embodiments described above is only schematical, wherein it is described as illustrated by the separation member Unit module may or may not be physically separated, and the component shown as modular unit can be or can also Not to be physical unit, it can it is in one place, or may be distributed on multiple network module units.It can basis It is actual to need that some or all of the modules therein is selected to achieve the purpose of the solution of this embodiment.
Through the above description of the embodiments, those skilled in the art can be understood that each embodiment can It is realized by the mode of software plus general hardware platform, naturally it is also possible to pass through hardware.Based on this understanding, above-mentioned technology Scheme substantially in other words can be embodied in the form of software products the part that the relevant technologies contribute, the computer Software product may be stored in a computer readable storage medium, such as ROM/RAM, magnetic disk, CD, including some instructions to So that computer equipment (can be personal computer, server or the network equipment etc.) execute each embodiment or Method described in certain parts of embodiment.
Finally, it should be noted that the above embodiments are merely illustrative of the technical solutions of the present invention, rather than its limitations;At this It under the thinking of invention, can also be combined between the technical characteristic in above embodiments or different embodiment, step can be with It is realized with random order, and there are many other variations of different aspect present invention as described above, for simplicity, they do not have Have and is provided in details;Although the present invention is described in detail referring to the foregoing embodiments, the ordinary skill people of this field Member is it is understood that it is still possible to modify the technical solutions described in the foregoing embodiments, or to part of skill Art feature is equivalently replaced;And these are modified or replaceed, each reality of the application that it does not separate the essence of the corresponding technical solution Apply the range of a technical solution.

Claims (10)

1. a kind of digging mine method based on block chain is applied to agent node, which is characterized in that the described method includes:
It is sent to each miner's node and digs mine task requests, wherein the digging mine task requests carry search number, described to search Rope number is used to indicate each miner's node and searches out in the search space of each random number and described search number pair All there is same search number, same search number between the search space of any two random number in the cryptographic Hash to be verified answered Corresponding cryptographic Hash to be verified is all different;
Receive the cryptographic Hash to be verified corresponding with described search number that each miner's node uploads;
According to the cryptographic Hash to be verified, current block is verified.
2. the method according to claim 1, wherein
One random number corresponds to N number of difference cryptographic Hash to be verified, and N is positive integer;
Described search is numbered as obtained from known constant M is made the modulo operation of N, and M is positive integer.
3. according to the method described in claim 2, it is characterized in that, the known constant M is that will combine block information to make Hash What operation obtained, wherein the block information that the combination block information is recorded by block head in current block works as proparea with described The block elevation information of block is combined into.
4. according to the method described in claim 3, it is characterized in that, the block head record of each block is following any one or two kinds of The above block information: random number, target cryptographic Hash, miner's wallet address, generates signature and block signature at difficulty value, wherein institute Obtained from generation signature is stated as the generation signature of a upper block and miner's wallet address are made Hash operation, the block signature Make what signature operation obtained using Hash content of the own private key to current block for agent node.
5. according to the method described in claim 4, proparea is worked as in verifying it is characterized in that, described according to the cryptographic Hash to be verified Block, comprising:
The cryptographic Hash to be verified and generation signature are made into Hash operation, obtain expectation cryptographic Hash;
Judge whether the expectation cryptographic Hash is less than or equal to the target cryptographic Hash;
If being less than or equal to, determine that the corresponding random number of the cryptographic Hash to be verified is effective, and be packaged block;
If more than determining that the corresponding random number of the cryptographic Hash to be verified is invalid.
6. the method according to claim 1, wherein the method is also after being verified the current block Include:
Count this dig mine when, each miner's node upload cryptographic Hash to be verified quantity and each miner's node Upload the total amount of cryptographic Hash to be verified;
The proportionate relationship between the quantity of cryptographic Hash to be verified and the total amount is uploaded according to each miner's node, distribution is tested Demonstrate,prove the reward generated by the current block.
7. a kind of digging mine device based on block chain, it is applied to agent node, which is characterized in that described device includes:
Sending module digs mine task requests for sending to each miner's node, wherein the digging mine task requests, which carry, searches Rope number, each miner's node be all stored with same search number and random number corresponding with described search number and to Cryptographic Hash is verified, also, the corresponding cryptographic Hash to be verified of different miner's node same search numbers is all different;
Receiving module, the cryptographic Hash to be verified corresponding with described search number uploaded for receiving each miner's node;
Authentication module, for verifying current block according to the cryptographic Hash to be verified.
8. a kind of non-transient computer readable storage medium, which is characterized in that the non-transient computer readable storage medium is deposited Computer executable instructions are contained, the computer executable instructions are for executing agent node as claim 1 to 6 is any The digging mine method based on block chain described in.
9. a kind of digging mine machine characterized by comprising
At least one processor;And
The memory being connect at least one described processor communication;Wherein, be stored with can be by described at least one for the memory The instruction that a processor executes, described instruction is executed by least one described processor, so that at least one described processor energy It is enough in execution such as the digging mine method as claimed in any one of claims 1 to 6 based on block chain.
10. a kind of block catenary system characterized by comprising
Miner's node;
Agent node, the agent node and miner's node communication;
Wherein, the agent node includes:
At least one processor;And
The memory being connect at least one described processor communication;Wherein, be stored with can be by described at least one for the memory The instruction that a processor executes, described instruction is executed by least one described processor, so that at least one described processor energy It is enough in execution such as the digging mine method as claimed in any one of claims 1 to 6 based on block chain.
CN201811013770.4A 2018-08-31 2018-08-31 Digging mine method and device, digging mine machine and block catenary system based on block chain Pending CN109255614A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811013770.4A CN109255614A (en) 2018-08-31 2018-08-31 Digging mine method and device, digging mine machine and block catenary system based on block chain

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811013770.4A CN109255614A (en) 2018-08-31 2018-08-31 Digging mine method and device, digging mine machine and block catenary system based on block chain

Publications (1)

Publication Number Publication Date
CN109255614A true CN109255614A (en) 2019-01-22

Family

ID=65050034

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811013770.4A Pending CN109255614A (en) 2018-08-31 2018-08-31 Digging mine method and device, digging mine machine and block catenary system based on block chain

Country Status (1)

Country Link
CN (1) CN109255614A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111402049A (en) * 2020-03-11 2020-07-10 北京价值互联科技有限公司 Mining method based on block chain mortgage transaction
CN111447069A (en) * 2020-03-23 2020-07-24 腾讯科技(深圳)有限公司 Low-frequency access data processing method based on block chain
CN113487201A (en) * 2021-07-14 2021-10-08 海南马良师傅网络科技有限公司 Instrument relocation task distribution system

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106713412A (en) * 2016-11-09 2017-05-24 弗洛格(武汉)信息科技有限公司 Block chain system and construction method of block chain system
CN107005574A (en) * 2016-12-23 2017-08-01 深圳前海达闼云端智能科技有限公司 Block generation method and device and block chain network
CN107464117A (en) * 2017-08-04 2017-12-12 平安科技(深圳)有限公司 Data managing method and block catenary system based on block chain
CN107995120A (en) * 2016-11-22 2018-05-04 南京银链信息科技有限公司 Construct the method and multi-tiling catenary system of multi-tiling chain

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106713412A (en) * 2016-11-09 2017-05-24 弗洛格(武汉)信息科技有限公司 Block chain system and construction method of block chain system
CN107995120A (en) * 2016-11-22 2018-05-04 南京银链信息科技有限公司 Construct the method and multi-tiling catenary system of multi-tiling chain
CN107005574A (en) * 2016-12-23 2017-08-01 深圳前海达闼云端智能科技有限公司 Block generation method and device and block chain network
CN107464117A (en) * 2017-08-04 2017-12-12 平安科技(深圳)有限公司 Data managing method and block catenary system based on block chain

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111402049A (en) * 2020-03-11 2020-07-10 北京价值互联科技有限公司 Mining method based on block chain mortgage transaction
CN111447069A (en) * 2020-03-23 2020-07-24 腾讯科技(深圳)有限公司 Low-frequency access data processing method based on block chain
CN113487201A (en) * 2021-07-14 2021-10-08 海南马良师傅网络科技有限公司 Instrument relocation task distribution system
CN113487201B (en) * 2021-07-14 2022-11-11 海南马良师傅网络科技有限公司 Instrument relocation task distribution system

Similar Documents

Publication Publication Date Title
CN109146484A (en) Common recognition verification method, digging mine machine and block catenary system based on block chain
CN109087111A (en) Common recognition verification method, digging mine machine and block catenary system based on block chain
CN109242299A (en) Distribution digs mine method, digs mine machine and block catenary system
CN109087105A (en) For digging the Hash Search method of mine, digging mine machine and block catenary system
CN108717630B (en) Block output method and implementation system thereof
CN109885264B (en) Logic slicing method and system for block chain link points
CN109741039B (en) Accounting method, mine pool server, terminal equipment, mine excavation node and mine pool
Wang et al. Decentralized caching for content delivery based on blockchain: A game theoretic perspective
CN109075964B (en) Block chaining supporting multiple one-way functions for block verification
CN109242491A (en) It digs mine identity identifying method, dig mine machine and block catenary system
CN108776929A (en) Bill processing method, system based on block chain database and readable storage medium storing program for executing
KR101994455B1 (en) distributed network system operating a group for the nodes included in the system
CN107480990A (en) Block chain bookkeeping methods and device
EP4318362A1 (en) Blockchain-based data processing method, apparatus and device, and storage medium
CN110417558A (en) Verification method and device, the storage medium and electronic device of signature
CN108492183A (en) Account trading method, system and the computer readable storage medium of block chain
CN110855432B (en) Asynchronous BFT & DPOS consensus mechanism for assigning verifier rewards based on verifiable random functions
CN112085504B (en) Data processing method and device, computer equipment and storage medium
CN109255614A (en) Digging mine method and device, digging mine machine and block catenary system based on block chain
CN110519297A (en) A kind of data processing method and equipment based on block chain private key
CN111314067A (en) Block storage method and device, computer equipment and storage medium
CN108898440A (en) Flow exchanging method and device
CN109088722A (en) Block chain node evolution method and block chain node
CN116595094A (en) Federal learning incentive method, device, equipment and storage medium based on block chain
Ren et al. Pooled mining is driving blockchains toward centralized systems

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
AD01 Patent right deemed abandoned

Effective date of abandoning: 20210409

AD01 Patent right deemed abandoned