Bitcoin: A Peer-to-Peer Electronic Cash System
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. We propose a solution to the double-spending problem using a peer-to-peer network. 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.
一个纯粹的点对点电子现金系统将允许在线支付直接从一方发送到另一方,而无需通过金融机构。数字签名提供了部分解决方案,但如果仍然需要一个可信的第三方来防止双重支付,那么主要的好处就丧失了。我们提出了一种使用点对点网络来解决双重支付问题的方案。该网络通过将交易哈希到一条不断增长的、基于哈希的工作量证明链中来给交易打上时间戳,形成一条不重做工作量证明就无法更改的记录。
Commerce on the Internet has come to rely almost exclusively on financial institutions serving as trusted third parties to process electronic payments. While the system works well enough for most transactions, it still suffers from the inherent weaknesses of the trust-based model. Completely non-reversible transactions are not really possible, since financial institutions cannot avoid mediating disputes. The cost of mediation increases transaction costs, limiting the minimum practical transaction size and cutting off the possibility for small casual 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. A payee can verify the signatures to verify the chain of ownership.
我们将一枚电子货币定义为一条数字签名链。每个所有者通过对前一笔交易的哈希和下一个所有者的公钥进行数字签名,并将这些添加到货币的末端,从而将货币转移给下一个人。收款人可以通过验证签名来验证所有权链。
The solution we propose begins with a timestamp server. A timestamp server works by taking a hash of a block of items to be timestamped and widely publishing the hash. The timestamp proves that the data must have existed at the time in order to get into the hash. Each timestamp includes the previous timestamp in its hash, forming a chain, with each additional timestamp reinforcing the ones before it.
我们提出的解决方案始于一个时间戳服务器。时间戳服务器的工作方式是对要打时间戳的一组数据项的区块取哈希值,并广泛发布该哈希。时间戳证明了该数据在那个时间点必然已经存在,才能被纳入哈希。每个时间戳在其哈希中包含前一个时间戳,形成一条链,每个额外的时间戳都加强了在它之前的那些。
To implement a distributed timestamp server on a peer-to-peer basis, we will need to use a proof-of-work system. The proof-of-work involves scanning for a value that when hashed, 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.
为了在点对点的基础上实现分布式时间戳服务器,我们需要使用工作量证明系统。工作量证明涉及扫描一个值,使其哈希后以若干个零位开头。所需的平均工作量与所要求的零位数成指数关系,但可以通过执行一次哈希来验证。对于我们的时间戳网络,我们通过在区块中递增一个随机数来实现工作量证明,直到找到一个使区块哈希满足所要求零位数的值。一旦花费了 CPU 算力使其满足工作量证明,该区块就无法在不重做工作的情况下被更改。
The steps to run the network are as follows: 1) New transactions are broadcast to all nodes. 2) Each node collects new transactions into a block. 3) Each node works on finding a difficult proof-of-work for its block. 4) When a node finds a proof-of-work, it broadcasts the block to all nodes. 5) Nodes accept the block only if all transactions in it are valid and not already spent. 6) 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.
运行网络的步骤如下:1)新交易被广播到所有节点。2)每个节点将新交易收集到一个区块中。3)每个节点为其区块寻找一个困难的工作量证明。4)当一个节点找到工作量证明时,它将该区块广播给所有节点。5)节点仅在区块中的所有交易都有效且尚未被花费的情况下才接受该区块。6)节点通过使用已接受区块的哈希作为前一个哈希来创建链中的下一个区块,以此表达对该区块的接受。
By convention, the first transaction in a block is a special transaction that starts a new coin owned by the creator of the block. This adds an incentive for nodes to support the network, and provides a way to initially distribute coins into circulation, since there is no central authority to issue them. The steady addition of a constant 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.
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. Once a predetermined number of coins have entered circulation, the incentive can transition entirely to transaction fees and be completely inflation free.
The incentive may help encourage nodes to stay honest. If a greedy attacker is able to assemble more CPU power than all the honest nodes, he would have to choose between using it to defraud people by stealing back his payments, or using it to generate new coins. 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 时间和电力。
激励也可以通过交易手续费来资助。如果一笔交易的输出值小于其输入值,差额就是交易手续费,会被加到包含该交易的区块的激励价值中。一旦预定数量的货币已经进入流通,激励就可以完全转变为交易手续费,并且完全没有通货膨胀。
激励可能有助于鼓励节点保持诚实。如果一个贪婪的攻击者能够集结比所有诚实节点更多的 CPU 算力,他将不得不在用它来通过偷回自己的支付来欺骗人们,还是用它来生成新币之间做出选择。他应该会发现按照规则行事更有利可图——这些规则使他获得的新币比其他所有人加起来都多——而不是破坏系统和他自己财富的有效性。
Once the latest transaction in a coin is buried under enough blocks, the spent transactions before it can be discarded to save disk space. To facilitate this without breaking the block's hash, transactions are hashed in a Merkle Tree, 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.
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。以 2008 年计算机系统通常配备 2GB 内存来看,加上摩尔定律预测的每年 1.2GB 的增长,即使区块头必须保存在内存中,存储也不会成为问题。
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. He can't check the transaction for himself, but by linking it to a place in the chain, he can see that a network node has accepted it, and blocks added after it further confirm the network has accepted it.
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. While network nodes can verify transactions for themselves, the simplified method can be fooled by an attacker's fabricated transactions for as long as the attacker can continue to overpower the network. 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.
不运行完整网络节点也可以验证支付。用户只需要保留最长工作量证明链的区块头副本——他可以通过查询网络节点直到确信自己拥有最长链来获取——并获得将交易链接到其所在区块的默克尔分支。他无法自己检查交易,但通过将交易链接到链中的一个位置,他可以看到一个网络节点已经接受了它,而之后添加的区块进一步确认网络已经接受了它。
因此,只要诚实节点控制着网络,验证就是可靠的,但如果网络被攻击者压制,则更容易受到攻击。虽然网络节点可以自己验证交易,但只要攻击者能够继续压制网络,简化方法就可能被攻击者伪造的交易所欺骗。一种防御策略是在网络节点检测到无效区块时接受来自它们的警报,提示用户的软件下载完整区块和被警报的交易以确认不一致。
Although it would be possible to handle coins individually, it would be unwieldy to make a separate transaction for every cent in a transfer. 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.
虽然可以单独处理每一枚币,但为每次转账中的每一分钱都单独创建一笔交易是不切实际的。为了允许价值的拆分和合并,交易包含多个输入和输出。通常会有一个来自较大前序交易的单个输入或多个合并较小金额的输入,以及最多两个输出:一个用于支付,一个将找零(如果有的话)退还给发送者。
应该注意的是,扇出——一笔交易依赖于多笔交易,而那些交易又依赖于更多交易——在这里不是问题。永远不需要提取一笔交易历史的完整独立副本。
The traditional banking model achieves a level of privacy by limiting access to information to the parties involved and the trusted third party. 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. 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. Some linking is still unavoidable with multi-input transactions, which necessarily reveal that their inputs were owned by the same owner. The risk is that if the owner of a key is revealed, linking could reveal other transactions that belonged to the same owner.
传统银行模型通过限制相关方和可信第三方对信息的访问来实现一定程度的隐私。公开宣布所有交易的必要性排除了这种方法,但仍然可以通过在另一个地方打断信息流来维护隐私:保持公钥匿名。公众可以看到有人向另一个人发送了一笔金额,但没有将交易与任何人联系起来的信息。这类似于证券交易所发布的信息级别,其中单笔交易的时间和规模——"记录带"——是公开的,但不会透露交易方的身份。
作为额外的防火墙,每笔交易都应该使用一个新的密钥对,以防止它们被链接到一个共同的所有者。对于多输入交易,一些链接仍然是不可避免的,因为它们必然揭示其输入属于同一个所有者。风险在于,如果一个密钥的所有者被揭露,链接可能会揭示属于同一所有者的其他交易。
We consider the scenario of an attacker trying to generate an alternate chain faster than the honest chain. Even if this is accomplished, it does not throw the system open to arbitrary changes, such as creating value out of thin air or taking money that never belonged to the attacker. Nodes are not going to accept an invalid transaction as payment, and honest nodes will never accept a block containing them. An attacker can only try to change one of his own transactions to take back money he recently spent.
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. 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.
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.
我们考虑一个攻击者试图比诚实链更快地生成替代链的场景。即使做到了这一点,也不会使系统对任意更改开放,比如凭空创造价值或拿走从不属于攻击者的钱。节点不会接受无效交易作为支付,诚实节点永远不会接受包含它们的区块。攻击者只能尝试更改自己的交易之一,以取回他最近花费的钱。
诚实链与攻击者链之间的竞赛可以被描述为二项随机游走。成功事件是诚实链延伸一个区块,其领先优势增加 +1;失败事件是攻击者的链延伸一个区块,差距减少 -1。攻击者从给定差距追赶上来的概率类似于赌徒破产问题。假设一个拥有无限信用的赌徒从亏损开始,进行可能无限次的尝试以达到收支平衡。我们可以计算他达到收支平衡的概率,或者攻击者追上诚实链的概率。
鉴于我们假设 p > q,随着攻击者需要追赶的区块数量增加,概率呈指数级下降。在胜算不利于他的情况下,如果他不能在早期就幸运地向前冲刺,随着他越来越落后,他的机会变得微乎其微。
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.
我们提出了一个不依赖信任的电子交易系统。我们从数字签名构成的通常框架出发,这提供了对所有权的强有力控制,但如果没有防止双重支付的方法就是不完整的。为了解决这个问题,我们提出了一个使用工作量证明的点对点网络来记录交易的公开历史,如果诚实节点控制了大部分 CPU 算力,这些记录很快就会变得在计算上对攻击者来说不切实际去更改。该网络在其非结构化的简洁性中是健壮的。节点同时工作,几乎不需要协调。它们不需要被识别,因为消息不会被路由到任何特定的地方,只需要在尽力而为的基础上被传递。