Consider Testnet transaction 7a438...de03e which has vout[0].scriptPubKey
=
OP_DUP OP_DROP OP_DUP OP_HASH160 039.....6fe OP_EQUALVERIFY OP_CHECKSIG
The script is equivalent to a standard pay-to-pubkeyhash scriptPubKey. Let's try to spend it:
> bitcoind createrawtransaction '[{"txid":"7a438.....de03e","vout":0}]' '{"mfq.....oDY":1.3}'
01000000013ee0bdf5779c48f42bda36cd740ba297ae071ec7fe3eadae6418602de48d437a0000000000ffffffff0180a4bf07000000001976a914039541a738df12eed1825b866eb5bb5aba6bf6fe88ac00000000
> bitcoind signrawtransaction 01000.....00000
{
"hex" : "01000000013ee0bdf5779c48f42bda36cd740ba297ae071ec7fe3eadae6418602de48d437a0000000000ffffffff0180a4bf07000000001976a914039541a738df12eed1825b866eb5bb5aba6bf6fe88ac00000000",
"complete" : false
}
As you can see, bitcoind
refuses to sign the transaction (same hex
and obviously complete
is false
) I guess because it can't find a suitable address (since it's a non-standard script). I do indeed control the address and have its private key.
Is there any way to sign this transaction?
signmessage
the hash bytes. Then I just base68-decode the RPC result and use "<sig> <signedHash>" as myscriptSig
. Could this scheme work? Will try ASAP.