来自于Intel project:Hyperledger Sawtooth,目前版本 PoET 1.0

PoET 其实是属于Nakamoto consenus的一种,利用“可信执行环境”来提高当前解决方案(如工作证明)的效率。发布到Hyperledger的PoET的初始参考实现是为抽象TEE编写的,以使其对任何TEE实现都保持灵活性。

PoET stochastically elects individual peers to execute requests at a given target rate. Individual peers sample an exponentially distributed random variable and wait for an amount of time dictated by the sample. The peer with the smallest sample wins the election.

For the purpose of achieving distributed consensus efficiently, a good lottery function has several characteristics:

  • Fairness: The function should distribute leader election across the broadest possible population of participants.
  • Investment: The cost of controlling the leader election process should be proportional to the value gained from it.
  • Verification: It should be relatively simple for all participants to verify that the leader was legitimately selected.

现使用SGX技术构建TEE,using new secure CPU instructions which are becoming widely available in consumer and enterprise processors(现在Intel自家的cpu都支持了SGX)。PoET uses these features to ensure the safety and randomness of the leader election process without requiring the costly investment of power and specialized hardware inherent in most “proof” algorithms. (这也是其卖点,具有proof-based算法的高可扩展性,同时也具有低消耗,较高性能)

它基于如下方式运行:

  1. Every validator requests a wait time from an enclave (a trusted function).
  2. The validator with the shortest wait time for a particular transaction block is elected the leader.
  3. One function, such as “CreateTimer”, creates a timer for a transaction block that is guaranteed to have been created by the enclave.
  4. Another function, such as “CheckTimer”, verifies that the timer was created by the enclave. If the timer has expired, this function creates an attestation that can be used to verify that validator did wait the allotted time before claiming the leadership role.

The PoET leader election algorithm meets the criteria for a good lottery algorithm. 分布类似于其他彩票算法提供的分配。选举的概率与所贡献的资源成比例(在这种情况下,资源是具有可信执行环境的通用处理器)。An attestation of execution provides information for verifying that the certificate was created within the enclave (and that the validator waited the allotted time). Further, the low cost of participation increases the likelihood that the population of validators will be large, increasing the robustness of the consensus algorithm.

----------------------------------------------------

enclave:其实是SGX中的术语,A protected area in an application’s address space which provides confidentiality and integrity even in the presence of privileged malware.

PPK, PSK:PoET ECC public and private key created by the PoET enclave.

关键的函数:

  这里有三种情况:如果当前SGX安全时间比waitTimer中的时间要小,那么还没有到时间;如果比这个时间加Twt要大,那么该waiTimer失效了,过期(所以只能在Twt时间内处理);如果在区间内,则生成认证,并且置全局变量

WaitTimer activeWT 为NULL,该变量标识是否有可用的waitTimer对象

阶段:Sign-up Phase(包括client side 和 server side):A validator has to wait for  block to be published on the distributed ledger before participating in an election.
阶段:Election Phase:


客户端开启,从disk中调取密封的数据解密封,然后调用createWaitTimer函数,等待函数产生的duration时间,到了后及时调用creatWaitCertification函数,产生waitCertificate,将(waitCertificate, signature, block, OPK, PPK) 广播出去。其它的server验证这些tuples,最后从所有合法的waitcertificate中找最小的duration为选举成功者。
(验证的过程中,好几点没看懂??还有,验证enclave产生的证书时,是在验证者的enclave中验证,还是在外部验证?)
安全考虑:设置Twt的目的是强制执行此约束以避免在一段时间内没有事务构建块的情况下,几个验证程序在等待WaitTimers的持续时间后可能会保留,并且只有在有足够的事务可用时才生成WaitCertificate。在这一点上,他们都会发出他们的WaitCertificates,产生大量流量并可能导致分叉。超时缓解了这个问题。

关于 Multi-user or Multi-ledger SGX Enclave Service:通过将用户名和分类帐输入参数设置为generateSignUpData()和unsealSignUpData(),可以为多个用户或分类帐使用相同的包围区。 然后将注册元组(用户名,分类帐,PPK,PSK,MCID)密封到磁盘,用户名和分类帐用于生成文件名。 只要用户对服务进行身份验证,后者就可以将安全区解封,并使用与该用户(和分类帐)对应的文件中的注册元组。

 参考:https://sawtooth.hyperledger.org/docs/core/releases/latest/architecture/poet.html#introduction

基于消逝时间量的共识机制(POET)的更多相关文章

  1. Hyperledger中的共识机制

    Hyperledger Consensus 共识过程 Hyperlydger中建立共识的过程由以下两个独立的过程构成: Ordering of transactions (交易排序) Validati ...

  2. POW共识机制原理及优缺点

    PoW共识机制 POW工作量证明(英文全称为Proof of Work)在比特币之前就已经出现,中本聪在设计区块链的共识机制的时候就是借鉴了POW工作量证明.常见的是利用HASH运算的复杂度进行CPU ...

  3. 区块链共识机制(POW、POS、DPOS等)的优缺点

    一.POW:工作量证明机制 基本原理: 第一代共识机制,比特币的基础.理解起来,很简单,就是“按劳取酬”,你付出多少工作量,就会获得多少报酬(比特币等加密货币).在网络世界里,这里的劳动就是你为网络提 ...

  4. 通俗讲解:PoW共识机制与以太坊的关系、Ghost协议 及 PoS共识机制的变种---Casper

    作者:林冠宏 / 指尖下的幽灵 掘金:https://juejin.im/user/587f0dfe128fe100570ce2d8 博客:http://www.cnblogs.com/linguan ...

  5. (转)从拜占庭将军问题谈谈为什么pow是目前最好的共识机制

    我们知道基于区块链技术现在有很多的共识机制,包括不限于POW,POS,DPOS,PBFT……,我先不说为什么我最认可POW,我们先来看看著名的拜占庭将军问题: 拜占庭帝国即中世纪的土耳其,拥有巨大的财 ...

  6. 区块链共识机制之工作量证明(POW)

    像比特币.以太坊.NXT.Bitshares等这些区块链系统,其本质上是一种加密经济组织,它建立在点对点网络上,是去中心化.无管辖的,由密码学.经济学和社会共识来共同维护.这些加密网络因各种原因有着多 ...

  7. 基于netty轻量的高性能分布式RPC服务框架forest<下篇>

    基于netty轻量的高性能分布式RPC服务框架forest<上篇> 文章已经简单介绍了forest的快速入门,本文旨在介绍forest用户指南. 基本介绍 Forest是一套基于java开 ...

  8. 基于netty轻量的高性能分布式RPC服务框架forest<上篇>

    工作几年,用过不不少RPC框架,也算是读过一些RPC源码.之前也撸过几次RPC框架,但是不断的被自己否定,最近终于又撸了一个,希望能够不断迭代出自己喜欢的样子. 顺便也记录一下撸RPC的过程,一来作为 ...

  9. 共识机制:AngelToken技术的根基

    共识机制是区块链技术的一个核心问题,它决定了区块链中区块的生成法则,保证了各节点的诚实性.账本的容错性和系统的稳健性. 常用的共识机制主要有 PoW.PoS.DPoS.Paxos.PBFT等. 基于区 ...

随机推荐

  1. PKUWC Slay The Spire

    题面链接 LOJ sol 好神啊.果然\(dp\)还是做少了,纪录一下现在的思维吧\(QAQ\). 我们首先可以发现期望是骗人的,要不然他乘的是什么xjb玩意. 其实就是要求所有方案的最优方案和. 因 ...

  2. 洛谷 P3205 [HNOI2010]合唱队 解题报告

    P3205 [HNOI2010]合唱队 题目描述 为了在即将到来的晚会上有更好的演出效果,作为AAA合唱队负责人的小A需要将合唱队的人根据他们的身高排出一个队形.假定合唱队一共N个人,第i个人的身高为 ...

  3. phpmyadmin 配置方法

    几乎所有的配置参数都在 config.inc.php 文件中.如果这个文件不存在,您可以在 libraries 目录中找到 config.default.php,将它复制到根目录,并改名为 confi ...

  4. 项目管理---git----遇到问题------.gitignore不起作用

    情况 在管理一个版本库时,有时候不想要管理某些文件,这个时候我就把这个问价写到.gitignore文件中,这样应该就可以将这个文件忽略,不再进行·版本管理了,但是经常出现的情况是:将这些文件名写到其中 ...

  5. Java EE之Servlet

    1.创建Servlet类 Servlet在Java EE API规范中的定义: Servlet是一个运行在Web服务器中的Java小程序.Servlet将会接收和响应来自Web客户端的请求,使用HTT ...

  6. 解题:CEOI 2017 Mousetrap

    题外话: 这是制杖yd的交流题目 题面 首先把捕鼠夹所在的点提出来当根,然后这变成了一棵有根树,我们先来看耗子移动的影响 可以发现耗子往下走就回不来了,而且最后还会被困在一个叶子上,那么这个时候我们把 ...

  7. 【DP】【CF1097D】 Makoto and a Blackboard

    更好的阅读体验 Description 给定一个数 \(n\),对它进行 \(k\) 次操作,每次将当前的数改为自己的因数,包括 \(1\) 和自己.写出变成所有因数的概率是相等的.求 \(k\) 次 ...

  8. python之旅:python中range()和len()函数区别

    函数:len() 作用:返回字符串.列表.字典.元组等长度 语法:len(str) 参数: str:要计算的字符串.列表.字典.元组等 返回值:字符串.列表.字典.元组等元素的长度 实例 1.计算字符 ...

  9. ASP.NET MVC 3 常用

    http://blog.csdn.net/churujianghu/article/details/7297358 1.ASP.NET MVC 3 如何去除默认验证 这个默认验证是在web.confi ...

  10. 布谷鸟搜索算法CS

    0 引言 布谷鸟搜索(Cuckoo Search,CS)是由 Xin-She Yang 和 Suash Deb 于 2009 年开发的自然启发式算法.CS 基于布谷鸟的寄生性育雏(brood para ...