BitVM论文中图1解析

栈顶值为1,进入OP_IF分支。OP_HASH160操作码,对应为:
先做SHA-256运算
再对SHA-256运算结果,做RIPEMD-160
对0x47c31e611a3bd2f3a7a42207613046703fa27496做OP_HASH160之后的结果,与0xf592e757267b7f307324f1e78b34472f8b6f46f3做OP_EQUALVERIFY,若不等则失败退出;若相等则继续执行,这样栈顶为1。
相关哈希在线工具为:
ripemd160 hash generator【注意选中“convert before hex string to binary”选项,输出格式选中“hex string”】
SHA256 online tool【注意选中Input Type为“Hex”】
OP_IF
OP_HASH160
<0xf592e757267b7f307324f1e78b34472f8b6f46f3>
OP_EQUALVERIFY
<1>
OP_ELSE
OP_HASH160
<0xb157bee96d62f6855392b9920385a834c3113d9a>
OP_EQUALVERIFY
<0>
OP_ENDIF
//
// Script Wizard makes it easy to design and compile
// custom Bitcoin scripts.
//
// Simply write your script and put witness elements
// at the very top. You can see stack execution line by line.
//
// Feel free to create issues on GitHub if you encounter bugs.
//
<0x47c31e611a3bd2f3a7a42207613046703fa27496>
<1>
最后更新于
这有帮助吗?