第15部分—墨翻译(463790821).doc_第1页
第15部分—墨翻译(463790821).doc_第2页
第15部分—墨翻译(463790821).doc_第3页
第15部分—墨翻译(463790821).doc_第4页
第15部分—墨翻译(463790821).doc_第5页
已阅读5页,还剩1页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

翻译 第15部分 Pool Mining矿池挖矿Poolminersfollow a similar workflow, illustrated below, which allowsminingpool operators to payminersbased on their share of the work done. Theminingpool gets new transactions from thenetworkusingbitcoind. Using one of the methods discussed later, eachminersminingsoftware connects to the pool and requests the information it needs to constructblockheaders.矿池的矿工遵循着相似的工作流程,如下图所示,它允许矿池主根据矿工的工作份额支付工资。矿池通过支持bitcoind的连接网络来获得新的交易。使用后面讨论的方法之一,每个矿工的采矿软件都与矿池连接,并取得它需要的信息来构建区块标头。In pooledmining, theminingpool sets thetargetthreshold a few orders of magnitude higher (less difficult) than thenetworkdifficulty. This causes themininghardware to return manyblockheaders which dont hash to a value eligible for inclusion on theblock chainbut which do hash below the poolstarget, proving (on average) that theminer checked a percentage of the possible hash values.在这种集中开采的方式中,矿池设置目标门槛比网络难度大了好几个数量值(难度较低)。这将导致采矿硬件挖矿机返回许多符合纳入条件的Hash值的块链头,而不是那些不符合目标的Hash.这就能够证明(一般而言)矿工查出了Hash值出现的百分之一可能性。Theminerthen sends to the pool a copy of the information the pool needs to validate that the header will hash below thetargetand that the theblockof transactions referred to by the headerMerkle rootfield is valid for the pools purposes. (This usually means that thecoinbase transactionmust pay the pool.)接着,矿工将需要验证的低于目标的块头信息副本发送到矿池,而在Merkle root中提及的交易区块对于矿池来说是有效的(这通常意味着coinbase交易必须支付矿池的费用。 )The information theminersends to the pool is called a share because it proves the minerdid a share of the work. By chance, some shares the pool receives will also be below thenetworktargettheminingpool sends these to thenetworkto be added to theblock chain.矿工发送矿池的数据称为一个份额(share ),因为它证明了矿工所做的工作份额。有时候,矿池会接收到低于全网算力目标的的份额矿池会将它们添加到网络块链中。Theblock rewardandtransaction feesthat come fromminingthatblockare paid to the miningpool. Theminingpool pays out a portion of these proceeds to individualminers based on how many shares they generated. For example, if theminingpoolstarget threshold is 100 times lower than thenetworktargetthreshold, 100 shares will need to be generated on average to create a successfulblock, so theminingpool can pay 1/100th of its payout for each share received. Differentminingpools use different reward distribution systems based on this basic share system.那挖矿获得的区块奖励和产生的交易费用是支付给矿池的。矿池支付根据矿工的工作份额支付部分款项的。例如,如果矿池的目标门槛比全网目标门槛低100倍, 即平均每一个成功的区块需要产生100个份额,所以矿池将支付每个份额所得款项的百分之一。基于这个基本的分配系统系统,不同的矿池使用不同的奖励分配系统。Block Prototypes区块原型In both solo and poolmining, theminingsoftware needs to get the information necessary to constructblockheaders. This subsection describes, in a linear way, how that information is transmitted and used. However, in actual implementations, parallel threads and queuing are used to keep ASIC hashers working at maximum capacity,在单独挖坑和矿池挖矿中,挖矿软件都要获取必要的信息来构建块头。本小节要无法以线性的方式介绍的是,这些信息是如何以线性的方式传播和使用的。然而,在实际应用真实实现中,并行线程和队列是用来保持ASIC hashers工作达到最大算力的。getwork RPCgetwork RPCThe simplest and earliest method was the now-deprecated Bitcoin CoregetworkRPC, which constructs a header for theminerdirectly. Since a header only contains a single 4-byte nonce good for about 4 gigahashes, many modernminersneed to make dozens or hundreds ofgetworkrequests a second. Solominersmay still usegetwork, but most pools today discourage or disallow its use.最早且最简单的方式是现在已经过时弃用的核心挖矿协议是getwork RPC,它向矿工直接构建块头。由于一个块头只包含一个4个字节的随机字符串(nonce),只能支持4.0 GH(个gigahashes),现在的许多矿工要在每秒做几十个或几百个getwork的请求。单独挖坑的矿工仍然可以使用getwork,但现在大多数的矿池不建议或不允许使用它。getblocktemplate RPCAn improved method is the Bitcoin CoregetblocktemplateRPC. This provides the miningsoftware with much more information:getblocktemplate RPC是经过改进的一种挖坑矿方式,这种方式给挖矿坑软件提供了更多信息:1. The information necessary to construct acoinbase transactionpaying the pool or the solominersbitcoindwallet.1.一笔coinbase交易要支付的矿池或单独挖坑矿工的bitcoind钱包所需的信息需要支付给矿池或者单独挖矿矿工bitcoind钱包的coinbase交易的费用信息。2. A complete dump of the transactionsbitcoindor theminingpool suggests including in theblock, allowing theminingsoftware to inspect the transactions, optionally add additional transactions, and optionally remove non-required transactions.2.bitcoind钱包提供的交易信息或矿池交易建议需要包含的交易信息的完整转储意味着,包括区块,允许挖矿软件检查交易,选择性地添加额外交易和去除非必须的交易。3. Other information necessary to construct ablock headerfor the nextblock: theblock version, previousblockhash, and bits (target).3.其他为了下一个区块构建区块标头所需的信息:区块的版本,前一个块Hash值和位(目标)。4. Theminingpools currenttargetthreshold for accepting shares. (For solominers, this is thenetworktarget.)4.矿池当前接受份额(share)的的矿池的当前目标阈值。 (对于单独挖矿的矿工,就是全网的算力目标。 )Using the transactions received, theminingsoftware adds a nonce to thecoinbase extra nonce field and then converts all the transactions into aMerkle treeto derive a Merkle rootit can use in ablock header. Whenever the extra nonce field needs to be changed, theminingsoftware rebuilds the necessary parts of theMerkle treeand updates the time andMerkle rootfields in theblock header.利用收到的交易,采矿软件在coinbase的额外nonce字段上增加了一个nonce,然后把所有的交易转换成Merkel树,来推导在区块标头中用到的Merkle root。每当额外的nonce字段需要改变,采矿软件就会重建Merkle的必要部分并更新块头中的的时间和Merkle root的区域。Like allbitcoindRPCs,getblocktemplateis sent over HTTP. To ensure they get the most recent work, mostminersuseHTTP longpollto leave agetblocktemplaterequest open at all times. This allows theminingpool to push a newgetblocktemplateto the mineras soon as anymineron thepeer-to-peer networkpublishes a newblockor the pool wants to send more transactions to theminingsoftware.和所有的bitcoind RPC一样, getblocktemplate通过HTTP发送。为了确保他们获得的是最新的工作,大部分矿工用HTTP longpoll来使一个getblocktemplate要求随时保持开放。这就意味着当P2P网络上的任何矿工发布出一个新的区块或是矿池想要发送更多的交易到挖矿软件的时候,矿池能够及时将一个新的getblocktemplate发送给矿工。StratumStratumA widely used alternative togetblocktemplateis theStratum mining protocol. Stratum focuses on givingminersthe minimal information they need to constructblockheaders on their own:Stratum mining protocol Stratum是一种广泛使用的替代getblocktemplate的挖矿协议。Stratum侧重于给矿工自己构建标头所需的最少信息:1. The information necessary to construct acoinbase transactionpaying the pool.1.构建一个coinbase交易需要支付矿池所需的信息。2. The parts of theMerkle treewhich need to be re-hashed to create a newMerkle root when thecoinbase transactionis updated with a new extra nonce. The other parts of theMerkle tree, if any, are not sent, effectively limiting the amount of data which needs to be sent to (at most) about a kilobyte at current transaction volume.2.当coinbase交易更新,有了一个新的额外nonce,为了创造一个新的Merkle root,Merkle树上的一部分需要被重新散列。而Merkle树的其它部分,如果存在的话,将不被发送。这样能够有效地限制在当前交易量中数据量,需要被发送的数据总量(最多)在大约一千字节。3. All of the other non-Merkle rootinformation necessary to construct ablock headerfor the nextblock.3.所有其他为构建下一个区块构建块头的非Merkle root的所有其他所需信息。4. Theminingpools currenttargetthreshold for accepting shares.4.矿池接受份额的当前目标阈值。Using thecoinbase transactionreceived, theminingsoftware adds a nonce to the coinbaseextra nonce field, hashes thecoinbase transaction, and adds the hash to the received parts of theMerkle tree. The tree is hashed as necessary to create aMerkle root, which is added to theblock headerinformation received. Whenever the extra nonce field needs to be changed, theminingsoftware updates and re-hashes thecoinbase transaction, rebuilds theMerkle root, and updates the headerMerkle rootfield.利用收到的coinbase交易,挖矿软件在coinbase的额外nonce字段上增加了一个nonce,对coinbase交易进行散列,并把Hash值添加到增加接收的部分Merkle树上部分Hash。该树的散列是因为需要创建Merkle root,的该树又被散列必要,Merkle root会被添加到块头信息中。每当额外的nonce字段需要改变,挖矿软件就更新和重新散列coinbase的交易,重建Merkle root,并更新标头的Merkle root区域。Unlikege

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论