2

I have a raw transaction and would like to check if signed or not. How can I do this.

I tried using bitcoind and verifying a transaction from be blockchain but it says its not complete.

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

You could:

$bitcoin-cli decoderawtransaction <HEX>

Then check if all your vins have a correct scriptSig.

A unsigned tx would look like (partial):

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

a signed (partial)

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

You can call http://tbtc.blockr.io/api/v1/tx/raw/587d670669e410748553badc3e885d7c58e67f1a0bb36e62ed165d340bf09924

It's using 3rd party API blockr.io, please pay attention for the prefix "tbtc"at the URL which indicates testnet. You will get json data with scriptSig element inside every input and scriptPubKey in each output, to validate the signature you will use some kind of open source library which ever you prefer.

  • It sounds like the OP is looking for a way to check signatures in general, not just for transactions already in the chain. – Nick ODell May 9 '15 at 19:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.