Idea on edX's Blockchain Technology
Some writes for edx blockchain course
What is PoW
The idea for Proof of Work(PoW) was first published in 1993 by Cynthia Dwork and Moni Naor and was later applied by Satoshi Nakamoto in the Bitcoin paper in 2008. Proof of Work consensus is the mechanism of choice for the majority of cryptocurrencies currently in circulation. The term “proof of work” was first used by Markus Jakobsson and Ari Juels in a publication in 1999. Nowadays, it is widely used in public chain projects especially bitcoin and ethereum codebased ones
The goal of PoW is to maintain the p2p network, defending from DoS attacks, and gurantee the value’s safety on chain. PoW imposes some restrictions on operations in the network. They need to put a lot of effort into execution. Effective attacks require a lot of computing power and a lot of time to calculate. Therefore, an attack is possible, but it is useless because the cost is too high. And it is important to have strong computing power to solve difficult problems and form new obstacles no matter how much money in the wallet. Therefore, the holders of huge amounts of funds are not responsible for the decision of the entire network. It is more like a “two factor authorization”, because it uses non-service-ralated factors, like CPU computation, to gurantee datastore in the chain is safe. For example, in bitcoin, coins are “mined” using the Hashcash proof-of-work function by individual miners and verified by the decentralized nodes in the P2P bitcoin network. And the difficulty is periodically adjusted to keep the block time around a target time.
The Understanding on Proof of Work
The defination of PoW is well-known, so I wont repeat these basic infomation. On the other hand, as an experienced PoW(mining) project host and user, I would argue more personal opinion about the “shortages” of PoW ecosystem.
0x01 Energy really is wasted on PoW?
Almost all opponents of PoW are focus on the usage of electricity, and then comparing to their home electricity price to conclude a huge lost result. But the fact is, the waste is less than they imagine, even no actual loss.
I have to answer, no, PoW is not a waste of electricity.
As a Chinese, I know how a miner or a mining farm manager controls his cost on electric - find the cheapest electricity source. In China, you can find excess hydropower in wide Southern area, and wind power in West. If there is no mining pool, the cheap electricity will have to be moved to the national power grid and add the high transportation cost to its price. Thus in large cities, like Shanghai, electricity price is much higher. But with mining, the value of electricity can be converted into the coin value on the first time, and we just need to move the necessary part to maintain the power grid. So we can avoid the power loss on transportation, we can avoid the value loss on transportation, even we can avoid the extra cost on electricity management.
And also, the cost of PoW is not more than the triditional economy. We always call cryptocurrency “the new money”, and it represents that the cryptocurrency itself can be a standalone economic system. You can google how many resources are wasted by the “old moneys”, the cost of every banks, clearing houses, finance brokers etc. The answer is that it must be larger than PoW. I am used to worked in Citibank, I saw the stuffs never turn off their computers after work, I saw the sub-branch was open but did not serve anyone, I saw stuffs competing with each other by food-wasting Chinese style dinners. So why their work is not resource-consuming, but PoW is?
0x01 PoW is worse than other consensus?
Nowadays it is a trend that desperating PoW in blockchain developing, and the projects which still uses PoW are all treated as a “Bitcoin style”, “Old style”, “Out of date style”, regardless of whether it is really a bitcoin fork.
But I have to answer again, no, PoW is never worse than anyone, especially for public chain.
I had maintained one cryptocurrency project. Maybe beacase of the situation which was fulfilled with eth tokens or the token-style project name, my project was always treated as a token. After publishing on bitcointalk forum, tons of vendors sent me message - provide ICO(initial coin offering) service, provide advertisement service, provide exchange service, provide google rank service, provide youtube interview service, etc. But all of them were charging 0.5-2BTC which I cannot afford as a small technical project. The fact was that we were a PoW mining project having a great scene application. I felt failure at first becasue I cannot afford services. However, after mainnet igniting, the hashrate of the network was pumping and the coin price was pumping. Then I started reviewing bitcoin, ethereum, and projects born from ethereum like EOS.
It is clear that, PoW leads to the bitcoin’s successful. Without it, there will be nobody who are willing to pay their fiat currency to a useless unreliable coin whose founder disappering.
As for ethereum, though Vitalik Buterin says PoS is a better, without Ethash, ethereum wont ignite its mainnet and pump its coin price.
Some will argue that ethereum’s success is from its decentralized applications, which is not depending on mainnet coin price nor PoW consensus. Maybe it’s right, it is true that PoW is not fit for private chain or union chain, becasue it needs other factors to keep the network safety instead of electricity. But the opponents still have to approve that the PoW guarantee the robust of ethereum’s, as a public chain, “value network”. And also, with this, ethereum is able to serve the well-known token publish services. Provided with no PoW gurantee, ethereum will be hard to serve at beginning. After all, bitcoin network, or bitcoin forks can also privide token services, and projects like EOS would be ICOed in bitcoin network not ethereum.
What is consensus?
There is an abstract go lib which is great for understanding what consensus is
And its theorical raft implement is here, practical raft implement is here
So, in short, consensus is a manager of state, which ensures the state’s unify among p2p network, accepting and execuating continuous opeartions on state.