SOLVED: After create_send, how to sign and broadcast the transaction in Bitcoin?

After a successful create_send, I get a hex string output from counterparty. In reading the counterparty API documentation, I see I need to a sign and broadcast in the bitcoin client. Effectively, signrawtransaction and sendrawtransaction using bitcoind.

So, what I’m struggling with is the inputs required by signrawtransaction.

signrawtransaction “hexstring” ( [{“txid”:“id”,“vout”:n,“scriptPubKey”:“hex”,“redeemScript”:“hex”},…] [“privatekey1”,…] sighashtype )

I understand “hexstring” is the output from the previous step in create_send. However, in order to get the other variables (txid, scriptpubkey:hex, redeemscript:hex) do I need to do a decoderawtransaction of the hexcode from create_send?

Any help would be appreciated, thanks :slight_smile:

Step1: signrawtransaction hexcode_from_create_send null ‘[“privatekey_from_counterparty_send_address”]’
Step2: sendrawtransaction hexcode_result_from_step1

What was throwing me off was the second argument for the signrawtransaction command. You can specify null since all the arguments are in the hexcode.

1 Like