Raw-Transaction

使用 blockcypher 驗證交易時出錯

  • May 1, 2021

我使用 blockcypher API ( <https://api.blockcypher.com/v1/btc/test3/txs/new> ) 創建了一個測試網交易,然後使用簽名者 (go lang) 簽署了交易。然後將簽名的交易發送到 blockcypher ( <https://api.blockcypher.com/v1/btc/test3/txs/send> )

但它返回錯誤:

Error validating generated transaction: Error running script for input 0 referencing e41a5ceca53f2cd6076f3a100137d6182d0bd567d91e508f4171712b9c67f429 at 0: Script was NOT verified successfully.

我收到的回复:

{
 "errors": [
   {
     "error": "Error validating generated transaction: Error running script for input 0 referencing e41a5ceca53f2cd6076f3a100137d6182d0bd567d91e508f4171712b9c67f429 at 0: Script was NOT verified successfully."
   }
 ],
 "tx": {
   "block_height": -1,
   "block_index": -1,
   "hash": "c514900d8ed184c37bd795c30f24d56508c40ca5f65c2bf8d724162fd8976353",
   "addresses": [
     "tb1qy0jm6vmy2vmndpzzj34z6h6xnelta98d0ukf6s",
     "tb1qwchaysp9wfukq54yee8uye20f2c5zkpl97elvx"
   ],
   "total": 3996400,
   "fees": 3600,
   "size": 222,
   "vsize": 141,
   "preference": "low",
   "relayed_by": "2a01:4f8:192:6027::2",
   "received": "2021-05-01T09:34:02.926591638Z",
   "ver": 1,
   "double_spend": false,
   "vin_sz": 1,
   "vout_sz": 2,
   "confirmations": 0,
   "inputs": [
     {
       "prev_hash": "e41a5ceca53f2cd6076f3a100137d6182d0bd567d91e508f4171712b9c67f429",
       "output_index": 0,
       "output_value": 4000000,
       "sequence": 4294967295,
       "addresses": [
         "tb1qwchaysp9wfukq54yee8uye20f2c5zkpl97elvx"
       ],
       "script_type": "pay-to-witness-pubkey-hash",
       "age": 1973087,
       "witness": [
         "3045022100a4a53cc0eaae807e5c3500af2132a8e575823fc0ff7ceb92de94b739920810ba0220339aa4128967654977b6afb8be9a8897c5e822e2cb5659fe987c106bec44101e",
         "03f2cfd459014d4f19f36e28dcae329ca4f6b263d4d7c13ca7317a75b1a130f0f6"
       ]
     }
   ],
   "outputs": [
     {
       "value": 2000000,
       "script": "001423e5bd33645337368442946a2d5f469e7ebe94ed",
       "addresses": [
         "tb1qy0jm6vmy2vmndpzzj34z6h6xnelta98d0ukf6s"
       ],
       "script_type": "pay-to-witness-pubkey-hash"
     },
     {
       "value": 1996400,
       "script": "0014762fd2402572796052a4ce4fc2654f4ab141583f",
       "addresses": [
         "tb1qwchaysp9wfukq54yee8uye20f2c5zkpl97elvx"
       ],
       "script_type": "pay-to-witness-pubkey-hash"
     }
   ]
 },
 "tosign": [
   ""
 ]
}

任何幫助將不勝感激。謝謝你們。

見證人的簽名數據末尾似乎沒有 sighash 類型。

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