Introduction

Not every day that somebody in the field of distributed systems, comes out and says “I have a new breakthrough to tell you about”. However, recently, Prof. Emin Gün Sirer, from Cornell University, said that he does. In this article, we are going to describe to you a new family of consensus protocols that just emerged several months ago. “Team Rocket — A pseudonymous team — with the collaboration of Prof. Sirer dropped this paper titled “Snowflake to Avalanche: A Novel Metastable Consensus Protocol Family for Cryptocurrencies” on IPFS. The paper builds on comprehensive low-level details and proofs that are…


Image for post
Image for post

Cryptocurrencies have gained a lot of traction during the past few years. A plethora of currencies have come to life and many more are yet to come. Currently, as of 29 May 2018, Coinmarketcap reports more than 1633 different coins, each of which has its own set of goals, roles, and purposes. It has become relatively easy for developers and teams to initiate their own project and deploy their new coin. On the contrary, it has become hard for newcomers to understand the demography of the space and hence, they are becoming more reluctant to invest. Early investors are not…


The hype surrounding Blockchains has exaggerated the realistic capabilities and applications of this new technology. This frenzy made it hard on businesses, developers, and investors to understand the practical limitations and to identify the right applications that are appropriate for Blockchain or distributed ledger technology.

Karl Wüst and Arthur Gervais from ETH Zurich have recently published a peer-reviewed paper¹ that presents a structured methodology that can help determine the suitable technical solution to solve a particular application problem. In this blog post, we will go through this methodology and explain some examples applied in the paper.

Technology Comparison

Image for post
Image for post
Comparison between the main different types of state persistence¹.

Blockchains are append-only ledgers…


The hype surrounding Blockchains has exaggerated the realistic capabilities and applications of this new technology. This frenzy made it hard on businesses, developers, and investors to understand the practical limitations and to identify the right applications that are appropriate for Blockchain or distributed ledger technology.

Karl Wüst and Arthur Gervais from ETH Zurich have recently published a peer-reviewed paper¹ that presents a structured methodology that can help determine the suitable technical solution to solve a particular application problem. In this blog post, we will go through this methodology and explain some examples applied in the paper.

Technology Comparison

Image for post
Image for post
Comparison between the main different types of state persistence¹.

Blockchains are append-only ledgers…


Introduction

All of the current smart contract public blockchains suffer from limited transaction throughput and lack of privacy. For these reasons, many industries and investors (e.g., J.P.Morgan & Goldman Sachs) are shifting towards private chains, sacrificing the benefits of decentralization and global resource utilization of public chains. Although many current projects are focused on the scalability problem, very few of them are trying to solve the privacy concerns. For example, the Enigma Project is amongst the very few projects that are focusing on solving public-chain privacy using a software-based approach.

A new platform called Ekiden solves these major problems by a)


引言

分布式系统领域中,不是每天都有人告诉你“我有一个新的突破。”然而最近,来自康奈尔大学的Emin Gün Sirer教授表示他确实有个新突破。在本文中,我们将向您描述几个月前刚刚面世的新的共识协议族。匿名团队Team Rocket同Sirer教授合作,在IPFS上发表了题为“Snowflake to Avalanche: A Novel Metastable Consensus Protocol Family for Cryptocurrencies”的论文。该论文关注于具体的细节和证明上,因此很难被非专业人士理解。在本文中,我们通过简化和可视化该协议,让您也能够理解这种新方法。

两类共识协议

当许多分布式计算机共享相同的任务和资源时,共识是最重要目标之一。

典型的例子是在多个服务器上维护金融系统中的帐户余额。金融机构不依靠单一数据库来存储数据,而是利用分布在全球不同地理位置的机器来处理这些交易。他们需要一种方法来让所有这些机器数据是一致的,进而它们所反映的帐户余额也是一致的。

另一个例子是保持对亚马逊在线购物服务的一致性。为了在全球范围内扩展服务,数据必须(在地理上)分布于不同的大型数据中心上。亚马逊需要定期查看其库存产品,否则可能会发生无法意料的事情。例如,库存的最后一件商品肯能会重复出售给两个不同的人。

这一直是计算机科学中的一个重要问题。 为此,学者和工程师们在过去40年中一直在努力寻找有效的解决方案。在分布式系统领域,目前只存在两组共识协议族。我们接下来将会描述着两组协议族。

经典共识协议族

第一类协议被称为经典共识协议,它是由两位伟大的计算机科学家Leslie Lamport和Barbara Liskov共同开发的。他们两人都是图灵奖获得者(相当于计算机科学家的诺贝尔奖)。该协议的优点很多,包括快速结算和快速担保交易。

然而,这也是有代价的:

  • 它们无法扩展到1000个节点以上。这是因为它们通信成本正比于节点个数的二次方,即O(n²)。
  • 他们要求网络中的每个人都知道所有其他参与者。

本质上,他们的安全性取决于法定数量的节点所作出的一致判断,这些节点确认看到同样的事情并进行认定。在构建私链时,这种方法是合理的,但是,当您处于不受信任的节点的动态环境中时,这种方法并不适用。因此,公链需要基于另一种不同的共识协议。

中本聪共识协议

2009年,另一个类协议被提出来了。中本聪提出了他的新协议系列,并展示了它独特的稳健性:

  • 我们不需要知道参与网络的所有节点。任何节点都可以在任何时间点离开或加入,任何矿工都可以提出一个区块并参与系统。
  • 它可以扩展到分布在全世界的大量节点和参与者。

然而这些优点也是有代价的,特别是:

  • 比特币非常慢,平均而言,用户必须等待大约10–60分钟才能确认他们的交易被存储在链上。
  • 吞吐量也非常有限。比特币每秒可处理大约3–7笔交易,当然,这巨力成为世界货币的处理量还相差甚远。
  • 最后,比特币消耗了大量的能量;大约相当于4个切尔诺贝利核电站的能量为比特币供电。这些能量都花在了运算上了。

Avalanche雪崩协议

雪崩协议(Avalanche)结合了两者的优点,特别是,

  • 快速结算和低延迟:也就是说,在全球范围内实现结算需要大约2秒钟。这基本上意味着在2秒后,您的付款就已经处理和验证完成了。
  • 更高的吞吐量:每秒1000–10,000个交易。
  • 稳健:网络无需就参与者是谁达成一致。
  • 静态协议:最重要的是,协议是绿色的。这意味着它是可持续的,它不会浪费任何能量,并且没有特殊的矿工生态系统,其中矿工的利益与用户的利益无关。

核心理念:Metastability

Image for post
Image for post
运行中的雪崩协议¹。 核心思想依赖于抽样投票。

雪崩协议的核心理念是metastability。共识协议中最糟糕的事情是无法在两个选择之间做出决定,即你不希望它模糊地说两个事件中有一个发生了,实际你期望它能确定两个事件中到底哪个发生了哪个没发生。雪崩协议的matastable协议旨在倾向于选择于两个选项中的一个。

为了直观解释该过程的核心思想,让我们看一个简化的例子,如上图所示。 考虑一个想要投票给蓝色或红色的去信任节点网络。

  • 网络的单个节点从选择少量随机对等节点(例如五个)开始,并要求他们选择颜色。
  • 然后,每个对等节点以投票进行回应,发出请求节点使用该投票来形成所有投票的加权结果。在上图中(在第一帧中),从发起请求的节点角度来看,整个网络基于第一投票倾向于红色。
  • 每个参与者都需要重复这一过程。

该协议类似于重复的二次抽样投票过程。这里发生的事情是,即使我们开始在红色和蓝色是一半一半的最糟糕的情况下,在一轮之后,很有可能结果不再是打平手了。此外,在两轮甚至在三轮之打平手的概率将会非常小,打平手的几率会以指数方式衰减。该协议旨在于倾向某一结果而不是留在模棱两可的中间选项。随着它的倾向性越来越高,网络的感知的颜色将会转移到其中一种颜色。我们向一个结果方向移动的速度(节点对一种颜色投票比另一种颜色更多)将会不断加快,并且在某个时候我们达到不返回点,整个网络已就颜色达成一致。

关于协议的一些说明

  • 高效的可扩展性:协议是轻量级的,因此提供可扩展性和低延迟。
  • 拜占攻击庭容忍度:它可以容忍大量的拜占庭参与者,而不对安全性产生影响。特别地,它可以容忍多达50%的节点作为拜占庭节点(即尝试欺骗网络并保持整个网络不平衡的节点)。但是,它们无法让两个节点决定两种不同颜色。
  • 平等主义生态系统:雪崩协议产生了一个平等主义的生态系统,即网络中的所有节点都是相同的。 没有矿工,也没有特权。
  • 冲突交易不受保护:如果攻击者试图在两次不同的交易中花费相同的钱两次(双重支出),那么雪崩协议将无法在这两种交易之间做出选择,导致这笔钱丢失。经典共识和中本聪协议将会选择其中一个交易,但是雪崩协议不会。这是雪崩协议的一个非常有趣的属性,它会隐式而又自然地惩罚坏的角色,而协议本身没有增加任何额外的复杂读。

雪崩协议代币:AVA

AVA — — 雪崩(Avalanche)的缩写,是一种新的利用雪崩协议的代币。

  • 通过投注股份对Sybil攻击进行威慑:雪崩协议协议通过投注AVA代币股份来防止sybil攻击。这意味着节需要点拥有AVA代币,以表明他们在系统中拥有一些所有权。与以太坊和其他代币不同,这些股份不是抵押品,而是永远不会丢失的。如果你行为不端,你的钱也不会被扣走。所以这里的投入股份只是为了确保你不能冒充别人。这是雪崩协议的重大成果之一。股份投注不是用于达成共识,而事实上它完全独立共识。
  • 通过投票进行经济管理:整个系统一个有趣的特点是管理。到目前为止,我们介绍的的核心思想是使用二次抽样投票来达成共识。我们可以使用相同的机制来就协议本身的关键参数达成一致。因此,例如,如果网络没有足够的拥有者,网络可以决定提高货币增发速度。相反,网络也可以决定降货币增发速度以提高价格并减少可用的代币供应。相比之下,中本聪协议必须按照固定的速率曲线释放2100万代币。相反,雪崩协议本质上取代了中央银行,他用一群利益相关的人来维护,这些利益相关者的利益是和代币是否妥善管理相联系的。

结论

人们经常谈论比特币中使用的共识协议,就好像它是一种纯粹的去中心化的方法,可以平等地对待所有网络参与者的意见。不幸的是,在比特币中决策主要是由矿工做出的。

相比之下,雪崩协议将共识问题与管理问题分开。每个都是模块化和独立化地处理。通过gossip协议与循环采样的智能组合形成共识。同时,通过抽样和投注股份实现公平治理,从而实现用户与其决策之间的直接联系。

参考文献:

  1. Cryptoconf 2018, Emin Gün Sirer talk — Snowflake to Avalanche
  2. Snowflake to Avalanche: A Novel Metastable Consensus Protocol Family for Cryptocurrencies, Team Rocket, 2018


Introduction

Not every day that somebody in the field of distributed systems, comes out and says “I have a new breakthrough to tell you about”. However, recently, Prof. Emin Gün Sirer, from Cornell University, said that he does. In this article, we are going to describe to you a new family of consensus protocols that just emerged several months ago. “Team Rocket — A pseudonymous team — with the collaboration of Prof. Sirer dropped this paper titled “Snowflake to Avalanche: A Novel Metastable Consensus Protocol Family for Cryptocurrencies” on IPFS. The paper builds on comprehensive low-level details and proofs that are…


Cryptocurrencies have gained a lot of traction during the past few years. A plethora of currencies have come to life and many more are yet to come. Currently, as of 29 May 2018, Coinmarketcap reports more than 1633 different coins, each of which has its own set of goals, roles, and purposes. It has become relatively easy for developers and teams to initiate their own project and deploy their new coin. On the contrary, it has become hard for newcomers to understand the demography of the space and hence, they are becoming more reluctant to invest. Early investors are not…

Mohamed ElSeidy

Research Partner @ Token Daily Research| PhD @ EPFL, Switzerland | Distributed Systems & Data Analytics

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store