SN-10015 附来源、原文与上下文。
James A. Donald 写道:
James A. Donald wrote:
引用的来信James A. Donald来源 ↗仅仅每个人都知道 X 还不够。我们还需要每个人都知道每个人都知道 X,并且每个人都知道每个人都知道每个人都知道 X ——正如拜占庭将军问题中那样,这是分布式数据处理中的经典难题。
It is not sufficient that everyone knows X. We also need everyone to know that everyone knows X, and that everyone knows that everyone knows that everyone knows X - which, as in the Byzantine Generals problem, is the classic hard problem of distributed data processing.
工作量证明链是拜占庭将军问题的一种解决方案。我试着放在那个情境下重新表述一下。
The proof-of-work chain is a solution to the Byzantine Generals' Problem. I'll try to rephrase it in that context.
若干位拜占庭将军各有一台电脑,想通过暴力破解密码来攻击国王的 wi-fi。他们已得知密码的长度是特定的字符数。一旦他们触发网络生成一个数据包,就必须在有限时间内破解密码,侵入并清除日志,否则就会被发现并惹上麻烦。只有大多数人同时发起攻击,他们的 CPU 算力才足以迅速破解密码。
A number of Byzantine Generals each have a computer and want to attack the King's wi-fi by brute forcing the password, which they've learned is a certain number of characters in length. Once they stimulate the network to generate a packet, they must crack the password within a limited time to break in and erase the logs, otherwise they will be discovered and get in trouble. They only have enough CPU power to crack it fast enough if a majority of them attack at the same time.
他们并不特别在意何时攻击,只要大家达成一致就行。他们决定,谁愿意都可以宣布一个时间,而最先听到的时间就是正式攻击时间。问题在于网络并非即时传输;如果两位将军几乎同时宣布不同的攻击时间,有些人可能先听到一个,另一些人先听到另一个。
They don't particularly care when the attack will be, just that they all agree. It has been decided that anyone who feels like it will announce a time, and whatever time is heard first will be the official attack time. The problem is that the network is not instantaneous, and if two generals announce different attack times at close to the same time, some may hear one first and others hear the other first.
他们用工作量证明链来解决这个问题。每位将军收到自己最先听到的攻击时间后,就让电脑去求解一个极难的工作量证明问题,其哈希包含这个攻击时间。工作量证明难度很高,预计他们所有人同时计算 10 分钟,才会有一个人找到答案。一旦某位将军找到工作量证明,就将它广播到网络,所有人都会更改当前的工作量证明计算,把这个工作量证明纳入正在计算的哈希。如果有人之前在另一个攻击时间上工作,就会切换到这个时间,因为它的工作量证明链现在更长了。
They use a proof-of-work chain to solve the problem. Once each general receives whatever attack time he hears first, he sets his computer to solve an extremely difficult proof-of-work problem that includes the attack time in its hash. The proof-of-work is so difficult, it's expected to take 10 minutes of them all working at once before one of them finds a solution. Once one of the generals finds a proof-of-work, he broadcasts it to the network, and everyone changes their current proof-of-work computation to include that proof-of-work in the hash they're working on. If anyone was working on a different attack time, they switch to this one, because its proof-of-work chain is now longer.
两小时后,某个攻击时间应该已经被纳入一条由 12 个工作量证明构成的哈希链。每位将军只需验证这条工作量证明链的难度,就能估算每小时有多少并行 CPU 算力投入其中,并看出,要在给定时间内产生这么多工作量证明,必定需要大多数电脑参与。他们必定都看到了这个时间,因为工作量证明就是他们为此工作的证据。如果工作量证明链展示的 CPU 算力足以破解密码,他们就可以放心地在约定时间发起攻击。
After two hours, one attack time should be hashed by a chain of 12 proofs-of-work. Every general, just by verifying the difficulty of the proof-of-work chain, can estimate how much parallel CPU power per hour was expended on it and see that it must have required the majority of the computers to produce that much proof-of-work in the allotted time. They had to all have seen it because the proof-of-work is proof that they worked on it. If the CPU power exhibited by the proof-of-work chain is sufficient to crack the password, they can safely attack at the agreed time.
你所问到的所有同步、分布式数据库和全局视图问题,都是通过工作量证明链解决的。
The proof-of-work chain is how all the synchronisation, distributed database and global view problems you've asked about are solved.