How to sign rawtransaction with private key
With java? Sign it with the program that created the raw transaction, bitcoin-cli.
With signrawtransactionwithwallet.
Or with signrawtransactionwithkey (0.17.0 RPC)
signrawtransactionwithkey &quot;hexstring&quot; [&quot;privatekey1&quot;,...] ( [{&quot;txid&quot;:&quot;id&quot;,&quot;vout&quot;:n,&quot;scriptPubKey&quot;:&quot;hex&quot;,&quot;redeemScript&quot;:&quot;hex&quot;,&quot;amount&quot;:value},...]
take txid,vout,scriptPubKey from an online explorer, live.blockcypher.com
redeemScript should be blank.
&quot;raw transaction&quot; &quot;[&quot;priv key&quot;]&quot; &quot;[{&quot;txid&quot;:&quot;the taxid&quot;,&quot;vout&quot;:the vout integer,&quot;scriptPubKey&quot;:&quot;from the explorer&quot;,&quot;redeemScript&quot;:&quot;&quot;,&quot;amount&quot;:the amount}]&quot;
after sign, if want to call sendrawtransaction, if the tx id is not synced will be &quot;Missing Inputs&quot;(in dogecoin-1.10.0 executed) ; or if wallet is offline or if started with -noconnect, then broadcast the transaction online like here https://live.blockcypher.com/btc/pushtx/
More info to deal with a -noconnect and no synced data situation: How to send bitcoin from an offline Bitcoin Core that doesn&#39;t have a synced balance?