交易
19 条名言。中文为本站译文,每条附日期与原文链接。
我们需要一种办法,让收款人确信之前的拥有者没有签署过更早的交易。对我们而言,最早的交易才是有效的,所以我们不关心之后的双重支付企图。确认一笔交易不存在的唯一办法,就是知晓所有交易。在基于铸币厂的模型中,铸币厂知晓所有交易,并决定哪笔先到。要在没有可信方的情况下实现这一点,交易必须公开广播,并且需要一个让参与者就交易被接收顺序的唯一历史达成一致的系统。收款人需要证明:在每笔交易发生时,大多数节点都同意它是先被接收的那笔。
英文原文
We need a way for the payee to know that the previous owners did not sign any earlier transactions. For our purposes, the earliest transaction is the one that counts, so we don't care about later attempts to double-spend. The only way to confirm the absence of a transaction is to be aware of all transactions. In the mint based model, the mint was aware of all transactions and decided which arrived first. To accomplish this without a trusted party, transactions must be publicly announced, and we need a system for participants to agree on a single history of the order in which they were received. The payee needs proof that at the time of each transaction, the majority of nodes agreed it was the first received.
我们把电子货币定义为一条数字签名链。每位拥有者将电子货币转让给下一位时,会对上一笔交易的哈希和下一位拥有者的公钥进行数字签名,并将签名附加到货币末尾。收款人可以通过验证签名来验证所有权链。
英文原文
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.
值得注意的是,分叉(fan-out)在这里不是问题:即便一笔交易依赖于几笔交易,而那几笔交易又依赖于更多交易,也无妨。我们从不需要提取一笔交易的完整独立历史副本。
英文原文
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.
虽然可以逐个处理每枚货币,但为每分钱都单独做一笔交易太过笨拙。为了实现价值的拆分与合并,交易包含多个输入和输出。通常要么是来自一笔较大先前交易的单个输入,要么是合并多个小额的多个输入;输出至多两个:一个用于付款,另一个将找零(如果有)返还给发送者。
英文原文
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.
新交易广播不一定非要触达所有节点。只要触达足够多的节点,它很快就会被纳入某个区块。区块广播对丢包也有容忍度。如果某个节点没收到某个区块,它在收到下一个区块并发现自己漏了一个时,会主动请求补回。
英文原文
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. If a node does not receive a block, it will request it when it receives the next block and realizes it missed one.
我们提出的方案始于一台时间戳服务器。时间戳服务器的工作方式是:对一批待加时间戳的条目取哈希,然后广泛公布该哈希,比如发表在报纸或 Usenet 帖子中。时间戳证明了数据在当时必然已经存在——显然,只有存在的数据才能被哈希。每个时间戳都会在自己的哈希中包含前一个时间戳,从而形成一条链,每新增一个时间戳都会强化之前的所有时间戳。
英文原文
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, such as in a newspaper or Usenet post. The timestamp proves that the data must have existed at the time, obviously, 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.
传统银行模式通过将信息访问限制在相关方和可信第三方之间来实现一定程度的隐私。公开广播所有交易的要求排除了这种做法,但隐私仍可在另一处切断信息流来维持:保持公钥匿名。公众能看到有人把一笔钱转给了另一个人,但无法将交易与任何人关联起来。这类似于证券交易所披露的信息:每笔交易的时间和金额(即“纸带”)公开,但不透露交易双方是谁。
英文原文
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.
如果交易需要多等一个或几个周期才能进入区块,也不是问题。
英文原文
It's not a problem if transactions have to wait one or a few extra cycles to get into a block.
交易接收者通常需要持有交易约一小时或更久,以便让这种可能性有时间消除。他们仍可以立即转手这些币,但在发货等行动之前应当等待。
英文原文
Receivers of transactions will normally need to hold transactions for perhaps an hour or more to allow time for this kind of possibility to be resolved. They can still re-spend the coins immediately, but they should wait before taking an action such as shipping goods.
接收者只需沿区块链向后验证到足够深的深度,这通常只需要 2 笔交易的深度。此前的所有交易都可以丢弃。
英文原文
The recipient just needs to verify it back to a depth that is sufficiently far back in the block chain, which will often only require a depth of 2 transactions. All transactions before that can be discarded.
即时不可否认性并非其特性,但它依然比现有系统快得多。纸质支票可能一两周后才跳票。信用卡交易在 60 到 180 天内都可能被撤销。而比特币交易在一两小时内就可达到充分的不可逆转。
英文原文
Instantant non-repudiability is not a feature, but it's still much faster than existing systems. Paper cheques can bounce up to a week or two later. Credit card transactions can be contested up to 60 to 180 days later. Bitcoin transactions can be sufficiently irreversible in an hour or two.
基本交易就是第 2 节图中所见的样子:一个(买方)签名,满足上一笔交易中的公钥条件;以及一个(卖方)新公钥,下次花费时必须满足该公钥条件。
英文原文
A basic transaction is just what you see in the figure in section 2. A signature (of the buyer) satisfying the public key of the previous transaction, and a new public key (of the seller) that must be satisfied to spend it the next time.
如果商家真的遇到盗窃问题,可以让顾客等 2 分钟,或者等一封电子邮件,许多商家本来就这样做。如果想进一步优化,比如是大文件下载,他们可以在交易被证实为双重支付时中途取消下载。如果是网站访问,通常让顾客先用 5 分钟再视情况切断也不是什么大事——反正很多这类网站都有免费试用。
英文原文
If a merchant actually has a problem with theft, they can make the customer wait 2 minutes, or wait for something in e-mail, which many already do. If they really want to optimize, and it's a large download, they could cancel the download in the middle if the transaction comes back double-spent. If it's website access, typically it wouldn't be a big deal to let the customer have access for 5 minutes and then cut off access if it's rejected. Many such sites have a free trial anyway.
发送资金有两种方式。如果接收者在线,你可以输入其 IP 地址,它会自动连接、获取一个新的公钥,并附带留言发送交易。如果接收者不在线,可以发送到其比特币地址,即他们提供给你的公钥哈希。他们下次联网并收到包含该交易的区块时就能收到这笔钱。这种方式的缺点是无法附带留言信息,且地址多次使用会损失一些隐私,但如果双方不能同时在线,或接收者无法接受外来连接,这仍是一个实用的备选方案。
英文原文
There are two ways to send money. If the recipient is online, you can enter their IP address and it will connect, get a new public key and send the transaction with comments. If the recipient is not online, it is possible to send to their Bitcoin address, which is a hash of their public key that they give you. They'll receive the transaction the next time they connect and get the block it's in. This method has the disadvantage that no comment information is sent, and a bit of privacy may be lost if the address is used multiple times, but it is a useful alternative if both users can't be online at the same time or the recipient can't receive incoming connections.
数字货币包含其拥有者的公钥。转让时,拥有者对该货币连同下一位拥有者的公钥进行签名。任何人都可以通过检查签名来验证所有权链。
英文原文
A digital coin contains the public key of its owner. To transfer it, the owner signs the coin together with the public key of the next owner. Anyone can check the signatures to verify the chain of ownership.
为了更好的隐私,比特币地址最好只使用一次。
英文原文
For greater privacy, it's best to use bitcoin addresses only once.
这在销售终端会很实用。收银机在屏幕上显示一个编码了比特币地址和金额的二维码,你用手机拍下即可。
英文原文
That would be nice at point-of-sale. The cash register displays a QR-code encoding a bitcoin address and amount on a screen and you photo it with your mobile.
设计支持非常丰富的可能交易类型,都是我多年前就设计好的。托管交易、保证合约、第三方仲裁、多方签名等。如果比特币大规模流行起来,这些都是未来我们想探索的方向,但它们都必须在最初就设计好,以确保日后能够实现。
英文原文
The design supports a tremendous variety of possible transaction types that I designed years ago. Escrow transactions, bonded contracts, third party arbitration, multi-party signature, etc. If Bitcoin catches on in a big way, these are things we'll want to explore in the future, but they all had to be designed at the beginning to make sure they would be possible later.
正如你发现的,根本问题在于:在交易至少获得 1 个确认之前,我们不该将其计入余额或花掉。0 确认/未确认的交易是彻底的二等公民。它们最多只能作为“已收到某笔资金”的提示,把它们计入余额或花掉都为时尚早。
英文原文
As you figured out, the root problem is we shouldn't be counting or spending transactions until they have at least 1 confirmation. 0/unconfirmed transactions are very much second class citizens. At most, they are advice that something has been received, but counting them as balance or spending them is premature.
