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是一個必須的元素蜀踏,如同燃料一樣维蒙。 平臺上的應用用來它來支付給那些執(zhí)行請求操作的機器。換言之果覆,ether可以激勵開發(fā)者寫出高質(zhì)量的應用(無用的代碼會消耗更多ether)颅痊,同時保持網(wǎng)絡健康(為提供資源的人給予報酬)。
如果你僅想測試這項技術(shù)局待,你大概沒有必要需要真的ether斑响。你可以下載最新的錢包App,然后切換到測試網(wǎng)絡即可測試钳榨。
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是如何創(chuàng)建的舰罚?
ETH總供應量,以及發(fā)行的比例是由2014預售時重绷,其捐贈情況來決定沸停。 大概如下:
6000萬ETH用于捐贈者
1200萬ETH(相當于上面的20%)用于用戶開發(fā)基金會,大部分分配給早期貢獻者昭卓,開發(fā)者愤钾,以及以太坊基金會
大約每15秒出一個區(qū)塊瘟滨,并獎勵5個ETH給礦工
-
有時候也會獎勵2 ~ 3個ETH給那些找到答案,但它所挖出的區(qū)塊并沒有被包含進區(qū)塊鏈(這叫做uncle/aunt獎勵)
注意能颁,拜占庭更新被實現(xiàn)后杂瘸, 一個區(qū)塊獎勵變?yōu)?個ETH,uncle獎勵變?yōu)?.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會無限供應嗎败玉?
不會。 根據(jù)2014預售時镜硕,所有參與者所達成的條款运翼,ETH每年最多增發(fā)1800萬(初始供應量[7200w]的25%)。 這就是說兴枯,當絕對發(fā)行量是固定的血淌,相對的通脹每年在下降。 理論上講财剖,如果每年發(fā)行量沒有限制悠夯,那么在未來某個時間點,每年新創(chuàng)建的token的速度會達到每年丟失的token的速度(比如誤用躺坟,密鑰丟失沦补,token持有者死亡等等),最后會達到平衡咪橙。
但是這個增發(fā)速度可能有所改變: 大約在2018到2019期間夕膀,以太坊會用新的,目前還在開發(fā)中的共識算法Casper來替代工作量證明共識算法美侦。 Casper預期會更高效店诗,同時只需更少的挖礦補貼。有關(guān)具體的發(fā)行辦法音榜,以及它會服務于哪個個功能庞瘸,目前還處在研究中,但是可以保證的是:
- 當前最大的發(fā)行量是最大的極限赠叼,在casper下發(fā)行的token量是不會超過它的(可能還會更少)擦囊。
- 不管最終采用那個方法,它會是一個去中心化的智能合約嘴办,它不會對任何特定人群區(qū)別對待瞬场,它的初衷是有益于整個網(wǎng)絡的安全,健康涧郊。
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?
開發(fā)者:
他們要使用以太坊區(qū)塊鏈來構(gòu)建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?
以太坊通過全世界的計算機來維持運行。為了獎勵那些處理合約彤灶,保護網(wǎng)絡安全的算力看幼,會給為區(qū)塊鏈創(chuàng)建最新區(qū)塊的計算機一個獎勵。平均每15秒幌陕,一個新的區(qū)塊會被加入到以太坊區(qū)塊鏈诵姜,新的區(qū)塊包含了最新的被處理的交易。 生成這個區(qū)塊的計算機會獲得3個ETH作為獎勵搏熄。 因為生成區(qū)塊算法的性質(zhì)棚唆,這個過程(產(chǎn)生工作量證明)保證是隨機的,并且獎勵會按照每個機器的算力來按比例分配心例。
在加密貨幣術(shù)語中宵凌,這個過程通常叫做挖礦。
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挖礦
如果你在一個私有網(wǎng)絡(同時如果你僅僅想免費測試這項技術(shù))止后, 任何帶有標準CPU的正常的計算機都能夠運行這個網(wǎng)絡摆寄,并通過挖礦獲取ETH(在測試網(wǎng)絡中生成的ETH,只能在測試網(wǎng)絡中回收)坯门。 對于小規(guī)模網(wǎng)絡或者私下測試而言,是一個最好的選擇逗扒, 因為它僅需要少量資源古戴。在真實以太坊網(wǎng)絡(或上線測試),一臺標準的桌面電腦(或筆記本)可能需要發(fā)很長時間才能成功挖出一個區(qū)塊矩肩,獲得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)
然而刽酱,在你能找到任何區(qū)塊前喳逛,你的計算機需要執(zhí)行一個“構(gòu)建DAG”的流程。 挖礦時需要這個DAG(有向無環(huán)圖)是一個巨大的數(shù)據(jù)結(jié)構(gòu)(大約1GB) 棵里,用來防止ASIC(專用集成電路)機器被大規(guī)模生產(chǎn)润文,以用來挖礦。 它的目的是保護像你這樣的礦工殿怜,這樣可以讓你家里的計算機仍然有競爭力典蝌。生成這個DAG數(shù)據(jù)結(jié)構(gòu)大約需要10分鐘時間,一旦完成头谜,Geth就會啟動自動挖礦骏掀。
如果你成功挖出一個區(qū)塊,在日志中,你會看到像下面這樣的消息:
?? 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.
- C++ Etherminer. This is a version for the pro miners. To install it, follow the guide to install the whole C++ ethereum code.
- Go experimental GPU branch. It's experimental so you need to build go from source to get it. This version is focused on hobbyists and developers. To install it, clone geth from source and then switch to the GPU Miner branch.
使用命令行來進行GPU挖礦
如果你真想在以太坊網(wǎng)絡挖礦來獲取ETH獎勵截驮,那么你應使用專用的電腦來運行以太坊網(wǎng)絡笑陈,這種電腦會配置非常強大的圖形卡。
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. 這是一個專業(yè)礦工版本绵疲。要安裝哲鸳,請按照這個教程來做:安裝整個C++以太坊代碼
- Go 實驗性GPU分支. 它是一個實驗性的版本,因此你需要自己通過編譯源碼來創(chuàng)建一個版本盔憨。 這個版本主要是業(yè)余愛好者以及開發(fā)者在用徙菠。 要安裝,先克隆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.
更多有關(guān)挖礦信息
- 以太坊的工作量證明算法沒有使用Scrypt或Sha256, 取而代之,它使用EtHash, Hashimoto / Dagger 混合體算法问慎。 在以太坊gibBook萍摊, 挖礦章節(jié),你可以了解到這個算法理論如叼,設計相關(guān)的東西冰木。 注意,在Serenity階段(未來會發(fā)布笼恰,在以太坊開發(fā)路線圖片酝,它是一個重要的里程碑)我們計劃著切換到權(quán)益證明共識算法(POS)
- EtHash工作量證明算法需要大量內(nèi)存,每個GPU上至少需要1+GB的內(nèi)存挖腰。 因為DAG需要從GPU并行輸入雕沿,輸出代價是非常大的,至少1GB起猴仑,后續(xù)還會無限的增加审轮。要持續(xù)挖1年肥哎, 2GB內(nèi)容應該是一個不錯的選擇。
- 挖礦算力大約跟內(nèi)存帶寬成比例疾渣。 因為在以太坊內(nèi)部實現(xiàn)是用OpenCL寫的篡诽, 所以AMD的GPU會比同等價格的NVIDA GPU要快。使用AMD的R9 290X顯卡跑常規(guī)頂級性能測試榴捡, 獲得的實驗數(shù)據(jù)驗證了這個說法杈女。
- 強烈不推薦使用ASIC跟FPGA機器來挖礦,因為這個在財務上做法是低效的吊圾,這在一個獨立的審計中达椰,已經(jīng)確認這個說法。不要期望在市場上看到他們项乒,如果你的確看到了啰劲,請要特別小心。
What's the relationship between bitcoin and ether?
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.
以太坊跟比特幣之間是什么關(guān)系檀何?
不管在技術(shù)上蝇裤,還是貨幣上,如果沒有比特幣频鉴,就沒有太坊栓辜。 在數(shù)字生態(tài)中,兩者之間不是競爭貨幣垛孔,而是一個互補的關(guān)系藕甩。ETH 被當做 “加密石油”, 它是目的是:用來支付計算的似炎,并不是用來或者被認為是一個貨幣,資產(chǎn)悯姊,股份或者其他任何東西羡藐。
你可以在以太坊的生態(tài)中,有多種方式來使用比特幣悯许。
- 交易BTC, ETH: 多個第三方公司正致力于讓BTC跟ETH之間的兌換變地更加容易仆嗦,順暢。如果要執(zhí)行智能合約先壕,可以用BTC購買ETH, 同時又可以立刻把ETH換成BTC瘩扼,這樣確保的價值不變,以及在比特幣網(wǎng)絡上的安全垃僚。 最新的錢包包含一個ETH, BTC自動轉(zhuǎn)換功能集绰。
- 使用錨定派生: 在多方之間,創(chuàng)建復雜的交易谆棺,以太坊就是一個非常好用的工具栽燕。如果所有的當事人相信的比特幣價格數(shù)據(jù)源,那么創(chuàng)建一個基于以太坊的貨幣是有可能的。這個貨幣的的價值錨定比特幣的市場價格碍岔。 這就意味著浴讯,你可以把比特幣兌換成token。 token需要保證總是可以兌換成同等數(shù)量的比特幣蔼啦,同時又必須跟其他以太坊智能合約完全兼容榆纽。
- 使用比特幣中轉(zhuǎn)實現(xiàn)雙向錨定:比特幣中轉(zhuǎn)是一部分代碼,它允許你把比特幣以側(cè)鏈的方式轉(zhuǎn)入以太坊捏肢。 這就意味著你能使用比特幣本身有限的腳本功能鎖定一個比特幣到一個比特幣合約奈籽,這個合約直接連接到以太坊合約,然后猛计,它發(fā)行一個基于以太坊的token(保證可以被比特幣轉(zhuǎn)回)唠摹。這個中轉(zhuǎn)功能還在開發(fā)當中,當功能實現(xiàn)奉瘤,測試完勾拉,并證明是安全后,我們會在這里把它列出來盗温。
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);
如何使用命令行發(fā)送ETH?
注意: 以太坊地址目前還沒有內(nèi)置地址有效性檢查藕赞。也就是說,如果你誤輸入一個地址卖局,你的ETH將會永久丟失斧蜕,也不會有第二次確認窗口提示。如果你要進行大額轉(zhuǎn)賬時砚偶,可以先發(fā)送一筆你小額的轉(zhuǎn)賬批销,即使丟了,你也是可以接受的染坯,直到你感覺沒什么問題時均芽,再進行大額轉(zhuǎn)賬。
以太坊有兩種類型賬號:
普通賬號: 這些賬號上的ETH单鹿,僅通過私鑰來轉(zhuǎn)移ETH
合約賬號:這些賬號上的ETH, 是通過合約內(nèi)部的代碼來控制ETH的轉(zhuǎn)移
在本節(jié)掀宋, 我們只關(guān)注普通賬號。
同樣仲锄,交易也有兩種類型:
ETH轉(zhuǎn)移交易: 發(fā)送到普通賬號的交易
其他交易: 智能合約之間的通信
在你執(zhí)行你的第一個ETH發(fā)送時劲妙,你需要一個朋友先給你發(fā)送一個ETH. 如果你沒有,你可以創(chuàng)建多個新的賬號儒喊,按之前討論的步驟镣奋,然后簡單地在你的賬號之間轉(zhuǎn)移ETH. 假設你創(chuàng)建了第二個賬號來接受ETH:
var sender = web3.eth.accounts[0];
var recipient = web3.eth.accounts[1];
var amount = web3.toWei(0.01, "ether");
前兩行設置兩個賬號本地變量,方便后面使用怀愧。 你可以自由修改發(fā)送者唆途,接受者地址富雅。 如果你使用你朋友的賬號地址,把地址放在引號之間肛搬,像這樣: ‘0xffd25e388bf07765e6d7a00d6ae83fa750460c7e'. 第三行代碼没佑,把ETH轉(zhuǎn)化成以太坊網(wǎng)絡基本單位(wei).
雖然有很多ETH面額名字,我們僅使用兩個: "ether" 跟 “wei”. Wei是ether的原子單位温赔, 它是在系統(tǒng)級別中被用到蛤奢。日常的交易使用ether, 1 ether 等于 1 * 10 18 wei. 因此在發(fā)送任何交易前,把發(fā)送的ETH數(shù)量轉(zhuǎn)化成相應數(shù)量的wei是非常重要的陶贼。 對此啤贩,你可使用 web3.toWei函數(shù)。
設置好上面的變量后拜秧,用下面的方式發(fā)送交易:
web3.eth.sendTransaction({from: sender, to: recipient, value: amount})
等幾秒后痹屹,交易應該就完成了。 要檢查一個賬號的余額, 簡單的輸入:
web.eth.getBalance(recipient)
建議: 如果你正在使用Geth, 你可以僅使用eth來替換web3.eth命令行枉氮。
交易收據(jù)
在任何時候志衍,你在以太坊上創(chuàng)建一個交易,返回的字符串是交易哈希聊替。你可以使用它來跟蹤交易的進度楼肪,或使用_eth.getTransaction(),eth.getTransactionReceipt來查詢過去交易所發(fā)費的gas惹悄。 下面展示如何使用它:
var tx = web3.eth.sendTransaction({from: web3.eth.accounts[0], to: web3.eth.accounts[1], value: amount, });
web3.eth.getTransaction(tx);
如果交易已打包進區(qū)塊春叫,你可以使用下面的方式來查看收據(jù):
web3.eth.getTransactionReceipt(tx);