How to signtransactionwithkey on v25.0?
On testnet, address mhGwrKAfsm9DDuwkJLjS7gUKLiJC6DugBP receives 0.00010661 via trx 2a3416caf9e08510985b6f27d05855521aa60b9eef0295e0018177cbf96ad928. I have the private key for this address and use it to attempt signing.
Using the same txid as above, I createrawtransaction, sending to a new address:
$bitcoin-cli createrawtransaction "[{"txid":"2a3416caf9e08510985b6f27d05855521aa60b9eef0295e0018177cbf96ad928","vout":1}]" "[{"mtDWiWtkxu59jjs9y2cqFUeriu6GPWm4d2":0.00000661}]" 020000000128d96af9cb778101e09502ef9e0ba61a525558d0276f5b981085e0f9ca16342a0100000000fdffffff0195020000000000001976a9148b4d3652c85352f12aca04a5d11af5304a6e6cb188ac00000000
Adding the above hex output, I attempt to sign the transaction with the private WIF key:
$ bitcoin-cli signrawtransactionwithkey "020000000128d96af9cb778101e09502ef9e0ba61a525558d0276f5b981085e0f9ca16342a0100000000fdffffff0195020000000000001976a9148b4d3652c85352f12aca04a5d11af5304a6e6cb188ac00000000" "["5J47...N9R8bg"]" error code: -5 error message: Invalid private key
How to signtransactionwithkey? I do not wish to use a wallet.
Tried signrawtransactionwithkey in bitcoin core. Expected a hex-encoded raw transaction with signature but instead received **error code: -5 error message: Invalid private key **