原始文献 / 邮件 / Bitcoin P2P e-cash paper
Bitcoin P2P e-cash paper
Cryptography Mailing List · 2008-11-09 01:58:48 UTC
Hal Finney 写道:
> 文中提到,如果广播的交易没有传达到所有节点,也没关系,因为它很快就会进入区块链。这是如何发生的——如果创建"下一个"区块的节点(第一个找到 hashcash 碰撞的节点)没有听到这笔交易,之后又有几个区块被同样没听到该交易的节点添加进去呢?所有听到这笔交易的节点是否都会保留它,希望自己运气好找到下一次碰撞、成为出块者时把它纳入区块?
没错,节点会把交易保留在工作集中,直到它们进入区块。如果一笔交易传达到了90%的节点,那么每当发现一个新区块,它就有90%的概率被包含在内。
或者举例来说,如果一个节点在等待看哪条链增长最快的过程中同时保留两条或多条链,而此时到来一个属于链A的区块,其中包含对链B中某币的双重支付,系统会检查这种情况吗?(这可能发生在有人双重支付、两组不同节点分别听到同一枚币的两笔不同交易时。)
这不需要检查。最终胜出的分支中的那笔交易成为有效交易,另一笔无效。如果有人试图这样双重支付,最终总有且仅有一笔支付有效,其余无效。
交易收款方通常需要等待一小时左右,让这类可能性有时间解决。他们仍可以立即再花掉这些币,但在采取发货等行动前应先等待。
我也不太明白,一个能集结超过所有诚实参与者算力的强大攻击者,究竟如何实现双重支付或取消交易。我看到他可以创建新区块并添加到最长链上,但他如何抹去或添加链中的旧交易?当攻击者发送他的新区块时,诚实节点难道不会做一致性检查,以确保没有任何内容被抹去吗?多解释一下这种攻击会很有帮助,以便判断攻击者的收益是否比简单地用他的算力诚实地铸造新币更高。
攻击者不是在末尾追加区块。他必须回过头重做他那笔交易所在的区块及其之后的所有区块,还包括他操作期间网络在末尾不断添加的新区块。他在改写历史。一旦他的分支更长,它就成为新的有效链。
这触及一个关键点。即使在场的人都看到了其中的猫腻,也无法利用这个事实。
最长链始终被视为有效链,这一点是绝对必要的。在场的节点可能记得某个分支先出现、后被另一个分支取代,但他们无法让不在场的人相信这一点。我们不能让一部分节点派系死守他们认为先出现的分支,另一部分节点则死守自己先见到的分支,还有后来加入、从没见过事发经过的节点。CPU算力工作量证明投票必须拥有最终决定权。让所有人保持一致的唯一办法是:相信最长链永远是有效链,无论如何。
关于支付交易,币的接收方需要做哪些检查?她需要回溯这枚币的整个转移历史,并确保列表上的每笔交易确实都链接进了"时间戳"区块链吗?还是只需检查最新的一笔?
收款方只需回溯验证到区块链中足够深的深度,这通常只需要回溯2笔交易。更早的所有交易都可以丢弃。
时间戳节点会检查交易吗?确保一枚币的前一笔交易在链中,从而强制执行"链中所有交易代表有效币"这条规则?
没错,正是如此。当节点收到一个区块时,它会根据区块中的历史交易检查其中每笔交易的签名。区块只能包含依赖于先前区块(或同一区块)中有效交易的交易。交易C可以依赖同一区块中的交易B,B依赖更早区块中的交易A。
抱歉问了这么多问题,但正如我所说,这确实是一个非常有前景、非常原创的想法,我期待看到这个概念进一步发展。如果能看到一个更面向过程的描述,包含各种对象(币、区块、交易)数据结构的具体细节、消息中包含的数据,以及处理系统中各类事件的过程算法描述,会很有帮助。您提到正在做一个实现,但我认为一个更正式的文字版系统描述会是很有帮助的下一步。
感谢您的提问。我做这件事的顺序其实是反的:我必须先写出所有代码,才能说服自己可以解决每一个问题,然后才写了论文。我想我发布代码的速度会比写出详细规范更快。在您自行补齐空白的那些假设中,大多数已经是对的。
Satoshi Nakamoto
---------------------------------------------------------------------
The Cryptography Mailing List
Unsubscribe by sending "unsubscribe cryptography" to majordomo at metzdowd.com
英文原文
Hal Finney wrote:
> it is mentioned that if a broadcast transaction does not reach all nodes,
> it is OK, as it will get into the block chain before long. How does this
> happen - what if the node that creates the "next" block (the first node
> to find the hashcash collision) did not hear about the transaction,
> and then a few more blocks get added also by nodes that did not hear
> about that transaction? Do all the nodes that did hear it keep that
> transaction around, hoping to incorporate it into a block once they get
> lucky enough to be the one which finds the next collision?
Right, nodes keep transactions in their working set until they get into a block. If a transaction reaches 90% of nodes, then each time a new block is found, it has a 90% chance of being in it.
Or for example, what if a node is keeping two or more chains around as
it waits to see which grows fastest, and a block comes in for chain A
which would include a double-spend of a coin that is in chain B? Is that
checked for or not? (This might happen if someone double-spent and two
different sets of nodes heard about the two different transactions with
the same coin.)
That does not need to be checked for. The transaction in whichever branch ends up getting ahead becomes the valid one, the other is invalid. If someone tries to double spend like that, one and only one spend will always become valid, the others invalid.
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.
I also don't understand exactly how double-spending, or cancelling
transactions, is accomplished by a superior attacker who is able to muster
more computing power than all the honest participants. I see that he can
create new blocks and add them to create the longest chain, but how can
he erase or add old transactions in the chain? As the attacker sends out
his new blocks, aren't there consistency checks which honest nodes can
perform, to make sure that nothing got erased? More explanation of this
attack would be helpful, in order to judge the gains to an attacker from
this, versus simply using his computing power to mint new coins honestly.
The attacker isn't adding blocks to the end. He has to go back and redo the block his transaction is in and all the blocks after it, as well as any new blocks the network keeps adding to the end while he's doing that. He's rewriting history. Once his branch is longer, it becomes the new valid one.
This touches on a key point. Even though everyone present may see the shenanigans going on, there's no way to take advantage of that fact.
It is strictly necessary that the longest chain is always considered the valid one. Nodes that were present may remember that one branch was there first and got replaced by another, but there would be no way for them to convince those who were not present of this. We can't have subfactions of nodes that cling to one branch that they think was first, others that saw another branch first, and others that joined later and never saw what happened. The CPU power proof-of-work vote must have the final say. The only way for everyone to stay on the same page is to believe that the longest chain is always the valid one, no matter what.
As far as the spending transactions, what checks does the recipient of a
coin have to perform? Does she need to go back through the coin's entire
history of transfers, and make sure that every transaction on the list is
indeed linked into the "timestamp" block chain? Or can she just do the
latest one?
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.
Do the timestamp nodes check transactions, making sure that
the previous transaction on a coin is in the chain, thereby enforcing
the rule that all transactions in the chain represent valid coins?
Right, exactly. When a node receives a block, it checks the signatures of every transaction in it against previous transactions in blocks. Blocks can only contain transactions that depend on valid transactions in previous blocks or the same block. Transaction C could depend on transaction B in the same block and B depends on transaction A in an earlier block.
Sorry about all the questions, but as I said this does seem to be a
very promising and original idea, and I am looking forward to seeing
how the concept is further developed. It would be helpful to see a more
process oriented description of the idea, with concrete details of the
data structures for the various objects (coins, blocks, transactions),
the data which is included in messages, and algorithmic descriptions
of the procedures for handling the various events which would occur in
this system. You mentioned that you are working on an implementation,
but I think a more formal, text description of the system would be a
helpful next step.
I appreciate your questions. I actually did this kind of backwards. I had to write all the code before I could convince myself that I could solve every problem, then I wrote the paper. I think I will be able to release the code sooner than I could write a detailed spec. You're already right about most of your assumptions where you filled in the blanks.
Satoshi Nakamoto
---------------------------------------------------------------------
The Cryptography Mailing List
Unsubscribe by sending "unsubscribe cryptography" to majordomo at metzdowd.com
