带有手动创建的兑换脚本的比特币原始交易

时间:2019-06-26 13:50:23

标签: node.js transactions stack bitcoin

我正在使用2个节点bitcoinNode1和bitcoinNode2在regtest模式下运行比特币。我通过编写操作码创建了赎回脚本,并使用btcc将其转换为十六进制形式。

HP-ProBook-440-G4:~$ btcc OP_IF OP_SHA256 
a967bf5e8ca09e059d6bb7a3efa8f62190284649d3eab773518827164ac481fb 
OP_EQUALVERIFY OP_DUP OP_HASH160 
f5fb6147ff889a392211d0f0831a71137bedbff1 OP_ELSE OP_200 OP_CSV 
OP_DROP OP_DUP OP_HASH160 cac5d03956494ffc17f78ea7b71189abf7f3593d 
OP_ENDIF OP_EQUALVERIFY OP_CHECKSIG

O / p:

63a820a967bf5e8ca09e059d6bb7a3efa8f62190284649d3eab773518827164ac481fb8876a914f5fb6147ff889a392211d0f0831a71137bedbff167064f505f323030064f505f4353567576a914cac5d0395649477789

现在,我正在尝试使用兑换脚本创建原始交易。

HP-ProBook-440-G4:〜$ bitcoin-cli -regtest -datadir =。/ bitcoinNode1 -conf =。/ bitcoinNode1 / bitcoin.conf -rpcuser = user1 -rpcport = 19001 createrawtransaction“ [{\” txid \ “:\” 818978d31bf63158612d080c4a934a78a52f52f7bc797cc1f84f6ca8cc4b2dea \ “\ ”VOUT \“:0}]”, “[{\” 63a820a967bf5e8ca09e059d6bb7a3efa8f62190284649d3eab773518827164ac481fb8876a914f5fb6147ff889a392211d0f0831a71137bedbff167064f505f323030064f505f4353567576a914cac5d03956494ffc17f78ea7b71189abf7f3593d6888ac \ “:0.01}]”

但是我不能创建它说无效的比特币地址。

HP-ProBook-440-G4:〜$ bitcoin-cli -regtest -datadir =。/ bitcoinNode1 -conf =。/ bitcoinNode1 / bitcoin.conf -rpcuser = user1 -rpcport = 19001 createrawtransaction“ [{\” txid \ “:\” 818978d31bf63158612d080c4a934a78a52f52f7bc797cc1f84f6ca8cc4b2dea \ “\ ”VOUT \“:0}]”, “[{\” 63a820a967bf5e8ca09e059d6bb7a3efa8f62190284649d3eab773518827164ac481fb8876a914f5fb6147ff889a392211d0f0831a71137bedbff167064f505f323030064f505f4353567576a914cac5d03956494ffc17f78ea7b71189abf7f3593d6888ac \ “:0.01}]”

我应该将兑换脚本转换为p2sh吗?如果是,那么如何?您能建议如何进行吗?

0 个答案:

没有答案