01.共识机制

正在学习区块链,如果我哪里有错误希望大家指出,如果有任何想法也欢迎留言。这些笔记本身是在typora上写的,如果有显示不正确的敬请谅解。笔记本身也是给我自己写的,所以如果有侵权的请通知我,我立即删除。


  比特币用的PoW,以太坊正在用PoW,打算以后用PoS,这些之间孰优孰劣呢?PoW就不写了,比特币那一页讲过。PoS以太坊的权益证明中写了一部分,我的理解还不是特别好,缺的再写写

1.共识机制的目的

这个很重要,也是这些共识机制需要解决的问题。在数字货币就是为了选出一个记账上链的节点。这个节点需要足够随机,“足够随机”很难做到。如果是我这种猪脑子会选择在所有节点中随机一个,但是一个人可能有很多账户(即控制很多个节点),这样根本做不到足够随机,需要的其实是所有“个人”,每个人只有一票这样去投。PoW做的就是按照算力就行投票。

共识机制是没有办法保证记账人记录的数据是正确的,只能保证记账人的选择是足够民主的。如果他记录的交易是错误的,只要这种错误不够多是不会对区块链造成影响的,因为不管是BTC还是ETH都是最长合法链。这样的话要是全部节点随机选择不就OK了,只挑选正确的区块留下。这不行,要是用户B申请了足够多的账户,他获得记账人的概率就会增大,如果记账人不记录A用户以后的全部交易记录,这是完全可以的。除此之外肯定还有别的原因,我目前就想到这一个。因此就要相对公平的选出一个尽量随机的记账人。

2. PoW

Principle: it is difficult to find a solution, but it is easy to check the result.

Performance: low.

DLT environment: public blockchain.

Completion: probabilistic.

Example of use: Bitcoin, Ethereum, Litecoin.

3.Pos

Principle: the network trusts the validator, who puts his own resources as a pledge for the ability to create blocks: the larger the share, the higher the probability that the network will allow the creation of a block.

Performance: high.

DLT environment: public / private blockchain.

Completion: probabilistic.

Example of use: NXT, Tezos, soon Ethereum.

这个方案有两个好处,其一不需要浪费电力了,其二抵抗51%攻击的能力提升了。

如果alice有10个币,bob有100个币,bob命中的机会就比alice大10倍,是线性的。有人说这样不是不公平嘛,那我告诉你PoW更不公平,因为PoW的电费越多越便宜,算力低的耗电量也低,电费就越贵,对于小矿工更不友好。

其二的问题。如果是抗ASIC算法,大集群集中精力发动一次就完事了,例如亚马逊、阿里、百度,攻击结束后不影响正常工作。比特币的挖矿算法能强点,毕竟需要买大量的专用矿机。而PoS,你先买51%的币再说,如果有人大量买入,肯定币的价格会大涨。

至于PoS的缺点。富人中签的概率更大,他们有更大的概率拿到交易费,他们会更有钱,正反馈。这种问题,下面会有修改,例如PoI。

4. DPoS(Delegated Proof of Stake )

如果说PoS是为了全民普选,那么DPoS就是人民代表大会制,大家选出人大代表去选选举。

5. PoA(Proof of Activity)

Principle: a hybrid of PoW and PoS.

Performance: low.

DLT environment: public.

Completion: probabilistic**.**

Usage example: Decred.

这就没啥说的了,例如PoS用来修改PoW的难度系数。

6. PoL(Proof-of-Location)

Principle: beacons are used to notice a node in a synchronized state, and then to mark its presence with a temporary stamp.

Performance: average.

DLT environment: public.

Completion: immediate.

Usage example: FOAM, Platin.

Proof-of-Location (PoL) allows users to secure a specific GPS location and thus authenticate themselves on the network. Interestingly, this blockchain protocol relies on BFT beacons, which record geolocation and time markers in the blockchain, which prevents disruptions and fraud in the system.

这个东西乍听起来好假,我要是在南极洲岂不永远可以打包?结果仔细一想,不可能按照洲一比一的概率来的,世界杯还有澳大利亚和亚洲的问题。而且随着时间的推移,这个比例肯定是在动态变化的。

7.PoI(Proof-of-Importance)

Principle: like PoS, but with additional properties that affect your ranking.

Performance: high.

DLT environment: public.

Completion: probabilistic.

Usage example: NEM.

这就是进化版的PoS,可以克服一些PoS的缺点。下面是我第一次从零开始全英文查到的。可以先简单概括一下,和PoS的区别是,PoI不是用的全部的币当做比例,而是用实际出了多少币,这样穷人和富人成为打包者的概率是相等的,除非太穷的。

Proof of Importance can be regarded as a novel consensus algorithm because, unlike existing consensus mechanisms such as proof of stake, it seeks to take into account one’s overall support of the network. For example with proof of stake, an argument can be made that it rewards coin hoarders. Under the proof of stake model, nodes are limited to ‘mining’ a percentage of transactions that is reflective of their stake in a cryptocurrency. For example, a proof of stake miner who owns 10% of a cryptocurrency would be able to mine 10% of blocks on the network. The limitation with this consensus model is that it incentivizes nodes on the network to save their coins, instead of spending them. It also produces a scenario in which ‘the rich get richer’, as large coin holders are able to mine a larger percentage of blocks on the network.

Proof of Importance looks to overcome the problems that can be found in the proof of stake model by identifying an account’s overall support of the network. NEM does this by accounting for three factors: vesting, transaction partners, and number and size of transactions in the last 30 days.

Vesting

  • A minimum of 10,000 vested coins is required for harvesting.
  • The higher the number of vested coins, the higher the account’s proof of importance score.
  • Proof of importance only counts coins that have been in an account for a set number of days.

Transaction Partners

  • Proof of importance rewards users who make transactions with other NEM accounts on the network.
  • Users cannot game the network by trading back and forth between accounts, the algorithm only accounts for net transfers over time.

Number and size of transactions in the last 30 days

  • Each transaction (above a minimum size) contributes to an account’s proof of importance score.
  • Larger and more frequent transactions have a greater impact on the proof of importance score.

8. PoET(Proof-of-Elapsed-Time)

Principle: blocks are created in a trusted environment with equal periods.

Performance: average.

DLT environment: private blockchain, with and without permissions.

Completion: probabilistic.

Usage example: Intel.

这个简单,总而言之就是PoW在私有链上的应用,既然是私有链就要用上它的优势:每个节点都是安全的,就是利用了这个特点能比PoW消耗更少的电量。给所有节点一人一个随机数,每个节点空等这么久,第一个等待结束的就是了。那如果等待时间是2,3,4,等待2结束的就打包,其实等待3和4的就没啥意义了。具体的操作流程应该会优化的。

Abstract:

Intel did not lag behind and developed its own blockchain protocol called IntelLedger.

This system is similar to Proof of Work but utilizes less electricity. Instead of participants solving a cryptographic puzzle, the algorithm works in a Trusted Execution Environment (TEE) environment, such as Intel Software Guard Extensions (SGX). The PoET protocol guarantees that the blocks are generated randomly and without any necessary efforts.

Detail:

The working of the POET algorithm is as follows. Each participating node in the network is required to wait for a randomly chosen time period, and the first one to complete the designated waiting time wins the new block. Each node in the blockchain network generates a random wait time and goes to sleep for that specified duration. The one to wake up first – that is, the one with the shortest wait time – wakes up and commits a new block to the blockchain, broadcasting the necessary information to the whole peer network The same process then repeats for the discovery of the next block.

The POET network consensus mechanism needs to ensure two important factors. First, that the participating nodes genuinely select a time that is indeed random and not a shorter duration chosen purposely by the participants in order to win, and two, the winner has indeed completed the waiting time.

Essentially, the workflow is similar to the consensus mechanism followed by Bitcoin’s proof of work (POW) algorithm, but without its high power consumption. Instead of being resource-intensive, it allows a miner’s processor to sleep and switch to other tasks for the specified time thereby increasing its efficiency.

Proof of Elapsed Time (Cryptocurrency)

9. PoA(Proof of authority)

Principle: semi-centralized blockchain for banks and insurance companies

Performance: high

DLT environment: Public, private or consortium.

Completion: probabilistic

Example of use: Kovan, Rinkeby, Giveth, TomoChain, Rublix, Swarm City, Colony, Go Chain.

它的特点主要在scalable,但是更加的中心化,感觉没啥特别的,没怎么具体看。

Abstract

Similar to PoS and DPoS, in PoA validators secure the blockchain and are able to produce new blocks. New blocks on the blockchain are created only when a supermajority is reached by the validators.

By identifying pre-selected authorities, PoA consensus becomes centralized. Therefore, it’s suited for private blockchains and consortiums, such as a group of banks or insurance companies for better scalability. The identities of all validators are public and verifiable by any third party. Having their identity at stake, validators act in the best interest of the network.

Detail

Conditions for Proof of Authority Consensus

Although the conditions may vary from system to system, the PoA consensus algorithm is usually reliant upon:

  • valid and trustworthy identities: validators need to confirm their real identities.
  • difficulty to become a validator: a candidate must be willing to invest money and put his reputation at stake. A tough process reduces the risks of selecting questionable validators and incentivize a long-term commitment.
  • a standard for validator approval: the method for selecting validators must be equal to all candidates.

The essence behind the reputation mechanism is the certainty behind a validator’s identity. This can’t be an easy process nor one that would be readily given up. It must be capable of weeding out bad players. Finally, ensuring that all validators go through the same procedure guarantees the system’s integrity and reliability.

Limitations

The perception of the PoA mechanism is that it foregoes decentralization. So one could say that this model of consensus algorithm is just an effort to make centralized systems more efficient. While this makes PoA an attractive solution for large corporations with logistical needs, it does bring some hesitation - especially within the cryptocurrency scope. PoA systems do have a high throughput, but aspects of immutability come into question when things like censorship and blacklisting can be easily achieved.

Another common criticism is that the identities of PoA validators are visible to anyone. The argument against this is that only established players capable of holding this position would seek to become a validator (as a publicly known participant). Still, knowing the validators’ identities could potentially lead to third-party manipulation. For instance, if a competitor wants to disrupt a PoA-based network, he may try to influence public known validators to act dishonestly in order to compromise the system from within.

Proof of Authority Explained

10.PoB(Proof of Burn)

Principle: burning a mined PoW cryptocurrencies in exchange for mining privileges or the coins/tokens of an alternative currency

Performance: medium

DLT environment: Public

Example of use: Slimcoin and Counterparty

这个听起来就很有意思,来让我一句话挑明:想证明你的工作量也就是你的付出,如果该种加密货币是没有挖矿算法的,可以烧掉其它基于PoW的加密货币来证明你投入了很大的指出。如果烧的是比特币,则表明我间接消耗了电量,虽然我直接消耗的是金钱。如果烧了币拿不到mining right,那和费电没挖到矿没区别。如果有人说这样不是浪费比特币吗?对不起,中本聪和比特币社区的同好们并没说这种情况是不允许的。

下面来自WIKI,不贴网址也不会被告侵权,哈哈哈

The key idea of proof-of-burn (this would also apply to proof-of-stake, by the way) is that when choosing the thing which is to qualify as a “difficulty”, i.e. to require miners to exhibit proof that they’ve “done something that’s tough to do”, all that matters is that an individual miner finds the task expensive. (Well… it also matters that everyone else should find it cheap to verify that it has been done.) It doesn’t need to be the case that real resources are consumed in the real econom

11. PoC(Proof of Capacity) or PoS(Proof of Space)

Principle: The amount of “work” a miner will perform depends on the amount of free disk space to devote to the plotting process.

Performance: high and efficient

DLT environment: public

Example of use: Burstcoin and Bitcoin Ore

简单说就是把PoW的电量换成了硬盘的容量,具体的没深究。

Proof of Capacity (Cryptocurrency)

12. PoST(Proof-of-Stake-Time)

Principle: introducing a stake-time component, where the probability to stake increases over time enhancing security and decentralization.

Performance: high

DLT environment: public

Example of use: VeriCoin Blockchain Explorer

我没太看懂这种协议,貌似比PoS更好,下面有具体的函数实现过程,可惜没看懂,国内还没有这个协议的介绍,谷歌也只有下面detial的两段内容。

Abstract

PoST enables an almost instant and free transaction system across the globe; independent of border, nation, government, and bank. PoST maintains the efficiencies of PoS, but at the same time increases the distribution and security with a certain probability to find proof and receive a reward.

This is achieved through a cyclic time-acceptance function equivalent to the coins held and corresponding to network strength. The time-acceptance model guarantees that relatively active staking increases compensation and a chance to build consensus via proof.

Detail

We herein propose a time-accepted nonlinear consensus that maintains the efficiencies of Proof-of-Stake, while increasing the distribution and security of the consensus system with a diminishing probability to find a proof and receive reward over time. This is achieved via a periodic time-acceptance function that is proportional to the coins held and relative to network strength. This time-acceptance model ensures that relatively active staking maximizes reward and probability to form consensus via proof. This incentivizes direct and active protection of the network. Furthermore, voluntary participation in the network is driven by an inflation targeted interest rate that is inversely proportional to network strength. This increasingly rewards nodes which consistently reinforce network security. This is in addition to a time-diminishing inflation rate that is proportional to network strength and active participation in reaching consensus, and relative to the Proof-of-Work distributed initial supply. A combination of costs and rewards favors direct participation in the protection of the consensus, providing enhanced security, equability,

introducing a nonlinear proof function that defines a fraction of time active and idle, at a given block. Idle-time is defined as the fraction of age that no longer supports the distribution of consensus and instead begins to degrade it. This quantified idle-time is unique to each stake, as It decreases the probability to meet the proof and impacts the fraction of earnable matured interest via consensus. Where the fraction of accepted age (f) is equal to the squared cosine of the product of π and that transactions consensus power §, defined as the fraction coin-age (g) of the average network wide stake-time weight (n) over 60 blocks (1 hour) [figure 1]. If the consensus-power § is greater than 0.45 all age is lost and the Time-active fraction is equal to the minimum stake time (m) of 8 hours

13. PoB(Proof-of-Brain)

Principle: the protocol enables smart, a social currency for publishers and content businesses

Performance: fast and efficient

DLT environment: public

Example of use: Steemit

应该就是用脑袋算什么东西,具体算什么用Steemit挖个矿试试吧,毕竟蓝皮书上也就是下面这一行结果而已。

Token systems that reward users as they contribute to a token-based community system require mechanisms for establishing and evaluating content’s social value: we call this “Proof-of-Brain.”

14. PoBA(Proof-of-Bank-Account)/PoPA(Proof-of-Physical-Address)

Principle: identity verification DApp

Performance: high

DLT environment: private

Example of use: ConsenSys and POA Network

没啥说的,光看名字和私有链这几个字就很清楚了。

Proof of Physical Address (PoPA) is a DApp which connects a real-life physical element with blockchain technology. This helps in verifying an individual’s identity. PoPA connects a person’s physical address with a wallet address in which they control the respective private key.

Every time a user verifies his/her card in the DApp, the PoPA protocol refreshes its own record and calls the ERC780 congenial contract to store the user/address connection.

15. PoC(Proof-of-concept)

Principle: demonstrates the feasibility of any blockchain project

Performance: unknown

DLT environment: private

Example of use: unknown

这个貌似和前面不一样,这个不是一种确定的方法,而是一种概念

A Proof of Concept (POC) can be used in any field such including Voting trackers, Record storage, Legal documents, etc. A POC can either be a prototype without any supporting code or a Minimum Viable Product (MVP) with a base feature set. A POC is a model used for an internal organization to have a better understanding of a particular project.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

tux~

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值