经典
比特币白皮书
九页纸如何在不设裁判的前提下让互不信任的陌生人就"谁付了钱"达成一致。逐节对照原文,标出它真正说了什么、以及流行转述里那些它其实没说的话。
- 作者
- Satoshi Nakamoto(2008)
- 校验
- sha256:b1674191a88ec5cdd733e4240a81803105dc412d6c6708d53ab94fc248f4f553
- 校验和实测自 cdn.nakamotoinstitute.org 的 bitcoin.pdf 副本(184,292 字节,9 页, PDF 内嵌创建时间 2009-03-24)。抽取时 bitcoin.org 从本机不可达,因此"该副本与 bitcoin.org 所发布字节完全相同"这一点未经本站实测。
怎么读这篇
这篇按原文分节走:每节先给一句话主旨,再逐段讲原文在说什么、 为什么这么写。术语和公式的解释放在正文右侧的边注里,读到哪看到哪。 每节末尾有一道自测题——答不出就说明那节没读懂,回头再看一遍比往下读划算。
适合谁读:高中数学基础即可读完前十节;第十一节的概率推导需要一点微积分或统计学直觉,但结论部分不需要
英文原文怎么查词:引文块保持整段可选中,任何划词翻译工具都能直接用 (iOS Safari 长按选词后选「查询」,桌面端可用沙拉查词一类扩展)。 本站只解释术语——像 proof-of-work、Merkle root 这种通用词典给不出 本文特定含义的词,会链到站内词条;普通生词交给你自己的词典更靠得住。
哪里真的难,不糊弄你
- 第十一节的泊松分布求和:为什么要"1 减去追平概率"而不是直接加总,这一步是全文唯一绕的地方
- 赌徒破产问题给出的 (q/p)^z,其闭式解本身要用递推或鞅论才能推出,原文直接引用了 Feller 而没有证明
- "最长链"与"累积工作量最大的链"在原文里被当作同义词,这个隐含假设在难度可变的现实中并不成立
前置知识(22/22 条站内已有)
- 哈希函数把任意长的数据压成一段固定长度的指纹:同样的输入必得同样的指纹,改一个字指纹就全变。
- 公钥密码与数字签名一对钥匙:私钥只有你有、用来签名;公钥人人可见、用来验证签名确实出自你手。
- 数字签名用只有你知道的私钥给一段数据盖章,任何人都能用你公开的公钥验证这个章是真的、且数据没被改过。
- 密钥对一对数学上绑定的钥匙:私钥留着签名,公钥公开验签,且从公钥推不出私钥。
- 双重支付同一笔电子货币被花两次——数字文件天生可复制,这是电子现金最根本的难题。
- 区块一批交易打包成一页账,配一个约 80 字节的头,头里记着上一页的指纹
- 节点网络里存账、验账、转发的机器,分自己全验和只验头两种
- 时间戳服务器把指纹公开发布,每个新指纹裹住上一个,串成改不回去的链
- 工作量证明用一段谁都能验证的算力开销当门票:做起来很贵,检查起来极便宜。
- 算力每秒能试多少次哈希:隔着网络唯一能被验证的力气
- 难度与目标值一个门槛数字:区块头哈希必须比它小才过关,越低越难
- 最长链规则两份互相矛盾的账本,选背后堆了更多工作量的那一份
- 分叉与孤块两人几乎同时出块,链短暂分成两支,落败那支被丢弃
- Merkle 树把一批数据两两哈希、层层向上收成一个根指纹;验证其中任何一条只需要一条极短的路径。
- UTXO / 未花费交易输出账本里没有余额这一栏,只有一堆还没被花掉的收据。
- 共识一群互不信任、可能失联的参与者,最终对同一份记录取得一致——难点从来不是投票,而是不知道该问谁。
- 激励让诚实比作恶更赚钱,于是不需要惩罚机制也没人想作恶。
- 女巫攻击一个人伪装成成千上万个人,把投票和信誉系统撑爆。
- 拜占庭将军问题一群互不信任的人,靠不可靠的信道商定同一个决定。
- 随机游走每步随机进退,走一万步大约只离原点一百步。
- 泊松分布已知平均每小时来 6 个,它给出下一小时来 0 个、1 个、10 个的各自概率。
- 赌徒破产问题每局赢面略小于一半,只要一直赌下去,输光是迟早的事。
读之前:这篇论文的体裁
九页,八条参考文献,一段 C 代码,三张表。没有致谢,没有机构,没有版本号,正文里连日期都没有。
先说三件容易被忽略的事实,它们决定了该怎么读这篇东西。
它不是规范文档。 论文没给出任何协议参数:难度调整只写”targeting an average number of blocks per hour”而不给数字,货币总量只写”a predetermined number of coins”而不给数字。想照着它实现比特币是不可能的。
它只严格证明了一件事。 第十一节那个概率不等式是全文唯一有数学的部分。其余十一节是工程草图和设计论证。
我们手上这份是 2009 年 3 月的修订版。 PDF 内嵌的创建时间是 D:20090324113315-06’00’,生成工具是 OpenOffice.org 2.4。流传甚广的”2008 年 10 月 31 日”是邮件列表首发日,不在论文本体里。
摘要:把问题压缩成一句话
原文摘要不长,值得整段读,因为全文的论证结构在这里已经完整出现了。
A purely peer-to-peer version of electronic cash would allow online payments to be sent directly from one party to another without going through a financial institution. Digital signatures provide part of the solution, but the main benefits are lost if a trusted third party is still required to prevent double-spending.
这两句是全文的问题陈述,而且陈述得极精确:数字签名解决了一部分,但不是全部。
签名能证明”我授权了这笔转账”,却证明不了”我没有把同一笔钱授权给另一个人”。因为签名是可以重复使用的——同一份签名数据提交两次,两次都验证通过。要判断哪一次在先,你需要一个所有人都认可的时间顺序。而”所有人都认可的顺序”传统上只能由一个中心机构给出。
The network timestamps transactions by hashing them into an ongoing chain of hash-based proof-of-work, forming a record that cannot be changed without redoing the proof-of-work. The longest chain not only serves as proof of the sequence of events witnessed, but proof that it came from the largest pool of CPU power.
这是解法陈述。拆开看有四个动作叠在一起:给交易打时间戳、把它们哈希进一条链、这条链由工作量证明构成、于是修改历史等于重做工作量。
最后半句是整个设计的枢轴:最长的链同时是两件事的证明——事件顺序的证明,以及”它来自最大算力池”的证明。把”谁说的对”这个社会问题,换成了”谁算得多”这个物理问题。
自测为什么数字签名本身不足以防止双花?
因为签名证明的是授权,不是顺序。同一笔钱可以被合法签名给两个不同的收款人,两份签名都能通过验证。缺的是一个所有人公认的”哪笔在先”的判定,而这需要全局时间顺序——签名机制不提供这个。
1. Introduction:为什么”可撤销”本身是一种成本
这一节全是经济论证,没有技术内容。它要回答的是”现有支付系统到底哪里不好”。
What is needed is an electronic payment system based on cryptographic proof instead of trust, allowing any two willing parties to transact directly with each other without the need for a trusted third party.
中本聪列的现有体系的病症,顺序很有讲究:交易不可完全不可逆(因为要留争议调解空间)→ 调解成本推高最低交易额 → 小额支付变得不可能 → 商家必须索取超出必要的客户信息 → 欺诈率被当作不可避免的成本吸收。
The system is secure as long as honest nodes collectively control more CPU power than any cooperating group of attacker nodes.
这句话请逐字记住,因为它是后面所有”51%“误传的源头。原文说的是”诚实节点集体控制的算力超过任何相互协作的攻击者群体”。它既没有出现数字 51,也没有把 50% 说成阈值。差别在第十一节会变得很实际。
自测白皮书认为传统支付系统的根本缺陷是什么?(提示:不是'手续费高')
是可逆性。因为交易可撤销,就必须有争议调解;调解产生成本,成本设定了最低可行交易额;于是小额支付在结构上不可能。手续费只是这个因果链的表现,不是原因。
2. Transactions:币不是余额,是一条签名链
We define an electronic coin as a chain of digital signatures. Each owner transfers the coin to the next by digitally signing a hash of the previous transaction and the public key of the next owner and adding these to the end of the coin.
这是全文最容易被现代读者误读的一句,因为今天大家的直觉是”账户里有余额”。白皮书里没有账户,没有余额。一枚币就是一条不断加长的签名链,每一环签的是两样东西:上一笔交易的哈希(把自己钉在历史上)和下一任所有者的公钥(指定往哪去)。
签上”上一笔交易的哈希”这个动作做了一件事:任何人拿到这枚币,可以一路往回验签,确认所有权转移每一步都被正确授权。
但验不出双花。 中本聪紧接着点出这一点,然后给了一句我认为是全文最凝练的话:
The only way to confirm the absence of a transaction is to be aware of all transactions.
要确认某笔交易不存在,唯一办法是知道所有交易。这句话直接决定了比特币必须是全网广播的——不是设计偏好,是逻辑必然。你没法在只看到局部的情况下证明否命题。
于是”防双花”的需求被翻译成了”就交易的先后顺序取得多数共识”:
The payee needs proof that at the time of each transaction, the majority of nodes agreed it was the first received.
这一节假设你已经懂的东西: 数字签名的签/验语义、公钥与私钥、哈希作为指针、mint(造币厂)和中心权威的角色、银行如何靠账本防双花、“公开宣告”作为不可抵赖手段。
自测为什么白皮书的设计必须把所有交易向全网广播?
因为要确认一笔交易不存在(即没有发生过在先的双花),唯一办法是掌握全部交易。否命题无法从局部信息证明。全局广播不是性能取舍,是这个安全定义的逻辑前提。
3. Timestamp Server:把报纸公示搬到网络上
A timestamp server works by taking a hash of a block of items to be timestamped and widely publishing the hash, such as in a newspaper or Usenet post [2-5].
时间戳服务器不是中本聪的发明——他引了四篇文献(Haber & Stornetta 那一系列,1991–1997)。原始想法很朴素:把一批文件的哈希登在报纸上。报纸的公开性和不可回溯修改性,让你事后无法伪造”这份文件在那天已经存在”。
中本聪加的一步是把时间戳串起来:
Each timestamp includes the previous timestamp in its hash, forming a chain, with each additional timestamp reinforcing the ones before it.
每个时间戳把前一个包含进自己的哈希里。于是链条越往后长,前面的部分越难改——改第 n 个就必须重算 n 之后的全部。这个”后来者加固先前者”的性质,是整条链安全性的来源。
这一节假设你已经懂的东西: 哈希的单向性与抗碰撞、链式哈希、公示作为信任替代品、Usenet、篡改可检测性(tamper-evidence)。
自测'每个时间戳包含前一个'这个设计买到了什么?
历史的累积加固。要修改链上第 n 个时间戳,必须连带重算它之后的每一个,因为每一个都把前者的哈希封在了自己里面。链越长,早期部分越不可动。
4. Proof-of-Work:把投票权绑到物理成本上
这一节是整个系统的引擎。
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.
请注意 such as with SHA-256——这是举例语气。原文没有把 SHA-256 定为规范,而且 SHA-256 在九页里只出现这一次。
机制本身是 Adam Back 的 Hashcash(引文 [6]):不断改一个计数器重算哈希,直到结果开头有足够多的零位。
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.
沉没成本变成了防御。修改一个区块 = 重做它以及它之后所有区块的工作量。
接下来是这一节最重要的一句,它解决的是一个完全不同的问题——投票权分配:
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.
如果多数是按「一个 IP 地址一票」来算,那么任何能分配到大量 IP 的人都能颠覆它。工作量证明本质上是「一个 CPU 一票」。
The majority decision is represented by the longest chain, which has the greatest proof-of-work effort invested in it.
多数派的决定由最长的链代表,因为那条链上投入的工作量证明最多。只要多数算力由不合作攻击者之外的节点掌握,诚实链就会增长最快,把其他竞争链甩在后面。
难度调整只有一句,而且不含任何数字:
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.
“2016 个区块""每两周”这些参数都不在论文里。原文甚至只写了难度上调的方向,没写下调。
这一节假设你已经懂的东西: 工作量证明、Hashcash、SHA-256、前导零与目标值、暴力搜索、nonce(本节首次出现)、指数期望工作量与 O(1) 验证的不对称、区块链接(Prev Hash 字段)、沉没成本、女巫攻击与 IP 批量分配、投票代表权、最长链规则、累积工作量、难度、滑动平均、硬件速度增长。
自测为什么'一个 IP 一票'不可行,而'一个 CPU 一票'可行?
因为 IP 地址可以近乎免费地大量获取,投票权就成了资源分配能力的函数,攻击者可以凭空制造多数。算力不能凭空制造——每一票都对应真实的电力和硬件支出。工作量证明把投票权锚定在一个外部稀缺资源上。
自测原文给出的出块目标间隔是多少?
没有给。 第 4 节只说难度由滑动平均调整,目标是”每小时若干个区块”(an average number of blocks per hour),不含数字。“10 分钟”这个数只在第 7 节作为估算磁盘占用的假设条件出现一次。
5. Network:六步,全网协议就这么长
整个网络协议在原文里是六个编号步骤,一字不多。这是全文唯一的算法级枚举,值得逐条对照:
- New transactions are broadcast to all nodes.
- Each node collects new transactions into a block.
- Each node works on finding a difficult proof-of-work for its block.
- When a node finds a proof-of-work, it broadcasts the block to all nodes.
- Nodes accept the block only if all transactions in it are valid and not already spent.
- Nodes express their acceptance of the block by working on creating the next block in the chain, using the hash of the accepted block as the previous hash.
第 6 步是精巧之处:接受一个区块的表达方式,就是开始在它后面干活。没有投票消息,没有确认协议,没有签名表态。“同意”这个动作和”生产”这个动作是同一个动作。
Nodes always consider the longest chain to be the correct one and will keep working on extending it.
分叉的处理只有两句话:
If two nodes broadcast different versions of the next block simultaneously, some nodes may receive one or the other first. In that case, they work on the first one they received, but save the other branch in case it becomes longer. The tie will be broken when the next proof-of-work is found and one branch becomes longer; the nodes that were working on the other branch will then switch to the longer one.
如果两个节点同时广播了下一个区块的不同版本,有些节点会先收到其中一个。这时它们先在自己收到的那个分支上工作,但会把另一个分支保存下来,以防它后来变成更长的那条。
网络假设放得极松:
New transaction broadcasts do not necessarily need to reach all nodes. As long as they reach many nodes, they will get into a block before long. Block broadcasts are also tolerant of dropped messages.
消息可以丢,节点可以随时离线再回来——回来时只要接受最长链就自动补上了缺失的历史。这就是摘要里那句 “accepting the longest proof-of-work chain as proof of what happened while they were gone” 的兑现。
这一节假设你已经懂的东西: 广播/gossip 传播、交易池(隐含,未命名)、区块组装、有效性校验、“未被花费”检查(即 UTXO 语义,未命名)、竞争分支、平局打破、链重组、best-effort 投递与丢包容忍、节点补块、网络分区。
旁证:中本聪自己解释这一节在解什么问题
白皮书正文里 Byzantine 出现 0 次。但白皮书公布后第 13 天,中本聪在密码学邮件列表上回复 James A. Donald 时,第一句话就是:
The proof-of-work chain is a solution to the Byzantine Generals’ Problem.
然后他给了一个白皮书里完全没有的比喻。这段是理解第 5 节最好的材料,且出自原作者亲笔,值得全文引用:
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.
一群拜占庭将军各有一台电脑,想暴力破解国王的 wi-fi 密码。他们已经知道密码长度。一旦触发网络产生一个数据包,就必须在有限时间内破解进去把日志擦掉,否则会被发现、要吃苦头。而只有多数人同时开工,他们的总算力才够快。
注意这个设定的巧妙:“必须多数人同时动手”这个约束不是规则规定的,是物理决定的。算力不够就是破解不完,没有裁判来执行这条规则。
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.
他们并不在乎具体几点动手,只要都同意同一个时间就行。约定是:谁想喊就喊一个时间,最先听到的那个算官方时间。麻烦在于网络不是瞬时的——如果两个将军几乎同时喊出不同的时间,有人先听到这个,有人先听到那个。
这正是第 5 节那句 “If two nodes broadcast different versions of the next block simultaneously” 的原型,只是把”区块”换成了”进攻时间”。
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.
解法是用一条工作量证明链。每个将军收到他最先听见的那个进攻时间后,就让电脑去解一道极难的工作量证明题,题目的哈希里含着这个进攻时间。这道题难到:全体一起算,预计要 10 分钟才会有一个人算出来。谁先算出来就广播,其他人于是把这个证明并进自己正在算的哈希里。原来在算别的进攻时间的人会切过来,因为这条工作量证明链现在更长了。
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.
两小时后,一个进攻时间会被一条 12 个工作量证明组成的链哈希住。每个将军只要验证这条链的难度,就能估算出每小时投入了多少并行算力,从而看出:要在规定时间内产出这么多工作量证明,必须动用了多数电脑。
这是整段最关键的一句,也是白皮书里被压缩掉的那一步推理。工作量证明的真正产出不是”一个数字”,而是一份关于有多少人在协同工作的可验证证据。12 这个数字来自 10 分钟一个、两小时共 12 个。
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.
工作量证明链就是你问的所有同步问题、分布式数据库问题、全局视图问题的解法。
为什么这封邮件值得放进正文,而不是丢在延伸阅读里:它是同一作者、同一时期、直接解释本节机制的材料。白皮书把”这系统到底在解什么问题”这句话省掉了,读者只能自己拼。邮件把它补上了。
自测节点如何向网络表达'我接受这个区块'?
通过开始在它后面挖下一个区块,把它的哈希填入新区块的 prev hash 字段。没有独立的投票或确认消息——接受和生产是同一个动作,这让协议不需要任何协商轮次。
6. Incentive:这一节和你以为的不一样
By convention, the first transaction in a block is a special transaction that starts a new coin owned by the creator of the block.
出块奖励在原文里只有这一句,而且通篇没有出现 reward 这个词,也没有 coinbase。它是 “a special transaction”。
The incentive can also be funded with transaction fees. If the output value of a transaction is less than its input value, the difference is a transaction fee that is added to the incentive value of the block containing the transaction.
手续费的定义很干净:输入减输出的差额。
现在是关键部分。请仔细读这两句,它们放在一起讲了一件被广泛误传的事:
The steady addition of a constant of amount of new coins is analogous to gold miners expending resources to add gold to circulation. In our case, it is CPU time and electricity that is expended.
稳定新增固定数量的新币,类比于金矿开采者消耗资源把黄金投入流通。在这里被消耗的资源是 CPU 时间和电力。
Once a predetermined number of coins have entered circulation, the incentive can transition entirely to transaction fees and be completely inflation free.
这是全文唯一提到总量上限的地方,而且没有数字。 没有 21,000,000,没有 21 million。这个数字来自代码,不来自论文。
这一节结尾是一个博弈论论证,说明为什么掌握多数算力的攻击者仍会选择诚实:
He ought to find it more profitable to play by the rules, such rules that favour him with more new coins than everyone else combined, than to undermine the system and the validity of his own wealth.
攻击者如果有能力重写历史,他同时也有能力合法赚取最多的新币;而攻击会摧毁他自己持有资产的价值。这是”利益相关”式的安全论证——不是密码学保证,是经济激励对齐。
这一节假设你已经懂的东西: 铸币税、货币发行与流通、黄金开采类比、CPU 时间与电力成本、交易输入输出与差额、手续费、通胀、货币总量上限(概念上,无数值)、激励相容、理性攻击者、持币者的自我惩罚机制。
自测白皮书规定的比特币总量是多少?减半周期是多久?
都没有规定。 第 6 节只写”once a predetermined number of coins have entered circulation”,不给数值;而它对增发的描述是 “the steady addition of a constant of amount of new coins”——恒定速率,与减半相反。2100 万和四年减半都来自实现代码,不在论文中。
7. Reclaiming Disk Space:Merkle 树在这里才出场
To facilitate this without breaking the block’s hash, transactions are hashed in a Merkle Tree [7][2][5], with only the root included in the block’s hash. Old blocks can then be compacted by stubbing off branches of the tree. The interior hashes do not need to be stored.
Merkle 树在白皮书里的首要用途是省磁盘,不是轻钱包验证(那是下一节的事)。逻辑是:交易被埋得足够深之后内容可以丢弃,但区块头的哈希不能变——把交易组织成 Merkle 树,只把根放进区块头,就可以剪掉树枝而不动根。
然后是全文唯一的一串完整算术:
A block header with no transactions would be about 80 bytes. If we suppose blocks are generated every 10 minutes, 80 bytes * 6 * 24 * 365 = 4.2MB per year. With computer systems typically selling with 2GB of RAM as of 2008, and Moore’s Law predicting current growth of 1.2GB per year, storage should not be a problem even if the block headers must be kept in memory.
不含交易的区块头大约 80 字节。如果我们假设区块每 10 分钟生成一个,那么每年是 80 × 6 × 24 × 365 = 4.2MB。
这一节假设你已经懂的东西: 磁盘成本、确认深度(“buried under enough blocks”)、已花费交易的可丢弃性、Merkle 树(根、内部哈希、剪枝)、区块头与区块体的分离、80 字节头部的构成(未逐字段说明)、字节/MB/GB、RAM、摩尔定律。
自测白皮书里 Merkle 树的首要用途是什么?
回收磁盘空间(第 7 节标题就是 Reclaiming Disk Space)。因为只有根进入区块头哈希,旧交易可以被剪掉而不破坏区块头。轻钱包验证是第 8 节的用途,是同一结构的第二个红利。
8. Simplified Payment Verification:轻钱包的全部理论
It is possible to verify payments without running a full network node. A user only needs to keep a copy of the block headers of the longest proof-of-work chain, which he can get by querying network nodes until he’s convinced he has the longest chain, and obtain the Merkle branch linking the transaction to the block it’s timestamped in.
无需运行完整网络节点也能验证支付。用户只需保存最长工作量证明链的区块头副本,他可以不断向网络节点查询直到确信自己拿到的是最长链,然后取得把该交易挂到其所在区块上的 Merkle 分支。
轻客户端拿两样东西:区块头链,以及一条把自己那笔交易连到某个区块的 Merkle 路径。它验证不了交易本身有效,但能验证”全网确实把它打包进了最长链”,然后靠后续区块累积的工作量来提升信心。
原文很坦白地说出了这个模式的弱点:
As such, the verification is reliable as long as honest nodes control the network, but is more vulnerable if the network is overpowered by an attacker.
补救办法也只有一句:
One strategy to protect against this would be to accept alerts from network nodes when they detect an invalid block, prompting the user’s software to download the full block and alerted transactions to confirm the inconsistency.
一种防护策略是接受网络节点在检测到无效区块时发出的警报,提示用户的软件下载完整区块并核对不一致的交易。
对高频收款的商家,中本聪的建议是自己跑全节点:
Businesses that receive frequent payments will probably still want to run their own nodes for more independent security and quicker verification.
这一节假设你已经懂的东西: 全节点与轻客户端的区别、区块头链、Merkle 路径/包含性证明、向多个对等节点查询以确定最长链(隐含日食攻击风险,未命名)、确认数与概率安全、伪造交易、警报机制、独立验证的权衡。
自测轻客户端能验证什么,不能验证什么?
能验证:某笔交易被打包进了最长工作量证明链的某个区块(靠 Merkle 路径 + 区块头)。不能验证:那笔交易本身是否合法、输入是否已被花费。它把有效性判断外包给了”多数算力是诚实的”这个假设。
9. Combining and Splitting Value:为什么不怕历史爆炸
To allow value to be split and combined, transactions contain multiple inputs and outputs.
一笔交易可以有多个输入、多个输出。原文补了一句关于结构的量化断言:
Normally there will be either a single input from a larger previous transaction or multiple inputs combining smaller amounts, and at most two outputs: one for the payment, and one returning the change, if any, back to the sender.
通常情况下,要么是来自某笔更大的先前交易的单个输入,要么是多个凑成小额的输入;同时最多两个输出:一个给收款方,另一个是找零(如果有)退回给付款方。
然后是这一节的要点,回应一个真实的担忧:
It should be noted that fan-out, where a transaction depends on several transactions, and those transactions depend on many more, is not a problem here. There is never the need to extract a complete standalone copy of a transaction’s history.
如果每笔交易依赖多笔前序交易,而那些又各自依赖更多,历史会呈组合式膨胀。中本聪说这不成问题——因为从来不需要抽出一笔交易的完整独立历史。你不靠追溯来源来相信一笔钱,你靠它在最长链里的位置。
这一节假设你已经懂的东西: 可分性与最小单位、交易输入/输出、找零输出、多输入聚合、交易图/依赖 DAG、fan-out 的组合爆炸。
自测为什么交易依赖的 fan-out 不会导致数据爆炸?
因为验证一笔钱不需要它的完整来源历史。时间戳链已经证明了这笔交易被全网接受,所以不必沿依赖图回溯。原文:There is never the need to extract a complete standalone copy of a transaction’s history.
10. Privacy:论文承诺的隐私比你以为的少
The necessity to announce all transactions publicly precludes this method, but privacy can still be maintained by breaking the flow of information in another place: by keeping public keys anonymous.
传统金融隐私靠访问控制(只有银行和当事人看得见)。比特币不能用这条路——第 2 节已经论证过全局广播是必需的。于是隐私被移到另一个断点:公钥不与身份绑定。
The public can see that someone is sending an amount to someone else, but without information linking the transaction to anyone. This is similar to the level of information released by stock exchanges, where the time and size of individual trades, the “tape”, is made public, but without telling who the parties were.
公众能看到有人正在向另一个人转账某个金额,但看不到把这笔交易关联到具体身份的信息。这与证券交易所公布的信息层级相似:单笔交易的时间和规模(即「行情带」)是公开的,但交易双方是谁并不公开。
As an additional firewall, a new key pair should be used for each transaction to keep them from being linked to a common owner.
然后中本聪自己指出了这道防线的漏洞:
The risk is that if the owner of a key is revealed, linking could reveal other transactions that belonged to the same owner.
风险在于:一旦某个密钥的主人被认出来,关联分析就能顺着这条线把属于同一人的其他交易一并暴露。注意这里的因果方向——泄露不是从链上开始的,而是从链外的一次身份暴露开始,然后沿着链上已有的关联反向扩散。
Some linking is still unavoidable with multi-input transactions, which necessarily reveal that their inputs were owned by the same owner.
多输入交易带来的部分关联是无法避免的:把几笔钱凑在一起花,本身就宣告了这几笔钱属于同一个人。
值得注意的是原文用的词是 anonymous(形容 public key),而不是 pseudonymous。但它描述的机制、以及它自己承认的关联风险,实质上就是假名性。
这一节假设你已经懂的东西: 银行式隐私与访问控制、公开广播与隐私的固有张力、假名性、证券交易所的 tape、密钥复用与地址复用、多输入交易的共同所有权泄漏、去匿名化的链式扩散(taint/clustering,未命名)。
自测白皮书承诺的隐私水平是什么?
假名性,不是匿名。 公钥与身份不绑定,可见性类似交易所的 tape(时间和金额公开、对手方不公开)。原文明确承认两个漏洞:密钥所有者一旦暴露会牵连其他交易;多输入交易必然泄露这些输入同属一人。
11. Calculations:全文唯一的数学
这一节是白皮书的心脏。前十节是工程草图,只有这里有严格结论。
第一步:把攻防写成随机游走
The race between the honest chain and an attacker chain can be characterized as a Binomial Random Walk. The success event is the honest chain being extended by one block, increasing its lead by +1, and the failure event is the attacker’s chain being extended by one block, reducing the gap by -1.
诚实链领先的区块数是一个整数,每出一个块它 +1 或 -1。就这么简单。
第二步:赌徒破产问题给出闭式解
The probability of an attacker catching up from a given deficit is analogous to a Gambler’s Ruin problem. Suppose a gambler with unlimited credit starts at a deficit and plays potentially an infinite number of trials to try to reach breakeven. We can calculate the probability he ever reaches breakeven, or that an attacker ever catches up with the honest chain, as follows [8]:
三个记号:
p = probability an honest node finds the next block
q = probability the attacker finds the next block
qz = probability the attacker will ever catch up from z blocks behind
结论:
Given our assumption that p > q, the probability drops exponentially as the number of blocks the attacker has to catch up with increases. With the odds against him, if he doesn’t make a lucky lunge forward early on, his chances become vanishingly small as he falls further behind.
在我们假设 p > q 的前提下,攻击者需要追赶的区块数每增加一个,成功概率就指数下降。他一开始就落后,如果不能靠早期的一次幸运冲刺追上,机会会随着落后加深而趋于消失。
第三步:收款方不知道攻击者已经挖了多少
前面假设了攻击者落后 z 个块。但收款方看到 z 个确认时,并不知道攻击者在这段时间秘密挖出了几个。中本聪用泊松分布处理这个未知量:
He doesn’t know the exact amount of progress the attacker has made, but assuming the honest blocks took the average expected time per block, the attacker’s potential progress will be a Poisson distribution with expected value:
收款方不知道攻击者到底挖了多少。但只要假设那些诚实区块花的是每块的平均预期时间,攻击者可能的进度就服从一个泊松分布,其期望值为:
然后对攻击者可能的进度求全概率:
To get the probability the attacker could still catch up now, we multiply the Poisson density for each amount of progress he could have made by the probability he could catch up from that point:
要算出攻击者此刻仍能追平的概率,就把他可能取得的每一种进度的泊松密度,乘上从那个位置追平的概率:
最后一步是纯技巧——把无穷尾部换成有限求和:
Rearranging to avoid summing the infinite tail of the distribution…
重排一下,避免去求这个分布的无穷尾部……
第四步:代码和数字
原文直接给了 C 代码:
#include <math.h>
double AttackerSuccessProbability(double q, int z)
{
double p = 1.0 - q;
double lambda = z * (q / p);
double sum = 1.0;
int i, k;
for (k = 0; k <= z; k++)
{
double poisson = exp(-lambda);
for (i = 1; i <= k; i++)
poisson *= lambda / i;
sum -= poisson * (1 - pow(q / p, z - k));
}
return sum;
}
攻击者掌握 10% 算力时:
q=0.1
z=0 P=1.0000000
z=1 P=0.2045873
z=2 P=0.0509779
z=3 P=0.0131722
z=4 P=0.0034552
z=5 P=0.0009137
z=6 P=0.0002428
z=7 P=0.0000647
z=8 P=0.0000173
z=9 P=0.0000046
z=10 P=0.0000012
掌握 30% 算力时(注意步长变成 5):
q=0.3
z=0 P=1.0000000
z=5 P=0.1773523
z=10 P=0.0416605
z=15 P=0.0101008
z=20 P=0.0024804
z=25 P=0.0006132
z=30 P=0.0001522
z=35 P=0.0000379
z=40 P=0.0000095
z=45 P=0.0000024
z=50 P=0.0000006
反过来解:要把成功概率压到 0.1% 以下需要几个确认?
Solving for P less than 0.1%…
求解使 P 小于 0.1% 的取值……
P < 0.001
q=0.10 z=5
q=0.15 z=8
q=0.20 z=11
q=0.25 z=15
q=0.30 z=24
q=0.35 z=41
q=0.40 z=89
q=0.45 z=340
这一节还藏着一个实践建议,讲的是收款方该如何防范预先挖好的攻击链:
The receiver generates a new key pair and gives the public key to the sender shortly before signing. This prevents the sender from preparing a chain of blocks ahead of time by working on it continuously until he is lucky enough to get far enough ahead, then executing the transaction at that moment.
这一节假设你已经懂的东西: 二项随机游走、赌徒破产(无限信用、回本、无限次试验)、泊松分布与密度 λ^k e^(−λ)/k!、期望值 λ、无穷级数重排、条件概率与全概率公式、指数衰减、p/q/z 记号、p = 1−q 的归一化、泊松近似的前提、C 语言与 math.h、浮点精度、攻击者秘密并行挖链、临时密钥对。
自测攻击者掌握 45% 算力时,需要多少确认才能把双花成功率压到 0.1% 以下?这说明了什么?
340 个确认。 说明安全性不存在 50% 的硬阈值——低于半数算力的攻击者依然有实质成功概率,只是需要收款方等待更久。“51% 攻击”是通俗叙事,论文给的是一条连续的概率曲线。
自测为什么要把无穷求和重排成 1 减去有限求和?
因为 k > z 的所有项追平概率都是 1,直接加需要求无穷多项,无法在计算机上算。改成”1 − 攻击者失败的概率”后,求和范围收缩到 k = 0…z,成为有限步计算。纯粹是可计算性技巧,不改变结果。
12. Conclusion:中本聪自己的总结
We have proposed a system for electronic transactions without relying on trust. We started with the usual framework of coins made from digital signatures, which provides strong control of ownership, but is incomplete without a way to prevent double-spending. To solve this, we proposed a peer-to-peer network using proof-of-work to record a public history of transactions that quickly becomes computationally impractical for an attacker to change if honest nodes control a majority of CPU power.
我们提出了一套不依赖信任的电子交易系统。
The network is robust in its unstructured simplicity. Nodes work all at once with little coordination. They do not need to be identified, since messages are not routed to any particular place and only need to be delivered on a best effort basis.
“无结构的简单性”是中本聪对自己设计的评价,我认为这是他最自豪的一句。节点不需要身份,因为消息不需要路由到特定地点——这个性质让网络可以任意进出而无需注册、无需成员管理。
Nodes can leave and rejoin the network at will, accepting the proof-of-work chain as proof of what happened while they were gone. They vote with their CPU power, expressing their acceptance of valid blocks by working on extending them and rejecting invalid blocks by refusing to work on them. Any needed rules and incentives can be enforced with this consensus mechanism.
节点可以随意离开和重新加入网络,回来时只要接受工作量证明链作为它离开期间发生了什么的证明即可。
最后一句话的野心值得注意:“任何需要的规则和激励都可以用这个共识机制来强制执行”——他知道自己造的不只是一个支付系统,而是一台可以执行任意规则的机器。
自测原文对安全性的表述是'不可能被修改'还是别的?
是 computationally impractical(计算上不可行),且附带前提”if honest nodes control a majority of CPU power”。这是成本论证,不是密码学不可能性。第 11 节的表格给出的正是这个成本的量化形式。
References:八条,一条数学
原文的参考文献不带编号章节标题,独占第九页。
[1] W. Dai, "b-money," http://www.weidai.com/bmoney.txt, 1998.
[2] H. Massias, X.S. Avila, and J.-J. Quisquater, "Design of a secure timestamping service with minimal
trust requirements," In 20th Symposium on Information Theory in the Benelux, May 1999.
[3] S. Haber, W.S. Stornetta, "How to time-stamp a digital document," In Journal of Cryptology, vol 3, no
2, pages 99-111, 1991.
[4] D. Bayer, S. Haber, W.S. Stornetta, "Improving the efficiency and reliability of digital time-stamping,"
In Sequences II: Methods in Communication, Security and Computer Science, pages 329-334, 1993.
[5] S. Haber, W.S. Stornetta, "Secure names for bit-strings," In Proceedings of the 4th ACM Conference
on Computer and Communications Security, pages 28-35, April 1997.
[6] A. Back, "Hashcash - a denial of service counter-measure,"
http://www.hashcash.org/papers/hashcash.pdf, 2002.
[7] R.C. Merkle, "Protocols for public key cryptosystems," In Proc. 1980 Symposium on Security and
Privacy, IEEE Computer Society, pages 122-133, April 1980.
[8] W. Feller, "An introduction to probability theory and its applications," 1957.
引用分布本身有信息量:[2]–[5] 四条全是时间戳文献,[6] 是工作量证明,[7] 是 Merkle 树,[8] 是概率论。也就是说白皮书的技术零件全部是现成的,中本聪的贡献是组装方式。
附:论文没说,但常被说成它说了的
这一节是逐字检索的结果。我在 PDF 全文里搜过每一个词。
| 流行说法 | 原文实况 |
|---|---|
| 提出了”51% 攻击” | 字符串 51 出现 0 次。原文条件是 p > q 与 “a majority of CPU power”。而 q=0.45 z=340 那一行说明 50% 不是阈值 |
| 用了 blockchain 这个词 | blockchain 0 次,分写的 block chain 也 0 次。只有 chain、the longest chain、chain of blocks |
| 规定总量 2100 万 | 21 million / 21,000,000 均 0 次。只有 “a predetermined number of coins” |
| 规定奖励每四年减半 | halv* 0 次、reward 0 次。第 6 节反而说 “the steady addition of a constant of amount of new coins” |
| 规定 10 分钟出块 | 10 minutes 出现 1 次,在第 7 节,且是假设句 “If we suppose blocks are generated every 10 minutes”。第 4 节讲难度只说 “an average number of blocks per hour”,不含数字 |
| 规定 2016 块 / 两周调整难度 | 2016、two weeks 均 0 次 |
| 规定 1MB 区块上限 | 全文唯一的 MB 是 4.2MB。没有任何区块大小上限 |
| 剪枝后只需 2 个哈希 | 原文只说 “The interior hashes do not need to be stored”。图中剪掉 Tx0-2 后保留 3 个哈希 + Tx3 |
| 用了 SPV 这个缩写 | SPV 0 次,只有标题的全称 |
| 提到 ECDSA / 椭圆曲线 | 均 0 次。只有泛称 digital signatures;SHA-256 也只是 “such as with SHA-256” 的举例 |
| 用了 decentralized / trustless / ledger / wallet | 逐一核查:decentral* 0、trustless 0、ledger 0、wallet 0、Byzantine 0、fork 0、coinbase 0、genesis 0、UTXO 0、cryptocurrency 0、smart contract 0 |
| 把节点叫 miner | miners 1 次(仅在黄金类比 “analogous to gold miners expending resources” 中),mining 作为独立单词 0 次。论文从不称节点为矿工,只叫 node |
| 说了”累积工作量最大的链” | 原文说 the longest chain,并解释为 “which has the greatest proof-of-work effort invested in it”,把两者当同义。难度可变后二者不再等价——这是论文的隐含缺口 |
| 承诺匿名 | 用词是 “keeping public keys anonymous”,同时明确承认 “Some linking is still unavoidable with multi-input transactions”。是有限假名性,不是匿名承诺 |
自测'比特币白皮书发明了区块链'这句话错在哪?
两处。一,blockchain 这个词(连分写形式)在九页原文里一次都没出现。二,链式哈希时间戳是 Haber 和 Stornetta 1991 年的工作,白皮书第 3 节明确引用了 [2]–[5]。中本聪的贡献是把时间戳链、工作量证明、点对点广播和经济激励组装成一个能在开放网络里自洽运行的系统。
拿它去用
迁移有人跟你说「比特币是匿名的」。用论文第 10 节的原文判断这句话对不对。
不对,论文自己说的是假名不是匿名。
第 10 节的原话是公众能看到「someone is sending an amount to someone else」——交易全部公开,只是公钥不直接绑定身份。中本聪明确提示了两处泄露:多输入交易会暴露这些输入同属一人(这就是后来地址聚类分析的基础),以及公钥重用会把一个人的交易串起来。
所以正确表述是「假名 + 公开账本」,而这个组合在实践中比匿名更弱——链上数据永久留存,一次身份关联就能回溯全部历史。论文对此是诚实的,通俗报道不是。
定量边界第 11 节算出攻击者追赶概率随区块数指数下降。一个交易所说「我们等 6 个确认,所以绝对安全」。这句话的问题在哪?
问题在「绝对」,以及它省掉了论文那个计算的前提。
第 11 节的推导明确假设 p > q——诚实节点算力占多数。6 个确认给出的是在这个假设成立时攻击成功概率已经很小(论文给了 q=0.1 和 q=0.3 两组表格)。它不是一个与算力分布无关的安全常数。
如果攻击者掌握接近或超过半数算力,指数下降的结论整个失效——这就是 51% 攻击,不是漏洞而是模型前提被违反。所以准确说法是「在算力分布健康的前提下,6 个确认把重组风险降到可接受」,而这两个限定词都不能省。
追踪信任假设论文第 7 节讲用 Merkle 树剪枝,第 8 节讲简化支付验证(SPV)。手机钱包不存全链却能验证收款——它相信了什么?
它相信了最长链的区块头序列是诚实的。
SPV 客户端只下载区块头(每个约 80 字节),加上一条 Merkle 分支来证明「我这笔交易在这个区块里」。它没有验证那个区块里其他交易的有效性,也没有验证发送方是否真有那笔钱。
中本聪在第 8 节明确写了这个弱点,并给了缓解方向:从网络节点接受警报。所以 SPV 的安全性不是密码学保证的,是经济假设保证的——依赖多数算力诚实。全节点验证的是规则,SPV 信任的是多数。
这个区分决定了实际选择:小额支付用 SPV 合理,大额结算应当自己跑全节点。
继续读什么
按与原文的关系分组,每组内由浅入深。每条都说明为什么值得读——书单不给理由就只是摆设。
上游这篇论文站在谁的肩膀上
Hashcash - a denial of service counter-measure进阶
白皮书第四节的工作量证明直接引自这篇。八页,读完就明白"前导零"这个设计不是中本聪首创,原本是用来反垃圾邮件的
Bitcoin P2P e-cash paper(2008-11-13 邮件列表回复)入门
白皮书正文 Byzantine 出现 0 次,中本聪却在这封邮件里说工作量证明链就是拜占庭将军问题的解,并给了一个白皮书里没有的比喻。本文第 5 节已全文引用,这里给一手出处
How to Time-Stamp a Digital Document进阶
白皮书引用次数最多的一篇(8 条参考文献里占 3 条)。第 3 节那句"把报纸公示搬到网络上"的原型就在这里,读完会发现哈希链本身并非比特币的发明
An Introduction to Probability Theory and Its Applications, Vol. 1深入
白皮书唯一的数学参考文献。第十四章讲随机游走与赌徒破产,第 11 节那个 (q/p)^z 的来处就在那里——原文直接引用而没有证明
平行同一个问题的另一种答卷
The Byzantine Generals Problem深入
同一个问题的另一份答卷,比白皮书早 26 年。它给的是 3m+1 容错下界且要求参与者名单已知;中本聪用开放准入加经济激励换掉了名单。并排读才看清"去中心化"在两篇里不是同一个意思
下游这个想法后来变成了什么
精通比特币(Mastering Bitcoin,第 3 版)入门
白皮书只给机制骨架,这本给出真实字段、脚本和交易结构。想知道"80 字节区块头"具体装了什么就看它
Bitcoin and Cryptocurrency Technologies进阶
普林斯顿的公开课教材,把白皮书省略的部分(激励博弈、匿名性攻击、真实网络行为)补成完整课程
反面质疑或限制原文结论的材料
Majority is not Enough: Bitcoin Mining is Vulnerable深入
直接动摇第 11 节的模型。白皮书假设诚实节点会立刻广播出块,这篇证明"自私挖矿"策略下,掌握远低于 50% 算力的矿池也能拿到超额收益——p > q 这个安全边界比原文以为的更脆
On the Instability of Bitcoin Without the Block Reward深入
另一个反面材料。第 6 节说手续费终将取代新币奖励,这篇论证一旦只剩手续费,出块激励会变得不稳定——原文那句轻描淡写的过渡藏着一个未解决的问题
来源
- Bitcoin: A Peer-to-Peer Electronic Cash System (PDF)bitcoin.org
- Bitcoin whitepaper (HTML 转录本)Satoshi Nakamoto Institute
- Hashcash - a denial of service counter-measureAdam Back, 2002
- b-moneyWei Dai, 1998