My understanding of the process is that you create a valid raw-tx (what seems to work, at least the console does not complain) and then sign it with the privkey of the sender's address so you can use a pushtx service on another (online) computer to send it out. If that signed tx contains garbage (like a non-existant source tx), the miner is supposed to reject it. Please correct me if I am wrong on any of those assumptions.
OK, I see what you mean.
I think I mislead you earlier about how to get the scriptPubKey. It isn't just the address' public key, it has to be a whole script. For example:
$ clamd getaddressesbyaccount ''
[
"xEPEtmoV9nBYiiyoPmLcZFiHheYzLo81Du"
]
$ clamd dumpprivkey xEPEtmoV9nBYiiyoPmLcZFiHheYzLo81Du
Lom7ZtR3SLwU5PtNN9m3eXH7yzF5yv6HnZoZg6GzBoGjnqv5Snrw
$ clamd validateaddress xEPEtmoV9nBYiiyoPmLcZFiHheYzLo81Du
{
"isvalid" : true,
"address" : "xEPEtmoV9nBYiiyoPmLcZFiHheYzLo81Du",
"ismine" : true,
"isscript" : false,
"pubkey" : "029c44f618f4ee292591be21dedd0337bee7b64ce4e0e14776d1f0db8f802789b2",
"iscompressed" : true,
"account" : ""
}
$ clamd signrawtransaction $(clamd createrawtransaction '[{"txid":"1234567812345678123456781234567812345678123456781234567812345678","vout":69}]' '{"xBF6VfKts3Dx62JYJvcCVf2LqVnSig6H4t":1}') '[{"txid":"1234567812345678123456781234567812345678123456781234567812345678","vout":69,"scriptPubKey":"2321029c44f618f4ee292591be21dedd0337bee7b64ce4e0e14776d1f0db8f802789b2ac"}]' '["Lom7ZtR3SLwU5PtNN9m3eXH7yzF5yv6HnZoZg6GzBoGjnqv5Snrw"]'
{
"hex" : "02000000c1b92c5a017856341278563412785634127856341278563412785634127856341278563 4124500000000ffffffff0100e1f505000000001976a914203ceaf792be80e6d8e6905ce0f0a2db 61b8e9f288ac0000000034706c6179206f7220696e766573742077697468206120312520686f757 3652065646765202d2d204a7573742d446963652e636f6d",
"complete" : true
}
$
In that example I'm signing a "send to pubkey" script, not a "send to pubkey hash" script. It's using the pubkey directly, not the address, with a "ac" byte on the end for OP_CHECKSIG. (Addresses are basically 160 bit hashes of the pubkey). To sign a regular address script, the script looks like:
OP_DUP OP_HASH160 <160 bit pubkey hash> OP_EQUALVERIFY OP_CHECKSIG
or in hex:
19 76 a9 14 <40 hex characters for pubkey hash> 88 ac
So in your case you would do this:
$ clamd signrawtransaction $(clamd createrawtransaction '[{"txid":"71f2cbe9ff92b8c62a2bcfba5dfc9bc32a2d0c71bf55834e6d884b9ab0de201c","vout":69}]' '{"xK8vfFyKC4J2SHR2Hhk7whQAaCTGWbEEwW ":3.5}') '[{"txid":"71f2cbe9ff92b8c62a2bcfba5dfc9bc32a2d0c71bf55834e6d884b9ab0de201c","vout":69,"scriptPubKey":"1976a914c6580bcf8320c3ddaadebc9be9f38ac6fb59d21688ac"}]' '["Lo2RApGkaDZDePA347i56Lo4xRNGBwuxUgyQBC5cK9Ea2Kpn2mnt"]'
{
"hex" : "020000004abe2c5a011c20deb09a4b886d4e8355bf710c2d2ac39bfc5dbacf2b2ac6b892ffe9cbf 2714500000000ffffffff018093dc14000000001976a91476d3380912c1dda6d575bdbac5348db0 e46d8c4e88ac0000000034706c6179206f7220696e766573742077697468206120312520686f757 3652065646765202d2d204a7573742d446963652e636f6d",
"complete" : true
}
I got the 40 hex characters for your address by base58 decoding it:
$ python
Python 2.7.13 (default, Jan 19 2017, 14:48:08)
[GCC 6.3.0 20170118] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import binascii, base58
>>> binascii.hexlify(base58.b58decode_check('xSPPAQsgYTUsiH51xG3u4Shf7Cc7dt5V7g')[1:])
'c6580bcf8320c3ddaadebc9be9f38ac6fb59d216'