拜占庭将军问题
历史档案 / 镜像
打开历史存档来源说明
Standalone page from the early bitcoin.org site, preserved from the Wayback Machine snapshot captured on March 9, 2009 at 17:58:40 UTC. The page itself has no publication date; the entry date records the snapshot. Satoshi identified it as his description of how Bitcoin solves the Byzantine Generals' problem in a May 3, 2009 message to Martti Malmi.
若干位拜占庭将军各自拥有一台计算机,他们想通过暴力破解密码来攻击国王的 Wi-Fi。他们已经得知密码的长度是一定的字符数。一旦他们促使网络生成一个数据包,就必须在有限时间内破解密码,闯入系统并删除日志,以免被发现。只有当他们中的大多数人同时发起攻击时,他们的 CPU 算力才足以迅速破解密码。
他们并不特别在意攻击何时进行,只要能达成一致就行。大家已经决定,任何有意愿的人都可以宣布一个攻击时间,我们把它称为“计划”,而最先被听到的计划将成为正式计划。问题在于网络并非即时传输,如果两位将军在相近的时间宣布了不同的计划,有些人可能先听到一个,另一些人则可能先听到另一个。
他们使用一条工作量证明链来解决这个问题。每位将军收到自己最先听到的计划后,就让计算机去解决一个困难的、基于哈希的工作量证明问题,其哈希中包含该计划。工作量证明的难度足够高,即使所有人同时工作,预计也要过 10 分钟才会有人找到一个解,并将其广播到网络。收到这个解后,每个人都会调整其工作量证明计算中的哈希,将第一个解包含进去,这样当他们找到下一个工作量证明时,它就会链接在第一个之后。如果有人原本在为不同的计划工作,他们就会切换到这个计划,因为它的工作量证明链现在更长了。
大约两小时后,该计划应该已经被一条由 12 个工作量证明组成的链进行哈希。每位将军只需验证工作量证明链的难度,就能估算出每小时有多少并行 CPU 算力耗费在它上面,并看出要在规定时间内生成这条链,必然需要大多数计算机参与。至少,他们中的大多数人必定已经看到过这个计划,因为工作量证明证明了他们曾为它工作。如果工作量证明所显示的 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, lest they be discovered. 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 agree. It has been decided that anyone who feels like it will announce an attack time, which we'll call the "plan", and whatever plan is heard first will be the official plan. The problem is that the network is not instantaneous, and if two generals announce different plans at close to the same time, some may hear one first and others hear the other first.
They use a proof-of-work chain to solve the problem. Once each general receives whatever plan he hears first, he sets his computer to solve a difficult hash-based proof-of-work problem that includes the plan in its hash. The proof-of-work is difficult enough that with all of them working at once, it's expected to take 10 minutes before one of them finds a solution and broadcasts it to the network. Once received, everyone adjusts the hash in their proof-of-work computation to include the first solution, so that when they find the next proof-of-work, it chains after the first one. If anyone was working on a different plan, they switch to this one, because its proof-of-work chain is now longer.
After about two hours, the plan 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 in the allotted time. At the least, most of them had to have seen the plan, since the proof-of-work is proof that they worked on it. If the CPU power exhibited by the proof-of-work is sufficient to crack the password, they can safely attack at the agreed time.
Home