Bitcoin-Core

無法發送原始交易 Bitcoin Core 0.19.1 - non-mandatory-script-verify-flag(簽名必須為零,失敗的 CHECK(MULTI)SIG 操作)

  • March 28, 2020

我想發送一個原始的測試網交易,我就像在比特幣文件中那樣做,但我仍然收到這個錯誤:

非強制腳本驗證標誌(對於失敗的 CHECK(MULTI)SIG 操作,簽名必須為零)(程式碼 64)(程式碼 -26)

我究竟做錯了什麼?

  1. 我從清單中取出一筆交易
{
   "txid": "8ee71fee9e4706100c09fb2da4c3ccdac1a4475981bd893ba1eba9417947abff",
   "vout": 0,
   "address": "2Mw44JvAhBs4hgh5bT3gP2NgbhTbVwngW1m",
   "label": "",
   "redeemScript": "00143b88811e01b3efaa0bcd9da16ef85ef3a1583349",
   "scriptPubKey": "a91429c3d920cd18e34db9035c4322474aae4465792187",
   "amount": 0.02641617,
   "confirmations": 16197,
   "spendable": true,
   "solvable": true,
   "desc": "sh(wpkh([8939dfa5/0'/0'/8']02a44b3dd2f0964048265982156f668c037dfabc140eb98f292dbb723d28b85261))#husuy9tw",
   "safe": true
}
  1. 然後我從中創建原始交易:
createrawtransaction '[{"txid":"8ee71fee9e4706100c09fb2da4c3ccdac1a4475981bd893ba1eba9417947abff","vout":0}]' '{"2NCH5HXBwfHegFEUTNrkSKzyYTnTYQKDUjU":0.02}'
  1. 轉儲私鑰
  2. 並像這樣簽署交易
signrawtransactionwithkey '0200000001ffab477941a9eba13b89bd815947a4c1daccc3a42dfb090c1006479eee1fe78e0000000000ffffffff0180841e000000000017a914d0c3f50336b5f109207d722c692191ff86263e968700000000' '[" $privKey "]' '[{"txid":"8ee71fee9e4706100c09fb2da4c3ccdac1a4475981bd893ba1eba9417947abff","vout":0,"scriptPubKey":"a91429c3d920cd18e34db9035c4322474aae4465792187","redeemScript":"00143b88811e01b3efaa0bcd9da16ef85ef3a1583349","amount":0.02}]'

{
 "hex": "02000000000101ffab477941a9eba13b89bd815947a4c1daccc3a42dfb090c1006479eee1fe78e00000000171600143b88811e01b3efaa0bcd9da16ef85ef3a1583349ffffffff0180841e000000000017a914d0c3f50336b5f109207d722c692191ff86263e968702473044022010c174b3306cac5ca8ddbb6eadf0de2299c2a216ade25088290c17880aa5bd60022017bc9de608e7ff59ffa09a6a60d848875d37edfc4a4b687f0eb94d4c2cd11b4f012102a44b3dd2f0964048265982156f668c037dfabc140eb98f292dbb723d28b8526100000000",
 "complete": true
}

但是當我想發送原始交易時

sendrawtransaction 02000000000101ffab477941a9eba13b89bd815947a4c1daccc3a42dfb090c1006479eee1fe78e00000000171600143b88811e01b3efaa0bcd9da16ef85ef3a1583349ffffffff0180841e000000000017a914d0c3f50336b5f109207d722c692191ff86263e968702473044022010c174b3306cac5ca8ddbb6eadf0de2299c2a216ade25088290c17880aa5bd60022017bc9de608e7ff59ffa09a6a60d848875d37edfc4a4b687f0eb94d4c2cd11b4f012102a44b3dd2f0964048265982156f668c037dfabc140eb98f292dbb723d28b8526100000000

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

我嘗試了很多交易,但我無法發送它,也看不到我做錯了什麼。通常,比特幣核心發送按鈕工作正常。

該錯誤消息無關緊要。

SegWit 引入了一種生成簽名雜湊摘要的新方法,該方法需要在雜湊期間包含所花費的“金額”。這個“數量”是正在花費的輸出的價值,而不是您創建的新輸出的數量。在你的它是0.02641617或中本聰的實際值2641617

您的第 4 步應變為:

signrawtransactionwithkey '0200000001ffab477941a9eba13b89bd815947a4c1daccc3a42dfb090c1006479eee1fe78e0000000000ffffffff0180841e000000000017a914d0c3f50336b5f109207d722c692191ff86263e968700000000' '[" $privKey "]' '[{"txid":"8ee71fee9e4706100c09fb2da4c3ccdac1a4475981bd893ba1eba9417947abff","vout":0,"scriptPubKey":"a91429c3d920cd18e34db9035c4322474aae4465792187","redeemScript":"00143b88811e01b3efaa0bcd9da16ef85ef3a1583349","amount":0.02641617}]'

引用自:https://bitcoin.stackexchange.com/questions/93987