# \[Error\]\[Solved\] How to send transaction on Counterparty

**URL:** <https://forums.counterparty.io/t/error-solved-how-to-send-transaction-on-counterparty/4477>\
**Category:** Counterparty\
**Created:** [January 29, 2018, 11:07am UTC](https://forums.counterparty.io/t/error-solved-how-to-send-transaction-on-counterparty/4477 "2018-01-29T11:07:16Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![tobi](https://yyz2.discourse-cdn.com/flex004/user_avatar/forums.counterparty.io/tobi/32/1043_2.png) [@tobi](https://forums.counterparty.io/u/tobi)\
**Post date:** [January 29, 2018, 11:07am UTC](https://forums.counterparty.io/t/error-solved-how-to-send-transaction-on-counterparty/4477/1 "2018-01-29T11:07:16Z")

</div>

i was following this tutorial [http://counterpartytalk.org/t/how-to-create-a-send-transaction-on-counterparty/2429](http://counterpartytalk.org/t/how-to-create-a-send-transaction-on-counterparty/2429).

I created my own testnet counterwallet and created a new token has name ‘longdd’

Using public coindaddy api end point to create a new raw transaction

> {  
> “jsonrpc”: “2.0”,  
> “id”: 1,  
> “method”: “create\_send”,  
> “params”: {  
> “source”: “mypcUU2fYyJav7XUpPLtMVhuPupArLJtiM”,  
> “destination”: “min4TCYKofu1weFiSkgBy7MGGtMPukhuHs”,  
> “asset”: “LONGDD”,  
> “quantity”: 10000  
> }  
> }

I sent 10000 token from my adress mypcUU2fYyJav7XUpPLtMVhuPupArLJtiM to my friend address min4TCYKofu1weFiSkgBy7MGGtMPukhuHs

Response:

> {  
> “jsonrpc”: “2.0”,  
> “id”: 1,  
> “result”: “01000000017972f79269e7b2e6643cc736c853f4d3ff5bba6b434019d11bb7fb77d8483355010000001976a914c8c934c4ad0fa394fd01747c375957f30752e26f88acffffffff020000000000000000306a2e85fa6e8ba159a1d5e5c666944fd836819499d5ff7c39fce51726a8988d1c694532451c03d09cd6284f63f352fac35d3f5805000000001976a914c8c934c4ad0fa394fd01747c375957f30752e26f88ac00000000”  
> }

(P/s: Im using ruby)  
From my mnemonic\_code = “word1 word2 word3… word12”.  
I converted to private key base58

> prv\_key256 = Digest::SHA256.hexdigest(mnemonic\_code)  
> prv\_key = Bitcoin::Key.new(prv\_key256).to\_base58 # wallet import format

Tried to sign above raw transaction:

> bitcoin-cli --testnet signrawtransaction ‘01000000017972f79269e7b2e6643cc736c853f4d3ff5bba6b434019d11bb7fb77d8483355010000001976a914c8c934c4ad0fa394fd01747c375957f30752e26f88acffffffff020000000000000000306a2e85fa6e8ba159a1d5e5c666944fd836819499d5ff7c39fce51726a8988d1c694532451c03d09cd6284f63f352fac35d3f5805000000001976a914c8c934c4ad0fa394fd01747c375957f30752e26f88ac00000000’ ‘’ '[“prv\_key here”]

I got error

> {  
> “hex”: “01000000017972f79269e7b2e6643cc736c853f4d3ff5bba6b434019d11bb7fb77d8483355010000001976a914c8c934c4ad0fa394fd01747c375957f30752e26f88acffffffff020000000000000000306a2e85fa6e8ba159a1d5e5c666944fd836819499d5ff7c39fce51726a8988d1c694532451c03d09cd6284f63f352fac35d3f5805000000001976a914c8c934c4ad0fa394fd01747c375957f30752e26f88ac00000000”,  
> “complete”: false,  
> “errors”: [  
> {  
> “txid”: “xxxxxx”,  
> “vout”: 1,  
> “scriptSig”: “”,  
> “sequence”: 4294967295,  
> “error”: “Operation not valid with the current stack size”  
> }  
> ]  
> }

One more point,

I tried to decode raw transaction using [Decode Raw Bitcoin Hexadecimal Transaction | BlockCypher](http://live.blockcypher.com/btc/decodetx/) (not sure this is correct for cp tx or not) and found a missunderstand point.

> ```
> "script": "76a914c8c934c4ad0fa394fd01747c375957f30752e26f88ac" 
> 
> ```

why i didnt sign yet but scriptSig is existed.

> {  
> “addresses”: [  
> “mypcUU2fYyJav7XUpPLtMVhuPupArLJtiM”  
> ],  
> “block\_height”: -1,  
> “block\_index”: -1,  
> “confirmations”: 0,  
> “data\_protocol”: “unknown”,  
> “double\_spend”: false,  
> “fees”: 6175,  
> “hash”: “de1b101babddd23dacb114f27e4a026e8a2181cd84dc015291367abca0805573”,  
> “inputs”: [  
> {  
> “addresses”: [  
> “mypcUU2fYyJav7XUpPLtMVhuPupArLJtiM”  
> ],  
> “age”: 1261026,  
> “output\_index”: 1,  
> “output\_value”: 89675644,  
> “prev\_hash”: “553348d877fbb71bd11940436bba5bffd3f453c836c73c64e6b2e76992f77279”,  
> “script”: “76a914c8c934c4ad0fa394fd01747c375957f30752e26f88ac”,  
> “script\_type”: “pay-to-pubkey-hash”,  
> “sequence”: 4294967295  
> }  
> ],  
> “outputs”: [  
> {  
> “addresses”: null,  
> “data\_hex”: “85fa6e8ba159a1d5e5c666944fd836819499d5ff7c39fce51726a8988d1c694532451c03d09cd6284f63f352fac3”,  
> “script”: “6a2e85fa6e8ba159a1d5e5c666944fd836819499d5ff7c39fce51726a8988d1c694532451c03d09cd6284f63f352fac3”,  
> “script\_type”: “null-data”,  
> “value”: 0  
> },  
> {  
> “addresses”: [  
> “mypcUU2fYyJav7XUpPLtMVhuPupArLJtiM”  
> ],  
> “script”: “76a914c8c934c4ad0fa394fd01747c375957f30752e26f88ac”,  
> “script\_type”: “pay-to-pubkey-hash”,  
> “value”: 89669469  
> }  
> ],  
> “preference”: “low”,  
> “received”: “2018-01-29T10:58:39.830163057Z”,  
> “relayed\_by”: “54.166.89.207”,  
> “size”: 167,  
> “total”: 89669469,  
> “ver”: 1,  
> “vin\_sz”: 1,  
> “vout\_sz”: 2  
> }

Looking for any help, Thanks you so much. I was struggling with it over a week.

---

<div class="post-metadata">

**Author:** ![foldinger](https://avatars.discourse-cdn.com/v4/letter/f/8e8cbc/32.png) [@foldinger](https://forums.counterparty.io/u/foldinger)\
**Post date:** [January 29, 2018, 3:40pm UTC](https://forums.counterparty.io/t/error-solved-how-to-send-transaction-on-counterparty/4477/2 "2018-01-29T15:40:14Z")

</div>

Maybe it is that issue?

> <https://github.com/bitcoin/bitcoin/issues/9988>

---

<div class="post-metadata">

**Author:** ![tobi](https://yyz2.discourse-cdn.com/flex004/user_avatar/forums.counterparty.io/tobi/32/1043_2.png) [@tobi](https://forums.counterparty.io/u/tobi)\
**Post date:** [January 30, 2018, 2:24am UTC](https://forums.counterparty.io/t/error-solved-how-to-send-transaction-on-counterparty/4477/3 "2018-01-30T02:24:34Z")

</div>

thanks @foldinger let me take a look

---

<div class="post-metadata">

**Author:** ![tobi](https://yyz2.discourse-cdn.com/flex004/user_avatar/forums.counterparty.io/tobi/32/1043_2.png) [@tobi](https://forums.counterparty.io/u/tobi)\
**Post date:** [January 30, 2018, 10:23am UTC](https://forums.counterparty.io/t/error-solved-how-to-send-transaction-on-counterparty/4477/5 "2018-01-30T10:23:12Z")

</div>

i found problem is wrong private key, thanks you everybody
