In many articles have mentioned that “consensus algorithm” and “consensus”, everyone should have a “consensus attack is impressive,” right, is what we call the stake and the company is a truth, when you own the “51%” of the company, that is holding, wouldn’t it be can do whatever you want? In blockchain technology, too, blockchain accounting can not be tampered with, even if a reasonable transaction is written wrong address!
But!!! If you can convince 51 percent of the nodes on the blockchain to agree to your request, you can change the billing information. When this approach is used in a bad way, it is a “consensus attack.” And the principle of “consensus attack” or “consensus algorithm”, so this article will take you into consensus algorithm.
1
preface
Similarities and differences between traditional distributed consistency algorithm and blockchain consensus process
Similarities:
1) Append only
2) Emphasize serialization
3) Majority rule
4) The problem of separate coverage: that is, the long chain covers the short chain block, and the multi-node covers the logs of a few nodes
Difference:
Most of the traditional distributed consistency algorithms ignore The Byzantine fault tolerance (except Byzanetine Paxos), that is, it is assumed that all nodes only have non-human problems such as downtime and network failure, and the problem of malicious nodes tampering with data is not considered.
The relationship between blockchain consensus model and traditional consistency algorithm
Considering the differences above, combining the nature of the private chain and the industry chain, we have:
1) Private chain: a closed ecological storage network in which all nodes are trusted, such as most companies within a large group.
2) Industry chain: A semi-closed ecological transaction network with peer distrust nodes, such as company A, B, C and D in the real estate industry.
3) Public chain: an open and ecological trading network. This layer mainly provides a global trading network for industry chains and private chains.
Since private chain is a closed ecological storage network, it is optimal to use the traditional distributed consistency model. Because the alliance industry chain is semi-closed and semi-open, the use of Delegated Proof of XXX is optimal, and the traditional consistency algorithm can be used to add Byzantium fault tolerance/safety protection mechanism to improve the quality. The public chain PoW should still be the best choice.
As shown below:
2
Introduction to distributed consistency algorithms
This article focuses on the main Paxos algorithm family and Raft algorithm. There is a lot of information on both of them available on the web.
Paxos family of algorithms
Lamport proposed Paxos algorithm in 1998, and subsequently added several improved versions of Paxos to form the Paxos protocol family, and Paxos all have something in common that it is not easy to implement engineering.
1) Classic Paxos: LeaderLess, also known as Basic Paxos, the following are all variations of Paxos, based on CAP law, focusing on different directions.
2) being 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 an extra message (Verify) which acts to distribute knowledge and verify the actions of the other Lamport said in his 2011 paper “Leaderless Byzanetine Paxos” that it is not clear whether it is effective in practice. Considering the difficulty of implementing Paxos itself, this solution is not optimal from the engineering perspective, but it should be the best from the system perspective.
Ref:
1)Wikipedia_Paxos
2)Leaderless Byzanetine Paxos
Raft algorithm
This is a very friendly algorithm, easy to understand and implement, but it is Strong Leadership, that is to say, any time including the Leader, the Leader has full accounting rights, if the Leader node is malicious, the consequences will be terrible. A common problem with leadership’s consistency algorithms is that throughput is limited by a single node, and this is particularly true for Raft.
Introduction to Raft algorithm: https://raft.github.io/
Raft algorithm dynamic presentation: http://thesecretlivesofdata.com/raft/
other
VRR(Viewstamped Replication Revisited)
This is also a leadership-based consistency algorithm, which has the advantage of minimal latency compared to the other algorithms mentioned above.
3
Introduction to common blockchain consensus models
Reprinted from here: https://bitsharestalk.org/index.php?topic=4031.0
This is a white paper on DPoS, which mainly introduces DPoS, but also covers other consensus models.
White Paper on Delegated Proof-of-Stake (DPOS)
By Daniel Larimer
April 3, 2014
Translation: Yidaidaxia_ Hao Xiaoxi
Bitfang Digital Asset Research Club Translation (www.bitfarm.io)
Abstract
This white paper introduces a new implementation of a proof of equity mechanism that can verify transactions at the second level and provide better security in a shorter time than any existing proof of equity system. Produce the COINS network after a block of time, an authorization equity certificate system (DPOS) will have 20% of shareholders to verify your trade, and in the currency network statement transaction has almost irreversible (6 block, about 1 hour) after the time, under the DPOS mechanism, through its representative, to verify your trade has been 100% shareholders.
1.0 background
Distributed transaction ledgers need to be secure, unambiguous and irreversible in the shortest possible time to provide the most robust and decentralized system possible. In practice, the process has two aspects: selecting a unique node to generate a block and making the transaction ledger irreversible.
1.1 Proof of Work (POW)
The first successful attempt to solve this problem was the Bitcoin system, which used a proof-of-work mechanism to make the generation of longer ledgers computationally difficult. Proof of work is like the lottery, with one node finding a block every 10 minutes on average. If two nodes find a block at the same time, the network will decide which block to build the ledger based on the decisions of subsequent nodes. Statistically speaking, a transaction is considered unambiguously confirmed and irreversible after six blocks (about an hour). However, the core developers believe that 120 blocks (about a day) are needed to fully protect the network from a potentially longer attack on the blockchain that has already spent the newly created coins.
While a longer blockchain would become unlikely, it would still be possible for anyone with substantial economic resources to build one or have enough hash power to freeze users’ accounts.
1.2 Proof of Stake (POS)
There are many variations on proof of ownership, but the basic idea is that the difficulty of generating blocks should be proportional to your share of the network (ownership ratio). So far, two systems are up and running: Peercoin and NXT. Coincoin uses a hybrid mode that adjusts your mining difficulty with your equity. Future coin uses a deterministic algorithm to randomly select a shareholder to generate the next block. The Futurocoin algorithm adjusts your likelihood of being selected based on your account balance.
Futurocoin and Diancoin have both solved the problem of who will produce a block in the future, but they have not found a way to make the blockchain irreversibly secure in the appropriate time. According to the information we were able to find, to do this, Peercoin would need at least 6 blocks (about an hour) and Future Coin would need 10 blocks. We can find no basis for what level of security future coins provide after 10 blocks.
We previously published a white paper on Transactions as Proof of Stake (TaPOS), in which each transaction contains a hash of the previous block in the blockchain. Through this system, the network becomes more and more secure and irreversible for anyone, because eventually every block is voted on by shareholders. The challenge for TaPOS is that it doesn’t define who will generate the next block.
1.3 Ripple Consensus
The Wave consensus algorithm enables a group of nodes to reach consensus based on a particular node list. The initial list of special nodes is like a club. To admit a new member, 51% of the members of the club must vote for it. Consensus follows that the core members have 51% power, while outsiders have no influence. Because the club started “centralised”, it will remain “centralised” and shareholders can do little if it starts to rot. Like Bitcoin and PeerCoin, Ripple separates shareholders from their voting rights and is therefore more centralized than other systems.
2.0 Authorized Proof of Equity Mechanism (DPOS)
When the term Decentralized Autonomous Company (DAC) is used, decentralization means that each shareholder has influence in proportion to his shareholding, and the voting result of 51% shareholders is irreversible and binding. The challenge is to achieve 51% approval in a timely and efficient way.
To achieve this, each shareholder can delegate its voting rights to a representative. The top 100 delegates with the most votes take turns to award blocks on a set schedule. Each delegate is assigned a period of time to produce blocks. All representatives will receive 10% of the transaction fee equal to an average block. If an average block contains 100 shares as a transaction fee, a representative will receive 1 share as payment.
Network delays may prevent some delegates from broadcasting their blocks in time, which could lead to a fork in the blockchain. However, this is unlikely to happen because a representative of the manufacturing block can establish a direct connection with a representative of the block before and after the manufacturing. Establishing this direct connection to the representative after you (and perhaps the representative after you) is to ensure that you get paid.
This mode can generate a new block every 30 seconds, and the possibility of a blockchain fork under normal network conditions is extremely small and can be resolved within minutes if it does occur.
2.1 Become a delegate
To become a delegate, you must register your public key on the network and then assign it to a 32-bit unique identifier. This identifier is then referenced in the “header” of each transaction data.
2.2 Authorize your vote
Each wallet has a preferences window in which the user can select one or more representatives and rank them. Once set, each transaction a user makes will transfer votes from an “input representative” to an “output representative.” Typically, users do not create transactions specifically for voting purposes, because that would cost them a transaction fee. But in an emergency, some users may find it worthwhile to change their vote in a more aggressive way by paying a fee.
2.3 Keep delegates honest
Each wallet will display a status indicator to let users know how well their representative is performing. If they miss too many blocks, users will be recommended to get a new representative. If any representative is found to have issued an invalid block, then all standard wallets will require that a new representative be elected before any more transactions are made with each wallet.
2.4 Solution to blockchain fork
As with proof of work systems and other proof of equity systems, the best blockchain is the longest effective blockchain. Any time a representative misses an opportunity to issue a block, the block chain will be shorter than a potential rival. As long as 51% of the 100 blocks after your transaction was written to the block are produced, then you can safely assume that you are on the main blockchain.
Perhaps the most important thing to do to prevent losses from a blockchain fork is to be the first to know about it. Because delegates are well paid for producing blocks, they will stay online nearly 100 percent of the time to prevent losing revenue if they are voted out of office. You can safely assume that if one or two of the last 10 blocks missed production, some part of the Internet might be having connectivity problems, and users should be particularly alert and demand extra confirmation. If more than 5 out of 10 blocks are missing production, it means you are likely on a branch chain and should therefore stop all transactions until the fork is resolved.
Simply detecting and alerting users to network forks in a timely manner (less than 5 minutes) is a very important ability to minimize potential losses. It’s even more important to know if you’re on a branch chain.
2.5 Are 100 delegates decentralized?
Because decentralization has become a buzzword, its definition is hard to pin down. We see free markets as the basic form of decentralization, and barriers to access to free markets as the foundation of all decentralization. Like anything, there is a degree of centralization, so we compare the degree of centralization of the certificate of authorization scheme with other schemes.
2.5.1 COINS
The bitcoin system is run with Delegated Proof of Work (DPOW), with about 10 representatives controlling most of the hash power. In the hands of those who can use economies of scale for unprofitable mining in order to compete, hash power is itself centralized. Finally, proof of work creates barriers to entry and prevents “active” block-makers from being easily replaced. Compared to the Bitcoin system, DPOS is at least 10 times more de-westernized in terms of block production, and perhaps a zillion times more decentralized in terms of market competition.
Although there is a certain amount of decentralization in terms of hashing power, we think the Bitcoin system is the most centralized when you think about the percentage of shares owned by the shareholders who control the system. If you look at the total number of people who use the bitcoin system, it’s probably less than one percent of them are involved in mining.
2.5.2 little money
Coincoin is a hybrid system, so it is partially centralized due to proof-of-work mechanisms. Like the Bitcoin system, it has mining pools. Compared to Bitcoin, Peercoin is undoubtedly more decentralized, however, because the proof-of-stake mining pools require users to keep their computers online and wallets unlocked, only a small percentage of shareholders are involved in any form of mining.
2.5.3 future currency
The future coin is forged transparently to select the next manufacturing node. The analogy is to use a certificate of entitlement scheme but you can only grant your voting rights to yourself, and how often you get the chance to forge blocks depends directly on your account balance. In that sense, Futurocoin is more decentralized than Peercoin and Bitcoin. But it still suffers from pitifully low participation in mining due to concerns about security risks and the fact that most regular users don’t turn their computers on all day to take advantage of crafting opportunities.
From this point of view, we can conclude that the future coin network is guaranteed by a small number of shareholders. In fact, if you don’t vote online, you lose your vote. To solve this problem, some future coin users use their equity to build equity pools and trust third parties to mine for them. This is a form of authorized equity certificate to increase shareholder participation, but it also puts their account balances at risk when they participate in these pools.
3.0 attack
In general, networks must defend against two types of attacks: denial-of-service attacks and double-payment attacks. An attacker carries out a denial-of-service attack by not adding some or all of the transactions to the ledger. This attack can be carried out by anyone who owns 51% of the network (whether bitcoin, Mirae or others). Using the short-term advantage of a network trying to reach a consensus, a double payment attack can be carried out. To fend off these attacks, the network must get 51% of its shareholders to agree quickly.
3.1 Prevent exclusion transactions
Having 100 representatives voted in by all shareholders, and rotating blocks as required, means that any deal approved by at least 1% of shareholders can be added to the ledger within 30 minutes. This means that no representative can gain by excluding from the outside a transaction that votes for another representative.
3.2 Centralize the power of some representatives
Regardless of the number of votes they are authorized to vote, the power of the top 100 is equally weighted, with each delegate having an equal share of the vote. Thus, power cannot be concentrated in the hands of a single representative by gaining more than 1 per cent of the vote.
It is possible for individuals or organizations to control multiple representatives of a blockchain. But this process will require a large proportion of shareholders to be duped into supporting the puppets. Even if these 51% puppets could be established, their ability to disrupt the network would still be limited and could be quickly identified and corrected. Without proof-of-work barriers to entry, the majority of honest users will identify the attack, fork the code and ignore the blocks produced by the attacker. Such attacks can disrupt networks, but are not fatal.
3.3 Distributed Denial of Service Attacks (DDOS) On Representatives
Since there are only 100 representatives, you can imagine an attacker doing a denial-of-service attack on each delegate in turn for the production block. Fortunately, the threat of this particular attack is easily mitigated by the fact that each delegate is identified by its public key rather than its IP address. This will make it harder to identify targets for DDOS attacks. And potentially direct connections between delegates will make it harder to block them from producing blocks.
4.0 Transaction-based Proof of Equity Mechanism (TaPOS)
Representation is an efficient way to build solid consensus in a short period of time, and TaPOS provides shareholders with a long-term mechanism to directly approve the actions of their representatives. On average, 51% of shareholders directly identified each block within six months. Depending on the proportion of shares active in circulation, roughly 10% of shareholders can confirm blockchain within days. This direct confirmation ensures the long-term security of the network and makes all attack attempts extremely clear.
5.0 High quality service
Assuming a DPOS system with a $10 billion market, an average transaction fee of 0.25% per year, and delegates collectively receiving 10% of all transaction fees, each delegate would receive $25,000 per year to keep their nodes online.
This is a lucrative role and many people will continue to compete for it. This means that everyone who wants the job will find a way to “steal” it from whoever has it. To do this, they will conduct a statistical analysis of the representative behavior to find any deviations from the standard algorithm. Once they find that deviation, they can hopefully pick up some votes. Those with the job may go to great lengths to prove that they are running standard software. The more effectively they can demonstrate their integrity to block production, the more likely they are to keep their jobs. You can imagine developers quickly creating systems that reps can use to quickly demonstrate which deals are widely disseminated.
In fact, market competition will produce the most creative solutions to prove the integrity and reliability of representatives. There is much to be gained from making networks safer, and little to be gained from trying to circumnavigate networks.
6.0 the conclusion
The combination of THE DPOS process and TaPOS will result in a network with at least three times more provable consensus than bitcoin, Peercoin and Future coin networks. DPOS allows consensus to be reached faster and eliminates the possibility of small disturbances from random minority shareholders. Financial incentives ensure that delegates are committed to proving that they have good behaviour and may use consensus algorithms similar to the Ripple system. DPOS, in effect, is a way to generate wave-specific node lists in a decentralized manner without the risk of network forks.
(Blockchaindev.org by Chenhao)
The following is our community introduction, welcome all kinds of cooperation, exchange, learning 🙂