Raw-Transaction

如何檢查原始交易是否已簽署?

  • May 9, 2015

我有一個原始交易,想檢查是否簽名。我怎樣才能做到這一點。

我嘗試使用 bitcoind 並驗證來自區塊鏈的交易,但它說它不完整。

$ bitcoin-cli --testnet getrawtransaction 587d670669e410748553badc3e885d7c58e67f1a0bb36e62ed165d340bf09924
01000000021a0b47f279296aff3d201d31e98eaecf2586bf647844897b1e916d71cfc5563d000000006b483045022100fd58b00ca836fd4b37b4e9dd2816fafd7817601f6248084c1f19e4d8004c484602203bd3e6d76bb45c2056b925e256b332df7f8a17b1b19b22bba1b6a2d9da59f6a3012103cd34f8c371bf1036718313bc2c33002b9b29c937688e7a4edd4cc92deb94f6b7ffffffffb28a42467f4f54a4cacf9646b44343ab2d5a9e63bcb7fa62ee11b1fbe89f13aa000000006b483045022100aa28c61966f5bb213758496f43c6ab3c0919317413e0828dbc9cf6b1ab230e6902207af7aafa4e651c9951e322913f55e97986731855da30d911e813434adbd11510012103cb15b2bf4fb903df697f0bb647dcf3d20e7e452110ec3cab0a512f64c0df398affffffff0210270000000000001976a914f3aae15f9b92a094bb4e01afe99f99ab4135f36288ac9f580f00000000001976a914b9482e1e602909deebaac56a534455f3d145969d88ac00000000
$ bitcoin-cli --testnet signrawtransaction 01000000021a0b47f279296aff3d201d31e98eaecf2586bf647844897b1e916d71cfc5563d000000006b483045022100fd58b00ca836fd4b37b4e9dd2816fafd7817601f6248084c1f19e4d8004c484602203bd3e6d76bb45c2056b925e256b332df7f8a17b1b19b22bba1b6a2d9da59f6a3012103cd34f8c371bf1036718313bc2c33002b9b29c937688e7a4edd4cc92deb94f6b7ffffffffb28a42467f4f54a4cacf9646b44343ab2d5a9e63bcb7fa62ee11b1fbe89f13aa000000006b483045022100aa28c61966f5bb213758496f43c6ab3c0919317413e0828dbc9cf6b1ab230e6902207af7aafa4e651c9951e322913f55e97986731855da30d911e813434adbd11510012103cb15b2bf4fb903df697f0bb647dcf3d20e7e452110ec3cab0a512f64c0df398affffffff0210270000000000001976a914f3aae15f9b92a094bb4e01afe99f99ab4135f36288ac9f580f00000000001976a914b9482e1e602909deebaac56a534455f3d145969d88ac00000000
{
   "hex" : "01000000021a0b47f279296aff3d201d31e98eaecf2586bf647844897b1e916d71cfc5563d000000006b483045022100fd58b00ca836fd4b37b4e9dd2816fafd7817601f6248084c1f19e4d8004c484602203bd3e6d76bb45c2056b925e256b332df7f8a17b1b19b22bba1b6a2d9da59f6a3012103cd34f8c371bf1036718313bc2c33002b9b29c937688e7a4edd4cc92deb94f6b7ffffffffb28a42467f4f54a4cacf9646b44343ab2d5a9e63bcb7fa62ee11b1fbe89f13aa000000006b483045022100aa28c61966f5bb213758496f43c6ab3c0919317413e0828dbc9cf6b1ab230e6902207af7aafa4e651c9951e322913f55e97986731855da30d911e813434adbd11510012103cb15b2bf4fb903df697f0bb647dcf3d20e7e452110ec3cab0a512f64c0df398affffffff0210270000000000001976a914f3aae15f9b92a094bb4e01afe99f99ab4135f36288ac9f580f00000000001976a914b9482e1e602909deebaac56a534455f3d145969d88ac00000000",
   "complete" : false
}

你可以:

$bitcoin-cli decoderawtransaction <HEX>

然後檢查您vins是否有正確的scriptSig.

未簽名的 tx 看起來像(部分):

{
   "txid" : "8b2c1d3cfb884406747ac8d37b5e66ae18cba9acacb6074cc74e3aab1bfae55d",
   "version" : 1,
   "locktime" : 0,
   "vin" : [
       {
           "txid" : "cc8eb9dafb5c01a9ab69c03747de31630baaf8f7de63847cfe4fb91684bef564",
           "vout" : 1,
           "scriptSig" : {
               "asm" : "",
               "hex" : ""
           },
           "sequence" : 4294967295
       }
   ],

簽名(部分)

{
   "txid" : "587d670669e410748553badc3e885d7c58e67f1a0bb36e62ed165d340bf09924",
   "version" : 1,
   "locktime" : 0,
   "vin" : [
       {
           "txid" : "3d56c5cf716d911e7b89447864bf8625cfae8ee9311d203dff6a2979f2470b1a",
           "vout" : 0,
           "scriptSig" : {
               "asm" : "3045022100fd58b00ca836fd4b37b4e9dd2816fafd7817601f6248084c1f19e4d8004c484602203bd3e6d76bb45c2056b925e256b332df7f8a17b1b19b22bba1b6a2d9da59f6a301 03cd34f8c371bf1036718313bc2c33002b9b29c937688e7a4edd4cc92deb94f6b7",
               "hex" : "483045022100fd58b00ca836fd4b37b4e9dd2816fafd7817601f6248084c1f19e4d8004c484602203bd3e6d76bb45c2056b925e256b332df7f8a17b1b19b22bba1b6a2d9da59f6a3012103cd34f8c371bf1036718313bc2c33002b9b29c937688e7a4edd4cc92deb94f6b7"
           },
           "sequence" : 4294967295
       },

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