Bitcointalk · Transactions and Scripts: DUP HASH160 ... EQUALVERIFY CHECKSIG

中本聪,2010 年 6 月 17 日

SN-0757 已核对来源,附原文与上下文。

阅读语言
中文译文

Bitcoin 的本性是:一旦 0.1 版发布,核心设计在其余生中便铁板钉钉了。因此,我想把它设计成支持我能想到的每一种可能的交易类型。问题在于,每种东西无论用不用,都需要专门的支持代码和数据字段,而且每次只覆盖一种特例。特例会爆炸式增长。解决方案是脚本——它把问题泛化,交易双方可以把交易描述为一个由节点网络求值的谓词。节点只需要理解到"求值发送方的条件是否满足"这个程度。

脚本实际上就是一个谓词。它不过是一个求值为真或假的等式。Predicate 是个又长又生僻的词,所以我管它叫 script。

收款方对脚本做模板匹配。目前,接收方只接受两种模板:直接付款和比特币地址。未来版本可以加入更多交易类型的模板,运行该版本或更高版本的节点就能接收它们。网络中所有版本的节点都能把任何新交易验证并处理进区块,哪怕它们不知道如何解读这些交易。

这个设计支持我在多年以前就设计好的、极其多样的可能交易类型。托管交易、担保契约、第三方仲裁、多方签名等。倘若 Bitcoin 大规模流行起来,这些是我们将来想要探索的东西,但它们都必须在开端就设计好,以确保日后有可能实现。

我不相信 Bitcoin 的第二个兼容实现会是个好主意。这个设计有太多部分依赖所有节点以步进一致的方式得到完全相同的结果,第二个实现将是网络的威胁。MIT 许可与所有其他许可及商业用途兼容,故从许可的角度也没有重写的必要。

ORIGINAL · 英文原文
The nature of Bitcoin is such that once version 0.1 was released, the core design was set in stone for the rest of its lifetime.  Because of that, I wanted to design it to support every possible transaction type I could think of.  The problem was, each thing required special support code and data fields whether it was used or not, and only covered one special case at a time.  It would have been an explosion of special cases.  The solution was script, which generalizes the problem so transacting parties can describe their transaction as a predicate that the node network evaluates.  The nodes only need to understand the transaction to the extent of evaluating whether the sender's conditions are met.

The script is actually a predicate.  It's just an equation that evaluates to true or false.  Predicate is a long and unfamiliar word so I called it script.

The receiver of a payment does a template match on the script.  Currently, receivers only accept two templates: direct payment and bitcoin address.  Future versions can add templates for more transaction types and nodes running that version or higher will be able to receive them.  All versions of nodes in the network can verify and process any new transactions into blocks, even though they may not know how to read them.

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.

I don't believe a second, compatible implementation of Bitcoin will ever be a good idea.  So much of the design depends on all nodes getting exactly identical results in lockstep that a second implementation would be a menace to the network.  The MIT license is compatible with all other licenses and commercial uses, so there is no need to rewrite it from a licensing standpoint.
来源
Bitcointalk 原始链接 ↗ 记录编号 SN-0757