Ethereum consensus mechanism
There is an essential difference between ethereum and bitcoin. What is the difference? Bitcoin defines a set of currency system, while Ethereum focuses on building a main chain (which can be understood as a road) to allow a large number of blockchain applications to run on this road
from this point of view, Ethereum's application scenarios are more extensive, which is why we say that Ethereum marks a simple monetary system in the era of blockchain
1.0, and a transformation to other instries and application scenarios in the era of blockchain 2.0
however, there is no perfect thing in the world. Although Ethereum has expanded the application scope of blockchain in all walks of life and improved the speed of transaction processing, it also has some disputes and doubts
first, the solution to the lack of scalability of Ethereum: slicing technology and lightning network
the bottom design of Ethereum, the biggest problem is that Ethereum has only one chain and no side chain, which means that all programs have to run on this chain equally, consuming resources and causing system congestion. Just like last year's very popular Ethereum game "encryption cat", when this game was very popular, it once caused Ethereum network paralysis
to improve the processing capacity, Ethereum proposes two ways: shard and lightning network. Let's introce these two technologies respectively
(1) fragmentation technology
vitalik buterin, founder of Ethereum, believes that the reason why mainstream blockchain networks such as bitcoin process transactions very slowly is that every miner has to process every transaction in the whole network, which is actually very inefficient. The idea of fragmentation technology is: a transaction does not need to be processed by all nodes in the whole network, as long as some nodes (miners) in the network are allowed to process it. Therefore, Ethereum network is divided into many pieces. At the same time, each piece can handle different transactions. In this way, the network performance will be greatly improved
however, the slicing technology is also controversial. As we all know, the important idea of blockchain technology is decentralization. Only when the whole network witnesses (processes) the same transaction can it have the highest authority. The Ethereum slicing technology is similar to the group witness, not all nodes witness together. In this way, it will lose the absolute "decentralization" attribute, and can only achieve the purpose of high performance by sacrificing certain characteristics of decentralization
(2) lightning network
lightning network uses the way of transaction under the chain. What does that mean? It means: when the participants of lightning network transfer money to each other, they do not need to confirm the transaction through the main chain of Ethereum, but create a payment channel between the participants and complete it under the chain
however, lightning network is not separated from the main chain. Before establishing a payment channel, you need to use the assets on the main chain as collateral to generate a balance proof, which indicates that you can transfer the corresponding balance. In the case that both parties of the transaction hold the balance certificate, both parties can make unlimited number of transfers under the chain through the payment channel
only when the off chain transaction is completed and the assets need to be transferred back to the chain, the balance change information of the main chain account will be registered on the Ethereum main chain, and no matter how many transactions occur ring this period, there will be no record on the main chain
another real benefit of lightning network is that it can save the cost of miners for you. At present, when we trade on the main chain of Ethereum, we need to consume gas and pay for miners. Once we move the transaction to the lower chain, we can save this part of the cost
Of course, lightning network is not perfect. When using the lightning network, the assets on the main chain should be used as collateral; And this part of assets as collateral can not be used before the user completes the transaction under the chain. This also determines that lightning trading is only suitable for small transactionsthe above is the problem of insufficient scalability of Ethereum, as well as the two main solutions: fragmentation technology and lightning network
Second, there are loopholes in Ethereum's smart contract and the infamous Dao event
Ethereum's smart contract is very powerful, but there are loopholes in any code. The biggest controversy of Ethereum's smart contract lies in the so-called loopholes, that is, security issues. According to relevant research, 34200 (about 3%) of the nearly 1 million smart contracts based on Ethereum contain security vulnerabilities, which will allow hackers to steal eth, freeze assets or delete contracts, such as the infamous Dao incident
(1) what does Dao meanbefore introcing the Dao event, let's first introce what Dao is. Dao is the abbreviation of decentralized
autonomous organization, which can be understood as decentralized autonomous organization. From the perspective of Ethereum, Dao is a kind of contract or a combination of contracts on the blockchain, which is used to replace the government's review and complex intermediate proceres, so as to achieve an efficient and decentralized trust system. Therefore, Dao is not a specific organization, that is to say, there can be many Dao, all kinds of Dao
(2) the infamous Dao event
however, when we talk about Dao now, we basically refer to the Dao event, that is, the infamous hacker attack event we just mentioned. As we know, the English word "the" refers to "the Dao event". The Dao event
refers to "the Dao event", because we just said that Dao is not a specific organization, there can be many Dao, all kinds of Dao
in 2016, slock.it, a German company focusing on "smart locks", launched the Dao project on Ethereum in order to realize decentralized physical exchange (such as apartments and ships). Since April 30, 2016, the financing window has been open for 28 days
unexpectedly, this Dao project is very popular. It raised more than US $100 million in just half a month. By the end of the whole financing period, it raised a total of US $150 million. Therefore, it has become the largest crowdfunding project in history. However, it didn't last long. In June, hackers took advantage of the loopholes in the smart contract to successfully transfer more than 3.6 million Ethernet coins and put them into a Dao sub organization, which has the same structure as the Dao. At that time, the price of Ethernet currency fell directly from more than $20 to less than $13
this event shows that there are loopholes in smart contracts, and once the loopholes are exploited by hackers, the consequences will be very serious. This is why many people criticize Ethereum and say that its smart contract is not smart
to solve this problem, many foreign companies begin to provide code audit services in order to solve the vulnerability problem of smart contract. From a technical point of view, some teams are currently testing smart contracts. Most of these teams are led by professors from Harvard, Stanford and Yale, and some of them have obtained investment from leading institutions
in addition to the problems of insufficient expansibility and loopholes in smart contracts, the controversy over Ethereum lies in the POS consensus mechanism it pursues, that is, the proof of equity mechanism. Under the proof of equity mechanism, if anyone holds more money and holds it for a longer time, he will get more "rights" (interests) and have the opportunity to get bookkeeping power, Bookkeeping can also be rewarded. In this way, it is easy to create the oligarchic advantage of "the stronger the stronger"
Another problem is the chaos of ICO. ICO is a common way to raise funds for blockchain projects, which we can understand as pre-sale. The outbreak of ICO projects on Ethereum has caused illegal activities such as fund allocation and money fraud under the banner of ICO, which has caused security risks to social and financial stabilitydo you remember what the consensus mechanism of bitcoin is? The consensus mechanism of bitcoin is pow. To put it simply, the more work you do, the higher the amount of computation you pay, the more likely you will be the first to find the correct hash value, and the more likely you will be rewarded with bitcoin
however, there are some defects in the pow of bitcoin, that is, it is too slow to process transactions, and miners need to constantly collide hash values through calculation, which is costly and inefficient. Friends who are interested in blockchain knowledge should see such a saying:
in order to make up for the deficiency of bitcoin, Ethereum has proposed a new consensus mechanism, called POS (this is the abbreviation of English, which means "proof of equity", also translated into "proof of equity")
POS simply means the same as its literal meaning: equity, equity. The more currency you hold, the more equity you have, the higher your equity
Ethereum's POS means that the more money you hold, the longer you hold it, the less difficult it will be to calculate and the easier it will be to mine
in the initial setting of Ethereum, Ethereum hopes to build a relatively stable system by using POW in the early stage, then graally adopt POW + POS, and finally completely transition to POS. So, it's true that the consensus mechanism of Ethereum is POS, but POS is only a plan or goal at the beginning of Ethereum's release. At present, Ethereum has not yet transitioned to POS, and the consensus mechanism adopted by Ethereum is still pow, that is, the pow of bitcoin, but it is slightly different from the pow of bitcoin
the amount of information here is a bit large,
the first information point is that the consensus mechanism currently adopted by Ethereum is also pow, but it is slightly different from the pow of bitcoin. So, what's the difference between the pow of Ethereum and bitcoin: in short, the mining difficulty of Ethereum can be adjusted, but the mining difficulty of bitcoin can't be adjusted. Just like our college entrance examination, because the teaching situation and the number of students in different provinces are not the same, so the college entrance examination is divided into national papers and provincial independent proposition
Ethereum said that I am in favor of the topic by region. Bitcoin said: No, it must be the same volume in the whole country. The difficulty is the same for everyone
the popular explanation is that bitcoin uses computer computing power to do a lot of hash collisions, enumerate various possibilities to find a correct hash value. The Ethereum system has a special formula to calculate the difficulty of each block. If a block is verified faster than the previous block, Ethereum protocol will increase the difficulty of the block. By adjusting the block difficulty, the time needed to verify the block can be adjusted
according to the Ethereum protocol, the dynamic adjustment method of difficulty is to make the time interval of creating new blocks in the whole network 15 seconds, and the network uses 15 seconds to create blockchain. In this way, because the time is too fast, the synchronization of the system is greatly improved, and it is difficult for malicious participants to launch 51% (that is, more than half) of the computing power to modify historical data in such a short time
the second information point is: in the initial setting of Ethereum, we hope to achieve the transition from POW to
POS through phased upgrade
dating back to 2014, at the beginning of Ethereum's launch, the team announced that the launch of the project would be divided into four stages, namely, Froniter, homestead, metropolis and serenity. In the first three stages, the consensus mechanism adopts pow (workload proof mechanism), and in the fourth stage, it switches to POS (equity proof mechanism)
on July 30, 2015, the first phase "frontier" of Ethereum was officially released. This phase is only suitable for developers. Developers can write smart contracts and decentralized application DAPP on Ethereum network, and miners begin to enter Ethereum network to maintain network security and get Ethereum coins. The leading-edge version is similar to the beta version, proving whether the Ethereum network is reliable or not
on March 14, 2016, Ethereum entered the second stage of "homeland". In this stage, Ethereum provides the wallet function, so that ordinary users can easily experience and use Ethereum. There is no obvious technology improvement in other aspects, but it shows that Ethereum network can run smoothly
in September 2017, Ethereum has reached the third stage of "metropolis"“ "Metropolis" is composed of Byzantine and Constantinople. The goal of this stage is to introce the hybrid chain mode of POW and POS, so as to prepare for the smooth transition from POW to POS. This is the latest popular "Ethereum Constantinople upgrade". In the Constantinople upgrade, Ethereum will make some changes to the underlying protocols and algorithms to lay a good foundation for the implementation of POW and
POS
how much reward will Ethereum get for mining? Miners who win the block creation competition will get the following income:
1. Static reward, 5 ethereums
2. The fuel cost in the block, i.e. gas, we talked about in the last issue
3. As a part of the block, it includes the extra reward of "Uncle block". Uncle is uncle of uncle, and each uncle block can get 1 / 32 of the mining reward as a reward, that is, 5 times 1 / 32, which is equal to 0.15625 ethereums. Here, let's briefly explain the concept of "TERT block". The concept of "TERT block" was proposed by Ethereum. Why should we introce the concept of TERT block? This also starts with bitcoin. In the bitcoin protocol, the longest chain is considered absolutely correct. If a block is not part of the longest chain, it is called a "orphan block". An isolated block is a block, which is also legal, but it may be found later, or the network transmission is slower, and it does not become part of the longest chain. In bitcoin, the solitude is meaningless and will be discarded later, and the miners who find the solitude will not receive mining related rewards
however, Ethereum does not think that isolated blocks are worthless, and Ethereum system will give rewards to miners who find isolated blocks. In Ethereum, isolated blocks are called "Uncle blocks", which can contribute to the security of the main chain. Ethereum's ten second block interval is too fast, which will rece the security. By encouraging the use of tertiary blocks, the main chain can obtain more security guarantees (because the isolated block itself is legal). Moreover, paying the tertiary block can also stimulate the miners to actively mine and actively use tertiary blocks. Therefore, Ethereum thinks that it is valuable.
2) in terms of algorithm, the core algorithm sha256 adopted by bed and BTC has the same value attributes, but bed has established a new economic model through new technology development; Eth uses ethash algorithm
3) from the perspective of mining cost: BTC mining is becoming more and more difficult and has become an arena for mining equipment. At present, the latest 110t ant S19 Pro mining machine has adopted the latest 7Nm chip, and the price of the machine is nearly 20000 yuan. Some low computing power machines, such as the former king ant S9, can only be eliminated, resulting in a huge waste of resources; Eth uses graphics card GPU to mine, and the cost is also quite high; And bed can dig directly with the existing bitcoin miner or the obsolete bitcoin miner with low computing power, so the cost of miner is very low and the waste of resources is reced
4) from the perspective of total amount and upgrade space: the total amount of BTC is 21 million, and the current price is about ¥ 76000; The total amount of eth will reach 113 million, and the current price is about 2500 yuan; The total amount of bed and BTC is 21 million, and there is a huge space for upgrading.
1, data layer / data layer
the data layer mainly describes the physical form of blockchain, which is a chain structure starting from Genesis block on blockchain, including block data, chain structure, random number, time stamp, public and private key data on blockchain, and is the lowest level data structure in the whole blockchain technology
2. Network layer / network layer
the network layer mainly realizes the mechanism of distributed network through P2P technology, and the network layer includes P2P networking mechanism, data dissemination mechanism and data verification mechanism. Therefore, blockchain is essentially a P2P network with automatic networking mechanism, and the communication between nodes is maintained by maintaining a common blockchain structure
3. Consensus layer / consensus layer
consensus layer mainly includes consensus algorithm and consensus mechanism, which enables highly dispersed nodes to reach consensus on the effectiveness of block data efficiently in the decentralized blockchain network. It is one of the core technologies of blockchain and also the governance mechanism of blockchain community. At present, there are at least dozens of consensus mechanism algorithms, including workload proof, rights and interests proof, rights and interests authorization proof, burning proof, importance proof and so on
data layer, network layer and consensus layer are the necessary elements of building blockchain technology. Without any layer, it can not be called a real blockchain technology
4. Incentive layer / activator layer
the incentive layer mainly includes the issuing system and distribution system of economic incentive. Its function is to provide certain incentive measures, encourage nodes to participate in the security verification work in the blockchain, incorporate economic factors into the blockchain technology system, encourage nodes that comply with rules to participate in bookkeeping, and punish nodes that do not comply with rules
5. Contract layer / contract layer
the contract layer mainly includes various scripts, codes, algorithm mechanisms and smart contracts, which is the basis of block chain programming. Embedding the code into the blockchain or token, realizing the smart contract that can be customized, and automatically executing without a third party when certain constraints are met, is the foundation of the blockchain's distrust
6. Application layer / application layer
the application layer of blockchain encapsulates various application scenarios and cases, which are similar to applications on computer operating system, portals on Internet browsers, search engines, e-malls or apps on mobile phones. The blockchain technology applications are deployed on Ethereum, EOS and qtum, and are implemented in real life scenarios. The future programmable finance and programmable society will also be built on the application layer
incentive layer, contract layer and application layer are not necessary factors for each blockchain application, and some blockchain applications do not completely include the three-tier structure.
pos: POS is a consensus algorithm in the public chain, which can be used as a replacement of pow algorithm. POW is a mechanism to ensure the security of bitcoin, Ethereum and many other blockchains, but POW algorithm is criticized for destroying the environment and wasting power in the process of mining. POS tries to solve these problems by replacing the concept of mining with a different mechanism
POS mechanism can be described as a kind of virtual mining. POS mainly relies on the token in the blockchain itself. In pow, a user may buy a computer for 1000 dollars, join the network to mine and proce new blocks, and get a reward. In POS, users can buy tokens of equal value with us $1000 and put them into the POS mechanism as deposit, so that users have the opportunity to generate new blocks and get rewards. In pow, if users spend $2000 on hardware equipment, they will of course get twice the computing power to mine, thus getting twice the reward. Similarly, if you invest twice as much token as the deposit in the POS mechanism, you have twice as much chance to get the right to generate new blocks.
before the birth of bitcoin, global information transmission was realized through the Internet's TCP / IP (Transmission Control Protocol / Internet Interconnection Protocol) protocol to achieve high-speed and low-cost transmission. However, with the development of interconnection technology (Internet, Internet of things, VR / AR), the ways of interaction between people and objects, people and information are more diversified, More entities are digitized or token, just the sharing and transmission of information can not meet the economic and social development, so when the entity is digitized or token, people pay more and more attention to the value transfer and how to transfer these assets and values point to point
on October 31, 2008, Satoshi Nakamoto published bitcoin's white paper "bitcoin: an e-cash in peer-to-peer network" for the first time, and proposed to realize value transfer through decentralized bitcoin network. In the bitcoin system, all participants in the whole network are the supervisors of the transaction, and both parties can complete the transaction without establishing a trust relationship. Blockchain technology has changed the way we obtain and share information, creating a new distributed, point-to-point ecological society
before the emergence of bitcoin network, we have been unable to transfer and transmit the value of point-to-point through the Internet without the help of third-party trusted institutions. Bitcoin network is the first value transfer protocol (VTP) running on the information superhighway. At present, with the maturity of blockchain technology, the application scenarios of blockchain are not limited to bitcoin and Ethereum. Bitcoinpc tries to combine the above and below blockchain to form the ecological environment of the third blockchain, and further uses VTP protocol to realize point-to-point value transmission
since 2009, with the value of bitcoin being accepted by more and more people and the price rising, bitcoin market has graally become a mecca for global investors. The reason lies in the continuous improvement of investment threshold, continuous compression of investment profit margin and excessive policy intervention compared with other instries, The symbolic significance of blockchain technology and the low value of currency market have become the fundamental reasons for the continuous influx of funds
at present, the blockchain technology in the market is mainly divided into three times:
& #10146; The first era is a point-to-point e-cash system represented by BTC< br />
➢ The second era is the open smart contract complete solution represented by eth< br />
➢ The third era is to solve the problem of eth performance shortage and block congestion, and strive to achieve better commercial value of public chain cluster
it can be inferred that after nearly a decade of crazy speculation in the early stage of the currency market, the next decade will usher in the golden age of value investment. At this time, how to choose an undervalued and high-quality project has become the primary task, just as Bill Gates invested in Coca Cola
what is BPC
BPC, full name bitcoinpc, bit capacity, is a new cryptocurrency based on proof of capacity (hereinafter referred to as POC)
BPC is a digital asset and application platform of blockchain. It provides a new proof of capacity, and provides bitcoinpcasset and bitcoinpcid functions at the bottom of the system, which makes it very convenient for people to carry out asset digitization business, not just to create native tokens on the blockchain
by taking the capacity of hard disk as the basis of consensus, BPC makes its proction more decentralized, makes it more secure and credible, and enables everyone to participate in the proction of cryptocurrency, and generates credit and value through mathematics
BPC's choice of computer hard disk mining is a disruptive innovation. There are CPU, GPU and hard disk as mining equipment in computer. CPU and GPU can not avoid becoming AISC mining machine in the end. At the same time, CPU and GPU will cause a lot of energy waste. The hard disk has the characteristics of anti AISC and power saving. The hard disk can keep its operation only by simple disk scanning. BPC chooses hard disk mining to avoid the defects of CPU and GPU perfectly. The maximum mining capacity of a single mining machine is 8t, avoiding some POC currencies, After a certain stage of development, small households can't enter the market, but big ones are playing. They are playing the same way as POW mining. Small capacity PC mining machine makes it easier to lay out the ecology, enter thousands of households, and realize the idea of Zhongben congren mining. The revolution of POC mining has already started, and the next wave of bull market will proce the leading currency of POC. We'll see< Deterministic: the behavior of the program is deterministic, and the consensus is reached, and the non deterministic factors are excluded in the design of the system
2. Time: Based on POC mechanism, BPC provides system call based on block time stamp, which can regard the whole blockchain as a time stamp server and obtain the time stamp when any block is constructed< Randomness: bitcoinpc runs in two ways to obtain random numbers:
(1) when each block is constructed, the consensus node will reach a consensus on a random number and fill it into the field of the block, and the mining program can read the word segments of any block
(2) the mining program can use the hash value of the block as a means of generating random numbers, Because the hash value of a block is random, a weak random number can be obtained by this method< Data source: bitcoinpc provides two kinds of deterministic data sources:
(1) blockchain ledger
the program can access all the data on the whole blockchain through interoperability services, including complete blocks and transactions, as well as each of their fields. The data on the block is deterministic and consistent, so it can be accessed safely
(2) contract storage space
every node deployed on bitcoinpc has a private storage area which can only be accessed by the node itself. The consensus mechanism of bitcoinpc ensures that the storage state of each node is consistent. Bitcoinpc does not provide a direct way to access the data outside the chain. It needs to send the data outside the chain to the inside of the chain through transaction, so as to convert it into the above two types of data sources before it can be accessed
5. Node call: bitcoinpc nodes have the ability to call each other, but cannot call recursively< High performance: bitcoin PC adopts lightweight VM (virtual machine) as its node's execution environment, which has fast startup speed and small resource occupation, so it is suitable for short programs like nodes. JIT (just in time compiler) technology can significantly improve the execution efficiency of virtual machine
7. Extensibility: the calling relationship between nodes of bitcoinpc is static, and the calling target cannot be specified at runtime
8. Low coupling: bitcoinpc system adopts low coupling design, and the block program communicates with the outside through the interoperability service layer when executing< High efficiency and energy saving: the mining economic model of POC makes miners become a community of ecological interests, and uses money as a new means of proction to replace the original power consumption resources, which makes the whole ecology of BPC expand automatically. Everyone in the world who can buy a hard disk can participate in mining<
BPC application scenarios
superconcting transaction: bitcoinpc will incubate blockchain superconcting transaction projects in the future<
smart Fund: bitcoinpc will increase investment in smart fund projects in the future. It is very similar to the Dao project based on Ethereum, but it tries to improve security through some methods to avoid repeating the mistakes of the Dao
cross chain interoperability: bitcoinpc provides support for the implementation of cross chain interoperability, which can not only realize cross chain asset exchange, but also run cross chain distributed transactions, run on different blockchains, and ensure their consistency<
BPC distribution mechanism
total number of BPCs issued: 42 million
4.2 million (10% of the total number): used to motivate bitcoinpc developers and bitcoinpc board members (pre excavation)
2.1 million (5% of the total number): used to encourage bitcoinpc community construction (output of each mining block)
35.7 million (85% of the total number): used for miners to mine
< br />
block proction time: 10 minutes
initial block size: 100bpc / block
block capacity: 10M
half cycle: 4 years
initial TPS: 70 transactions / second
