为广大币圈朋友提供币圈基础入门专业知识!
当前位置首页 > 区块链知识> 正文

区块链pos共识机制是什么,区块链pos共识机制有哪些

发布时间:2023-12-21-16:06:00 来源:网络 区块链知识 区块   共识   机制

区块链pos共识机制是什么,区块链pos共识机制有哪些

区块链POS共识机制是一种分布式共识机制,它是一种新型的分布式记账技术,它可以使参与者在不受中心化管理者控制的情况下进行安全的数据交换。它通过规则来确保所有参与者都能够达成一致,从而使网络可靠,安全和可追溯。本文将介绍区块链POS共识机制中的三个关键词:节点、抵押和投票。

节点是区块链POS共识机制的基础,它是一个计算机,可以运行POS共识机制的节点软件,以及参与共识机制的网络。节点可以是矿工,也可以是普通用户,它们都可以参与到区块链POS共识机制中来,参与共识,参与投票,并获得报酬。

抵押是区块链POS共识机制的重要组成部分,它是参与者把自己的资产抵押给网络的一种方式。参与者把自己的资产抵押给网络,作为参与共识的保证,以确保参与者的行为是正确的。当参与者参与共识时,如果参与者的行为是不正确的,网络将会扣除参与者的抵押资产,以确保网络的安全。

投票是区块链POS共识机制的重要组成部分,它是参与者参与共识的一种方式。在POS共识机制中,参与者可以把自己的票投给另一个参与者,以确定另一个参与者是否有资格参与共识。投票的结果决定了参与者是否有资格参与共识,以及参与者可以获得多少报酬。

区块链POS共识机制是一种新型的分布式记账技术,它可以使参与者在不受中心化管理者控制的情况下进行安全的数据交换。它的三个关键词:节点、抵押和投票,是它的基础,每个关键词都是POS共识机制的重要组成部分,它们的结合能够使网络可靠,安全和可追溯。


请查看相关英文文档

① What is the consensus mechanism known as the "soul of the blockchain"

We know that the blockchain is a decentralized distributed accounting technology. In the blockchain system Among them, there is no centralized accounting institution like a bank. How to ensure the consistency of each transaction on all accounting nodes? The consensus mechanism solves this problem, so it can also be said that the consensus mechanism is the soul of the blockchain.

Currently, the more common consensus mechanisms include: PoW (Proof of Work), Proof of Stake and Delegated Proof of Stake:

01

PoW (Proof-of-Work)

Proof of Work Mechanism

The full name of POW is Proof of Work, which means “Proof of Work” or “Proof of Work”. How much monetary reward you get from mining depends on the effective work of your mining contribution. That is to say, the better the performance of the mining machine and the longer the mining time, the more monetary rewards you get.

BTC is the most successful cryptocurrency under the POW mechanism. Although the POW mechanism has successfully proven its long-term stability and relative fairness, under the existing framework, the use of POW's "mining" form will consume a large amount of energy. The energy it consumes is just to continuously perform SHA256 calculations to ensure fair workload, and has no other meaning of existence. The current transaction efficiency that BTC can achieve is about 5TPS (5 transactions/second). Ethereum is currently subject to the upper limit of the total amount of GAS in a single block, and the transaction frequency that can be achieved is about 25TPS, which is the same as the average thousand times per second and peak performance. There is a huge difference between VISA and MASTERCARD, which can achieve processing efficiency of 10,000 times per second.

02

PoS (Proof-of-Stake)

Proof of Stake Mechanism

POS is Proof of Stake or Equity Proof, the full name is Proof of Stake. The proof-of-stake model is a model that issues interest based on the amount and time of the currency held.

POS mechanism, compared to POW, the POS mechanism saves energy and introduces the concept of "coin age" to participate in random operations. The POS mechanism allows more currency holders to participate in the accounting work without the need to purchase additional equipment (mining machines, graphics cards, etc.). The computing power of each unit token is positively related to the length of time it is held. That is, the more tokens a holder holds and the longer the time, the greater the probability that the holder can sign and produce the next block. Once it signs the next block, the "coin age" held by the currency holder will be cleared and a new cycle will be re-entered.

Under the POS mechanism, because the signers of blocks are randomly generated, some currency holders will hold tokens for a long time and in large amounts to obtain a greater probability of generating blocks, as many as possible to clear his "coin days". Therefore, the number of circulating tokens in the entire network will decrease, which is not conducive to the circulation of tokens on the chain, and prices will be more susceptible to fluctuations. Since there may be a small number of large investors holding most of the tokens in the entire network, the entire network may become more and more centralized as the running time increases. Compared with PoW, the cost of doing evil under the PoS mechanism is very low, so for forking or double-spending attacks, more mechanisms are needed to ensure consensus. Under stable conditions, approximately 12 transactions can be generated per second, but due to network delays and consensus issues, it takes about 60 seconds to fully broadcast the consensus block. In the long run, the speed of generating blocks (i.e. clearing the "coin age") is much lower than the speed of network propagation and broadcasting. Therefore, under the PoS mechanism, it is necessary to "limit the speed" of generating blocks to ensure the stability of the main network. run.

03

DPoS

Delegated Proof of Stake Mechanism

DPOS is delegated proof of stake.

The DPoS mechanism requires that before generating the next block, it must be verified that the previous block has been signed by a trusted node. Compared with PoS's "national mining", DPoS uses a system similar to the "Congress" to directly select trusted nodes, and these trusted nodes (i.e. witnesses) exercise power on behalf of other currency holders. Witnesses Nodes are required to be online for a long time, thus solving a series of problems such as delays in block production that may be caused by PoS block signers not always being online. The DPoS mechanism can usually reach a transaction speed of 10,000 times per second, and can reach the level of 100,000 seconds when the network delay is low, which is very suitable for enterprise-level applications.

04 Other consensus mechanisms

There are other consensus mechanisms in the blockchain system such as PBFT, NEM (NEM) used POI, etc. These consensus mechanisms are proposed to solve some shortcomings of existing consensus mechanisms. But there are not as many systems currently in use as POW, POS and DPOS.

The consensus mechanism is the core of the blockchain system, which determines the degree of decentralization, performance and security of a blockchain system. Therefore, in the development of public chains, the design of the consensus mechanism is the core and key.

② What consensus mechanisms are currently used in the blockchain and what are their respective advantages, disadvantages and scope of application

There are currently four main types of consensus mechanisms: Pow, Pos, DPos, and Pool
1. Pow workload proof is the familiar mining. Through AND or operation, a random number that satisfies the rules is calculated, that is, the accounting right of this time is obtained, and the data that needs to be recorded in this round is sent to the entire network. Other nodes are verified and stored together;
Advantages: Complete decentralization, nodes can enter and exit freely;
Disadvantages: At present, Bitcoin has attracted most of the world’s computing power, and other blockchain applications use the Pow consensus mechanism. It is difficult to obtain the same computing power to ensure one's own security; mining causes a lot of waste of resources; the cycle to reach consensus is long and is not suitable for commercial applications

2. PoS equity proof, a type of POW Upgrade the consensus mechanism; according to the proportion and time of tokens held by each node, the mining difficulty is reduced in an equal proportion, thereby speeding up the speed of finding random numbers.
Advantages: It shortens the time to reach consensus to a certain extent
Disadvantages: It still requires mining, which essentially does not solve the pain points of commercial applications

3. DPos share authorization certification mechanism , similar to board voting, currency holders vote for a certain number of nodes to perform verification and accounting on their behalf.
Advantages: Significantly reduce the number of nodes participating in verification and accounting, and can achieve second-level consensus verification
Disadvantages: The entire consensus mechanism still relies on tokens, and many commercial applications do not require the existence of tokens
br />
4. Pool verification pool, based on traditional distributed consistency technology, plus data verification mechanism; it is a consensus mechanism currently used in a wide range of industry chains
Advantages: No tokens are required It can work and achieve second-level consensus verification based on mature distributed consensus algorithms (Pasox, Raft);
Disadvantages: The degree of decentralization is not as good as bictoin; more suitable for multi-center business models with multi-party participation
>
There are huge advantages in using the consensus mechanism to ensure data consistency (the consensus mechanism was first proposed by Ripple, a network transaction synchronization mechanism that prioritizes data correctness. In the consensus network, no matter how the software code changes, it cannot There is no way to enter the network without consensus, let alone a fork).
————————————————
PS: A little self-deprecating, although the consensus mechanism is absolutelyThis ensures that no hard fork will occur at any time. However, the disadvantage of this mechanism is also obvious, that is, it takes much longer to achieve consensus with other nodes than the current Bitcoin network. In extreme cases, the consequences of being disconnected in the Ripple consensus mechanism network are also terrifying.

It is possible that your home has a power outage for one day, and the entire system will no longer be able to achieve consensus with other Rippled nodes the next day (the consensus mechanism actually requires more than 80% of the nodes to recognize your data, your Submission will be accepted by other nodes, otherwise the connection will be exclusively refused), and you can even only clear all more than 500 GB of your data and resynchronize before you can connect to other Ripple nodes.

So currently, the existing Rippled end is not suitable for civilian use (for commercial use, the impact is relatively small. For example, RL's own Rippled node is hosted in the Amazon cloud data center. If it does not respond for a long time, it can be very high. The amount of compensation is claimed, and that kind of place is almost uninterrupted except for major disasters). This is also one of the aspects that RL has always wanted to improve.

③ Are there 7 core technologies for blockchain operation that you should know?


How many of the 7 core technologies for blockchain operation do you know?
1 .Blockchain link
As the name suggests, blockchain is a chain composed of blocks. Each block is divided into two parts: block header and block body (including transaction data). The block header includes the hash (PrevHash) value (also called hash value) of the previous block used to implement block linking and the random number (nonce) used to calculate the mining difficulty. The hash value of the previous block is actually the hash value of the header of the previous block, and the rules for calculating random numbers determine which miner can obtain the power to record the block.
2. Consensus Mechanism
Blockchain was born with Bitcoin and is the basic technical architecture of Bitcoin. Blockchain can be understood as a decentralized accounting system based on the Internet. A decentralized digital currency system like Bitcoin requires blockchain to ensure the consistency of accounting by each honest node without a central node. Therefore, the core of blockchain technology is a consensus mechanism that reaches a consensus on the legality of transactions among individuals who have no basis for trust in each other without central control.
There are currently four main categories of blockchain consensus mechanisms: PoW, PoS, DPoS, and distributed consensus algorithms.
3. Unlocking scripts
Scripts are an important technology for automatic verification and automatic execution of contracts on the blockchain. Each output of each transaction does not strictly point to an address, but to a script. A script is like a set of rules that govern how the recipient can spend the assets locked on this output.
The legality verification of transactions also relies on scripts. Currently it relies on two types of scripts: locking scripts and unlocking scripts. The locking script is a condition added to the output transaction, implemented through a script language, and is located at the output of the transaction. untieThe lock script corresponds to the lock script. Only if the conditions required by the lock script are met, the corresponding assets on this script can be spent, which is located at the input of the transaction. Many flexible items can be expressed through scripting language. The interpretation script is similar to a "virtual machine" in our programming field, which is distributed and runs on every node in the blockchain network.
4. Transaction Rules
Blockchain transactions are the basic units that constitute blocks, and are also the actual effective content that the blockchain is responsible for recording. A blockchain transaction can be a transfer or other transactions such as the deployment of smart contracts.
In the case of Bitcoin, a transaction refers to a payment transfer. The trading rules are as follows:
1) The input and output of the transaction cannot be empty.
2) For each input of the transaction, if its corresponding UTXO output can be found in the current transaction pool, the transaction will be rejected. Because the current transaction pool is a transaction that has not been recorded in the blockchain, and each input of the transaction should come from a confirmed UTXO. If found in the current transaction pool, it is a double spend transaction.
3) For each input in the transaction, its corresponding output must be UTXO.
4) Each input unlocking script must work with the corresponding output locking script to verify the compliance of the transaction.
5. Transaction Priority
The priority of blockchain transactions is determined by the blockchain protocol rules. For Bitcoin, the priority of a transaction being included in a block is determined by the time it takes for the transaction to be broadcast to the network and the size of the transaction. As the time it takes for a transaction to be broadcast to the network increases and the chain age of the transaction increases, the priority of the transaction is increased and will eventually be included in the block. For Ethereum, the priority of a transaction is also related to the transaction fee that the publisher of the transaction is willing to pay. The higher the transaction fee that the publisher is willing to pay, the higher the priority of the transaction being included in the block.
6.Merkle proof
The original application of Merkle proof is the Bitcoin system (Bitcoin), which was described and created by Satoshi Nakamoto in 2009. The Bitcoin blockchain uses Merkle proofs in order to store transactions in every block. This makes the transaction unable to be tampered with and makes it easy to verify whether the transaction is included in a specific block.
7.RLP
RLP (Recursive Length Prefix, recursive length prefix encoding) is a main encoding method for object serialization in Ethereum. Its purpose is to encode any nested sequence of binary virtual data. Lu Ji

④ What is the proof-of-stake mechanism (PoS) in the blockchain

What does it mean when Bitcoin mining adopts the proof-of-work mechanism? Proof of Stake, referred to as POS, also known as equity proof mechanism, is similar to putting assetsDeposit it in the bank, and the bank will allocate corresponding income to you based on the amount and time you hold the digital assets. In the same way, with PoS digital assets, the system will allocate corresponding rights and interests to you based on your currency age. The currency age is the product of the number of coins you hold and the time. For example, if you hold 100 coins for a total of 30 days, then your coin age will be 3,000. Compared with PoW (proof of work mechanism), PoS has two advantages. First, PoS will not cause excessive waste of electricity because PoS does not require mining by competing for computing power. Second, POS is more difficult to carry out 51% attacks. You can only launch an attack if you have 51% of the coins. If the network is attacked, your own interests will be damaged, which is obviously not cost-effective. Compared with PoW (proof of work mechanism), PoS has two advantages. First, PoS will not cause excessive waste of electricity because PoS does not require mining by competing for computing power. Second, POS is more difficult to carry out 51% attacks. You can only launch an attack if you have 51% of the coins. If the network is attacked, your own interests will be damaged, which is obviously not cost-effective. Currently, there are many digital assets that use PoW to issue new coins and PoS to maintain blockchain network security.

⑤ Comparison of two consensus mechanisms (PoW vs PoS)

The core architecture of the blockchain is the consensus mechanism, which can be said to be the driving engine of the blockchain. It has been developed for so many years. At present, the only mainstream mechanisms that can stand the test are PoW (Proof of Work) and PoS (Proof of Stake). To give a brief overview, the characteristic of the PoW system is that it consumes a lot of computing power to calculate the solution of a specific algorithm (typically such as hashing). The first one to calculate the result has the right to generate a block and will also receive coins as a reward (this is also coin The production and distribution process, vividly called Mining), typical blockchains that use PoW include Bitcoin and Ethereum. Currently, PoW also has the longest running time and is recognized as the most reliable and secure consensus mechanism; its essence is to consume a large amount of Computing power is used to realize the inverse entropy process within the system and ensure the long-term security and stability of the system. However, PoW is widely criticized for consuming too much energy resources. In this regard, PoS is considered a greener solution. As the name suggests, PoS becomes a staker by pledging the assets in the system, namely coins. In this way, you have the right to produce blocks. The more pledged shares, the higher the probability of obtaining the right to produce blocks, which also means more rewards.

There is a CAP theorem in distributed systems, which means that there is a trilemma in a distributed system, that is, it is impossible to satisfy these three characteristics at the same time: consistency (Consistency), availability (Availability) ) and partition tolerance, but only two of them can be satisfied. As a distributed network, this theorem of blockchain has gradually evolved into the triple paradox of blockchain, that is, securitySecurity, decentralization and scalability can only satisfy two characteristics at the same time.

Overall, the PoW system pays more attention to Security and Decentralization, giving up on Scalability. This is also the reason why the throughput of the Bitcoin network is very slow. The PoS system is more concerned about scalability (Scalability) and decentralization (Decentralization), but I am more skeptical about whether PoS can really achieve decentralization (Decentralization). From the perspective of conservatism and the longer-term stability of the system, I personally stand firmly on the side of PoW. This may be related to my conservative personality. I am not particularly optimistic that PoS can be more stable as a base layer. Especially like the Luna incident in May, the general process of the incident was that the algorithmic stable currency UST on the Luna chain lacked value support and eventually became unanchored. The core problem was that the anchoring design of UST tried to use a PoS equity system to support its anchor. The US dollar was fixed, and too many USTs were issued in excess. In addition, the design flaw in the exchange between UST and Luna eventually led to Luna's own death spiral. But the greater significance of this incident should be to sound an alarm. Can the PoS mechanism really maintain stability and maintain so-called decentralization in the face of short-selling capital? It is possible that the number of nodes will shrink quickly and gradually become more centralized.

All system designs need to be compromised based on their own positioning. From the perspective of value anchoring, let’s briefly analyze why PoW will be more advantageous in the long run.

The three main participants in the PoW system are R&D personnel, investors (or users) and Miners. The checks and balances between these three make the system reach a stable and balanced state. In the PoS system, the important balancing force of Miner is removed, and investors and Miner become the same group of stakers. Therefore, the abuse of power by this group will become relatively unrestricted, and the chain will subsequently The direction of development may also be more unbalanced and more likely to favor the direction of the stakers group.

The PoW system well explains what is universally recognized value. In the abstract, it is the scarcity of high cost. Both high cost and scarcity are indispensable. PoS can only achieve at most one of these scarcities.

In order to earn coins by producing blocks on the chain, Miner not only needs to continueTo pay high electricity costs, it must also continuously invest in research and development, upgrade hardware, optimize infrastructure and operational scale to maintain its competitiveness. The final result is that miners that can sustain profits in the long term will not be an unchanged group. Instead, miners that are too inefficient will always be eliminated in competition so that high-efficiency miners can survive. This is also more conducive to decentralization (Decentralization), because the ever-changing Miner group means that no one Miner can maintain the majority of the network's computing power for a long time, unless they pass the severe competition test and continuously optimize themselves. Provide more computing power.

In fact, the pledgers in the PoS system do not have much real risk investment, and there is no harsh competition mechanism for survival of the fittest. They only need to simply run a staker node to earn interest, which is essentially just By simply converting your own money in the banking system into on-chain capital, you can harvest new people who enter the system. This behavior is not too difficult. By simply earning "risk-free" interest, they are not converting capital into any form of investment that requires risk testing.

And when a hard fork occurs, PoW Miners will be more cautious when choosing which chain to support, because they need to invest high electricity costs to endorse their choice, and they will lose money if they choose the wrong one. All input costs. If a hard fork occurs in the PoS system, the pledged coins will be part of the internal state of the system. After the hard fork, the pledger will have the same amount of assets on two different chains. Since there is no silent cost, the pledger will prefer both sides. Both are supported, making hard forks easier and more frequent, known as the nothing at stake problem.

PoW is truly permissionless, which means that old people already in the system cannot restrict new people from joining. As long as you have the ability to provide computing power, you can directly access the network. Produce coins. In the PoS system, if new people want to enter, they have to buy coins from the old people first.

Moreover, in order to pay for various high costs (electricity, equipment, infrastructure, etc.) in PoW, Miner has to sell some coins after producing them to make up for the costs. This is also a way to distribute coins to The process of more people; especially in a bear market, Miner has to sell coins at low prices in order to maintain expenses, so that new talents have the opportunity to obtain chips at a relatively low cost. This is a healthy ecological expansion process. In PoS, since pledgers do not have any operating costs and do not need to face too much competition, pledgers do not need to rush to sell after getting coins from the block, which makes it easier to drive up prices. In fact, it will incentivize the elderly in the field to exploit new entrants. Those who play the game will not give more opportunities to those who come after them; the entire system will tend to be more closed and gradually evolve into a limited game.In the long run, it will only become more and more centralized; the wealth in the system will become more and more concentrated, the rich will get richer, and the poor will get poorer, making it even less possible to achieve decentralization.

Since blocks are generated in the PoW system by providing workload, over time this workload will be accumulated and the chain will continue to extend forward. This is why it is called a block. chain; these accumulated workloads also create huge obstacles for attackers. If you want to reverse the entire chain, not only does it require very high computing power, but it also takes a long time, which also provides a long enough time to deal with attacks. Time buffer.

The PoS system actually only maintains a distributed ledger and has no concept of workload accumulation. Once the attack is successful, it is quite easy to reverse the entire chain and can be completed in a few minutes.

Strictly speaking, BTC supported by PoW computing power should not be classified as high-tech, because its entire system architecture is more conservative and stable, and it provides more of a materialized value (objective costliness). It can serve as an anchor of value, so the title of digital gold is very appropriate. And like ETH (currently PoW, PoS after the 2.0 upgrade), these are closer to technological innovation platforms. PoS is essentially more like an equity system. In fact, the PoS system needs to be centralized, and tends to rely more on the vitality of the entire community. It needs to rely on the innovation and development capabilities of the core team to move forward; while PoW needs to be decentralized and is more focused on stability and providing objective costliness.

As a value distribution system, blockchain has computing power as its anchor of value. Without computing power, it will degenerate into an equity system. Where the computing power is, the funds will follow. The current development trend is also gradually moving towards multi-layer networks, similar to the multi-layer protocol stack of TCP/IP. From the perspective of being a base layer (Base Layer), what is more needed is long-term stability and value support, so the PoW system is more suitable; while PoS may be more used as Layer 2 to achieve scalability (Scalability), making up for PoW The throughput of the base layer is insufficient, and computing power security and value support are obtained by anchoring on the PoW base layer.

Finally, let’s talk about the recent market conditions. The waterfall since May and June has made many people panic. The panic index has stayed in single digits for a long time. In fact, I don’t think there is any need to panic. To survive in this circle for a long time, we still have to have psychological expectations in the face of such big fluctuations. I remember that Shen Nanpeng of Sequoia Capital often mentioned the word Grit, which is the tiny particles left after gravel has been polished thousands of times; Grit represents courage and perseverance.Persistence, there is a feeling of being constantly rubbed against the ground but still moving forward bravely. This is similar to what Taleb said about antifragility. Things that carry value should have this quality. PoW systems are definitely antifragile.

Looking back at the various incidents I have experienced since joining the circle in 2017, in fact, big fluctuations like this happen almost every year (except for 2019, which was relatively smooth); like the 94 incident in China in 2017, The big bear market in 2018, the 312 incident in 2020, the 519 incident in 2021, and then the market turns bearish in May and June of this year in 2022. After each big fluctuation, the market will eliminate those that should be eliminated and clear them out. The risks that should be cleared are also a good thing for the development of the entire industry. We should still take a longer view, at least looking at the changes in 5 to 10 years. Fluctuations and risks brought about by the development of science and technology are inevitable. There is nothing new under the sun. Every technological revolution will always be mixed with There are many objections and doubts, as well as many speculations and scams; this process always goes through various thunderstorms and comebacks, revaluation after clearing bubbles, consolidating the foundation and accumulating energy to jump to a new stage of development again. The arrival of the value Internet is something that cannot be avoided. Once you understand and see this trend clearly, avoid all kinds of pitfalls and market noise, stay away from the temptation of contract leverage and various copycats, and hold on to core assets, time itself will It will pay off.

⑥ What technology does the blockchain apply to achieve this function?

The blockchain applies the following technologies to achieve
The first is the consensus mechanism. The commonly used consensus mechanisms are mainly There are PoW, PoS, DPoS, PBFT, PAXOS, etc. Since there is no center in the blockchain system, there needs to be a preset rule to guide the nodes of all parties to reach an agreement on data processing. All data interactions must be carried out in accordance with strict rules and consensus;
The second It is cryptography technology. Cryptography technology is one of the core technologies of blockchain. Many classic algorithms of modern cryptography are used in current blockchain applications, mainly including: hash algorithm, symmetric encryption, asymmetric encryption, digital Signature etc.
The third type is distributed storage. Blockchain is a distributed ledger on a peer-to-peer network. Each participating node will independently and completely store and write block data information. The advantages of distributed storage compared with traditional centralized storage are mainly reflected in two aspects: data information is backed up on each node to avoid data loss due to single point failure; data on each node is stored independently, effectively avoiding Malicious tampering with historical data.
Smart contracts: Smart contracts allow trusted transactions without a third party. As long as one party reaches the pre-set goals of the agreement, the contract will automatically execute the transaction. These transactions are trackable and irreversible. It has the advantages of transparency, credibility, automatic execution, and mandatory performance. Blockchain technology has many unique features that make it a unique invention and give it unlimited horizons to explore.

⑦ The common features of blockchainConsensus mechanism

The so-called "consensus mechanism" is to complete the verification and confirmation of transactions in a very short time through the voting of special nodes; for a transaction, if several nodes with unrelated interests can If a consensus is reached, we can think that the entire network can also reach a consensus on this. Beijing Muqi Mobile Technology Co., Ltd., a professional blockchain outsourcing development company, welcomes discussions for cooperation. Below we will look at several consensus mechanisms of blockchain, hoping to help everyone understand the basic technology of blockchain.

Due to the development of blockchain technology, everyone is no longer unfamiliar with the term consensus mechanism. With the development of technology, various innovative consensus mechanisms are also developing.

POW proof of work

Bitcoin uses the PoW proof of work mechanism, and later Ethereum used the PoW consensus mechanism. Pow is equivalent to calculating a difficult mathematical problem, which is to calculate the hash value of a new block, and the difficulty of the calculation will be adjusted every period of time. Although PoW is a consensus mechanism that is relatively recognized by everyone, calculations will consume a lot of energy and may pollute the environment.

POS Equity Proof

The probability of obtaining accounting rights is determined by the number and duration of holding Tokens. Compared with POW, POS avoids a large waste of resources caused by mining and shortens the time for each node to reach consensus. If the network environment is good, it can be achieved in milliseconds and has low requirements on node performance.

However, the shortcomings of POS are also obvious. Nodes holding more Tokens have a greater chance of obtaining accounting rights. This will lead to the "Matthew Effect", where the rich will get richer, destroying the decentralization of the blockchain. Centralization.

DPOS Proof of Equity

The principle of DPOS Delegated Proof of Equity is the same as that of POS. The main difference is that DPOS Token holders can vote to elect agents as super nodes, responsible for Produce blocks and maintain consensus rules on the network. If these nodes fail to perform their duties, new nodes will be voted in. The same disadvantage also tends to be centralized.

POA Proof of Authority

POA nodes can reach consensus without communication, so it is extremely efficient. And it can also resist computing power attacks very well and has high security. But POA requires a centralized authoritative node to verify identity, which means it will harm the decentralization of the blockchain, which is also a compromise between decentralization and improved efficiency.

⑧ Four consensus mechanisms of blockchain

The consensus mechanism of blockchain can be divided into the following four categories: Proof of Stake mechanism, Proof of Work mechanism, Pool verification and pool shares Authorization certification mechanism.
Blockchain is a chain composed of blocks one after another. Each block stores certain information, whichThey are connected into a chain according to the chronological order of their respective creation. This chain is saved in all servers. As long as one server in the entire system can work, the entire blockchain is safe. These servers are called nodes in the blockchain system, and they provide storage space and computing power support for the entire blockchain system.

⑨ What is the consensus mechanism of blockchain?

How to achieve consensus in a decentralized network? In the blockchain system, there is no centralized accounting institution like a bank. It is crucial to ensure the consistency of each transaction on all accounting nodes, that is, to achieve consensus across the entire network. The consensus mechanism solves this problem. At present, the main consensus mechanisms include the proof-of-work mechanism PoW and the proof-of-stake mechanism PoS. PoW determines your probability of obtaining accounting rights by evaluating your workload. The greater the workload, the more likely you are to obtain this accounting opportunity. PoS determines your probability of obtaining accounting rights by evaluating the number and length of time you hold tokens. This is similar to the dividend system of stocks. People who hold relatively large shares can receive more dividends. The principle of DPOS is similar to that of POS, except that some "people's congress representatives" are selected. The main difference from PoS is that nodes elect several agents, who verify and keep accounts. With the development of technology, more advanced consensus mechanisms may be born in the future.

⑩ Blockchain consensus mechanism POS and DPOS

As the first consensus mechanism in the blockchain and one that has withstood sufficient practical testing, the workload proof algorithm solves the following problems: The issue of transaction information consistency in distributed systems builds a trust mechanism for nodes that do not trust each other in a decentralized network, and is also a key technical link for the successful application of Bitcoin.

After several years of actual operation, the shortcomings of this algorithm have also been revealed. The Bitcoin network completes 600 trillion SHA256 operations per second, consuming a large amount of power resources. In the end, these calculations have no practical effect. or scientific value. The only purpose of these operations is to solve the workload proof problem. Another real threat is the concentration of computing power. The workload proof is essentially the process of using the exhaustive method to find the hash value that meets the specified conditions. The computing power The stronger it is, the higher the possibility of obtaining accounting rights (that is, mining). At first, it was the first people to use graphics cards to mine, and later to use FPGA mining machines, and later to use ASIC special chips to mine. People are now the ones who are constantly making better ASICs. In addition, there are "miner" nodes that unite to form mining pools, such as Ghash. Ghash issued a statement in 2014 that it will ensure that no more than 40% of the computing power of the entire network will be exceeded in the future. , this kind of self-discipline statement is a great irony of Bitcoin’s trustless mechanism.

Since the birth of Bitcoin, people have begun to try other consensus mechanisms besides the proof-of-work algorithm, such as the representative proof-of-stake POS, delegated proof-of-stake DPOS, and Byzantine Fault Tolerance (BFT). and practical Byzantine fault tolerance mechanism(PBFT), etc. Below we will mainly introduce POS and DPOS, leaving BFT and PBFT for the next article.

Proof of Stake POS

POS is a type of consensus algorithm, or the design idea of ​​a type of consensus algorithm, not one. The first to adopt POS was Peercoin. Peercoin is a type of cryptocurrency launched by a geek with the pseudonym Sunny King in August 2012. It adopts the proof-of-work mechanism + the proof-of-stake mechanism, and introduces the proof-of-stake mechanism into cryptocurrency for the first time. Peercoin introduces the concept of "coin age". Each coin generates 1 coin age every day. For example, if you hold 100 coins for a total of 30 days, then your coin age will be 3000 at this time. When a new block is generated, other nodes that want to obtain accounting rights also need to calculate the hash value of Bitcoin. The difficulty of obtaining the hash value that meets the conditions is related to the difficulty value. This difficulty value here is related to the age of the currency. Inversely proportional, that is, the older your currency is, the greater the probability of obtaining a hash value that meets the conditions. At the same time, your currency age is cleared. After accounting, the system will give you corresponding "interest". You will be cleared 365 coins every time. Age, the interest earned is: 3000 * interest rate / 365, the interest rate of Peercoin is 1%, which is 0.08 coins.

It can be seen that under the POS mechanism, the more coins you hold, the easier it is to obtain accounting rights, which is close to the winner-takes-all feeling. But the more coins you hold, the closer it is to an honest person. nodes, the greater the loss caused by destroying the entire network. There is a loophole in Peercoin's POS mechanism. For people who do not hold coins, they have little benefit, so some malicious attacks have no loss for them. This is the Nothing-at-stake attack. Subsequent more successful POSs have introduced mechanisms to deal with this kind of attack.

The Ethereum system aims to introduce proof of stake, known as Casper, this year. Under the proof-of-stake consensus mechanism, users will be able to have “currency rights” in the Ethereum network. Users who act honestly and confirm legitimate transactions will receive interest proportional to their equity; users who act maliciously and attempt to cheat the network will lose their equity.

Delegated Proof of Equity DPOS

Delegated Proof of Equity DPOS is a variant of POS. Typical examples of using DPOS are BitShares. The basic principle is that the entire network votes to select 101 node agents. Account permissions, the permissions of these representative nodes are exactly the same. The representative nodes take turns keeping accounts and can choose to create blocks or not. But they cannot change the details of the transaction, and the behavior of malicious or late representative nodes will be made public, and the network may vote them out quickly and easily. Representative nodes that are expelled will lose their accounting rights and corresponding income.

DPOS is a weak centralizationThe consensus mechanism retains some key advantages of centralized systems, such as transaction speed (the time of each block is 10 seconds, a transaction takes about 1 minute after getting 6-10 confirmations, and a complete 101-block The cycle only takes about 16 minutes), but each currency holder has the ability to decide which nodes can be trusted, and in fact, representative nodes will actively reduce their income to win more votes, and the remaining income will be used as dividends. Payment to all BitShares holders. DPOS is somewhat similar to representative democracy and the joint-stock company board of directors system. It is an elite system, but its identity is subject to the people below. In DPOS, the holders of the currency at least have the right to decide the identity of the representative node-or miner.

博客主人唯心底涂
男,单身,无聊上班族,闲着没事喜欢研究股票,无时无刻分享股票入门基础知识,资深技术宅。
  • 39772 文章总数
  • 3637507访问次数
  • 3093建站天数