美文网首页
FAQ - What is Ether? (什么是以太坊?)

FAQ - What is Ether? (什么是以太坊?)

作者: terryc007 | 来源:发表于2018-04-10 18:22 被阅读56次

    What is Ether ?

    原文地址: https://www.ethereum.org/ether
    翻译: terryc007
    版本:1.0

    What is Ether?

    Ether is a necessary element — a fuel — for operating the distributed application platform Ethereum. It is a form of payment made by the clients of the platform to the machines executing the requested operations. To put it another way, ether is the incentive ensuring that developers write quality applications (wasteful code costs more), and that the network remains healthy (people are compensated for their contributed resources).

    If you just want to test the technology, you probably don't need real ether. Download the latest Wallet app and switch to the Test Network

    什么是以太?

    要运营分布式应用平台以太坊, 那么ether是一个必须的元素,如同燃料一样。 平台上的应用用来它来支付给那些执行请求操作的机器。换言之,ether可以激励开发者写出高质量的应用(无用的代码会消耗更多ether),同时保持网络健康(为提供资源的人给予报酬)。

    如果你仅想测试这项技术,你大概没有必要需要真的ether。你可以下载最新的钱包App,然后切换到测试网络即可测试。

    FAQ

    How are ethers created?

    The total supply of ether and its rate of issuance was decided by the donations gathered on the 2014 presale. The results were roughly:

    • 60 million ether created to contributors of the presale
    • 12 Million (20% of the above) were created to the development fund, most of it going to early contributors and developers and the remaining to the Ethereum Foundation
    • 5 ethers are created every block (roughly 15 seconds) to the miner of the block
    • 2-3 ethers are sometimes sent to another miner if they were also able to find a solution but his block wasn't included (called uncle/aunt reward)

    Note that after the Byzantium update is implemented, the mining and uncle reward is reduced to 3 ethers and 0.625-2.625 ethers, respectively.

    ETH是如何创建的?

    ETH总供应量,以及发行的比例是由2014预售时,其捐赠情况来决定。 大概如下:

    • 6000万ETH用于捐赠者

    • 1200万ETH(相当于上面的20%)用于用户开发基金会,大部分分配给早期贡献者,开发者,以及以太坊基金会

    • 大约每15秒出一个区块,并奖励5个ETH给矿工

    • 有时候也会奖励2 ~ 3个ETH给那些找到答案,但它所挖出的区块并没有被包含进区块链(这叫做uncle/aunt奖励)

      注意,拜占庭更新被实现后, 一个区块奖励变为3个ETH,uncle奖励变为0.625 ~ 2.625个ETH 。

    Is the ether supply infinite?

    No. According to the terms agreed by all parties on the 2014 presale, issuance of ether is capped at 18 million ether per year (this number equals 25% of the initial supply). This means that while the absolute issuance is fixed, the relative inflation is decreased every year. In theory, if this issuance was kept indefinitely then at some point the rate of new tokens created every year would reach the average amount lost yearly (by misuse, accidental key lost, the death of holders etc) and there would reach an equilibrium.

    But the rate is not expected to be kept: sometime in 2018-2019 Ethereum will be switched from Proof of Work to a new consensus algorithm under development, called Casper that is expected to be more efficient and require less mining subsidy. The exact method of issuance and which function it will serve is an area of active research, but what can be guaranteed now is that (1) the current maximum is considered a ceiling and the new issuance under casper will not exceed it (and is expected to be much less) and (2) whatever method is ultimately picked to issue, it will be a decentralized smart contract that will not give preferential treatment to any particular group of people and whose purpose is to benefit the overall health and security of the network.

    ETH会无限供应吗?

    不会。 根据2014预售时,所有参与者所达成的条款,ETH每年最多增发1800万(初始供应量[7200w]的25%)。 这就是说,当绝对发行量是固定的,相对的通胀每年在下降。 理论上讲,如果每年发行量没有限制,那么在未来某个时间点,每年新创建的token的速度会达到每年丢失的token的速度(比如误用,密钥丢失,token持有者死亡等等),最后会达到平衡。

    但是这个增发速度可能有所改变: 大约在2018到2019期间,以太坊会用新的,目前还在开发中的共识算法Casper来替代工作量证明共识算法。 Casper预期会更高效,同时只需更少的挖矿补贴。有关具体的发行办法,以及它会服务于哪个个功能,目前还处在研究中,但是可以保证的是:

    1. 当前最大的发行量是最大的极限,在casper下发行的token量是不会超过它的(可能还会更少)。
    2. 不管最终采用那个方法,它会是一个去中心化的智能合约,它不会对任何特定人群区别对待,它的初衷是有益于整个网络的安全,健康。

    Who needs ether?

    Developers who intend to build apps that will use the ethereum blockchain. Users who want to access and interact with smart contracts on the ethereum blockchain.

    谁需要ETH?

    开发者:

    他们要使用以太坊区块链来构建app。

    用户:

    他们需要访问以太坊上的智能合约,或跟它交互

    How do I mine ether?

    The Ethereum network is kept running by computers all over the world. In order to reward the computational costs of both processing the contracts and securing the network, there is a reward that is given to the computer that was able to create the latest block on the chain. Every 15 seconds, on average, a new block is added to the blockchain with the latest transactions processed by the network and the computer that generated this block will be awarded 3 ether. Due to the nature of the algorithm for block generation, this process (generating a proof of work) is guaranteed to be random and rewards are given in proportion to the computational power of each machine.

    This process is usually called mining in the crypto-currency lingo.

    如何通过挖矿获取ETH?

    以太坊通过全世界的计算机来维持运行。为了奖励那些处理合约,保护网络安全的算力,会给为区块链创建最新区块的计算机一个奖励。平均每15秒,一个新的区块会被加入到以太坊区块链,新的区块包含了最新的被处理的交易。 生成这个区块的计算机会获得3个ETH作为奖励。 因为生成区块算法的性质,这个过程(产生工作量证明)保证是随机的,并且奖励会按照每个机器的算力来按比例分配。

    在加密货币术语中,这个过程通常叫做挖矿。

    CPU MINING USING THE COMMAND LINE

    If you are on a private network (and if you just want to test the technology for free, you should) then any normal computer with a normal CPU will be able to run the network and earn test ether (ether that is only redeemable on the test network where it was generated) through mining. This is the best choice for small-scale network or testing privately, as it's less resource intensive. On the real (or live test) network a normal desktop (or laptop) computer might take a very long time to successfully mine a block and receive ether.

    Before you do any mining, you need to set which address will receive your earnings (called "etherbase"). You only need to do this once. Here's how to set your etherbase and then start mining:

    Geth:

    miner.setEtherbase(eth.accounts[0])
    miner.start()
    

    Eth:

    web3.admin.eth.setMiningBenefactor(web3.eth.accounts[0])
    web3.admin.eth.setMining(true)
    

    Before you can find any blocks, however, your computer needs to go through a process called “building a DAG”. This DAG (short for “Directed Acyclic Graph”) is a large data structure (~1GB) required for mining, intended to prevent ASIC machines (“Application Specific Integrated Circuits”) from being mass manufactured for mining ether. Its goal is to protect miners like yourself so that you will only ever need your home computer to remain competitive. The DAG should take about 10 minutes to generate and as soon as it finishes, Geth will start mining automatically.

    If you have successfully mined a block you will see a message like this among the logs:

    🔨 Mined block #123456
    

    To check your earnings, you can display your balance with:

    web3.fromWei(web3.eth.getBalance(web3.eth.accounts[0]), "ether")
    

    使用命令行来进行CPU挖矿

    如果你在一个私有网络(同时如果你仅仅想免费测试这项技术), 任何带有标准CPU的正常的计算机都能够运行这个网络,并通过挖矿获取ETH(在测试网络中生成的ETH,只能在测试网络中回收)。 对于小规模网络或者私下测试而言,是一个最好的选择, 因为它仅需要少量资源。在真实以太坊网络(或上线测试),一台标准的桌面电脑(或笔记本)可能需要发很长时间才能成功挖出一个区块,获得ETH奖励。

    在你挖矿前,你需要设定一个地址用来接收奖励(称之为: etherbase)。你仅需要这样设置一次即可。下面是如何设置etherbase,并开始挖矿的代码:

    Geth

    miner.setEtherbase(eth.accounts[0])
    miner.start()
    

    Eth

    web3.admin.eth.setMiningBenefactor(web3.eth.accounts[0])
    web3.admin.eth.setMining(true)
    

    然而,在你能找到任何区块前,你的计算机需要执行一个“构建DAG”的流程。 挖矿时需要这个DAG(有向无环图)是一个巨大的数据结构(大约1GB) ,用来防止ASIC(专用集成电路)机器被大规模生产,以用来挖矿。 它的目的是保护像你这样的矿工,这样可以让你家里的计算机仍然有竞争力。生成这个DAG数据结构大约需要10分钟时间,一旦完成,Geth就会启动自动挖矿。

    如果你成功挖出一个区块,在日志中,你会看到像下面这样的消息:

    🔨 Mined block #123456
    

    要查看你的收入, 你可以显示你的余额:

    web3.fromWei(web3.eth.getBalance(web3.eth.accounts[0], "ether"))
    

    GPU MINING USING THE COMMAND LINE

    If you are serious about mining on the live ethereum network and getting real ether rewards, then you should use a dedicated computer with very powerful graphics cards in order to run the network.

    Instructions for Eth:

    If you are using Eth then GPU mining comes out of the box. Simply quit the console (press control+C multiple times and then enter) and then start it with the --GPU option turned on:

    eth -b --genesis path/to/genesis.json -i -m on -G
    

    Once you started, just follow the same instructions as normal CPU mining.

    Instructions for Geth

    There are currently two options for GPU mining in Geth available. You can read a more detailed description of how to install it on this mining post.

    使用命令行来进行GPU挖矿

    如果你真想在以太坊网络挖矿来获取ETH奖励,那么你应使用专用的电脑来运行以太坊网络,这种电脑会配置非常强大的图形卡。

    Eth介绍

    如果你正在使用Eth,那么可以使用GPU挖矿。 退出Eth终端(多次按control+C,按键按enter键),然后在启动Eth时,带上 -- GPU选项来开启GPU挖矿。

    eth -b --genesis path/to/genesis.json -i -m on -G
    

    一旦启动,就可以用跟CPU挖矿同样的指令来操作。

    Geth介绍

    在Geth中,目前有两个方式来GPU挖矿。你可以阅读“如何安装它”这个挖矿帖子,获取更多详细的信息。

    • C++ Etherminer. 这是一个专业矿工版本。要安装,请按照这个教程来做:安装整个C++以太坊代码
    • Go 实验性GPU分支. 它是一个实验性的版本,因此你需要自己通过编译源码来创建一个版本。 这个版本主要是业余爱好者以及开发者在用。 要安装,先克隆geth源码,然后切换到GPU挖矿分支

    MORE INFORMATION ON MINING

    • Ethereum's proof of work algorithm does not make use of Scrypt or Sha256, instead, it leverages EtHash, a Hashimoto / Dagger hybrid. You can read all about the theory behind this and its design in the Ethereum gitBook, mining chapter. Note that for Serenity (a future release, a major milestone on the Ethereum development roadmap) we are planning to switch to Proof of Stake (PoS).
    • The Ethash proof of work algorithm is memory hard, you'll need at least 1+GB of RAM on each GPU. I say 1+ because the DAG, which is the set of data that's being pushed in and out of the GPU to make parallelisation costly, will start at 1GB and will continue growing indefinitely. 2GB should be a good approximation of what's needed to continue mining throughout the year.
    • Mining prowess roughly scales proportionally to memory bandwidth. As our implementation is written in OpenCL, AMD GPUs will be 'faster' than similarly priced NVIDIA GPUs. Empirical evidence has already confirmed this, with R9 290x regularly topping benchmarks.
    • ASICs and FPGAs are strongly discouraged by being rendered financially inefficient, which was confirmed in an independent audit. Don't expect to see them on the market, and if you do, proceed with extreme caution.

    更多有关挖矿信息

    • 以太坊的工作量证明算法没有使用Scrypt或Sha256, 取而代之,它使用EtHash, Hashimoto / Dagger 混合体算法。 在以太坊gibBook, 挖矿章节,你可以了解到这个算法理论,设计相关的东西。 注意,在Serenity阶段(未来会发布,在以太坊开发路线图,它是一个重要的里程碑)我们计划着切换到权益证明共识算法(POS)
    • EtHash工作量证明算法需要大量内存,每个GPU上至少需要1+GB的内存。 因为DAG需要从GPU并行输入,输出代价是非常大的,至少1GB起,后续还会无限的增加。要持续挖1年, 2GB内容应该是一个不错的选择。
    • 挖矿算力大约跟内存带宽成比例。 因为在以太坊内部实现是用OpenCL写的, 所以AMD的GPU会比同等价格的NVIDA GPU要快。使用AMD的R9 290X显卡跑常规顶级性能测试, 获得的实验数据验证了这个说法。
    • 强烈不推荐使用ASIC跟FPGA机器来挖矿,因为这个在财务上做法是低效的,这在一个独立的审计中,已经确认这个说法。不要期望在市场上看到他们,如果你的确看到了,请要特别小心。

    What's the relationship between bitcoin and ether?

    Bitcoin and Ethereum

    Ethereum would never be possible without bitcoin—both the technology and the currency—and we see ourselves not as a competing currency but as complementary within the digital ecosystem. Ether is to be treated as "crypto-fuel", a token whose purpose is to pay for computation, and is not intended to be used as or considered a currency, asset, share or anything else.

    There are many ways in which you can use Bitcoins within the Ethereum ecosystem:

    • Trade BTC for ETH: multiple third-party companies are working to make the exchanging of ether and bitcoins as easy and seamless as possible. If so desired one could trade bitcoins for ether with the purpose of executing contracts and trade it back immediately in order to keep their value pegged and secured by the bitcoin network. The latest version of the wallet includes an automatic conversion between ether and bitcoin.
    • Use a pegged derivative: Ethereum is a great tool for creating complex trading between multiple parties. If you have a source for the price of Bitcoin that all parties trust, then it's possible to create an ethereum based currency whose value is pegged to the market value of Bitcoin. This means that you could trade bitcoins to a token that is guaranteed to always trade back to the same amount of bitcoins while still being fully compatible with other ethereum contracts.
    • Use a Bitcoin relay to convert a 2-way peg: the bitcoin relay is a piece of code that allows you to sidechain a bitcoin into ethereum. This means that you can use Bitcoin's native limited scripting capability to lock a bitcoin into a contract that is directly connected to an ethereum contract, which can then issue an ethereum based token that is guaranteed to be backed by bitcoin. The relay is under development and as implementations are tested and proved to be secure, we will list them here.

    以太坊跟比特币之间是什么关系?

    不管在技术上,还是货币上,如果没有比特币,就没有太坊。 在数字生态中,两者之间不是竞争货币,而是一个互补的关系。ETH 被当做 “加密石油”, 它是目的是:用来支付计算的,并不是用来或者被认为是一个货币,资产,股份或者其他任何东西。

    你可以在以太坊的生态中,有多种方式来使用比特币。

    • 交易BTC, ETH: 多个第三方公司正致力于让BTC跟ETH之间的兑换变地更加容易,顺畅。如果要执行智能合约,可以用BTC购买ETH, 同时又可以立刻把ETH换成BTC,这样确保的价值不变,以及在比特币网络上的安全。 最新的钱包包含一个ETH, BTC自动转换功能。
    • 使用锚定派生: 在多方之间,创建复杂的交易,以太坊就是一个非常好用的工具。如果所有的当事人相信的比特币价格数据源,那么创建一个基于以太坊的货币是有可能的。这个货币的的价值锚定比特币的市场价格。 这就意味着,你可以把比特币兑换成token。 token需要保证总是可以兑换成同等数量的比特币,同时又必须跟其他以太坊智能合约完全兼容。
    • 使用比特币中转实现双向锚定:比特币中转是一部分代码,它允许你把比特币以侧链的方式转入以太坊。 这就意味着你能使用比特币本身有限的脚本功能锁定一个比特币到一个比特币合约,这个合约直接连接到以太坊合约,然后,它发行一个基于以太坊的token(保证可以被比特币转回)。这个中转功能还在开发当中,当功能实现,测试完,并证明是安全后,我们会在这里把它列出来。

    How do I send ether using the command line?

    ATTENTION: Ethereum addresses don't have built-in checks on them yet. That means that if you mistype an address, your ether will be lost forever, without a secondary confirmation window. If you are moving a significant amount, start with smaller quantities that you can afford to lose, until you feel comfortable enough.

    There are two types of accounts in Ethereum: normal accounts, holding ether that can only be moved with a private key and contracts, which hold ether only controlled by their own internal code. In this section, we focus on the former. The remainder of this guide will be dedicated to the latter.

    Similarly, your transactions are also of two types: those sent to normal accounts are ether transfers, while the rest are communication with smart contracts.

    Before you execute your first ether transfer you need a friend to send your ether to. If you don’t have any, you can also create as many new accounts as you want, following the steps discussed previously and simply move your funds between accounts you own. Assuming you created a second account to send the ether to:

    var sender    = web3.eth.accounts[0];
    var recipient = web3.eth.accounts[1];
    
    var amount = web3.toWei(0.01, "ether");
    

    The first two lines set local variables with account numbers for easier access later. Change the sender and recipient addresses to whatever you like. If you are adding a friend's account address instead, put it in between quotes like ‘0xffd25e388bf07765e6d7a00d6ae83fa750460c7e'. The third line converts the chosen amount to the network's base unit (wei).

    Although there are many names for ether denominations, we will use only two: “ether” and “wei”. Wei is the atomic unit of ether, and is the one used on the system level. Most day-to-day transactions will be done with ether, which is equivalent to one quintillion wei, or a 1 followed by 18 zeros. So before sending any transactions, it’s very important to convert the amount to wei, and for that, you can use the web3.toWei function.

    After having set the variables above, send the transaction with:

    web3.eth.sendTransaction({from: sender, to: recipient, value: amount})
    

    Waiting a few seconds, the transaction should be complete. To check the balance of an account, simply type:

    web3.eth.getBalance(recipient)
    

    Tip: If you are using Geth then you can just use eth instead of web3.eth command.

    Transaction Receipts

    Anytime you create a transaction in Ethereum, the string that is returned is the Transaction Hash. You can use those to keep track of a transaction in progress, or the amount of gas spent in a past transaction using eth.getTransaction() and eth.getTransactionReceipt. Here's how to use it:

    var tx =  web3.eth.sendTransaction({from: web3.eth.accounts[0], to: web3.eth.accounts[1], value: amount});
    web3.eth.getTransaction(tx);
    

    And if the transaction has been picked up already, you can check its receipt with this:

    web3.eth.getTransactionReceipt(tx);
    

    如何使用命令行发送ETH?

    注意: 以太坊地址目前还没有内置地址有效性检查。也就是说,如果你误输入一个地址,你的ETH将会永久丢失,也不会有第二次确认窗口提示。如果你要进行大额转账时,可以先发送一笔你小额的转账,即使丢了,你也是可以接受的,直到你感觉没什么问题时,再进行大额转账。

    以太坊有两种类型账号:

    普通账号: 这些账号上的ETH,仅通过私钥来转移ETH

    合约账号:这些账号上的ETH, 是通过合约内部的代码来控制ETH的转移

    在本节, 我们只关注普通账号。

    同样,交易也有两种类型:

    ETH转移交易: 发送到普通账号的交易

    其他交易: 智能合约之间的通信

    在你执行你的第一个ETH发送时,你需要一个朋友先给你发送一个ETH. 如果你没有,你可以创建多个新的账号,按之前讨论的步骤,然后简单地在你的账号之间转移ETH. 假设你创建了第二个账号来接受ETH:

     var sender = web3.eth.accounts[0];
     var recipient  = web3.eth.accounts[1]; 
     
     var amount = web3.toWei(0.01, "ether");
    

    前两行设置两个账号本地变量,方便后面使用。 你可以自由修改发送者,接受者地址。 如果你使用你朋友的账号地址,把地址放在引号之间,像这样: ‘0xffd25e388bf07765e6d7a00d6ae83fa750460c7e'. 第三行代码,把ETH转化成以太坊网络基本单位(wei).

    虽然有很多ETH面额名字,我们仅使用两个: "ether" 跟 “wei”. Wei是ether的原子单位, 它是在系统级别中被用到。日常的交易使用ether, 1 ether 等于 1 * 10 18 wei. 因此在发送任何交易前,把发送的ETH数量转化成相应数量的wei是非常重要的。 对此,你可使用 web3.toWei函数。

    设置好上面的变量后,用下面的方式发送交易:

     web3.eth.sendTransaction({from: sender, to: recipient, value: amount})
    

    等几秒后,交易应该就完成了。 要检查一个账号的余额, 简单的输入:

     web.eth.getBalance(recipient)
    

    建议: 如果你正在使用Geth, 你可以仅使用eth来替换web3.eth命令行。

    交易收据

    在任何时候,你在以太坊上创建一个交易,返回的字符串是交易哈希。你可以使用它来跟踪交易的进度,或使用_eth.getTransaction(),eth.getTransactionReceipt来查询过去交易所发费的gas。 下面展示如何使用它:

    var tx = web3.eth.sendTransaction({from: web3.eth.accounts[0], to: web3.eth.accounts[1], value: amount, });
    web3.eth.getTransaction(tx);
    

    如果交易已打包进区块,你可以使用下面的方式来查看收据:

    web3.eth.getTransactionReceipt(tx);
    

    相关文章

      网友评论

          本文标题:FAQ - What is Ether? (什么是以太坊?)

          本文链接:https://www.haomeiwen.com/subject/nzbnhftx.html