比特币创世论文《Bitcoin: A Peer-to-Peer Electronic Cash System》研读之五:工作量证明

原文翻译

4. Proof-of-Work

To implement a distributed timestamp server on a peer-to-peer basis, we will need to use a proof-of-work system similar to Adam Back's Hashcash [6], rather than newspaper or Usenet posts. The proof-of-work involves scanning for a value that when hashed, such as with SHA-256, the hash begins with a number of zero bits. The average work required is exponential in the number of zero bits required and can be verified by executing a single hash.

For our timestamp network, we implement the proof-of-work by incrementing a nonce in the block until a value is found that gives the block's hash the required zero bits. Once the CPU effort has been expended to make it satisfy the proof-of-work, the block cannot be changed without redoing the work. As later blocks are chained after it, the work to change the block would include redoing all the blocks after it.

比特币创世论文《Bitcoin: A Peer-to-Peer Electronic Cash System》研读之五:工作量证明

The proof-of-work also solves the problem of determining representation in majority decision making. If the majority were based on one-IP-address-one-vote, it could be subverted by anyone able to allocate many IPs. Proof-of-work is essentially one-CPU-one-vote. The majority decision is represented by the longest chain, which has the greatest proof-of-work effort invested in it. If a majority of CPU power is controlled by honest nodes, the honest chain will grow the fastest and outpace any competing chains. To modify a past block, an attacker would have to redo the proof-of-work of the block and all blocks after it and then catch up with and surpass the work of the honest nodes. We will show later that the probability of a slower attacker catching up diminishes exponentially as subsequent blocks are added.

To compensate for increasing hardware speed and varying interest in running nodes over time, the proof-of-work difficulty is determined by a moving average targeting an average number of blocks per hour. If they're generated too fast, the difficulty increases.

4.工作量证明

为了实现基于点对点[1]网络的分布式时间戳[2]服务器,我们需要使用一种和Adam Back's Hashcash[3]相似的工作量证明[4]系统,比起报纸或Usenet[5]网。工作量证明牵扯到在生成哈希时扫描一个值,以SHA-256[6]为例,这个哈希值以一系列的零比特开始。平均工作量随着开头零的个数要求的增加而越来越大并可以通过执行一次hash来验证。

对于我们的时间戳网络来说,我们通过在区块中增加一个临时值直到一个可以让这个区块的哈希值达到要求的值被找到来实现工作量证明。一旦CPU算力被花费来使其满足工作量证明,除非重做工作量证明这个区块就不能被修改。当之后的区块加入进来,修改区块的工作量将包含重算之后所有的工作量证明。

工作量证明也解决了在主要决策中确定代表性的问题如果多数派的确定是靠IP地址一IP一票,它就会被可以产生多个IP的节点操纵。工作量证明是必要的一CPU一票的机制。最长链就是主要决策的代表,其中包含最多的工作量,如果大多数CPU算力被非恶意节点所控制,那么诚实的链就会比所有与它竞争的链都生长的更快并超过他们。为了修改一个之前的区块,攻击者必须重算这个区块以及这个区块之后所有区块的工作量证明,然后赶上并超过非恶意节点。我们待会儿会落后的攻击者赶上的可能性随着区块的增加呈指数级减少[7]。

为了匹配硬件速度的增加,和运算节点的变化,工作量证明的难度被变化的每小时平均生成区块数所决定,如果它们产生的过快,就会增加难度。


细节解读

[1]什么是点对点

请参考我的另一篇博文:比特币创世论文《Bitcoin: A Peer-to-Peer Electronic Cash System》研读之一:摘要

https://blog.csdn.net/qq_27467365/article/details/81569962

[1]What is 'peer-to-peer'

Please refer to my other blog post《Study of《Bitcoin: A Peer-to-Peer Electronic Cash System》1》:

https://blog.csdn.net/qq_27467365/article/details/8156996


[2]什么是 时间戳

请参考我的另一篇博文:比特币创世论文《Bitcoin: A Peer-to-Peer Electronic Cash System》研读之四:时间戳服务器

https://blog.csdn.net/qq_27467365/article/details/81589805

[2]What is 'timestamps'

Please refer to my other blog post《Study of《Bitcoin: A Peer-to-Peer Electronic Cash System》4》:timestamps

https://blog.csdn.net/qq_27467365/article/details/81589805


 

[3]什么是”Adam Back's Hashcash“

Hashcash是一种用于限制电子邮件垃圾邮件和拒绝服务攻击的工作量证明系统,最近因其在比特币(和其他加密货币)中的使用而闻名,作为挖掘算法的一部分。 Hashcash由Adam Back于1997年提出。

[3]What is 'Adam Back's Hashcash'

Hashcash is a proof-of-work system used to limit email spam and denial-of-service attacks and more recently has become known for its use in bitcoin (and other cryptocurrencies) as part of the mining algorithm. Hashcash was proposed in 1997 by Adam Back.

Adam Back's Hashcash的*地址:https://en.wikipedia.org/wiki/Hashcash


[4] 什么是 工作量证明

请参考我的另一篇博文:比特币创世论文《Bitcoin: A Peer-to-Peer Electronic Cash System》研读之一:摘要

https://blog.csdn.net/qq_27467365/article/details/81569962

[4]What is 'proof-of-work'

Please refer to my other blog post《Study of《Bitcoin: A Peer-to-Peer Electronic Cash System》1》

https://blog.csdn.net/qq_27467365/article/details/8156996


[5]什么是 “Usenet“

请参考我的另一篇博文:比特币创世论文《Bitcoin: A Peer-to-Peer Electronic Cash System》研读之四:时间戳服务器

https://blog.csdn.net/qq_27467365/article/details/81589805

[5]What is”Usenet“

Please refer to my other blog post《Study of《Bitcoin: A Peer-to-Peer Electronic Cash System》4》:timestamps

https://blog.csdn.net/qq_27467365/article/details/81589805


[6]什么是“SHA-256“

 

[6]What is”SHA-256”

 


[7]为什么指数级减少?

 

[7]

 


《Bitcoin: A Peer-to-Peer Electronic Cash System》论文原文地址如下:https://bitcoin.org/bitcoin.pdf


版权所有声明

版权所有归属作者,未经允许不得转载、复制或用作它途。否则作者将具有追究法律责任的权利。

Copyright Clarify

Copyright ownership belongs to the author, shall not be reproduced, copied, or used in other ways without permission. Otherwise, the author will have the right to pursue legal responsibilities.