How to create a send transaction on Counterparty?

Let’s assume n4D7ndiC4yLZxhAf726uMHXC914sEuUAcg wants to send n1fseuMLWaKDnDkpXiz8PpwV8RqYna9Mbf one unit of his asset A1517414400000000000.

  • source: n4D7ndiC4yLZxhAf726uMHXC914sEuUAcg
  • destination: n1fseuMLWaKDnDkpXiz8PpwV8RqYna9Mbf
  • asset: A1517414400000000000
  • quantity: 1


  • This example uses Counterparty and Bitcoin testnet
  • On mainnet the procedure is the same, but for brevity this particle will omit testnet-related notes. In practice:
  • Command line: use testnet=1 in your counterparty server or --testnet in counterparty-client commands if there is no separate configuration file for testnet (in which case you need to use --config=/my/testnet.conf instead). The same goes for Bitcoin Core - if working on testnet, add -testnet (single dash) to your commands!
  • Counterparty API: use the testnet port (by default 14000).
  • Remember to use --unconfirmed or equivalent in the API if you don’t want to wait until transactions get confirmed
  • A testnet explorer for Counterparty can be found at

###Counterparty: Create Send Transaction

Source creates a send transaction in Counterwallet, counterparty-client or encodes it manually. This post contains many details about encoding and decoding used by Counterparty.

Using the Counterparty API create_send, this is how this send request would look like:

  "method": "create_send",
  "params": {"source": "n4D7ndiC4yLZxhAf726uMHXC914sEuUAcg", "destination": "n1fseuMLWaKDnDkpXiz8PpwV8RqYna9Mbf", "asset": "A1517414400000000000", "quantity": 1},
  "jsonrpc": "2.0",
  "id": 1

You could send this to the public API server with curl.
The response is a raw Bitcoin transaction with a Counterparty payload embedded in it.

  "result": "0100000001dac40b1e6f17b03bc44cd1a111fd0e4ceadc0c9279e44f7d5e16eaffe00bd9af020000001976a914f8eb547223b286af4c069845bab650951de0ba8988acffffffff0336150000000000001976a914dd1262b79cba636a0366790369d8442f2b7fba0688ac00000000000000001e6a1c1efa288c60bfb2614d69e7b251d602bf9fdb04f2af6fd3cddb9bcc4da9c73200000000001976a914f8eb547223b286af4c069845bab650951de0ba8988ac00000000",
  "id": 1,
  "jsonrpc": "2.0"

That’s all there is to it on the Counterparty platform. The rest is all Bitcoin.

###Bitcoin: Sign and Send (Broadcast) a Transaction

Source (address) needs to sign this raw transaction and broadcast it to the (bitcoin) network. As mentioned in the official API documentation, the Counterparty API does not duplicate this functionality present in many Bitcoin applications and APIs.

Using Bitcoin Core (reminder: -testnet is omitted in these examples):

$ bitcoin-cli signrawtransaction "0100000001dac40b1e6f17b03bc44cd1a111fd0e4ceadc0c9279e44f7d5e16eaffe00bd9af020000001976a914f8eb547223b286af4c069845bab650951de0ba8988acffffffff0336150000000000001976a914dd1262b79cba636a0366790369d8442f2b7fba0688ac00000000000000001e6a1c1efa288c60bfb2614d69e7b251d602bf9fdb04f2af6fd3cddb9bcc4da9c73200000000001976a914f8eb547223b286af4c069845bab650951de0ba8988ac00000000"

And the result of that is a signed transaction:

  "hex": "0100000001dac40b1e6f17b03bc44cd1a111fd0e4ceadc0c9279e44f7d5e16eaffe00bd9af020000006b483045022100cc36660656cfa3f30373cd76abc1ba3e0288a0a267f5109263140aabf56328b0022017a95d56a528630d861d72d306dbf982e1f6c095fd72ef685110f2f3f059032701210265f9763ea8f857571a003a9c7abddc9875a3dd921dbdb15c1659944869f945cdffffffff0336150000000000001976a914dd1262b79cba636a0366790369d8442f2b7fba0688ac00000000000000001e6a1c1efa288c60bfb2614d69e7b251d602bf9fdb04f2af6fd3cddb9bcc4da9c73200000000001976a914f8eb547223b286af4c069845bab650951de0ba8988ac00000000",
  "complete": true

Now we just need to broadcast that using the Bitcoin Core’s sendrawtransaction command:.

$ bitcoin-cli sendrawtransaction "<long-hex-thing-from-above>"


We get back a Bitcon transaction ID. In counterparty-server you’d see something similar:

2016-10-27-T18:59:08+0800 [INFO] Send: 1 A1517414400000000000 from n4D7ndiC4yLZxhAf726uMHXC914sEuUAcg to n1fseuMLWaKDnDkpXiz8PpwV8RqYna9Mbf 
(a7a1714bb71058d6ce6e198dabc33643fb94ed669643409aad21ecfc5c658dff) [valid]

To obtain information about this transaction immediately, we specify --unconfirmed and provide the raw transaction ID using get_tx_info action.

Using counterparty-client - because our instance Bitcoin Core has addrindex (see What is addrindex and why is it necessary?) - we can look up BTC and Counterparty balances of any address.

To see if destination address received our asset we would use the balances command in counterparty-client.

balances n1fseuMLWaKDnDkpXiz8PpwV8RqYna9Mbf

Or, using the Counterparty API (also on testnet):

    "method": "get_balances",
    "params": {
        "filters": [{"field": "asset", "op": "==", "value": "A1517414400000000000"}, {"field": "address", "op": "==", "value": "n1fseuMLWaKDnDkpXiz8PpwV8RqYna9Mbf"}],
        "filterop": "and" },
    "jsonrpc": "2.0",
     "id": 1


  "result": [
      "asset": "A1517414400000000000",
      "quantity": 1,
      "address": "n1fseuMLWaKDnDkpXiz8PpwV8RqYna9Mbf"
  "id": 1,
  "jsonrpc": "2.0"

Keywords: create_send, api, send

If you are looking for some lower level information about how the counterparty server forms the transaction, here are some details:

1 Like

@something Excuse me, i dont see how you sign that transaction using private key.

how they can respone complete true without private key.

P/s Thanks you, i resolved this problem