CN109977166B - Block chain consensus mechanism - Google Patents
Block chain consensus mechanism Download PDFInfo
- Publication number
- CN109977166B CN109977166B CN201910123323.2A CN201910123323A CN109977166B CN 109977166 B CN109977166 B CN 109977166B CN 201910123323 A CN201910123323 A CN 201910123323A CN 109977166 B CN109977166 B CN 109977166B
- Authority
- CN
- China
- Prior art keywords
- miners
- block chain
- block
- miner
- range
- 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.)
- Active
Links
- 238000012795 verification Methods 0.000 claims abstract description 24
- 238000004364 calculation method Methods 0.000 claims abstract description 17
- 238000000034 method Methods 0.000 claims abstract description 17
- 238000000605 extraction Methods 0.000 claims description 4
- 238000004519 manufacturing process Methods 0.000 abstract description 2
- 238000010187 selection method Methods 0.000 abstract 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 238000012790 confirmation Methods 0.000 description 1
- 238000010586 diagram Methods 0.000 description 1
- 230000005611 electricity Effects 0.000 description 1
- 238000005265 energy consumption Methods 0.000 description 1
- 238000005065 mining Methods 0.000 description 1
Images
Landscapes
- Storage Device Security (AREA)
- Management, Administration, Business Operations System, And Electronic Commerce (AREA)
Abstract
A block chain consensus method comprises a block chain public chain, wherein miners and verification nodes are arranged on the block chain public chain, the miners are registered nodes participating in block production in the block chain public chain, the verification nodes record the registered miners, the verification nodes manage the miners in a queue mode, and the verification nodes generate miner numbers for new miners through calculation. According to the block chain consensus method, a node is obtained through the random selection method, the problem of miner centralization in the block chain is solved, the calculation method is simple, the block outlet efficiency is improved, the calculation time is short, the resource consumption is low, miner numbers are randomly generated, the DDOS attack difficulty is improved, and the network security is enhanced.
Description
Technical Field
The invention relates to the technical field of block chains, in particular to a block chain consensus method.
Background
The existing Block chain consensus mostly adopts a POW scheme (workload certification), the POW scheme is that a Block Hash meeting requirements is composed of N leading zeros, the number of the zeros depends on the difficulty value of a network, a large amount of trial calculation needs to be carried out to obtain a reasonable Block Hash, the calculation time depends on the Hash operation speed of a machine, when a certain node provides a reasonable Block Hash value, the node is proved to be actually subjected to a large amount of trial calculation, certainly, the absolute value of the calculation times cannot be obtained, and the finding of the reasonable Hash is a probability event. When a node has the computing power which accounts for n% of the whole network, the node finds the Block Hash with the probability of n/100, so that the higher the computing power of the node is, the higher the probability of obtaining the Block Hash is, in use, the outgoing blocks are concentrated to the nodes with high computing power, and the serious centralization problem exists in a Block chain network.
In the using process, due to the limitation of the maximum block size of 1MB in the POW scheme, each block has about 10 minutes of confirmation delay (depending on the average transaction size), the maximum transaction amount is only 7 times/second (TPS), and the 7TPS obviously cannot meet the requirement of upper-layer service; and the energy consumption is huge, such as: the bitcoin network currently consumes about 25.5 Gigawatts (GW) of electricity per year, the entire ireland power usage is only 3.1 gigawatts, the austria power usage is 8.2 gigawatts, the electrical energy consumed by the bitcoin network far exceeds the overall power usage of small countries, and the number of too kilowatt hours (TWH) consumed by the bitcoin network has increased by 413.37% in the past year. Therefore, increasing transaction rate and saving power are issues that must be addressed in blockchain networks.
Disclosure of Invention
The invention aims to provide a block chain consensus method, which can solve the problem of centralization of miners in a block chain.
In order to achieve the purpose, the invention adopts the following technical scheme: a block chain consensus method comprises a block chain public chain, miners and verification nodes are arranged on the block chain public chain, the miners are registered in the block chain public chain and participate in block discharge, the verification nodes record the registered miners, the miners are managed by the verification nodes in a queue mode, and the numbers of the miners are generated by the verification nodes through calculation.
Preferably, the verification node selects the next miner number through a random selection algorithm.
Preferably, the random selection algorithm is implemented as follows:
acquiring the total number of miners in a public chain of a block chain, wherein the total number of the miners is m, and the m is a positive integer with the minimum value of 16;
acquiring the latest block number, wherein the latest block number is n, and n is an integer with the minimum value of 0;
acquiring a random character in a hash value character string of the latest block as a modulus, and when the random character is 0, adding 1 to the acquired character to obtain the modulus, wherein the modulus is mod; (ii) a
The miner range is c, and the miner range is obtained by calculating a mod through the block number n and the modulus;
the boundary of the miner range is s, and the boundary is obtained by calculating mod through the total number m of miners and a modulus;
the last range of the miners is mathematically r; calculating and obtaining the new block number n and the boundary s of the miner range;
the miner number is k, and the calculation method of the k value is as follows: k = c × s + r.
Preferably, the value of the mineworker's range c is the remainder of dividing n by mod.
Preferably, the value of the mineworker range boundary is m divided by the quotient integer part of mod.
Preferably, the last range of the miners is the remainder of the result of dividing n by s.
Preferably, the modulus mod is a random character in the string of latest chunk hash values.
Preferably, the modulus mod is the 20 th byte in the string of the latest chunk hash value.
Preferably, the block chain consensus method is applied to a block chain network.
Compared with the prior art, the invention has the following advantages and beneficial effects: a random mechanism proves that a node is selected, and the problem of centralization of miners in a block chain is solved; the calculation method is simple, and the block output efficiency is improved; the calculation time is short, and the resource consumption is low; and the miner number is randomly generated, so that the DDOS attack difficulty is improved, and the network security is enhanced.
Drawings
Fig. 1 is a schematic diagram of a block chain consensus system according to the present invention.
Detailed Description
The technical solution of the present invention will be described in further detail below.
A block chain consensus method comprises a block chain public chain, wherein miners and verification nodes are arranged on the block chain public chain, the miners are registered nodes participating in block production in the block chain public chain, the verification nodes record the registered miners, the verification nodes manage the miners in a queue mode, and the verification nodes generate miner numbers through calculation.
The block chain consensus method provided by the present invention, as shown in fig. 1, specifically comprises the following steps:
and step 1, verifying the validity of the new block.
And inputting related node information into the node participating in block extraction in the public chain of the block chain through the verification node, and after the verification node passes the verification after the node information is verified, registering the node participating in block extraction as a new miner.
And 2, managing miners.
The verification node records miners and arranges the miners into a queue according to the registration sequence.
And 3, selecting the serial number of the miner by a random selection algorithm.
Acquiring the total number of miners in a public chain of a block chain, wherein the total number of the miners is m, and the m is a positive integer with the minimum value of 16;
acquiring the latest block number, wherein the latest block number is n, and n is an integer with the minimum value of 0;
acquiring a random character in a hash value character string of the latest block as a modulus, and when the random character is 0, adding 1 to the acquired character to obtain the modulus, wherein the modulus is mod; (ii) a
The miners range is c, and the numerical value of c is the remainder of dividing n by mod;
the boundary of the mineworker range is s, and the numerical value of the s is the integer part of m divided by mod quotient;
the last range of the miners is mathematically r, and the numerical value of r is the remainder of the result of dividing n by s;
the calculation method of the number k of the miners comprises the following steps: k = c × s + r.
Example 1
The method comprises the steps that nodes participating in block extraction are registered as miners of a public chain of a block chain, a verification node records new miners and arranges the miners into a queue, the verification node obtains the total number m of the miners in the mining chain, the latest block number n and the 20 th character in the latest block hash value character string as a modulus mod, the remainder of dividing n by mod is used as a miner range c, the miner range boundary s is determined by dividing m by the integer part of the mod quotient, the remainder of dividing n by s is used as the last miner range mathematical r, the miner number k is calculated through the formula k = c x s + r, and finally the obtained k value is endowed to the new miners.
The block chain consensus method provided by the invention proves that a node is selected through a random mechanism, the problem of miner centralization in the block chain is solved, the calculation method is simple, the block outlet efficiency is improved, the calculation time is short, the resource consumption is low, miner numbers are randomly generated, the DDOS attack difficulty is improved, and the network security is enhanced.
Claims (4)
1. A block chain consensus method comprises a block chain public chain, wherein miners and verification nodes are arranged on the block chain public chain, and the block chain consensus method is characterized in that: the miners are registered in a public chain of the block chain and participate in block extraction, the number of the miners is recorded by the verification node, the miners are managed by the verification node in a queue form, and the numbers of the miners are generated by the verification node through calculation;
the verification node obtains the next miner number through a random selection algorithm;
the random selection algorithm is realized as follows:
acquiring the total number of miners in a public chain of a block chain, wherein the total number of the miners is m, and the m is a positive integer with the minimum value of 16;
acquiring the number of the latest block, wherein the number of the latest block is n, and the n is an integer with the minimum value of 0;
acquiring a random character in a hash value character string of the latest block as a modulus, and when the random character is 0, adding 1 to the acquired character to obtain the modulus, wherein the modulus is mod;
the miner range is c, and the miner range is obtained by calculating mod through the block number n and the modulus;
the boundary of the miner range is s, and the boundary is obtained by calculating mod through the total number m of miners and a modulus;
the last range of the miners is mathematical r; calculating the new block number n and the boundary s of the miner range to obtain;
the miner number is k, and the calculation method of the k value is as follows: k = c × s + r;
wherein the numerical value of the miner range c is the remainder of dividing n by mod;
the numerical value of the miner range boundary s is m divided by mod;
the last range of the miners is the remainder of the result of dividing n by s.
2. The block chain consensus method of claim 1, wherein: the modulus mod is a random character in the string of latest chunk hash values.
3. The block chain consensus method of claim 1, wherein: the modulus mod is the 20 th byte in the string of the latest chunk hash value.
4. The block chain consensus method of claim 1, wherein: the block chain consensus method is applied to a block chain network.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910123323.2A CN109977166B (en) | 2019-02-18 | 2019-02-18 | Block chain consensus mechanism |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910123323.2A CN109977166B (en) | 2019-02-18 | 2019-02-18 | Block chain consensus mechanism |
Publications (2)
Publication Number | Publication Date |
---|---|
CN109977166A CN109977166A (en) | 2019-07-05 |
CN109977166B true CN109977166B (en) | 2022-12-20 |
Family
ID=67077111
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201910123323.2A Active CN109977166B (en) | 2019-02-18 | 2019-02-18 | Block chain consensus mechanism |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN109977166B (en) |
Families Citing this family (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110769028B (en) * | 2019-09-10 | 2022-04-15 | 陕西优米数据技术股份有限公司 | Pattern authorization consensus system and method based on block chain technology |
CN111683120A (en) * | 2020-05-22 | 2020-09-18 | 哈尔滨工程大学 | An alliance node storage method that supports dynamic changes of verification nodes |
CN112202487B (en) | 2020-09-30 | 2022-03-08 | 东南大学 | Block chain structure based on satellite |
CN114650289B (en) * | 2020-12-02 | 2023-04-14 | 王志诚 | Method and device for block chain consensus |
CN112967148B (en) * | 2021-03-30 | 2024-02-20 | 电子科技大学长三角研究院(衢州) | Block chain consensus mechanism for intelligent Internet of things computing service |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102521653A (en) * | 2011-11-23 | 2012-06-27 | 河海大学常州校区 | Biostimulation neural network device and method for jointly rescuing by multiple underground robots |
CN109087105A (en) * | 2018-08-31 | 2018-12-25 | 深圳付贝科技有限公司 | For digging the Hash Search method of mine, digging mine machine and block catenary system |
CN109191197A (en) * | 2018-08-24 | 2019-01-11 | 陕西优米数据技术有限公司 | Video passenger flow statistical analysis based on block chain technology |
CN109242299A (en) * | 2018-08-31 | 2019-01-18 | 深圳付贝科技有限公司 | Distribution digs mine method, digs mine machine and block catenary system |
Family Cites Families (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US8024391B2 (en) * | 2006-11-06 | 2011-09-20 | Atmel Rousset S.A.S. | Modular multiplication method with precomputation using one known operand |
US9569771B2 (en) * | 2011-04-29 | 2017-02-14 | Stephen Lesavich | Method and system for storage and retrieval of blockchain blocks using galois fields |
-
2019
- 2019-02-18 CN CN201910123323.2A patent/CN109977166B/en active Active
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102521653A (en) * | 2011-11-23 | 2012-06-27 | 河海大学常州校区 | Biostimulation neural network device and method for jointly rescuing by multiple underground robots |
CN109191197A (en) * | 2018-08-24 | 2019-01-11 | 陕西优米数据技术有限公司 | Video passenger flow statistical analysis based on block chain technology |
CN109087105A (en) * | 2018-08-31 | 2018-12-25 | 深圳付贝科技有限公司 | For digging the Hash Search method of mine, digging mine machine and block catenary system |
CN109242299A (en) * | 2018-08-31 | 2019-01-18 | 深圳付贝科技有限公司 | Distribution digs mine method, digs mine machine and block catenary system |
Non-Patent Citations (3)
Title |
---|
Crypto Crumple Zones: Enabling Limited Access without Mass Surveillance;Charles Wright et al.;《2018 IEEE European Symposium on Security and Privacy (EuroS&P)》;20180709;288-306 * |
区块链技术在场外衍生品市场的应用场景设计;裴英剑 等;《中国证券期货》;20180228;36-46 * |
比特币的公平支付及监管问题的研究;王丹妮;《中国优秀硕士学位论文全文数据库 经济与管理科学辑》;20190215;J159-18 * |
Also Published As
Publication number | Publication date |
---|---|
CN109977166A (en) | 2019-07-05 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109977166B (en) | Block chain consensus mechanism | |
CN108470276A (en) | A kind of block chain common recognition method using agency's book keeping operation | |
CN110011810B (en) | Block chain anonymous signature method based on linkable ring signature and multiple signatures | |
US11121880B2 (en) | Method for reaching consensus on public distributed ledgers and system using the same | |
CN109039639A (en) | Bidding system based on layering certainty cryptological technique | |
CN113312608B (en) | Electric power metering terminal identity authentication method and system based on time stamp | |
CN108600161A (en) | A kind of fair efficient block chain common recognition method | |
CN111698222B (en) | Covert communication method of special bitcoin address generated based on vanitygen | |
CN112152813B (en) | Certificateless content extraction signcryption method supporting privacy protection | |
CN107067242A (en) | Difficulty value creation method in a kind of block chain generating process | |
CN113032370A (en) | Design method of partitioned block chain system | |
CN101872338B (en) | Method for obtaining safe information abstract in authentication header | |
CN113382016A (en) | Fault-tolerant safe lightweight data aggregation method under intelligent power grid environment | |
CN111541666A (en) | Certificateless cloud end data integrity auditing method with privacy protection function | |
CN115765968A (en) | A Homomorphic Encryption Data Security Fusion Method Based on Combined Random Numbers | |
Zamanov et al. | ASIC-resistant hash functions | |
CN109104289B (en) | Method for proving network contribution proving consensus based on P2P block chain | |
CN115842633A (en) | Efficient tracing method based on block chain data sharing | |
CN112073183A (en) | Block chain account generation method | |
CN114614991A (en) | Block chain automatic settlement method and system suitable for small micro load aggregation response | |
CN113708924B (en) | Elliptic curve threshold signature method based on block chain | |
CN202121594U (en) | Quantum security communication system based on synchronous random number information base information retrieval | |
Huang et al. | Snapshotprune: A novel bitcoin-based protocol toward efficient pruning and fast node bootstrapping | |
CN116346503B (en) | Encryption method and device for water carbon emission data based on full life cycle | |
CN118657517A (en) | Intelligent data collection and transmission method for electrical equipment based on the Internet of Things |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |