"Consensus algorithms" and "consensus attacks" have been mentioned in many articles. We should be more profound impression of "consensus attack", right, that is what we call this and the company shares is a truth, when you occupy the entire company "51%" shares, that is holding, it is not allowed to do it. In the block chain technology is the same, block chain accounting can not be tampered with, even if it is a reasonable deal to write the wrong address is not.
But. If you can convince 51% of the nodes in the block chain to agree to your request, you can modify the billing information, and when this approach is used in a bad way, it's a "consensus attack". and "consensus attack" principle or "consensus algorithm", then this article takes us into consensus algorithm.
1
Objective
Similarities and differences of traditional distributed consistency algorithm and block chain consensus process
Same point:
1) Append only
2) emphasis on serialization
3 Minority Obedience Majority principle
4 Separation coverage problem: Long chain cover short chain block, multi-node overlay a few node log
Different points:
Most traditional distributed consistency algorithms do not consider Byzantine fault tolerance (except Byzanetine Paxos), that is to say, all nodes only have downtime, network fault and other non-human problems, do not consider malicious node tampering data problem;
The relationship between block chain consensus model and traditional consistency algorithm
Considering the different points above, combining the nature of the private chain and the industry chain, we have:
1 private chain: Closed ecological storage network, all nodes are trustworthy, such as a large group within the majority of companies.
2 industry chain: Semi-closed ecological trading Network, there is a peer distrust node, such as real estate industry A, B, C, D companies.
3 Public chain: Open Ecological Trading Network, this layer is mainly for the industry chain and private chain to provide a global trading network.
Because the private chain is a closed ecological storage network, that is, the use of traditional distributed consistency model should be optimal; because the alliance industry chain its semi-closed semi-open characteristics, the use of delegated Proof of XXX is optimal, you can consider the traditional consistency algorithm as the basis to join Byzantine fault-tolerant/ Improve the safety protection mechanism. Public chain POW should still be the best choice.
As shown in the following illustration:
2
Introduction to Distributed consistency algorithm
This article mainly discusses the mainstream Paxos algorithm family and raft algorithm, here, the network on both the information is very rich, we can search for their own.
Paxos algorithm Family
1998 Lamport proposed Paxos algorithm, followed by adding a number of improved versions of the Paxos to form a Paxos protocol family, and Paxos have common ground is not easy to project implementation.
1 Classic paxos:leaderless, also known as Basic Paxos, the following are Paxos varieties, based on the CAP law, focusing on different directions.
2) Cheap Paxos
3) Egalitarian paxos:conflicts rare
4 Fast Paxos:leader Only when needed, conflicts common
5) Multi-paxos:leader Driven
6) Byzanetine Paxos
"Byzantine Paxos adds a extra message (Verify) which acts to distribute knowledge and Verify the actions of the other pro Cessors ". Lamport in the 2011 paper "leaderless byzanetine Paxos" said not clear whether the practice is effective, considering the difficulty of the implementation of the Paxos itself, this project is not the optimal engineering angle, but the system angle should be the best.
This subsection ref:
1) Wikipedia_paxos
2) leaderless Byzanetine Paxos
Raft algorithm
This is a very friendly algorithm, easy to understand, realize, but it is strong leadership, that is, arbitrary contains leader moment, leader have full bookkeeping rights, if this leader node is malicious, disastrous consequences. And leadership's consistency algorithm has a common problem, throughput is limited by a single node, this is particularly raft.
Introduction to Raft algorithm: https://raft.github.io/
Raft algorithm Dynamic Demo: http://thesecretlivesofdata.com/raft/
Other
VRR (viewstamped Replication Revisited)
This is also a consistency algorithm based on leadership, which has the advantage of minimizing latency compared to other algorithms mentioned above.
3
An introduction to common block chain consensus model
Reprinted from here: https://bitsharestalk.org/index.php?topic=4031.0
This is Dpos's white paper, which mainly introduces Dpos, but also includes introductions to other consensus models.
White Paper on the certification mechanism for authorized equity (delegated Proof-of-stake, Dpos)
Author: Daniel Larimer
April 3, 2014
Translation: Yidaidaxia_ Shaoxi
Bit Square Digital Asset Research Club translation works (Www.bitfarm.io)
Summary
This paper introduces a new implementation of the equity certification mechanism, which enables second-level validation of transactions and provides better security in less time than any existing equity certification system. After the time that the Bitcoin network generates a block, an authorized equity certification system (DPOS) enables your transaction to be verified by 20% shareholders, and after the time that the Bitcoin network declares that the transaction has been almost irreversible (6 blocks, about 1 hours), through its representative under the Dpos mechanism, Your deal has been verified by 100% of shareholders.
1.0 background
The distributed transaction General Ledger needs to be secure, unambiguous and irreversible in the shortest possible time, providing a most robust and centralized system. In practice, the process is divided into two aspects: selecting a unique node to generate a block and making the transaction general ledger irreversible.
1.1 Workload certification mechanism (Proof of Work, POW)
The first attempt to successfully solve the problem is the Bitcoin system (Bitcoin), which uses the work-proof mechanism to make the longer general ledger more computationally difficult to produce. The work-proof mechanism is like a lotto, with an average node finding a block every 10 minutes. If two nodes find chunks at the same time, the network will determine which block to build the general ledger according to the decision of the subsequent nodes. Statistically speaking, a transaction is considered to be clearly confirmed and irreversible after 6 blocks (about 1 hours). However, core developers believe that 120 blocks (about one day) are needed to fully protect the network from the potentially longer chain of attack blocks that have been spent on newly generated coins.
While a longer block chain may become less likely, anyone with huge economic resources can still create a longer chunk chain or have enough hash power to freeze user accounts.
1.2 Equity certification mechanism (Proof of Stake, POS)
There are many different variants of the equity certification mechanism, but the basic concept is that the difficulty of producing blocks should be proportional to the equity (ownership ratio) you share in the network. So far, two systems have started: dot-dot (peercoin) and future currency (NXT). Use a mix of dots, and use your equity to adjust your mining difficulties. The future currency uses a deterministic algorithm to randomly select a shareholder to produce the next block. The future currency algorithm adjusts the likelihood that you will be selected based on your account balance.
The future currency and the dot-dot currency respectively solve the problem of who will produce the next block, but they do not find a way to make the block chain have irreversible security within the appropriate time. According to the information we can find, to do this, it takes at least 6 blocks (about an hour) to order the currency, and 10 blocks for the future currency. We cannot find the basis for what level of security the future currency can provide after 10 blocks.
We have previously released a white paper on the transaction-based equity certification mechanism (transactions as Proof of Stake, Tapos), in which each transaction contains the hash value of the previous block in the block chain. Through this system, the network becomes more and more secure and irreversible to anyone, because eventually each block is voted by the shareholder. The challenge for Tapos is that it does not define who will produce the next block.
1.3 Rayleigh wave consensus mechanism (ripple Consensus)
Reboxetine consensus algorithm enables a group of nodes to reach a consensus based on a special node list. Initial special node list like a club, to accept a new member must be voted by 51% of the members of the club. The consensus follows the 51% power of the core members, while outsiders have no influence. As the club begins with "centrality", it will always be "central", and if it starts to decay, there is nothing shareholders can do about it. Like Bitcoin and Dots, the Rayleigh system separates shareholders from their voting rights and is therefore more central than other systems.
2.0 certification mechanism of authorized equity (DPOS)
When using the idea of going to a central autonomous Company (decentralized Autonomous Corporation, DAC), the centrality means that each shareholder has an influence on the percentage of its shareholding, and the outcome of the 51% shareholder vote will be irreversible and binding. The challenge is to achieve 51% approvals in a timely and efficient way.
In order to achieve this goal, each shareholder may delegate his or her voting rights to a representative. The top 100 representatives who have received the highest number of votes rotate the blocks in accordance with the established timetable. Each delegate is assigned to a time period to produce the block. All representatives will receive 10% per cent of the transaction fees that are equivalent to an average level of the block. If an average level block contains 100 shares as a transaction fee, a representative will receive 1 shares as remuneration.
Network latency may cause some delegates to not broadcast their blocks in time, which will result in a chunk chain forking. However, this is unlikely to happen because the representative of the manufacturing block can establish a direct connection with the representatives of the blocks before and after the manufacture. Establishing this direct connection with your subsequent representative (and perhaps also the subsequent representative) is to make sure you get paid.
The pattern can generate a new block every 30 seconds, and the probability of a block chain branching under normal network conditions is extremely small, and can be resolved within minutes even if it occurs.
2.1 Become a representative
To be a delegate, you must register your public key on the network and assign it to a 32-bit unique identifier. The identifier is then referenced by the "head" of each transaction data.
2.2 Authorize your vote.
Each wallet has a parameter setting window in which the user can select one or more delegates and rank them. Once set, each transaction that the user makes will transfer the ballot paper from "input rep" to "output rep". In general, users do not create deals that are specifically for voting purposes because they will cost them a transaction. But in an emergency, some users may find it worthwhile to change their votes in a more positive way by paying fees.
2.3 Keep The representative honest
Each wallet will display a status indicator to let the user know how their representative is performing. If they miss out on too many blocks, the system will recommend users for a new representative. If any representative is found to have issued an invalid block, then all standard wallets will require a new representative to be selected before more transactions are made in each purse.
2.4 Solution block Chain Fork
As with work proof system and other equity proof system, the best block chain is the longest effective block chain. Any time a representative misses the opportunity to issue a block, the block chain will be shorter than the potential competitor. As long as 51% of the 100 blocks after your transaction is written into the block, you can safely assume that you are on the main block chain.
Perhaps the most important thing in preventing the loss of a chunk-chain fork is to know the news at the first time after the incident. Because delegates are well paid through production blocks, they will maintain close to 100% of online time to prevent loss of revenue from being voted off. You can safely assume that if there are one or two blocks missing from production in the last 10 blocks, some parts of the Internet may be having connectivity problems, then users should be particularly alert and require additional confirmation. If there are more than 5 missed productions in the 10 block, then this means you are likely to be on a chain, so you should stop all transactions until the fork is resolved.
Simply discovering and alerting user network forking in a timely manner (less than 5 minutes) is a very important ability to minimize potential losses. It's more important to know if you're on a chain.
2.5 100 delegates are going to the center.
Since going to the center has become a buzzword, its definition is difficult to completely fix. We view the free market as the basic form of centrality, and view the barriers to access to the free market as the basis of all centrality. Like anything else, there is a degree of centrality, so we compare the central level of the authorized equity certification mechanism with that of other programs.
2.5.1 bit currency
The Bitcoin system is currently operating on the basis of an authorization workload certificate (delegated Proof of Work, Dpow), so about 10 delegates control the vast majority of the hashing force. In the hands of those who compete to use economies of scale for the benefit of mining without income, the hashing force is itself central. Finally, the workload certification mechanism to market barriers, so that "working" block manufacturers can not easily be replaced. Compared with the bitcoin system, Dpos is at least 10 times times more Westernized in block production, and may be centered on market competition for several times.
Although there is a certain amount of centrality in hashing, we think that the Bitcoin system is the most central when it comes to the account of the share held by the shareholders (bitcoin holders) who control the bitcoin system. If you consider the total number of users who are using the Bitcoin system, those involved in mining are likely to be less than 1%.
2.5.2 Little coins.
The point currency is a hybrid system, so it is partly centered because of the workload proving mechanism. Like the bitcoin system, it also has a mining pool. In comparison with Bitcoin, the point of currency is undoubtedly more central, however, since the equity proof mechanism of the pool requires users to keep their computers online and wallets unlocked, only a small fraction of shareholders are involved in any form of mining.
2.5.3 Future Coins
The future coins are forged with transparency to determine the next manufacturing node to be selected. It can be likened to using an authorized equity proof mechanism but you can only grant your vote to yourself, and the frequency with which you get the opportunity to forge blocks is directly dependent on the balance of your account. In this sense, the future currency is more central than the point currency and bitcoin. But because of concerns about security risks and the fact that most regular users do not open their computers all day to gain the advantage of forging opportunities, it still suffers from a poor level of mining involvement.
From this point of view, we can conclude that the future currency network is a small number of shareholders to protect the network security. In fact, if you don't vote online, you'll lose your vote. To solve this problem, some future-currency users set up equity pools with their stakes and trust third parties to dig for them. This is a form of authorized equity certification to increase shareholder participation, but it also allows their account balances to be at risk when they participate in these pools.
3.0 attacks
In general, the network must withstand two types of attacks: Denial of service attacks and double payment attacks. An attacker makes a denial-of-service attack by not adding some or all of the transactions to the general ledger. This attack can be carried out by anyone with 51% networks, regardless of bitcoin, future coins or others. The use of short-term advantages in the network is trying to reach a consensus can be a double payment attack. To withstand these attacks, the network must reach an agreement with 51% of its shareholders as soon as possible.
3.1 Preventing the exclusion of transactions
Having all 100 representatives elected by the shareholders and rotating the blocks as required means that any transaction approved by at least 1% of the shareholders can be added to the general ledger within 30 minutes. This means that no representative can gain interest by excluding transactions that vote to support other representatives.
3.2 Central to the power of some delegates
It has nothing to do with the right to vote, the first 100 people have the same weight, each delegate has an equal right to vote. Therefore, it is not possible to concentrate power on a single representative by obtaining more than 1% of the votes.
It is possible for individuals or organizations to control multiple representatives of a block chain. But the process will need to deceive a large percentage of the number of shareholders to support the "puppet". Even if these 51% puppets can be built, their ability to disrupt the network will remain limited and can be quickly identified and quickly corrected. Without the entry barriers set by the workload certification mechanism, the honest user who occupies the majority will identify the attack and then fork out the code and disregard the block produced by the attacker. This attack can disrupt the network, but it will not be fatal.
3.3 Distributed Denial of Service attacks (DDOS) for delegates
Because there are only 100 delegates, one can imagine an attacker, in turn, to a denial of service attack on each representative of a production block. Fortunately, the threat of a particular attack can easily be mitigated by the fact that each representative's identity is its public key rather than an IP address. This will make it more difficult to determine the target of DDoS attacks. and the potential direct connection between the representatives will make it more difficult to prevent them from producing blocks.
4.0 Trade-based equity certification mechanism (TAPOS)
Representation is an efficient way to reach a solid consensus within a short period of time, and Tapos provides shareholders with a long-term mechanism to directly approve their representative's behavior. On average, 51% of shareholders will confirm each block directly within 6 months. And depending on the proportion of active shares, almost 10% of shareholders can confirm the block chain within a few days. This direct recognition guarantees the long-term security of the network and makes all attack attempts extremely clear.
5.0 Quality of Service
Assuming that a dpos system has a market total of 10 billion dollars, an average annual transaction fee of 0.25%, and delegates total 10% of all transaction costs, each representative will receive 25,000 dollars a year to keep its nodes online.
This is a lucrative role for many people who will continue to compete for access to it. This means that everyone who wants to get the job will try to "steal" it from the person who owns the job. To do this, they will perform a statistical analysis of representative behavior to find any deviations from the standard algorithm. Once this deviation is found, they can hope to win some votes. The people who have the job may try their best to prove that they are running on standard software. The more effectively they prove their integrity in block production, the more likely they are to keep their jobs. You can imagine that developers will quickly make a system where delegates can quickly demonstrate which deals are widely disseminated.
In fact, market competition will produce the most creative solutions to demonstrate the integrity and reliability of the delegates. The effort to make the network more secure can yield a lot of benefits, while trying to round the network is not going to get much benefit.
6.0 Conclusion
Dpos process and Tapos combined the resulting network, its network consensus can be at least 3 times times as much as the bitcoin, Dot and future currency network. Dpos can reach a consensus faster, while eliminating the possibility of small-scale interference by random small shareholders. Economic incentives ensure that delegates are committed to demonstrating that they have good behavior and may adopt a consensus algorithm similar to the Rayleigh wave system (to achieve this proof). Dpos, in fact, is a way to generate a special list of Rayleigh waves through a centralized approach without the risk of network bifurcation.
(Article Source: blockchaindev.org Author: Chenhao)
The following is our community introduction, welcome to all kinds of cooperation, communication, learning: