比特币(BSV)知识库:脚本-False Return

BSV知识库 专栏收录该内容
82 篇文章 3 订阅

False Return

False Return输出是以脚本“OP_FALSE OP_RETURN”开头的交易输出数该脚本在验证时始终返回false,使得输出变得无法花费,并会锁定与该端点相连的所有资金。当尝试花费False Return的输出时,OP_FALSE将把“False”入栈,然后执行OP_RETURN。OP_RETURN将立即终止执行。然后从堆栈顶部读取执行结果。在这种情况下,读取到的结果是“false”,因此不管栈内的其它数据是什么,脚本都会被认为验证失败。

False Return输出可用于存储各种信息,如记录、token、文件等。False Return输出通常用作比特币交易中应用层协议的数据载体。

OP_RETURN输出

为防止人们利用比特币软件中的漏洞,中本聪在2010年将OP_RETURN操作码改为会强制脚本终止执行并返回失败。这使得所谓的“Op_Return输出”被广泛使用,它以OP_RETURN指令开始,然后为应用层协议存储数据。Bitcoin Core的规则规定,想要在输出中使用OP_RETURN指令,就必须保证它是输出中首个且唯一的操作码。2019年初的Quasar升级放宽了这些要求,允许了OP_FALSE OP_RETURN的存在,这是在为2020年2月的创世纪升级作准备,原始的OP_RETURN功能在这次升级中得以恢复。OP_FALSE的使用复制了OP_RETURN的可证不可花费的特性,这是众多应用范例所依赖的功能。在迁移到False Return输出之前,许多二层协议都是使用OP_RETURN框架构建的。


False Return

False Return outputs are transaction outpoints which begin with the script "OP_FALSE OP_RETURN". This script always returns a false when evaluated making the output unspendable and locking any funds attached to that endpoint. When attempting to spend the False Return output, OP_FALSE will push "false" to the stack, after which OP_RETURN is executed. OP_RETURN terminates the execution immediately. The result of the execution is then read from the top of the stack. In this case, "false" is read, therefore the script fails regardless of what else is on the stack.

False Return outputs can be used to store arbitrary information such as records, tokens, files and more. False Return outputs are commonly used as vehicles to carry data for application layer protocols inside Bitcoin transactions.

OP_RETURN Outputs

Due to changes made by Satoshi in 2010 to prevent people exploiting a bug in the Bitcoin software, the OP_RETURN opcode was changed to force scripts to terminate in failure. This led to the widespread use of so-called 'Op_Return outputs' which start with an OP_RETURN instruction and then store data for application layer protocols. Bitcoin Core rules stipulated that to use an OP_RETURN instruction in an output, it had to be both, the only opcode in the output, and the first opcode in the output. The Quasar Update in early 2019 relaxed these requirements to allow OP_FALSE OP_RETURN in preparation for the Genesis update in February 2020, where the original OP_RETURN functionality was restored. The use of the OP_FALSE, replicated the provably unspendable property of OP_RETURN that many use cases have come to rely on. Many second layer protocols were built using the OP_RETURN framework prior to being migrated to False Return outputs.

声明:

比特币(BSV)知识库项目由比特币协会(Bitcoin Association)发起并支持,更多信息请参见知识库官网:https://wiki.bitcoinsv.io/


  • 对比特币区块链开发感兴趣的朋友可以通过CSDN站内私信联系我们,申请加入BSV开发者交流群。
  • 同时,您也可以扫描下方二维码,关注比特币协会官方微信公众号——BA资讯,了解更多区块链领域的实时资讯。

  • 0
    点赞
  • 0
    评论
  • 0
    收藏
  • 扫一扫,分享海报

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、C币套餐、付费专栏及课程。

余额充值