【通读EOS白皮书】TOKEN模型与资源使用-01

in #cn6 years ago

今年币圈链圈一个重大事件就是:EOS在6.1日正式发布,但是还有非常多的人从未阅读过EOS技术白皮书。在此我准备做一个通读EOS白皮书系列,主要是翻译官方原文并加入个人解释的形式展现,水平有限,欢迎大家讨论交流。
微信公众号:blockd-public
微信号:点击查看


TOKEN模型与资源使用

请注意: 此白皮书中得到的加密代币指的是使用了EOS.IO软件的区块链代币。不是指ERC-20标准的以太坊代币

解释:EOS代币映射就是因为这个。

所有的区块链都是受资源约束的,并且都需要一套系统防止资源滥用。对于使用了EOS.IO软件的区块链,应用消耗的资源可以分成三大类:

  1. 宽带和日志存储(磁盘);
  2. 计算和堆积计算 (中央处理器);
  3. 状态存储器(内存).

带宽和计算有两种,实时计算和长期计算。区块链维护着所有消息的日志,这个日志最终保存下来被所有的全节点下载。通过使用消息日志可以重构所有应用状态。

解释:通过日志记录操作,通过查看日志按时间一步步还原操作可以恢复之前的状态。

计算债务指的是为了从消息日志中重新生成状态所必须执行的计算。如果计算债务增加的太快,那么就有必要给区块链状态进行一次快照,并且丢掉区块链的历史记录。如果计算债务增加的实在过快,那么可能需要花上6个月才能重现1年交易。因此,谨慎管理计算债务就非常重要。

区块链状态存储是指可从应用逻辑访问的信息。包括订单簿和账户余额。如果状态从来没被应用读取过那么这状态就不应保存。例如,博客文章内容与评论是应用逻辑不需要读取的,所以那些内容就不应该存储进区块链状态。 而文章以及评论的存在性,投票的数量和其他一些属性就需要做为区块链的状态一部分而存储。

解释:由于区块链是点对点的技术,随时都可能会加入新的节点,新的节点就需要快速的同步目前区块链状态。如果你使用重钱包就知道一次同步需要花费很长时间,所以要尽可能减少无用的信息。

区块生产者会公布他们可用的带宽和算力以及状态。EOS.IO 软件允许每个软件消耗容量与3天的抵压合约中持有的代币数量成比例。举例,如果一个基于EOS.IO软件启动的区块链,一个账户持有了区块链可分配代币总量的1%,那么这个账户就可以使用整个状态存储容量的1%。
区块链如果应用了EOS.IO软件就意味着带宽和计算能力是分配在分段存储基础之上,因为这些资源都是暂时的(没被用到的资源不能留到将来使用) EOS.IO软件使用的算法与Steem使用的限制带宽使用率的算法很相似。

解释:EOS.IO软件使用一种资源限制的算法,一个账户可以用的节点与你持有代币数比例有关。可以理解是一个应用不能占用其他应用的资源。这样的好处是显而易见,不会出现一只以太猫搞夸以太坊网络这样的事情。


原文如下

Token Model and Resource Usage

PLEASE NOTE: CRYPTOGRAPHIC TOKENS REFERRED TO IN THIS WHITE PAPER REFER TO CRYPTOGRAPHIC TOKENS ON A LAUNCHED BLOCKCHAIN THAT ADOPTS THE EOS.IO SOFTWARE. THEY DO NOT REFER TO THE ERC-20 COMPATIBLE TOKENS BEING DISTRIBUTED ON THE ETHEREUM BLOCKCHAIN IN CONNECTION WITH THE EOS TOKEN DISTRIBUTION.

All blockchains are resource constrained and require a system to prevent abuse. With a blockchain that uses EOS.IO software, there are three broad classes of resources that are consumed by applications:

  1. Bandwidth and Log Storage (Disk);
  2. Computation and Computational Backlog (CPU); and
  3. State Storage (RAM).

Bandwidth and computation have two components, instantaneous usage and long-term usage. A blockchain maintains a log of all messages and this log is ultimately stored and downloaded by all full nodes. With the log of messages it is possible to reconstruct the state of all applications.

The computational debt is calculations that must be performed to regenerate state from the message log. If the computational debt grows too large then it becomes necessary to take snapshots of the blockchain's state and discard the blockchain's history. If computational debt grows too quickly then it may take 6 months to replay 1 year worth of transactions. It is critical, therefore, that the computational debt be carefully managed.

Blockchain state storage is information that is accessible from application logic. It includes information such as order books and account balances. If the state is never read by the application then it should not be stored. For example, blog post content and comments are not read by application logic so they should not be stored in the blockchain's state. Meanwhile the existence of a post/comment, the number of votes, and other properties do get stored as part of the blockchain's state.

Block producers publish their available capacity for bandwidth, computation, and state. The EOS.IO software allows each account to consume a percentage of the available capacity proportional to the amount of tokens held in a 3-day staking contract. For example, if a blockchain based on the EOS.IO software is launched and if an account holds 1% of the total tokens distributable pursuant to that blockchain, then that account has the potential to utilize 1% of the state storage capacity.

Adopting the EOS.IO software on a launched blockchain means bandwidth and computational capacity are allocated on a fractional reserve basis because they are transient (unused capacity cannot be saved for future use). The algorithm used by EOS.IO software is similar to the algorithm used by Steem to rate-limit bandwidth usage.

Sort:  

你好cn区点赞机器人 @cnbuddy 谢谢你对cn区的贡献。倘若你想让我隐形,请回复“取消”。

Coin Marketplace

STEEM 0.18
TRX 0.13
JST 0.028
BTC 57451.97
ETH 3105.02
USDT 1.00
SBD 2.32