Consensus mechanism is the soul of block chain, as a country's law, maintain the normal operation of this world of chain block, block is one of the earliest consensus chain workload (POW), COINS and etheric fang are using work proves that the rights are a trend of the fashion now to prove (POS), etheric lane 2.0 will use POS consensus, there's the new chain such as Tezos, Polkadot, Algorand etc, rights certificate include entrusted rights (DPOS), representative of EOS, most of the other chain adopt the consensus of the public is derived from the pew or POS, we temporarily put chain alliance agreement not to discuss the category, from POW to POS, to study the development of chain block consensus,
Work certificate
Block chain consensus decision is the purpose of the right to block, effort to prove that the basic idea is to use force to decide the right to block, if you can first solve the calculation problem of POW, you can block, at each point in time, everyone in computation, and at the same time, we sum up the topic, and then the calculation results released out, this is actually a process of voting, release the block's vote, was finally selected, is the fastest from the calculated result of mine machine, as to not release of nodes, equivalent to abstain, effort to prove one of the biggest advantages, is to vote and the right to vote is binding, and once the vote after success, even if him voters can modify the content of the vote, because generally before the block, node pack has a block, then proof of this piece of work, done immediately cast out, this time packing block has no way to modify,
Mill run one day can throw out a lot of votes, but can not put all of the work force into a block; , on the other hand, if you want to roll back off his out of the blocks, also must pay and roll back the others required the same piece of work force, it is impossible, so POW consensus is very safe,
Mechanism to do consensus algorithm based on POW is the main disadvantages of delay is higher, because after we wrap up trading to the block, and complete a work proof, the block can be called a candidate block, workload that time is not so short, otherwise easy to split ends, so, at least from the pack up to finish the block of the effort to prove that a period of time, trading is to be confirmed,
Why can't effort to prove that time set too short? For certain cases, the condition of network broadcasting speed is limited, if the speed setting faster than radio speed, makes the node before received another new piece, they dig in, this would be A fork, if the gap is larger, the bifurcation is particularly much, bifurcation will reduce the security, said the attack on the currency we need 51% of the work force, the premise is that everyone is focused on the same chain, the good is 49%, the bad guys to have 51% can attack, but if really appear frequently bifurcate, for example I have 30% of the work force on A bifurcation, on bifurcate B 40% of the work force, when the bad guys want to bifurcation B change to roll back to A, only need 11% calculate force can, as long as than the most honest work force of the world's the difference between the two bifurcate that A little bit more, the attacker can make the longest chain in the two above the jumping on the branch, greatly reduce the security,
POW mechanism of another being criticized point is especially high energy consumption, environmental protection, because the hash operation power consumption, so, if you want to get block chain to support large-scale commercial, POW needs to change, so there will be a POS,
Interest in
Rights to prove the basic idea is: hold some COINS do pledge, to get the right to charge to an account and voting rights, voting rights and cash is proportional to the number of COINS, one vote, the more money, the greater the right to vote,
Don't know how many mill with POW involved in mining, POS agreement must know all the consensus on the number of participants and their amount of cash, and then to assign rights and voting rights, the other in POW, packaging and voting rights is together, but in POS, both of which can be separated, after distribution package right, get the package right has the qualifications of a candidate block, the block contains processing trade, and with his own signature, will be immediately join consensus candidate block does not mean that, after the broadcast candidate blocks need to by those who have the right to vote to vote, if they can get the support of the majority will eventually be candidate blocks to join the consensus, become an effective block, the voting process, of course, we can perform in many ways, more common is to use the minority is subordinate to the majority of the consensus algorithm, because now we know how many people are eligible to vote, how many tickets, so we use this consensus algorithm is easy to work out the most, such as more than 1/2 or 2/3,
In the decentralized system, who is responsible for the packaging, we need to election vote who is responsible for, sometimes for the sake of efficiency, we will choose a smaller committee first, and then by their vote, this commission is usually random, and more often rotate for the sake of fairness, or you can also use proxy DPOS mechanism of interest, the selection of relatively fixed commission is responsible for the packaging and vote, although such loss to some degree of decentralization, but it can greatly improve the efficiency,
In the POS system, if there is a participant in violation of the detected POS consensus agreement, such as more than one ticket, or to give up, you can make some punishment to them, all affect the security of the system behavior should receive punishment,
The advantages and disadvantages of interest in
Relative POW, what advantages do you have in interest in,
First advantage: the motivation of miners and the cash is consistent, POS miners must be in cash, in the whole ecological environment reduces a cash machine alone to the role of mining in the community of POW, cash, developers, and miners interests of three parties are not completely consistent, often have a conflict, the POS, miners and the interests of the wealthy more consistent, at least to a certain extent, reducing the conflicts and differences,
Second advantage: POS delay can be very low, very fast, can confirm in POS system, get a deal can be immediately packaging, packaging can be broadcast later, this time is no need to wait for, not like a POW, must wait at least do a hash operation time, in fact, the POS consensus delay is mainly restricted to network and the number of people to vote, the slower the network, the more people vote, waiting time is longer,
Third advantage: POS is environmental protection, because it does not need to use force to do work that vote is actually do a signature, then do some simple operation, easier than problem solving POW, so POS node hardware cost is very small, not electricity,
However, POS have their own problems,
The first is the communication complexity associated with the number of voting, and usually is square, the relationship between the number of people to vote, the more the more complex communication, consensus need time is longer, however, now through RBFT, BLS signature technology, can greatly reduce the number of voting, this problem is basically obtained the very good solution,
There is a problem of the nature of the comparison is voting decision time is earlier than generate candidate block, POW is packaged first, then vote, the final decision right to block, threw the ticket cannot be changed, in POS, decide the right to vote and voting is separate, not tied together, have a block in the past, we know who has the right to vote, so to get the right to vote, I can go casually, that means I can choose the strategy of space is larger, the game will become more complex, generally speaking, the strategy space for security is bad, because an attacker to set aside the larger operating space, an attacker if the operation space is large, capable of a lot of things, want to guarantee the security will become more difficult, the more the more difficult it is to guarantee the safety of complex system, on the one hand is to analyze would be more difficult to prove, on the other hand is the attackers were also more likely to find loopholes in complex system, so in POS system, there are many kinds of attacks, such as no interest, long-range attack, such as
Some interest in
Introduces a few famous POS consensus, mainly to understand their basic principles and their differences,
Tendermint
This is to use consensus across the Cosmos chain platform, can serve as a primer for understanding POS consensus, Tendermint new piece each time by not fixed nodes, then let all the other nodes by means of PBFT to block a vote, more than two-thirds of the chamber's passed, and it is the ultimate confirmation on the block, do not have to wait like POW several blocks, but the downside is that, if you vote, however, will have been waiting for, the details you can also see my early essay Jane books blog: https://www.jianshu.com/p/52932431de06
Polkadot
Wave card is also a cross chain platform, the relay chain USES is Nominated Proof of gaining, both "name and interest", the participants through the pledge to become a nominee, and then from the nominee elected verification, validation is responsible for a piece of again, the verifier can control the number of democratic centralism, the efficiency will be much higher, NPOS like DPOS, was elected a few selected node block, but DPOS only have the big chaebol, need to do a lot of pledge, NPOS more democratic, grass roots are more likely to participate, and the verifier rotation is more frequent,
Algorand
Mentioned earlier, POS consensus is a nature of a piece of weight determined by the people to vote, so everyone knew who was before a piece of a piece of nodes, so easy to be attacked; And block node can choose a variety of packaging strategy to maximize their own interests, so if there is a mechanism that can be randomly generated a node, the randomness is can not be predicted easily, but this can be very easy to verify, then you can use this way to elect a piece of node, Algorand found such a random node, this method actually very close to the way like POW, everyone can be packaged to submit candidate blocks, but finally not to see who is the fastest, draw but by a true random number, select only the next block,
And Casper
And Casper is etheric lane 2.0 will use way of consensus, and Casper had rights pledge, had a voting mechanism, but it's still a mix of a POW and POS, will slowly developed into a complete POS agreement, because want to upgrade the existing Ethernet based on POW lane, it is considered more chain availability rather than the eventual consistency, and Casper the piece will still by POW, then vote by POS node, node vote is something like gambling, can literally throw any piece, but if you don't have made the final selected blocks, would be punished, so finally everyone tends to throw a block, the longest chain
More innovative
What are we can discuss the future block chain can also be improved, when the throughput do bandwidth and network capacity limit, if you want to further expansion, has the following several ways,
Have a consideration from change block chain structure, the block on the structure of the structure of the chain to DAG DAG is a directed acyclic graph, each parent can have multiple child piece, if in the same way that a DAG, is not afraid of bifurcation, the speed can be enhanced greatly, but the DAG to consensus mechanism has a very big challenge, because DAG chain structure into a mesh structure, eventually need a good consensus to convergence of the mesh structure, can toward a direction and Conflux tried to adopt DAG structure optimize the POW consensus,
Another idea is to use the second expansion plan: not every transaction in all the online verification, can use a shard (sharding), a trade only need a shard in partial validation; Also can be used in a side chain solution, after trading in the side chain, write the results back to the main chain on a regular basis; Even can generate the chain directly, adopt different consensus on substring, such architecture is more flexible and better support for the application, the method can save the bandwidth of the entire network, improve the system throughput,
Adopts the hierarchical structure, a chain, in fact, you can use the mixed the consensus, on a chain of the multi-tier architecture, POW safe, reliable and can be used for issuing certificate, POS with high efficiency, confirm fast, and low energy consumption, can be used to make application, famous male chain MOAC is adopted such consensus,
But even on MOAC, POW and POS is separate, is it possible to adopt a POW + POS mixed consensus mechanism, namely to ensure the safety of the chain, and can improve the efficiency of the block, can also through the POS pledge to dig a hole and calculate the force of checks and balances, miners contain energy dissipation of armament competition?
Decred is one of the few has been mixed POW and POS consensus mechanism of the chain, also similar to and Casper, every piece is produced by POW, but should confirm by POS vote, Decred mainly from the perspective of governance in the chain of choice this way, and then let the POS stakeholders become dominant in the block chain management decision-making power, can only be the network consensus by voting rules, modified Decred the piece rate is not high, and because the POW and POS mining earnings ratio is fixed, POW energy mining also does not have very good restricted,
nullnullnull