简体   繁体   English

发送P2SH脚本赎回资金时sendrawtransaction返回错误

[英]sendrawtransaction is returning error when sending P2SH script to redeem funds

When I try to send the transaction: 当我尝试发送交易时:

0200000001359a74bdcfa7aea6f9f4e4cca17bc870d46269c0f0a6eaa6b5247b8c24f10ba200000000fdfd0047304402203c12558ab599bcbf7dca30b470dd3dd80cca2168f53d8a031818423a612f08b402201c6734b0fa540cc3957be654e00c9c810d7efa01efb3910d99d70dcfafaeebf9014cb3762103a0a6cc874c5f5d0726db4cf2662b99cc67944bde42ea857ce66a3024d233f638ac6300675368210227291539143aa8fb680298371d696fb79b7ce3100ee0e9c8a166e89ce361c4392102eadb538360917f81e7213db80232243c8132a13abea6c2c88ee878cc6008f3f02102502c4c66c19d5b864b529d80798158a7b5d8e9990c8724d7c517e3ecc4ddc7482102d7ba62e857e15ff3110345d815555952148b3cd3c7e141cd446935776a4cba6d54aeffffffff02e8030000000000001976a914f7418c7b078c301f13f6b68ea510d6a1ff419e3388ac282300000000000017a91443f661d060dab7f8fae42434f4165ea24c491c548700000000

I get the following error: 我收到以下错误:

mandatory-script-verify-flag-failed (Signature must be zero for failed CHECK(MULTI)SIG operation) (code 16) (code -26)

I'm signing the hash_256 digest of the raw transaction with SIGNHASH_ALL concantenated in 4 bytes: 我正在用4个字节的SIGNHASH_ALL签名原始事务的hash_256摘要:

0200000001359a74bdcfa7aea6f9f4e4cca17bc870d46269c0f0a6eaa6b5247b8c24f10ba20000000000ffffffff02e8030000000000001976a914f7418c7b078c301f13f6b68ea510d6a1ff419e3388ac282300000000000017a91443f661d060dab7f8fae42434f4165ea24c491c54870000000001000000
//Double SHA-256 Result:
56a472756ad48b81d851a984aea8c75147f472753b793fa497b894b8f796b7de

//Signature:
304402203c12558ab599bcbf7dca30b470dd3dd80cca2168f53d8a031818423a612f08b402201c6734b0fa540cc3957be654e00c9c810d7efa01efb3910d99d70dcfafaeebf9

//RedeemScript:
762103a0a6cc874c5f5d0726db4cf2662b99cc67944bde42ea857ce66a3024d233f638ac6300675368210227291539143aa8fb680298371d696fb79b7ce3100ee0e9c8a166e89ce361c4392102eadb538360917f81e7213db80232243c8132a13abea6c2c88ee878cc6008f3f02102502c4c66c19d5b864b529d80798158a7b5d8e9990c8724d7c517e3ecc4ddc7482102d7ba62e857e15ff3110345d815555952148b3cd3c7e141cd446935776a4cba6d54ae

Why is this occurring? 为什么会这样呢? What am I missing from my transaction/signing process. 我在交易/签名过程中缺少什么。

Turns out for P2SH, the redeemScript hex goes into the scriptSig of the transaction data that's to be signed. 原来是P2SH,redeemScript十六进制进入要签名的交易数据的scriptSig。 Example: 例:

0200000001359a74bdcfa7aea6f9f4e4cca17bc870d46269c0f0a6eaa6b5247b8c24f10ba2<# of bytes in Redeemscript><RedeemScript>0000000000ffffffff02e8030000000000001976a914f7418c7b078c301f13f6b68ea510d6a1ff419e3388ac282300000000000017a91443f661d060dab7f8fae42434f4165ea24c491c54870000000001000000

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 对 bitcoind 的 RPC 调用以添加 P2SH - RPC call on bitcoind for adding P2SH bitcoinj将P2SH输入事务连接到输出事务 - bitcoinj Connect P2SH input transaction to the output transaction 从 BitcoinJ 中的 WIF 生成 P2SH 比特币地址 Java - Generate P2SH bitcoin address from WIF in BitcoinJ Java 比特币:如何使用 python 或其他方法生成 BASE58 (P2SH) 地址 - Bitcoin: How to generate BASE58 (P2SH) Addresses using python or other methods 比特币现金 ABC - sendrawtransaction 错误 | 代码:-26 - Bitcoin Cash ABC - sendrawtransaction Error | Code : -26 错误:汽油资金不足*价格+价值(出现此错误,我正在使用trezorjs) - Error: insufficient funds for gas * price + value (getting this error , i am using trezorjs) 无论如何要减少coinpayments api中的资金确认时间? - Is there anyway to reduce funds confirmation timing in coinpayments api? 有没有办法从钱包中的特定比特币地址发送资金? - Is there a way to send funds from a specific bitcoin address in a wallet? zlib 的 uncompress() 奇怪地返回 Z_BUF_ERROR - zlib's uncompress() strangely returning Z_BUF_ERROR 当我使用 (mod p) 时,grapich 有什么区别,例如 y=x 和 y=x (mod 3) 之间的区别 - what is the differnce in a grapich when I use (mod p), for example the difference between y=x and y=x (mod 3)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM