Hermez官方文档翻译(一)关于Hermez

一、以太坊可扩展性 和 ZK-Rollups

https://docs.hermez.io/#/

背景

在过去的一年中,很明显,rollups 将成为以太坊公共区块链上的主要扩展范式:考虑到这一点,Iden3已经开发并准备推出Hermez,这是一个ZK-Rollup,专注于扩展支付和代币转账在以太坊上。

为什么要专注于转账? 事实证明,以太坊网络上超过50%的交易是转账,其中很大一部分是交易所的存款和取款。 如果交易开始使用rollups,或者(在理想情况下)甚至同意在同一rollups中满足,则需求可能会大大减少。

除了显着降低用户的交易成本外,这还可以带来以下好处:大大降低gas价格,并为更复杂的合约迁移出主链。

零知识证明Rollups

ZK-Rollup,例如Hermez,是第2层构造,使用以太坊区块链进行数据存储而不是计算:

  • 所有资金均由主链上的智能合约持有。
  • For every batch of transactions, a ZK-SNARK cryptographic proof is generated off-chain.
    对于每一批交易,链下都会生成ZK-SNARK加密证明。
  • 该ZK-SNARK证明了批次中每个交易的有效性,这意味着不必依靠以太坊主链来验证每个签名交易。

这样做的意义在于,无论交易数量如何,都可以在固定时间内进行验证。ZK-Rollups的核心是这种高效且持续不断地验证证明的能力。

除此之外,所有交易数据都在链上廉价发布,而无需签名。 由于数据是在链上发布的,因此没有其他等L2解决方案(如Plasma)困扰的数据可用性问题。

任何人都可以从此链上数据重建当前状态和历史记录。 这可以防止检查,并且避免了协调器(rollup batch producers)的中心化,因为任何人都可以从头开始构建状态树(并因此成为协调器coordinator)。

为什么需要ZK-Rollups?

以太坊网络每秒可处理约15笔交易(tps),而Visa网络平均约为2,000 tps。 吞吐量的这种限制直接影响每笔交易的价格并限制其使用。

As outlined in an earlier Iden3 post, ZK-Rollups have the potential to increase the Ethereum network’s maximum tps by two orders of magnitude, making it comparable to the Visa network’s average.

正如Iden3之前的文章所述,ZK-Rollups有潜力将以太坊网络的最大tps提升两个数量级,使其可与Visa网络的平均水平相提并论。

2000TPS 如何做到?

通过将每个交易压缩到约10个字节来改善区块链的可伸缩性:我们发送的ZK-SNARK无需在链上包括签名,而可以证明已在链外正确执行了1000个签名验证和其他交易验证检查。

由于签名占交易成本(gas)的很大一部分,因此实际上,ZK-Rollups具有显着降低每笔交易的平均成本的效果。 这使Hermez每批次可以容纳更多交易,从而提高了总体吞吐量。

二、Hermez价值主张

Hermez网络项目具有一些属性,这些属性将为用户和社区提供价值:

生产级解决方案

从第一天开始,Hermez将在mainnet中启动一个旨在成为可用token 交易网络的项目。 该产品将具有支持,维护和技术发展,以为用户提供最新的功能以及正确的风险管理。

第一个版本以特定的token 交易范围开始,该token 交易是通过 a technological stack 和 cryptography setup 实现的,到目前为止,这些技术被认为是测试最多的。

去中心化

Hermez之所以称为网络,是因为该模型本身是分散式的。

它是第2层结构,打算以每秒数千次的速度进行交易,因此共识算法必须很简单,以便一个代理(协调器)在任何给定时间处理此数量的交易。 使用此模型,它仍然保留了无权参与拒绝用户交易的特性。

高效

The decentralized model is implemented through a permissionless auction system for potential coordinators of the network to earn the right to process transactions during a slot of time.

去中心化的模型是通过无许可的拍卖系统实现的,该拍卖系统使网络的潜在协调员可以获得在一定时间段内处理交易的权利。

This auction model incentivizes the efficiency of coordinators since they need to process as many transactions as they can to collect the fees and compensate their investment and their operation expenses (and make money out of it).

这种拍卖模式提高了协调员的效率,因为他们需要处理尽可能多的交易以收取费用,并补偿他们的投资和运营费用(并从中赚钱)。

Hermez implements a ZK-Rollup based on ZK-SNARK proofs, the most efficient in terms of batch cost in Ethereum.

Hermez基于ZK-SNARK证明实现了ZK-Rollup,这在以太坊中是最高效的批处理成本。

Since the batches of transactions are a maximum of 2,000 in size, users will benefit from the scale and the underlying technology for nominal maximum savings up to 97% compared to the Ethereum cost for a single token transfer.

由于批量交易的最大数量为2,000,因此用户将从规模和基础技术中受益,与单次令牌传输的以太坊成本相比,名义上最大的节省额高达97%。

安全

Scalability can be achieved in different ways. Hermez is a layer 2 construction because it leverages Ethereum not only by using its native tokens but by also borrowing Ethereum’s security as a strong public blockchain.

可伸缩性可以通过不同的方式来实现。 Hermez是第2层结构,因为它不仅通过使用其原生令牌来利用以太坊,而且还借用以太坊的安全性作为强大的公共区块链。

The implementation of Hermez is based on iden3’s own technology (Circom and SnarkJS libraries) and the cryptographic technology which has been proven as the most robust so far, as used in the ZCash blockchain.

Hermez的实现基于iden3自己的技术(Circom和SnarkJS库)和加密技术,该技术已被证明是迄今为止最稳健的,如ZCash区块链中所使用的那样。

As a new network with a bootstrap period, Hermez has transitory security measures to protect the system with the objective to remove them and leave it fully decentralized.

作为一个具有启动周期的新网络,Hermez采取了临时安全措施来保护系统,以期将其删除并使其完全去中心化。

社区

Hermez旨在为社区做出贡献,因为没有它,该项目将无法实现。 可扩展性创新是难得的机会,可以重新调整社区及其提供的公共物品的激励措施。

40% of the generated value in the network will be sent to a donation process where the ecosystem projects will benefit from the donations. It will start with Gitcoin but other pools might be enabled in the future.

网络中40%的创造价值将被发送到捐赠过程中,在此过程中,生态系统项目将从捐赠中受益。 它将从Gitcoin开始,但将来可能会启用其他池。

Hermez will open source all the protocol and coordinator code, is open to contributions, and has committed to contribute to the creation of a L2 ecosystem for initiatives such as a better L2 interoperability .

Hermez将开放所有协议和协调器代码的源代码,向各方开放,并致力于为创建L2生态系统做出贡献,以实现更好的L2互操作性等计划。

专注于可用性

K-Rollups provide the technology for instant finality of transactions, which Hermez understands is a key feature for usability.

ZK-Rollups提供了用于即时完成交易的技术,Hermez认为这是可用性的关键功能。

Hermez Protocol also provides a guarantee that user transactions can not be censored and that all funds can always be sent back to layer 1. Layer 2 solutions increase complexity for the users, but the Hermez project focus is to provide the best possible usability for user onboarding, transactions and reduce friction and confusion between layers.

Hermez协议还提供了一种保证,即不能审查用户交易,并且始终可以将所有资金发送回第1层。 第2层解决方案为用户增加了复杂性,但是Hermez项目的重点是为用户进入提供最佳的可用性 ,交易,并减少各层之间的摩擦和混乱。

愿景

Hermez项目源自iden3计划,该计划由一支高素质的团队开展工作,以实现默认情况下具有普遍性和私有性的自我主权身份。 身份协议要具有通用性,就需要具有可伸缩性,并且个人可以(几乎)免费对其他身份提出声明。

从共生角度来看,Hermez Network有望从身份基础结构的进步中受益,例如验证,私人证书和声誉,以提高可用性,并扩大高吞吐量交易网络的潜在用例范围。

Hermez将引导其努力,成为可为最大数量的用户提供服务的基础架构。

三、Hermez 网络模型

Hermez 协议

Hermez以智能合约和开源工具(SDK,Block Explorer,Wallet等)的形式提供去中心化组件,以使参与者的新生态系统能够参与网络。 Hermez Network通过智能合约或所有操作协调员导出​​的标准化REST API与生态系统的其余部分进行交互。

Coordinators 协调器

协调器是Hermez Network的区块生产者。 这意味着他们是通过计算用户进行的交易的零知识证明有效地运行网络的人。

协调器使用系统基础结构:

  • 与Hermez网络同步,以从第1层获取数据(历史数据和更新数据)
  • 接收来自用户的交易请求
  • 处理交易请求以建立 rollup batches
  • 保存Merkle根以及正确性的ZK证明以及在以太坊上重建完整Merkle树所需的数据

The boot coordinator is a special seed coordinator which will be assigned to create batches of transactions by default, until an alternative permissionless operator will place a bid in an attempt to obtain the right to run the network in a future slot of time.

引导协调器是一个特殊的种子协调器,默认情况下将被分配来创建批量交易,直到另一个可选的无权限操作员出价以试图获得在未来某个时间段内运行网络的权利。

Auction 竞拍

Multiple coordinators can coexist in the network running Hermez nodes. They will compete in a continuous decentralized auction process managed by smart contract for the right to build rollup batches and collect the fees associated with each user transaction. The right to forge is structured in time slots, which are defined to be 10 minutes long.

多个协调器可以在运行Hermez节点的网络中共存。 他们将在由智能合约管理的连续分散拍卖过程中竞争获得建立rollup batches 和收取与每个用户交易相关的费用的权利。 铸造权的结构是按时隙划分的,该时隙被定义为10分钟长。

The winning bid is the one with the highest amount of HEZ, an ERC-20 utility token whose value is not pre-determined or pegged to a reference asset.

中标价格最高的是HEZ,这是一种ERC-20实用程序令牌,其价值未预先确定或与参考资产挂钩。

所有出价将由拍卖智能合约处理,所有放置的HEZ令牌将按以下方式使用:

  • 30%将被燃烧(永久去除)。
  • 40%的资金将自动永久转移到以太坊基金会控制的捐款帐户中。 这些捐款将首先发送到Gitcoin二次资金赠款,但具有面向未来的能力,也可以在其他二次资金匹配池可用时捐款;
  • 将分配30%作为Hermez Network使用激励措施,以补偿积极参与和网络采用,例如 奖励交易并奖励在Hermez L2地址而不是L1以太坊地址中持有特定代币。

拍卖过程提高了效率,因为协调员需要在每个时隙中包含尽可能多的交易,以补偿其竞标成本和运营费用。

To prevent bidders from buying up all the slots in one go, nobody will be able to bid on a specific slot more than one month in advance. And the auction will be closed two time slots before the time of creating the slot.

为了防止竞标者一次性购买所有广告位,任何人都不能提前一个月以上的时间对特定广告位进行出价。 拍卖将在创建广告位之前的两个时间段关闭。

The auction will be structured in a series of six time slots to cover one hour (%0-5), with 10 HEZ as the initial minimal bidding price for all of them.

拍卖将按照一系列六个时段进行,以覆盖一个小时(%0-5),其中所有时段的初始最低竞标价格为10 HEZ。

The first bid in each time slot must be over the minimum bidding price in order to be accepted as valid. Thereafter, any bid placed in the auction should outbid the previous bid by at least 10%.

每个时隙中的第一个出价必须超过最低出价,才能被接受为有效。 此后,拍卖中的任何出价都应比之前的出价高出至少10%。

The minimum bidding amount for each slot in an auction series will be decided by the network governance (see section “Hermez Governance”), and it will be possible to change it dynamically, affecting future, even already open, auctions.

拍卖系列中每个广告位的最低竞标金额将由网络治理(请参见“Hermez 治理”部分)确定,并且有可能动态更改它,从而影响将来甚至已经公开的拍卖。

Also, governance will be able to implement the effective decentralisation of the network by locking the price of specific slots of the auction to 0 HEZ and therefore wouldn’t require any minimum bid, this being an irreversible configuration.

同样,通过将拍卖的特定时段的价格锁定为0 HEZ,治理将能够实现网络的有效分散,因此不需要任何最低出价,这是不可逆的配置。

用户

将为网络用户提供易于使用的界面,以将其L1以太坊地址注册为Hermez L2帐户。 然后,他们将能够将其资金,ETH或ERC-20代币存入或提取出这些L2帐户。

最初,用户将通过基于非托管个人拥有的钱包解决方案的界面访问Hermez网络,该解决方案依赖于Metamask来管理私钥。

通过此界面,用户将能够:

  • 将他们的以太坊L1地址注册到Hermez网络中,并获得一个内部地址-一种用于他们希望存入的令牌的类型;
  • 通过简单的交易将L1令牌存入其Hermez网络地址;
  • Hermez之间的转移令牌地址处理速度更快,费用却很低;
  • 从Hermez网络地址中提取令牌回到其选定的L1地址。

Hermez provides protection mechanisms (enforced in the smart contract) that guarantee all tokens locked in the L2 solution can always be recovered by the users, even in the unlikely event that the auction-winning coordinator is malicious — in other words, stealing, censoring or blocking transactions is impossible.

Hermez提供保护机制(在智能合约中强制执行),以确保用户始终可以收回L2解决方案中锁定的所有令牌,即使万一拍卖中的协调员是恶意的(换句话说,是窃取,审查或 阻止交易是不可能的)。

The Hermez Network does not provide in any way custodial or exchange services. Hermez only and exclusively provides a L2 scaling solution for faster, low fee Ethereum tokens transfers.

Hermez网络不以任何方式提供托管或交易所服务。 Hermez仅并独家提供了L2伸缩解决方案,以实现更快,费用较低的以太坊代币转账。

Third-Party Volume Aggregators 第三方卷聚合器

Third-Party Exchanges and other volume aggregators will use an SDK to connect to the network to access L1 smart contracts and coordinator REST API endpoints and thus exploit Hermez’s full potential. Hermez will provide an interesting feature of atomic transactions, which implements a link between transactions that need to be executed together, and it’s very useful for token swaps.

第三方交易所和其他流量聚合商将使用SDK连接到网络,以访问L1智能合约和协调器REST API端点,从而发挥Hermez的全部潜力。 Hermez将提供原子交易的一个有趣功能,该功能实现了需要一起执行的交易之间的链接,这对于令牌交换非常有用。

四、安全

Hermez relies on certain assumptions that guarantee users can always recover their assets deposited on the network. These assumptions are based on several design and architectural decisions that we will review here.

Hermez依靠某些保证用户始终可以收回其存储在网络上的资产的假设。 这些假设基于我们将在此处回顾的一些设计和体系结构决策。

Hermez是在以太坊1.0之上运行的Layer2解决方案。 这意味着Hermez的安全性取决于以太坊提供的安全性假设和保证。 此外,Hermez是ZK-Rollup协议:在以太坊区块链之上,Hermez添加了从Zcash借用的另一层安全性。 在完成工作之后,Hermez集成了ZK-SNARK证明者/验证者模块,以在恒定的时间内验证一系列交易的执行。

这些ZK-SNARK使用某些密码原语,例如哈希和签名,这些原语做出了进一步的安全性假设,稍后将对其进行回顾。 最后,Hermez将操作规则嵌入到不同的智能合约中,以确保运营商不会阻止用户的交易,并且可以随时提取其资产。

综上所述,Hermez进行以下安全性假设:

  1. 以太坊的安全性假设。
  2. Groth16个假设(指数假设的知识)。
  3. 来自原语的某些加密假设,例如签名和哈希
  4. 依赖正确的设计和实现的软件安全性假设。

1. Ethereum

Hermez在以太坊之上运行。 所有Hermez数据都可以在以太坊上获得,并且也借鉴了第1层安全性。

2. ZK-Proofs

用户交易始终由以太坊智能合约通过验​​证协调器提供的ZK-Proof来验证。 这些ZK-Proof中使用的特定ZK-SNARK是Groth16。 该协议已被Zcash研究人员小组广泛使用和测试,目前被认为已经足够成熟,可以用于生产中。

目前,以太坊预编译的智能合约仅支持BN254椭圆曲线操作以进行zk-SNARK证明验证。 因此,Hermez使用此曲线生成和验证证明,并在此处使用Baby Jubjub来在电路内部实施椭圆曲线加密。

Zcash代替提供100位安全性的BN254,使用BLS12-381,具有128位安全性,请参见此处。 一旦以太坊可用,Hermez可能会迁移到[BLS12-381]曲线。

除其他好处外,BLS12-381提供128位的安全性,而不是BN256提供的100位。 实施BLS12-381曲线的EIP已获批准,下一个计划中的柏林硬分叉很可能会进行迁移。 此更改将提高安全级别。 此时, Baby Jubjub 将被 Jubjub curve.替代。

Baby Jubjub曲线满足此处(https://safecurves.cr.yp.to/)和此处(https://github.com/barryWhiteHat/baby_jubjub)所示的安全性标准。

Multi-party Computation for the Trusted Setup 可信设置的多方计算、

The proving and verification keys of the ZK-SNARK protocol require the generation of some random values that need to be eliminated. This elimination process is a crucial step: if these values are ever exposed, the security of the whole scheme is compromised. To construct the setting, Hermez uses a Multi-party computation (MPC) ceremony that allows multiple independent parties to collaboratively construct the parameters or trusted setup. With MPC, it is enough that one single participant deletes its secret counterpart of the contribution in order to keep the whole scheme secure.

ZK-SNARK协议的证明和验证密钥要求生成一些需要消除的随机值。 消除过程是至关重要的一步:如果暴露了这些价值,则整个方案的安全性将受到损害。 为了构建设置,Hermez使用了多方计算(MPC)仪式,该仪式允许多个独立方共同构建参数或信任设置。 使用MPC,一个参与者删除其贡献的秘密副本就足够了,以确保整个方案的安全。

可信设置的构建分为两个阶段:

  • 适用于任何电路的常规MPC仪式(也称为 Powers of Tau ceremony)
  • 为每个特定电路构造的阶段2。

Anyone can contribute with their randomness to the MPC ceremonies and typically, before getting the final parameters, a random beacon is applied.

任何人都可以通过其随机性参与MPC仪式,通常,在获取最终参数之前,将应用一个随机信标。

To contribute to the robustness of the setup, Hermez implemented an independent snarkjs module for computing and validating the MPC ceremonies. The software is compatible with current Powers of Tau, and it allows one to see the list of contributions of a given setup, to import a response, export a challenge of the ceremony, or to verify if the whole process has been correctly computed. Hermez’ contribution can be found here).

为了提高设置的健壮性,Hermez实现了一个独立的snarkjs模块(https://github.com/iden3/snarkjs),用于计算和验证MPC仪式。 该软件与 Powers of Tau 兼容,它允许查看给定setup的贡献列表,导入响应,导出仪式挑战或验证整个过程是否已正确计算。 您可以在此处找到Hermez的贡献)。

Cryptography 密码学

Hermez在电路内部使用了两个主要的加密原语:签名和哈希函数。

  1. 签名模式是Edwards Digital Signature Algorithm(EdDSA)在Baby Jubjub (迁移后,它将在Jubjub上使用EdDSA)。 该协议是通过使用电路语言圈和遵循Zcash的电路设计来实现的。
  2. 使用的哈希函数是Poseidon,它与MiMC相似,但具有混合层。 这些哈希函数已在TornadoCash(MiMC)和Semaphore(Poseidon)等项目中使用

设计

Hermez尝试去中心协调员的角色,同时对协调员执行一些规则或准则,以确保不会阻止用户交易。 其中一些功能是:

  • 要求协调员按照智能合约中的规定定期处理L1用户交易。 由于L1事务是串联在一起的,因此协调器必须处理所有未处理的L1交易,从而防止其阻塞特定的用户或L1操作。 请注意,资金提取是L1交易,因此它不能被协调员阻止。
  • 如果协调员在分配的时间内未处理交易,则任何在线协调员都可以处理交易。 这种机制称为协调器替代。
  • HermezDAO基金会控制着一个称为Boot协调器的不得已的协调器。 如果没有可用于处理任何批次的协调器,则启动协调器将处理交易。 HermezDAO基金会是为维护和运营Hermez网络而创建的非营利组织,根据BVI 2043757 in Wickhams Cay II, Road Town, Tortola, VG1110, British Virgin Islands.注册。
  • 投标过程格式允许治理机构为不同的参与者设置不同的最低投标价格,以增加由Boot协调器处理交易的机会。

安全审计

Smart contracts and circuits designed for ZK-proof system are being audited by different entities. The results will be published here as soon as they are available.

专为ZK-proof 系统设计的智能合约和电路正在由不同实体进行审核。 结果将在此处发布。

在此处可以找到Solidified(https://solidified.io/)进行的第一次审核的结果(https://github.com/hermeznetwork/contracts/blob/master/audits/Solidified%20-%20Audit%20Report%20-%20Hermez%20%5B31.10.2020%5D.pdf)。

您可以在此处找到Trail of Bits(https://www.trailofbits.com/)进行的第二次审核的结果(https://github.com/hermeznetwork/contracts/blob/master/audits/Trail%20of%20Bits%20-%20Audit%20Report%20-%20Hermez%20%5B23.12.2020%5D.pdf)。

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

打赏作者

西京刀客

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

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

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

打赏作者

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

抵扣说明:

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

余额充值