原始文献 / 论坛帖 / Re: Fees in BitDNS confusion

Re: Fees in BitDNS confusion

Bitcointalk · 2010-12-09 23:58:54 UTC

AuthorSatoshi Nakamoto
TitleRe: Fees in BitDNS confusion
Date2010-12-09 23:58:54 UTC
ForumBitcointalk · 原文

不是 locktime。

有个很久以后的可能设计:

你故意写一笔双重支付。输入输出都一样,这次带上手续费。当你的双重支付进了区块,第一笔支付就失效了。收款人其实察觉不到,因为新交易生效的那一刻旧交易失效,新交易直接顶替它的位置。

说起来容易做起来难。要做出能正确写双重支付的客户端,得做不少工作:在钱包里管理两个版本直到其中一个被选中、处理所有边界情况。现有代码里的每个假设都是“你不会写双重支付”。

比特币矿工那边也得改,交易池才有可能接受双重支付,但严格限定:输入输出必须一致且手续费更高。目前双重支付永远进不了交易池,所以每个节点都以“把先看到的那笔交易打进区块”为证。

英文原文

Not locktime.

There's a possible design for far in the future:

You intentionally write a double-spend.  You write it with the same inputs and outputs, but this time with a fee.  When your double-spend gets into a block, the first spend becomes invalid.  The payee does not really notice, because at the moment the new transaction becomes valid, the old one becomes invalid, and the new transaction simply takes its place.

It's easier said than implemented.  There would be a fair amount of work to make a client that correctly writes the double-spend, manages the two versions in the wallet until one is chosen, handles all the corner cases.  Every assumption in the existing code is that you're not trying to write double-spends.

There would need to be some changes on the Bitcoin Miner side also, to make the possibility to accept a double-spend into the transaction pool, but only strictly if the inputs and outputs match and the transaction fee is higher.  Currently, double-spends are never accepted into the transaction pool, so every node bears witness to which transaction it saw first by working to put it into a block.