http://counterparty.io/docs/counterpartyd/#sign-tx
There’s an example above on the same page, did you use the same parameters (and have to try to pass “privkey” (togoether with its value) as the 2nd parameter?). Also at the very bottom of the page: " If the private key you need to sign the raw transaction is not in the local bitcoind wallet.dat, you must first sign the transaction yourself (or, alternatively, you can call the sign_tx API method and specify the private key string to it, and counterpartyd will sign it for you). In either case, once you have the signed, hex-encoded transaction string, you can then call the broadcast_tx API method, which will then broadcast the transaction on the Bitcoin network for you.“
payload = {
“method”: “sign_tx”,
“params”: {‘unsigned_tx_hex’: unsigned_tx}, #could also specify an external private key to use for signing here
“jsonrpc”: “2.0”,
“id”: 0,
}
signed_tx = requests.post(url, data=json.dumps(payload), headers=headers, auth=auth)
print(”
SIGN_TX RESULT: ", signed_tx)</div></div></div></div>
Ah, looks like it’s a mistype in the API documentation. Thanks for a clue.

Param “tx_hex” should be “unsigned_tx_hex” like in the example.
Now I get annoying “Invalid request/response” error (private key in WIF format was provided).
Ah, no wonder, I was also confused by that. I submitted a bug report for that. Good catch.
Can you post a (testnet?) copy of the invalid transaction request here?
A developer told me it could be the signature.
A developer told me it could be the signature.You should probably try to sign the transaction externally with a known good external tool and compare output with this to make sure the signature is correct.
Signing with bitcoinjs lib works good.
Thanks for letting us know!
@sillywilly - I’m working through some of this now in the ruby gem (and thereafter the python gem) Transaction signing is a bit hard, but if you have access to a bicoind server, who has your private key installed, it’s an easy thing to dispatch to bitcoind. Might that work for you until the client libs are out? What language are you developing in?
@brighton36
Signing transactions on clientside suits me. I had a need in serverside signing to check the clientside signature (for some reason, time after time, I cannot broadcast signed transactions with added op_return output).