Skip to content

回复:需要 OP_BLOCKNUMBER 以支持有“时间”限制的交易 ​

原始发布页

打开来源页面
查看 1 个交叉存档

我们无法安全地实现 OP_BLOCKNUMBER。在网络分割后发生区块链重组时,交易需要能够进入链上更晚的区块。OP_BLOCKNUMBER 交易及其所有依赖交易都会变得无效。这对后来持有这些币、但并未参与该限时交易的人并不公平。

nTimeLock 的作用正好相反。它是一笔开放交易,在截止时间之前都可以用新版本替换。锁定之前,它无法被记录。截止时间到来时,版本最高的交易会被记录。例如,可以用它编写一笔托管交易:除非在截止时间前撤销,否则它会自动永久锁定并执行。这个功能尚未启用或使用,但支持已经具备,因此以后可以实现。

英文原文 ​

展开英文原文

We can't safely do OP_BLOCKNUMBER. In the event of a block chain reorg after a segmentation, transactions need to be able to get into the chain in a later block. The OP_BLOCKNUMBER transaction and all its dependants would become invalid. This wouldn't be fair to later owners of the coins who weren't involved in the time limited transaction.

nTimeLock does the reverse. It's an open transaction that can be replaced with new versions until the deadline. It can't be recorded until it locks. The highest version when the deadline hits gets recorded. It could be used, for example, to write an escrow transaction that will automatically permanently lock and go through unless it is revoked before the deadline. The feature isn't enabled or used yet, but the support is there so it could be implemented later.

为历史保存,为中文读者整理。每篇档案均附来源与英文原文。