Skip to main content

Polkadot共识第1部分:简介

December 30, 2019 in 共识-zh-cn
Avatarby Joe Petrowski

翻译:First.vip

来源链接: https://www.first.vip/project/6620.html

本系列文章将讨论Polkadot的安全和共识。在第1节深入介绍Polkadot如何创建和保护区块之前,定义一些术语。

共识算法帮助计算机网络像一台计算机一样运作。实际上,这意味着网络中的几乎所有计算机都必须同意某个初始状态,然后对初始状态的确定性操作日志达成共识,最终达成相同的状态。

虽然区块链给共识算法带来了一些有趣工具,但协调问题不是如今才有的问题。最早追溯到航天,由于太空比较荒凉,卫星或高空飞机上的计算机可能会出现不一致。试想一下,你手上有一个飞行计算机网络,想知道飞机的前进方向。无论询问网络中的哪台计算机都没有关系,因为你始终会得到相同的响应。

这与区块链有何联系?我们同样希望计算机网络就某些值达成共识。这个值可以是帐户余额,表决结果或智能合约的执行结果。

实际上,之前的一些共识算法类似于区块链。早在2001年的一场演讲中,麻省理工学院的教授芭芭拉·里斯科夫(Barbara Liskov)谈论了批量交易是如何提高实际拜占庭容错(PBFT)性能的,当时还没有比特币。

“想象一个非常忙碌的主站(primary),一个接一个的请求令它应接不暇,但这个主站实际上并没有为每个请求启动协议,反而是,它收集一批请求,并针对其中一组请求执行一个协议...因为没有必要每个人都给客户端发送回复。如果其中一位发送回复摘要便足以,因为已足以使客户端知道是否是一致的答复。”

PBFT提供了一组规则,就状态更改达成共识,甚至是就一批状态更改达成共识。

打破区块链共识

在区块链这样的分布式系统,需要回答下述几个问题:

1.谁可以提出下一次更改?

2.哪一组更改为最终更改?

3.如果有人打破规则会怎样?

尽早区分上面三个问题,因为许多区块链共识都是统一的。例如工作量证明,根据证明来筛选合适的区块归属者;最长链决定最终链条;计算证明的成本作为违反规则的惩罚。在波卡,上面三个问题都是孤立解答的。

非区块链系统仍然需要解答这三个问题。例如,假设所有计算机都运行相同的软件。在大多数情况下,这是没问题的。例如波音公司制造了一架飞机,则可以假设他们对飞机上的所有计算机进行了编程。

但是,在公共网络中,我们无法做出这样的假设。区块链利用经济学简化了一些网络假设,所有共识系统都存在“良好”和“作恶”行为。区块链的内置经济属性能奖励良好行为,惩罚作恶行为。PoS网络利用经济作为直接手段,确保达成共识。

区块链系统中的安全性是衡量打破共识的难度。权威证明(proof of authority),安全性是掌控权威的难度。在工作量证明中,安全性是获得和运作大量哈希算力,创建比网络更长链的成本。在权益证明中,安全性是抵押价值和风险价值。

Parity技术和Web3基金会成员开发实现了一个算法库来解决共识和安全性问题。在本系列文章中,开始,我们将先介绍最终性算法GRANDPA,因为所有区块生产算法都必须遵守最终性(头等仓注:finality,最终性指就区块最终状态达成共识)。之后,我们将讨论区块生产引擎BABE,以及如何将区块添加到链中。最后,我们将讨论如何使用经济学来保护GRANDPA和BABE。

来源|波卡官方博客

翻译|头等仓Tracey

编译|头等仓Mark

译文版权属头等仓所有,任何转载请保留文末信息。

From the blog

Product

JAM Session: Gavin Wood Reveals Bold Vision for Polkadot's Next Revolution

Yesterday at Token 2049 Dubai, Gavin Wood announced a bold vision for the next generation of Polkadot technology. In line with the other groundbreaking firsts that Polkadot has brought to the market, this new vision is set to revolutionize the future of Web3. It will provide the speed, scale, full decentralization, and ease of use needed to drive forward deep innovation across not just Web3, but the entire tech landscape. At the heart of this vision is JAM, a new version of the Polkadot chain t

Bridges

The landscape of trustless bridges on Polkadot

With research and writing from Oliver Brett, Adrian Catangiu, and Aidan Musnitzky, this article explores the rich environment of bridge building, both within Polkadot and to external ecosystems. Any Web3 protocol with true aspirations of interoperability needs to consider the development and deployment of bridges to external networks, and in this sense Polkadot is no different. Blockchain bridges are, in essence, mechanisms for two sovereign chains with different technological foundations to o

AI

Unleashing the Potential of AI with Polkadot: the Blockchain Powered Revolution

Blockchain technology has opened up a world of possibilities, and nowhere is this more evident than in the emerging field of artificial intelligence (AI). The Polkadot network is at the forefront of this revolution, serving as a powerful platform for innovative AI projects that are pushing the boundaries of what's possible. In this blog, we'll dive into some of the most exciting AI initiatives within the Polkadot ecosystem, exploring how these projects are leveraging Polkadot's advanced capabili

Subscribe to the newsletter to hear about updates and events.