As a star blockchain project, Filecoin consensus mechanism is fascinating

The blockchain is called the cornerstone of the Internet of Value, and the consensus mechanism is the core element of the blockchain and the charm of the blockchain. As a blockchain project popular with investors, Filecoin's consensus mechanism is really fascinating. Today, Interstellar Alliance teacher Peng will discuss Filecoin's consensus mechanism with you.

Insert picture description here

What is a consensus mechanism?

The self-trust of the blockchain is mainly reflected in the following facts: users distributed in the blockchain do not need to trust the other party of the transaction, nor do they need to trust the centralized organization, only need to trust the software system under the transaction center to realize the transaction .

The premise of this self-trust is the consensus mechanism of the blockchain, that is, in a mutual distrust market, the necessary and sufficient condition for each node to reach an agreement is that each node has the motivation to maximize its own interests. With this in mind, they will spontaneously and honestly abide by the rules set in the agreement, judge the authenticity of each record, and finally record the records judged to be true in the blockchain. In other words, if nodes have their own independent interests and compete with each other, it is almost impossible for these nodes to collude to deceive you, and the withdrawal is especially obvious when the nodes have a public reputation in the network.

Blockchain technology uses a set of consensus-based mathematical algorithms to establish a "trust" network between machines, thereby creating new credit creation through technological recognition rather than centralized credit institutions. Consensus can be simply understood as a consensus on a certain aspect of the common understanding, value, and ideas sought by different groups. The consensus mechanism is to determine the way to reach and maintain consensus.

What is the commonly used consensus mechanism?

Today's blockchain consensus mechanisms can be divided into four categories: Proof of Work (PoW), Proof of Stake (PoS), Proof of Share Authorization (DPoS) and Verification Pool (Pool).

1. Proof of Work (PoW):

PoW can be simply understood as proof that you have completed some work. By viewing the work results, you can know that you have completed the specified amount of work. The most commonly used blockchain consensus algorithm is PoW. Both Bitcoin and Ethereum are based on the PoW consensus mechanism.

For example: Bitcoin uses the PoW mechanism in the block generation process. The simple understanding is that everyone is fighting for the right to keep accounts. Whoever catches it first and completes the bookkeeping work correctly will be rewarded by the system. The reward is Bitcoin, which is called "mining". Miners use the computing power of computers to complete this accounting work. This professional computer with computing power is the so-called "mining machine".

advantage:

① Completely decentralized and decentralized, nodes can enter and exit freely, avoiding the cost of establishing and maintaining centralized credit institutions.

②As long as the computing power of the network saboteur does not exceed 50% of the total computing power of the entire network, the transaction status of the network can be negotiated and historical records will not be tampered with.

③The more computing power invested, the greater the possibility of obtaining the right to bookkeeping, and the greater the possibility of generating new block rewards.

Disadvantages:

①At present, the mining of Bitcoin has caused a lot of waste of computing power and energy.

②The incentive mechanism of mining also leads to a high concentration of mining rights

③The settlement cycle is long, up to 7 transactions per second, which is not suitable for commercial applications.

2. Proof of Rights and Interests (POS):

The probability that you get bookkeeping is determined by the number and duration of Token held. Similar to the dividend of stocks, the more equity holders, the more dividends. Token is equivalent to the rights and interests of the blockchain system. At present, many digital assets use POW to issue new coins.

advantage:

①Reducing the waste of resources of the workload mechanism;

② Speed ​​up the calculation, which can also be understood as an upgraded version of proof of work;

Disadvantages:

Nodes with a longer coin age are more likely to obtain accounting rights, which is likely to lead to the Matthew effect. The richer the richer, the more and more rights and interests will be concentrated, thus losing fairness.

3. Entrusted proof of equity (DPoS):

This is a more professional solution derived from PoS, similar to board voting, which means that the people who own the token vote for a fixed node, elect multiple agents, and the agents are responsible for verification and accounting. Unlike PoW and PoS, the entire network can participate in the accounting competition, and the accounting node of DPoS is determined within a certain period of time. In order to encourage more people to participate in the election, the system will generate a small amount of tokens as rewards, and BitShares uses this method.

advantage:

Compared with PoW, DPoS greatly improves the ability of the blockchain to process data, and can even reach the account in the second, while also greatly reducing the cost of maintaining the security of the blockchain network.

Disadvantages:

The degree of decentralization is weak, and the node agent is artificially selected, and the fairness is lower than PoS. It relies on the issuance of tokens to maintain the stability of the proxy node.

4. Verify pool consensus mechanism (Pool)

This is a consensus mechanism based on traditional distributed consistency technology combined with a data verification mechanism. It has been used in a wide range of industrial chains;

Advantages: no need to rely on tokens to achieve second-level consensus verification;

Disadvantages: The degree of decentralization is weak, and it is more suitable for a multi-center business model involving multiple parties;

Summary: Every consensus mechanism cannot satisfy security, efficiency and fairness at the same time. The weaker the degree of decentralization and the lower the security, the faster the blockchain speed; the stronger the degree of decentralization, the higher the security and the slower the blockchain speed. PoW is completely decentralized, but its operating efficiency is too low. PoS can improve efficiency, but it will reduce fairness and security. DPoS is highly centralized, but it has the highest efficiency in the short term. Currently, the industry blockchain uses Pool consensus on a large scale.

Insert picture description here

Filecoin's consensus mechanism

In terms of exploring the consensus mechanism, Filecoin is undoubtedly more forward-looking and breakthrough. Filecoin innovatively adopts a hybrid consensus mechanism-Proof of Copy (PoRep) + Proof of Time and Space (PoSt) + Expected Consensus (EC). Proof of replication is the core factor in the consensus mechanism. Although Filecoin's network protocol, consensus, and other algorithms are basically finalized, proof of replication is still in a continuous improvement plan.

Proof of Copy (PoRep) is an interactive proof system. In this system, the storage provider needs to provide a publicly verifiable certificate to show that it allocates a unique space resource for the data file copy and that the stored data is retrievable.

Proof of replication is the new Proof-of-Storage. PoRep must be able to prevent the following three common methods of attack: witch attack, external source attack and spawning attack. Their common feature is that the size of the data actually stored by the attacking miner is smaller than the data claimed to be stored, so that the attacking miner can get rewards he shouldn't get.

Sybil Attack (Sybil Attack): Using N identities, it is guaranteed to store N copies of data D, but in fact it stores less than N copies (for example, 1 copy), but N storage proofs are provided, and the attack is successful.

External data source attack (outsourcing attack): When the attacker miner receives the data proof D requested by the verifier, the attacker miner generates a proof from other miners to prove that they have stored the data D, but no data, and the attack is successful.

Generation attack: Attacker A can use some method to generate data D. After the verifier verifies, the attacker A can regenerate data D to complete the storage proof, and the attack is successful.

Insert picture description here

It is difficult to prevent generation attacks, and all PoS protocols encounter such problems. How to ensure that the miners actually store this data? PoRep needs to solve this problem. Therefore, the Filecoin protocol uses a game called RepGame to jointly solve these three attack methods. PoRes also introduces Time Bounded on this basis. No matter which method is adopted, there are many ways to implement the PoRes protocol. All methods must be able to prevent the above three attack methods, and must be able to pass the RepGame game test.

Proof of Time (PoSt) proposes a proof chain data structure that links some challenges and proofs. The time period is added to the proof chain, so that the proof of the data stored by the miners for a period of time is obtained, which is the Proof of Spacetime (PoSt).

PoSt can prove that miners have stored specific data during this period of time, and anchor these proof chains with timestamps, so that even if the verifier is not online, time and space proof can be used to verify the proof at a certain time in the future. The miner generates a proof chain, and PoSt will be submitted to the chain to generate a new block. Expected Consensus (EC) is to elect one or more miners in each round to create a new block. The probability of a miner winning the election is proportional to the miner's current effective storage (computing power). Filecoin converts the current storage ratio of miners in the network to the storage ratio of the entire network into voting power of the miner.

Regardless of whether one or more miners are elected during this cycle, the elected miners need to create new blocks and broadcast the new blocks to the network. Although the blocks in the chain are linear, the DAG (directed acyclic graph) used in the Filecoin block data structure can generate multiple blocks at the same time (so Filecoin transactions are more efficient than BTC. This is why Filecoin is called "Possible Blockchain Blockchain 3.0" reason). The hybrid consensus mechanism pioneered by Filecoin fundamentally defines Filecoin as an efficient and decentralized system and reflects Filecoin's fairness, confidentiality, and public verifiability.

Guess you like

Origin blog.csdn.net/cjxy066/article/details/109290646