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

区块链工作量证明名词解释是什么,区块链的工作量证明机制(pow)

发布时间:2023-12-11-10:59:00 来源:网络 比特币基础 区块   名词解释   工作量

区块链工作量证明名词解释是什么,区块链的工作量证明机制(pow)

区块链工作量证明机制(Proof-of-Work,简称POW)是一种验证某一个节点(矿工)花费大量的计算能力来解决复杂的数学问题的一种机制。它可以防止恶意篡改、重放攻击、垃圾邮件等,是区块链技术的基础。

相关关键词:

矿工:矿工是指通过运行特定的算法来完成POW机制的节点,它们负责完成比特币网络中的交易确认工作,他们的工作是把交易信息组装成区块,将其添加到区块链上,从而完成交易的确认。矿工会收取交易费用作为报酬,激励他们继续支持区块链网络的运行。

散户:散户是指参与区块链交易的普通用户,他们不一定拥有挖矿设备,也不会参与挖矿活动,只是参与交易,买卖比特币或其他加密货币。他们可以通过注册一个账户,在交易所上买卖比特币,或者通过钱包的地址发送和接收比特币。

节点:节点是指参与到区块链网络中的一台电脑,它负责验证区块链中的交易,并将其添加到区块链上,以确保数据的安全性和一致性。节点可以是矿工,也可以是普通用户,它们都可以参与到区块链网络中,参与到交易的验证和确认工作中。

POW机制是区块链技术的基础,它保证了区块链网络的安全性和可靠性,是比特币等加密货币的重要组成部分。矿工、散户和节点都是参与POW机制的重要组成部分,他们都在为区块链网络的发展做出贡献。
请查看相关英文文档

『一』FileCoin: Proof of Useful Work

Proof of Useful Work is developed by the famous decentralized storage project FileCoin in its A concept proposed in the white paper. Proof of Work, POW is an important consensus method for realizing blockchain, and FileCoin wants to implement a storage platform based on blockchain. So it also needs consensus, and what it chooses is workload proof consensus.

First, let’s explain the conventional proof of work. It is a way for blockchain to achieve consensus. It is the method adopted by Bitcoin, so proof of work is commonly known as "mining". As a decentralized peer-to-peer trading system, Bitcoin must maintain a common and identical ledger on different nodes to record all transactions and ensure that transactions are not repeated and money is not spent more than once. A rule is needed to maintain the consistency of this ledger. Everyone abides by this rule together, which is a consensus. A common method used in blockchain is to divide the ledger into many pages, and each page is a block. Each block is accounted for by one node and then distributed to other nodes for replication, so that the ledgers on all nodes are the same. But which node records each block requires a rule that everyone can abide by. The method used by Bitcoin is to ask all nodes to do a simple math problem. The question is very simple, but the calculation is very heavy, and it usually takes about 10 minutes to get the answer. Although getting the answer is time-consuming, verifying that the answer is correct is easy. Then all nodes will do the questions at the same time, and the first node to do it will get the accounting rights of the next block. Because each block has only one node that made the earliest question, the accounting rights of each block are unique and can be easily verified by other nodes. Once a node verifies that other nodes have obtained the accounting rights of the block, it must copy the block and add it to the local blockchain, and at the same time start the competition for the accounting rights of the next block. In this way, Bitcoin ensures that the blockchain of all nodes is consistent.

The process in which nodes compete for block accounting rights through a large number of calculations is the workload proof. Therefore, the workload proof system (or protocol, function) is an economic countermeasure against denial of service attacks and other service abuses. It requires the initiator to perform a certain amount of calculations, which means it takes a certain amount of computer time. This concept was first proposed by Cynthia Dwork and Moni Naor in an academic paper in 1993. The term Proof of Work (POW) was only really proposed in 1999 in an article by Markus Jakobsson and Ari Juels.

There are many ways to achieve blockchain consensus, such as POS, DPOS, POA, PBFT, etc., but proof of work is the only time-proven (11 years) blockchain consensus mechanism running on the public chain.

What kind of problem does workload proof have? Let’s use Bitcoin as an example. The mathematical problem that Bitcoin nodes do in order to obtain the right to produce blocks is called hash operation. The amount of calculation is very large. Every mining machine participating in Bitcoin mining must perform this calculation all the time, which consumes a lot of electricity. Unlike other calculations such as big data processing, this calculation can generate some value. Its only purpose is to compete for a node and become the block producer of the next block. Bitcoin currently consumes about 2.55 billion watts of electricity per year, which is equivalent to 0.5% of global electricity and the electricity consumption of Ireland in one year. Opponents of POW have accused mining of wasting electricity resources on illusory digital currencies, and called it liberal "swill".

However, people who think POW is a waste of electricity don’t know that it is energy and computing power that create Bitcoin’s secure and unbreakable system.

A piece of cash worth 100 yuan is not just you and I who think it is worth 100, but the entire social group thinks it is worth 100. The value comes from consensus. Bitcoin is a community behavior. People from different countries gather in the community and use the Internet to establish order. Its meaning also comes from group consensus. As long as everyone believes that Bitcoin is valuable and only consensus exists, then it will have value, and The fiat currencies are exactly the same. Therefore, the generation of value recognition does not necessarily need to be driven by the state. Bitcoin has reformed a carrier and medium for transmitting trust. Over the past thousands of years, human society has established political power and consensus through many bloody wars. Now it can be achieved without bloodshed, just by consuming some electricity. Wouldn't it be more advanced to realize it?

In summary, in order to design a decentralized and secure digital currency, energy and computing power are necessary costs. Proof of work is the only solution to build a secure property rights authentication system in a decentralized form. Therefore, people who think POW is a waste of electricity don’t know that it is energy and computing power that create Bitcoin’s secure and unbreakable system. Now the computing power of the entire Bitcoin network has reached a very terrifying level. It is impossible for anyone to launch a 51% computing power attack. The POW algorithm makes the Bitcoin system unbreakable.

Consumption incurred to create value is not waste.

But, with so much computing power, can it be used to create more value? In FileCoin terms, proof of work, are there any other uses?

FileCoin is a star project in the distributed storage industry. His development team, Protocol Lab, is the team that developed the IPFS protocol, so many people can't tell the difference between FileCoin and IPFS. It can be said that it is 201FileCoin’s ICO in 7 years pushed the industry to its peak and also led to a series of similar projects. This article is not intended to praise or belittle this project. I just want to express some of my own opinions based on my own experience in this industry, and try to be objective and fair. I hope it can provide some inspiration to those working in this industry.

FileCoin proposed in the white paper to implement a useful proof-of-work, which actually recognized that to build a secure and unbreakable blockchain, workload must be consumed. However, they don't want the calculations made for this workload to be completely wasted, so they want to make use of this workload. Therefore, the method they thought of was to add storage space usage to the proof of work. In this way, in order to form a consensus, all nodes must provide storage space to store files. This storage space can store user data, which is useful.

Let’s take a look at how FileCoin implements this useful proof-of-work consensus.

The consensus mechanism adopted by Filecoin is not a simple proof of work, but a mechanism called Expected Consensus (EC for short). Like other mainstream consensus mechanisms, the goal is to allow miners to compete for a highly unique block right and receive rewards. The miner who obtains the right to produce blocks is called Leader. In each round of block competition, in order to ensure the reliability of the ledger, there is a unique leader to perform accounting.

In other words, the core of consensus is to choose who will be the leader. There are generally two ways to select a leader, interactive or non-interactive. Interaction requires miners to vote for each other. For example, PBFT is interactive. Several people participating in the election send messages to each other, and the person who gets the majority of votes (more than 2/3) is the leader. Expected consensus uses a non-interactive method to elect Leaders. The participating parties do not send messages to each other at all, but each node performs calculations independently and privately. Finally, a node says, I won the election, and then provides a proof that others can easily verify that he indeed won the election. This verification method is zero-knowledge proof.

The expected consensus mechanism will preset an expected value of blocks for the blockchain network. For example, one block is generated every epoch, but there may be empty blocks or multiple blocks in one epoch. So in Filecoin, each height is not a block, but a set of blocks, called TipSet. This TipSet may contain multiple blocks. So actually Filecoin is a TipSet chain. The expected consensus cannot guarantee that only one Leader will be elected in each round, soThere will be the possibility of multiple Leaders in a round, so that the chain structure becomes a DAG mesh structure. Therefore, FileCoin will also weight blocks to achieve effective convergence.

There is one benefit to the EC consensus adopted by FileCoin. For the traditional POS consensus mechanism, a major problem is the inability to control forks. In other words, due to the low mining cost, participants can mine multiple chains at the same time to gain benefits. The expected consensus has designed this point, which is to use the weight and mortgage mechanism to encourage miners to choose the best chain, and to punish miners who mine multiple chains at the same time, which can promote convergence very quickly. This shows that it is a good way to use POW and POS together.

The possibility of each miner obtaining a block is positively related to the current effective storage amount accounting for the total storage amount of the entire network. This expected consensus mechanism is actually more like POS equity proof, except that it replaces the equity (Staking) in POS with an effective storage ratio. But where does the effective storage for miners come from? It is obtained by storing user data. How to prove that miners store user data, FileCoin created a new proof mechanism called POST spatio-temporal replication proof. This POST is the workload of FileCoin. By replacing power-consuming computing power with storage space for storing useful data, meaningless arms competition has turned into competition in the storage service market. This is truly where FileCoin advances. However, in order to successfully produce a block, after the miner is selected as the block producing node through the expected consensus, he must make a POST proof within one block time (currently 45 seconds) and submit it successfully before the block can be produced. Otherwise the opportunity is lost. Therefore, in order to ensure that miners can produce blocks within the specified time, the official finally decided to use GPU. Although this GPU does not work non-stop like the proof of work, there are still energy-consuming calculations that are contrary to the useful idea of ​​proof of work in the entire process of achieving consensus.

Also, when talking about expected consensus, we said that the block produced in each epoch is not a block, but a group of blocks, so the concept of epoch is very important. How to control the era? Before each miner participates in the election, he needs to generate a Ticket. This Ticket is actually a random number. He needs to go through a process of VDF and VRF. The full name of this VDF is Verifiable Delay Function, which is a verifiable delay function. His calculation process is serial and takes a certain amount of time, and this time cannot be reduced through multi-core parallelization. This ensures that no one can obtain acceleration by optimizing the hardware for the time each miner must spend when generating a Ticket. This function sounds perfect, but thisA VDF doesn’t exist yet! Now the FileCoin test network directly uses a waiting function sleep, which is UDF, Unverifiable Delay Function. The closest VDF solution available today also consumes a lot of computing resources. To put it bluntly, it still consumes electricity and is not environmentally friendly.

Therefore, useful proof of work is still just a good wish. The ideal is very full, but the reality is very skinny. FIL, known as the next Bitcoin, will continue to work hard to achieve this subversive consensus.

Summarize the process for FileCoin storage miners to obtain incentives: users store data and pay FIL fees -> miners store data -> generate copy proof -> complete space-time proof -> select blocks after EC consensus Leader -> Obtain packaging rights -> Miners obtain FIL rewards

From this flow chart, you can see that miners can obtain rewards in two places. One is that you can get users' FIL rewards when storing user files. One is to obtain FIL after obtaining the block packaging rights. A prerequisite for obtaining block packaging rights is to have enough user data. Therefore, when the storage demand is not large enough, miners will charge very low fees from users. When there are not enough users, they will even pay FIL to store data themselves, just to be able to store enough data and be selected as Leader in the EC consensus to receive packaging rewards. The effect of this is that FileCoin is very user-friendly and storage fees are very low. Therefore, it will definitely attract many applications to be developed on this platform. But the disadvantages are also obvious. If the storage capacity is not large enough, miners will not be able to compete with others for the right to produce blocks, so they will not receive rewards. In the end, the entire platform will develop in the direction of big miners and big mining pools, which is contrary to FileCoin's original intention of utilizing all idle servers to achieve distributed storage. In other words, we must wait until the industry reaches a certain scale and the technology becomes more mature before there are opportunities for mining with small mining machines.

Let’s first briefly talk about the pros and cons of centralized storage and decentralized storage. Centralized storage devices are managed in a unified manner, with good reliability and high performance. Decentralized storage data is naturally dispersed, easy to circulate, and has good disaster tolerance, but low reliability. From an economic perspective, centralized storage requires heavy asset investment and high costs. Decentralized storage passes through the blockchain incentive layer, and users can join by themselves. It is light-asset and can reduce the total cost of storage. In the future, the storage and processing of application data will still be based on centralized storage, while decentralized storage, because it is a distributed network, can mainly be used for popular data traffic distribution. At the same time, because there is no centralized ownership, it can become the first choice for decentralized applications.

There is a saying in the market that the decentralized network is suitable for the backup of cold data. In fact, this is not the advantage of decentralized storage. It is because it is too awkward to put hot data on the decentralized network. Reliable, and processing performance can't keep up. Therefore, if decentralized storage can achieve a certain scale effect, greatly reduce storage costs, regard cold data backup as a core business, and target cold data that is not stored by enterprises today because the cost is too high, it will be a great opportunity. Good direction for development.

In this way, technically speaking, decentralized storage does not necessarily have advantages over centralized storage. If a new model can be implemented that combines decentralized economic incentives and centralized storage, it can absorb the advantages of both. Truly achieve useful workloads. The large-scale mining farm model data center that FileCoin may promote in the future may be more marketable.

Today, 11 years later, Bitcoin has not realized its original intention of becoming a peer-to-peer electronic payment currency, but it cannot stop humans from buying it and owning it. Similarly, I believe that FileCoin has received support from a large enough community, miners and developers, even if it will not lead to the full implementation of distributed storage applications in the foreseeable future (perhaps this has never been the goal of FileCoin), but I I still believe that many people will buy it and hold it because of its consensus. Rising to the philosophical level, human beings are paying for the truth.

So in real life, what is useful, or in other words, are we using storage for consensus or consensus for storage? FileCoin is the former. FileCoin wants to achieve a decentralized consensus based on storage workload, which is perfect in theory. Human beings have to pay a price for pursuing perfection. That's why we waited so long on this project. But once realized, it may bring great value to mankind and bring infinite appeal to the market.

But decentralization is not a panacea for everything. One of the biggest advantages of centralization is that it is very efficient. Weakly centralized consensus like dPOS or alliance chain takes into account the advantages of both, can bring applications to the market more quickly, start the distributed storage industry in advance, and promote the implementation of distributed storage applications. Therefore, we pursue both the use of storage for consensus and the use of consensus for storage, and make our choices based on actual needs. In this process, I believe that the blockchain will further develop, gradually optimize, and become more and more useful.

『二』One of the blockchain consensus mechanisms: POW workload proof mechanism

Blockchain can be understood as an untamperable public ledger, and all participants can verify transactions. And keep accounts, which is a distributed ledger. So who will keep the accounts? How to ensure the consistency and accuracy of the ledger? That is, what is the consensus mechanism of the blockchain?

The consensus mechanism of the blockchain is to solve the problem of who will keep accounts (construct blocks) and how to maintain the consistency of the blockchain. There are many consensus mechanisms currently used in blockchain projects, such as: POW workload proof mechanism, POS equity proof mechanism, DPOS share authorization proof mechanism, etc. This article explains the POW workload proof mechanism.

The first successful application of blockchain is the POW proof-of-work mechanism adopted by the Bitcoin system. That is, taking the Bitcoin system as an example to illustrate the POW mechanism, first of all, the Bitcoin system has an incentive mechanism that allows all participants to compete for the right to bookkeeping, that is, whoever has the right to bookkeeping will receive the Bitcoin reward for constructing a new block (the current reward is 12.5 Bitcoin), and obtain the handling fees of all transactions in the new block as a reward.

How do participants compete for accounting rights? Participants use their own computing power to calculate a mathematical problem. Whoever calculates the result first will have the right to keep accounts and will be rewarded for constructing new blocks. This mathematical problem is to find a random number Nonce so that the result of the hash calculation of the block header is less than the target value. The Nonce itself is a field in the block header, so by constantly trying the value of Nonce to satisfy the hash of the block header. It is hoped that the calculated result is less than the target value. By dynamically adjusting the target value, the difficulty of the calculated Nonce value can be adjusted.

The process of hash calculation Nonce is usually compared to a sieve throwing game. Based on the number of sieves participating in the game, the difficulty of the game can be adjusted by adjusting the number of sieve points thrown. For example: 100 people participate in throwing sieves, there are 100 sieves in total, and the required number of points is 100 to win, then whoever among the 100 people throws 100 points first is the winner, and has the right to keep accounts. If you find that everyone rolls 100 points too quickly, you can increase the difficulty and require a roll of 80 points to win. If another 100 people participate in the game, the number of sieves is increased in the game. For example, the number of sieves is increased to 200. The difficulty of the game is also adjusted by setting the number of throw points.

The sieve is similar to the computing power of the Bitcoin network, and the number of points thrown is similar to the dynamically adjustable target value of the Bitcoin network.

The longest chain in the blockchain is regarded as the correct chain. If two blocks appear at the same time, the two blocks will be temporarily recorded in parallel, and the subsequent blocks will be based on one of them. One block will form the longest chain as the consistent chain, and the other block will be discarded. Bitcoin is based on the confirmation of 6 blocks, so the discarded block will not receive Bitcoins. The reward of the system is a waste of computing power (electricity bill) competing for accounting rights. Based on workload incentives, participants must do their best to construct correct blocks, that is, to meet the consistency of the blockchain. That is, all users on the entire network can reach a unique and consistent public ledger.

Current BitcoinThe computing power of the entire system has reached an astonishing 24.75EH/s, of which 1E=1000P, 1P=1000T, 1T=1000G, 1G=1000M, 1M=1000K, 1K=1000, H/s is one hash calculation per second ( Hash collision), that is, 24.75E hash calculations are performed per second, and there is still continuous computing power added to the Bitcoin system. The competition for Bitcoin accounting rights involves hardware providing computing power from CPUs, GPUs, professional mining machines, and mining pools. At present, the stand-alone version of professional mining machines can no longer compete for accounting rights. Multiple mining machines must be combined into a mining pool to compete for accounting rights.

『三』 What is the proof of work in blockchain mining?

The spelling of POW is Proof of Work. To put it simply, it is a work model that requires a lot of hard work to get relatively good pay.
When miners mine a new block, they must operate on the SHA-256 cryptographic hash function. The random hash value in the block starts with one or more 0s. As the number of zeros increases, the amount of work required to find this solution will increase exponentially, and miners find this solution through repeated attempts.
The first miner to calculate the correct answer can obtain the accounting rights of the current block and receive rewards for newly issued Bitcoins. Theoretically speaking, the greater the computing power (strength), the faster the calculation (moving), and the higher the profit value. You should be able to understand this, POW means distribution according to work, the more work, the more reward. At present, Bitcoin, the big brother in the currency world, and Ethereum, the second brother now, all have this model.

『四』What is blockchain

When designing the Bitcoin system, Satoshi Nakamoto creatively combined computer computing power competition with economic incentives to form a proof of work The (proof-of-work, POW) consensus mechanism allows mining computer nodes to complete currency issuance and accounting functions in computing competition, and also completes the operation and maintenance of blockchain ledgers and decentralized networks. This forms a complete cycle: mining with mining machines (competition for computing power), completing decentralized accounting (operating the system), and obtaining economic incentives in the form of Bitcoin (economic rewards).

Bitcoin’s proof-of-work consensus mechanism is a layer that connects upper-layer applications and lower-layer technologies: the layer above it is the issuance, transfer, and anti-counterfeiting of electronic cash; the layer below it , the nodes of the decentralized network reach a consensus and update the distributed ledger.

When discussing the present and future of blockchain, we will constantly return to the design of the Bitcoin system. It is a simple and exquisite system that integrates technical and economic factors. The source of all innovation in the blockchain.

The definition of blockchain

At this point, I believe readers can roughly understand what blockchain is. Finally, let us explain blockchain from different perspectives. Let’s define it.

The first definition of blockchain (relatively popular)

Bitcoin: an encrypted digital currency; blockchain: a basic technology.

Blockchain is an underlying technology derived from “Bitcoin”. In other words, Bitcoin is the first wildly successful application of blockchain technology.

The second definition of blockchain

Blockchain is a technology for “value representation” and “value transfer” in the digital world. One side of the blockchain coin is an encrypted digital currency or token that represents value, and the other side is a distributed ledger and decentralized network for value transfer.

Distributed ledgers and decentralized networks are also often called "chains", which can be regarded as a software platform; and the tokens that represent value are often called "coins".

The token is stored on the chain and managed through the code on the chain (the main form of smart contract), which is programmable.

What is blockchain

『Wu』Blockchain consensus mechanism

PoW: Proof of Work (PoW for short), simple The explanation is a certificate to confirm that you have done a certain amount of work. Because the entire process of monitoring work is usually extremely inefficient, it is a very efficient way to prove that the corresponding workload has been completed by certifying the results of the work. For example, graduation certificates, driver's licenses, etc. in real life are all certificates obtained through inspection results. This means that how many coins you receive depends on the effective work you contribute to mining. Simply understand, the better your computer performance is, the more benefits you will get. This is to execute the distribution of coins according to your workload. Most digital currencies, such as Bitcoin, Litecoin, etc., are virtual currencies based on the PoW model (the higher the computing power and the longer the mining time, the more coins you get).
PoS: PoS is a consensus algorithm in the public chain and can be used as an alternative to the PoW algorithm. PoW is the mechanism that keeps Bitcoin, currently Ethereum, and many other blockchains secure, but the PoW algorithm has been criticized for damaging the environment and wasting electricity during the mining process. PoS attempts to solve these problems by replacing the concept of mining with a different mechanism.
The PoS mechanism can be described as a kind of virtual mining. PoS mainly relies on the tokens in the blockchain itself. In PoW, a user may buy a computer with $1,000, join the network, mine and generate new blocks, and receive rewards. In PoS, users can use 1,000 US dollars to purchase tokens of equal value, and put these tokens as deposits into the PoS mechanism, so that users have the opportunity to generate newBlocks are rewarded. In PoW, if a user spends $2,000 on hardware equipment, they will of course receive twice the computing power for mining, and thus twice the reward. Likewise, by investing twice as many tokens as a deposit in a PoS mechanism, you have twice as much chance of gaining the right to generate a new block.

『Lu』 What does blockchain POW mean?

Blockchain PoW is a consensus mechanism on the blockchain. The current types of consensus mechanisms on the blockchain are There are many, and PoW is just one of them. It means workload proof mechanism. Other consensus mechanisms include POS (proof of equity mechanism), DPOS (share authorization proof mechanism), DAG (directed acyclic graph), PBFT (Practical Byzantine Fault Tolerance) and many other types.
The full name of POW is ProofofWork, which translates as "proof of work" or "proof of work."
Bitcoin, Dogecoin and Litecoin are all digital currencies based on the POW model. That is to say, how much monetary reward you get from mining depends on the effective work of the mining machine. That is to say, the better the performance of the mining machine and the longer the mining time, the more monetary rewards you will get. .
The important significance of proof of work is that it forces the creation of currency to require a certain amount of work and cost, which gives currency certain commodity attributes, allowing the invisible hand of the free market to pass the "price mechanism" Spontaneously adjusting the money supply ensures that the currency has a stable value, allowing the currency to gain people's trust.

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